From 19d490e7900a1de504980d8015084a44dd88dd30 Mon Sep 17 00:00:00 2001 From: "s.esmaeili" Date: Tue, 6 Oct 2026 16:48:36 +0330 Subject: [PATCH] feat: accounting integration (D27), SMS relay driver (D26), rebuild user apps - Add Tahesab/Zarrin accounting sync module with admin panel UI - Add SMS relay driver as default provider, refactor SMS into driver pattern - Update customer services, orders, products, and catalog queries - Rebuild user-app and user-app-v2 dist assets - Add Prisma migration for accounting tables - Update docker-compose and env examples - Update parity docs (DECISIONS, ISSUES, PROGRESS) Co-Authored-By: Claude Opus 4.6 --- .env.example | 31 +- DELIVERY.md | 28 +- .../accounting/AccountingConnection.vue | 743 +++++++ .../accounting/AccountingSyncButton.vue | 76 + .../accounting/CustomerAccountingCard.vue | 142 ++ apps/admin-panel/src/layouts/navMenuItems.ts | 8 + apps/admin-panel/src/router/admin.ts | 21 + .../src/views/apps/product/AddProduct.vue | 18 +- .../src/views/apps/product/ProductList.vue | 18 + .../views/apps/product/productListModel.ts | 2 + .../src/views/customer/CustomerDetail.vue | 4 + .../views/customer/omde/OmdeCustomerList.vue | 8 +- .../src/views/customer/omde/OmdeList.vue | 4 +- .../src/views/manage/accounting.vue | 698 +++++++ .../src/views/user/permissionConst.ts | 4 + apps/api/.env.example | 29 +- .../migration.sql | 110 + apps/api/prisma/schema.prisma | 125 ++ apps/api/scripts/test-accounting-tahesab.ts | 254 +++ apps/api/src/app.module.ts | 3 + .../accounting-admin.controller.ts | 107 + .../accounting-admin.service.ts | 366 ++++ .../accounting-config.service.ts | 298 +++ .../accounting-sync/accounting-config.ts | 181 ++ .../accounting-hooks.service.spec.ts | 106 + .../accounting-hooks.service.ts | 164 ++ .../accounting-sync/accounting-http.spec.ts | 87 + .../accounting-sync/accounting-http.ts | 281 +++ .../accounting-quick.controller.ts | 48 + .../accounting-sync/accounting-sync.module.ts | 27 + .../accounting-sync.service.ts | 949 +++++++++ .../accounting-sync/accounting-utils.spec.ts | 128 ++ .../accounting-worker.service.ts | 375 ++++ .../api/src/modules/accounting-sync/jalali.ts | 152 ++ .../providers/accounting-provider.ts | 310 +++ .../accounting-sync/providers/index.ts | 18 + .../providers/tahesab.provider.spec.ts | 298 +++ .../providers/tahesab.provider.ts | 511 +++++ .../providers/zarrin.provider.spec.ts | 215 ++ .../providers/zarrin.provider.ts | 466 +++++ .../src/modules/accounting-sync/secret-box.ts | 56 + .../admin-customers.service.ts | 23 +- .../admin-misc/admin-misc.controller.ts | 3 +- .../modules/admin-misc/admin-misc.service.ts | 9 +- .../admin-orders/admin-orders.service.ts | 24 +- .../admin-products/admin-products.service.ts | 34 + apps/api/src/modules/auth/acl.constants.ts | 2 + .../src/modules/catalog/catalog.service.ts | 57 +- .../customer-auth/customer-auth.service.ts | 8 +- .../customer-report.service.ts | 152 +- .../modules/customers/customers.service.ts | 22 +- apps/api/src/modules/orders/orders.service.ts | 13 + apps/api/src/modules/sms/drivers/index.ts | 17 + .../src/modules/sms/drivers/relay.driver.ts | 110 + .../api/src/modules/sms/drivers/sms-driver.ts | 55 + .../src/modules/sms/drivers/trez.driver.ts | 66 + apps/api/src/modules/sms/sms.service.spec.ts | 339 +++- apps/api/src/modules/sms/sms.service.ts | 148 +- ...ckFSThyi.js => AppearanceView-B0bKuyHr.js} | 2 +- .../dist/assets/CartView-IeY-S-nZ.css | 1 - ...tView-DyEDwwD2.js => CartView-MDu3XibQ.js} | 2 +- .../dist/assets/ChildOrdersView-BSUeH1Jr.css | 1 + .../dist/assets/ChildOrdersView-CTHMBAuv.js | 1 + .../dist/assets/ChildOrdersView-DS4jSTHf.css | 1 - .../dist/assets/ChildOrdersView-qV6oiil_.js | 1 - ...C1GrIPCU.js => CollectionView-CjJy961h.js} | 2 +- ...JXN.js => CompleteProfileView-CxdqhMlz.js} | 2 +- .../assets/CustomerChoiceView-B2Wj4PsY.css | 1 - .../assets/CustomerChoiceView-D-JqOITb.js | 1 + .../assets/CustomerChoiceView-H1FeybTn.css | 1 + .../assets/CustomerChoiceView-Yt6glUHR.js | 1 - .../dist/assets/DashboardView-B0WNzWOb.js | 1 - .../dist/assets/DashboardView-BRB4XUhz.js | 1 + .../dist/assets/DashboardView-D5cEPlGT.css | 1 - .../dist/assets/DashboardView-Dd-mLt1P.css | 1 + ...-CiVaZUZb.js => FavoritesView-DxHQrp9E.js} | 2 +- ...xnh5gKQ.js => FormItemContext-C33n6IMx.js} | 2 +- ...eView-BLj03XEk.js => HomeView-C0cpdx4l.js} | 2 +- ...eyCode-CA5MXqE7.js => KeyCode-DAs3W-5E.js} | 2 +- ...OzXdH.js => LoginRegisterView-GyFoinkN.js} | 2 +- ...iew--pb6tWn4.js => NewestView-BG4MNUeW.js} | 2 +- ...6v-gp.js => NotificationsView-BuhDQ6dh.js} | 2 +- ...w-B7LDWHTY.css => OrdersView-BULq1WHJ.css} | 2 +- .../dist/assets/OrdersView-BcT-EgU-.js | 1 - .../dist/assets/OrdersView-C8fvzMFb.js | 1 + ...ageBar-D5DXU6sO.js => PageBar-El-laHqK.js} | 2 +- ...rd-nL92ZIkB.js => ProductCard-CvKEozHI.js} | 2 +- ...ew-Bcb3A35W.js => ProfileView-qElFZKrE.js} | 2 +- ...trip-0Viss8IX.js => RateStrip-Cjr1qlEL.js} | 2 +- .../dist/assets/ReportView-NtWL-hNL.js | 1 - .../dist/assets/ReportView-ooq-YW_N.js | 1 + ...w-DjU8BNPp.css => ReportView-tLoo_9HZ.css} | 2 +- ...ut-BZCG2e_m.js => SearchInput-OrOd8Tqr.js} | 2 +- ...iew-uJ2hiU7a.js => SearchView-DNae1fsD.js} | 2 +- ...ad-BiCEpXAe.js => SectionHead-DNG9ywW4.js} | 2 +- ...IYETDv.js => TransactionsView-CUA8xQcy.js} | 2 +- ...Ou87VTNv.js => classCallCheck-BTVV3tFI.js} | 2 +- ...ilters-DVocLz3o.js => filters-CUgGgSea.js} | 2 +- .../{index-ecOSUWQv.js => index-B0RgkHMm.js} | 2 +- .../{index-BWyw3RAx.js => index-Dp9sxvBv.js} | 46 +- .../{index-7kdFQ8tV.js => index-UkXhTnpw.js} | 2 +- .../{index-sLHXZqt3.js => index-UuozCFb-.js} | 2 +- apps/user-app-v2/dist/index.html | 4 +- apps/user-app-v2/dist/sw.js | 2 +- apps/user-app-v2/index.html | 2 +- apps/user-app-v2/src/api/client.ts | 11 + apps/user-app-v2/src/main.ts | 8 + .../src/views/expert/ChildOrdersView.vue | 6 +- .../src/views/expert/CustomerChoiceView.vue | 6 +- .../src/views/report/ReportView.vue | 6 +- .../src/views/user/DashboardView.vue | 10 +- .../user-app-v2/src/views/user/OrdersView.vue | 6 +- .../src/views/user/ProfileView.vue | 69 +- ...BURkFSmu.js => AppearanceView-JPeTyrw8.js} | 2 +- ...tView-DetkKSek.js => CartView-CE6utvgI.js} | 2 +- .../dist/assets/ChildOrdersView-9SqS1v8K.css | 1 - .../dist/assets/ChildOrdersView-B4JRVT-K.js | 1 + .../dist/assets/ChildOrdersView-CAI7QnOO.js | 1 - .../dist/assets/ChildOrdersView-CIYWCc4O.css | 1 + ...C-Ms58li.js => CollectionView-DyHx7znU.js} | 2 +- ...iyF.js => CompleteProfileView-C-sZIS6E.js} | 2 +- .../assets/CustomerChoiceView-CyQmjcMe.css | 1 + .../assets/CustomerChoiceView-DGvV7Kp-.js | 1 - .../assets/CustomerChoiceView-DR1AjujO.js | 1 + .../assets/CustomerChoiceView-DsBBQpD2.css | 1 - .../dist/assets/DashboardView-BzQl9sTm.css | 1 + .../dist/assets/DashboardView-CD8ZNbpT.css | 1 - .../dist/assets/DashboardView-D-6ud1e0.js | 1 + .../dist/assets/DashboardView-DeyX-I-q.js | 1 - ...-DlJ27tPl.js => FavoritesView-5PtRZ-Og.js} | 2 +- ...eu2AbNf.js => FormItemContext-SUJOG-MO.js} | 2 +- ...eView-Bf0e5pmS.js => HomeView-BghGLzTy.js} | 2 +- ...eyCode-Cq_g5D61.js => KeyCode-DSd4o8Xn.js} | 2 +- ...kCA7F.js => LoginRegisterView-B_oBms2p.js} | 2 +- ...iew-D4LqxUjf.js => NewestView-CUwNENLc.js} | 2 +- ...6vOwf.js => NotificationsView-WnKh1Hfo.js} | 2 +- ...w-C3fIDAAH.css => OrdersView-CqIe9R9T.css} | 2 +- .../dist/assets/OrdersView-DI0Eszkl.js | 1 + .../dist/assets/OrdersView-c1hwULHC.js | 1 - ...ageBar-Ce9JfTDp.js => PageBar-DeTSeN2V.js} | 2 +- ...rd-DPbWAcGz.js => ProductCard-VIsRKw9N.js} | 2 +- ...ew-DG88eShx.js => ProfileView-CWtKqpE_.js} | 2 +- ...trip-lG3TrpVS.js => RateStrip-DRSPLvmj.js} | 2 +- .../dist/assets/ReportView-Cn0B_xne.js | 1 + .../dist/assets/ReportView-D0dhOiVU.js | 1 - ...w-rZPotJne.css => ReportView-DgEDfhFW.css} | 2 +- ...ut-B8FmHJhZ.js => SearchInput-D_58732w.js} | 2 +- ...iew-CWbz_TPq.js => SearchView-BKb5nF_Q.js} | 2 +- ...ad-wIJAAwTj.js => SectionHead-CLPy7Yf4.js} | 2 +- ...AkyYzD.js => TransactionsView-CXfaxF5z.js} | 2 +- ...CbaFv7Ew.js => classCallCheck-Bw-Na1wZ.js} | 2 +- ...ilters-Dlnb2GO7.js => filters-BPVyS_DN.js} | 2 +- ...e-8XVmmAFb.js => filtersStore-CQ9c22FV.js} | 2 +- .../{index-Pu-AYmD8.js => index-9k1Jdmtu.js} | 2 +- .../{index-CKLnG6u7.js => index-B5ImOnMw.js} | 2 +- .../{index-Bc5NMYvk.js => index-BINTtggB.js} | 2 +- .../{index-Dg78Fjh9.js => index-DOpGZRF9.js} | 52 +- ...veal-BVRIc6La.js => useReveal-Ct1W2y5M.js} | 2 +- apps/user-app/dist/index.html | 2 +- apps/user-app/dist/sw.js | 2 +- apps/user-app/src/api/client.ts | 11 + apps/user-app/src/main.ts | 8 + .../src/views/expert/ChildOrdersView.vue | 6 +- .../src/views/expert/CustomerChoiceView.vue | 6 +- apps/user-app/src/views/report/ReportView.vue | 6 +- .../user-app/src/views/user/DashboardView.vue | 10 +- apps/user-app/src/views/user/OrdersView.vue | 6 +- apps/user-app/src/views/user/ProfileView.vue | 69 +- apps/user-app/tsconfig.tsbuildinfo | 2 +- docker-compose.yml | 11 +- docs/ACCOUNTING-INTEGRATION-PLAN.md | 219 ++ docs/DATA-MIGRATION-MAP.md | 1154 +++++++++++ docs/SMS-RELAY-PLAN.md | 92 + docs/migration-precheck-2.sql | 181 ++ docs/migration-precheck.sql | 321 +++ docs/parity/DECISIONS.md | 57 + docs/parity/ISSUES.md | 20 +- docs/parity/PROGRESS.md | 1 + oapi-struncture.sql | 1804 +++++++++++++++++ 179 files changed, 12538 insertions(+), 370 deletions(-) create mode 100644 apps/admin-panel/src/components/accounting/AccountingConnection.vue create mode 100644 apps/admin-panel/src/components/accounting/AccountingSyncButton.vue create mode 100644 apps/admin-panel/src/components/accounting/CustomerAccountingCard.vue create mode 100644 apps/admin-panel/src/views/manage/accounting.vue create mode 100644 apps/api/prisma/migrations/20261005120000_accounting_integration/migration.sql create mode 100644 apps/api/scripts/test-accounting-tahesab.ts create mode 100644 apps/api/src/modules/accounting-sync/accounting-admin.controller.ts create mode 100644 apps/api/src/modules/accounting-sync/accounting-admin.service.ts create mode 100644 apps/api/src/modules/accounting-sync/accounting-config.service.ts create mode 100644 apps/api/src/modules/accounting-sync/accounting-config.ts create mode 100644 apps/api/src/modules/accounting-sync/accounting-hooks.service.spec.ts create mode 100644 apps/api/src/modules/accounting-sync/accounting-hooks.service.ts create mode 100644 apps/api/src/modules/accounting-sync/accounting-http.spec.ts create mode 100644 apps/api/src/modules/accounting-sync/accounting-http.ts create mode 100644 apps/api/src/modules/accounting-sync/accounting-quick.controller.ts create mode 100644 apps/api/src/modules/accounting-sync/accounting-sync.module.ts create mode 100644 apps/api/src/modules/accounting-sync/accounting-sync.service.ts create mode 100644 apps/api/src/modules/accounting-sync/accounting-utils.spec.ts create mode 100644 apps/api/src/modules/accounting-sync/accounting-worker.service.ts create mode 100644 apps/api/src/modules/accounting-sync/jalali.ts create mode 100644 apps/api/src/modules/accounting-sync/providers/accounting-provider.ts create mode 100644 apps/api/src/modules/accounting-sync/providers/index.ts create mode 100644 apps/api/src/modules/accounting-sync/providers/tahesab.provider.spec.ts create mode 100644 apps/api/src/modules/accounting-sync/providers/tahesab.provider.ts create mode 100644 apps/api/src/modules/accounting-sync/providers/zarrin.provider.spec.ts create mode 100644 apps/api/src/modules/accounting-sync/providers/zarrin.provider.ts create mode 100644 apps/api/src/modules/accounting-sync/secret-box.ts create mode 100644 apps/api/src/modules/sms/drivers/index.ts create mode 100644 apps/api/src/modules/sms/drivers/relay.driver.ts create mode 100644 apps/api/src/modules/sms/drivers/sms-driver.ts create mode 100644 apps/api/src/modules/sms/drivers/trez.driver.ts rename apps/user-app-v2/dist/assets/{AppearanceView-ckFSThyi.js => AppearanceView-B0bKuyHr.js} (98%) delete mode 100644 apps/user-app-v2/dist/assets/CartView-IeY-S-nZ.css rename apps/user-app-v2/dist/assets/{CartView-DyEDwwD2.js => CartView-MDu3XibQ.js} (94%) create mode 100644 apps/user-app-v2/dist/assets/ChildOrdersView-BSUeH1Jr.css create mode 100644 apps/user-app-v2/dist/assets/ChildOrdersView-CTHMBAuv.js delete mode 100644 apps/user-app-v2/dist/assets/ChildOrdersView-DS4jSTHf.css delete mode 100644 apps/user-app-v2/dist/assets/ChildOrdersView-qV6oiil_.js rename apps/user-app-v2/dist/assets/{CollectionView-C1GrIPCU.js => CollectionView-CjJy961h.js} (86%) rename apps/user-app-v2/dist/assets/{CompleteProfileView-h4pf7JXN.js => CompleteProfileView-CxdqhMlz.js} (96%) delete mode 100644 apps/user-app-v2/dist/assets/CustomerChoiceView-B2Wj4PsY.css create mode 100644 apps/user-app-v2/dist/assets/CustomerChoiceView-D-JqOITb.js create mode 100644 apps/user-app-v2/dist/assets/CustomerChoiceView-H1FeybTn.css delete mode 100644 apps/user-app-v2/dist/assets/CustomerChoiceView-Yt6glUHR.js delete mode 100644 apps/user-app-v2/dist/assets/DashboardView-B0WNzWOb.js create mode 100644 apps/user-app-v2/dist/assets/DashboardView-BRB4XUhz.js delete mode 100644 apps/user-app-v2/dist/assets/DashboardView-D5cEPlGT.css create mode 100644 apps/user-app-v2/dist/assets/DashboardView-Dd-mLt1P.css rename apps/user-app-v2/dist/assets/{FavoritesView-CiVaZUZb.js => FavoritesView-DxHQrp9E.js} (87%) rename apps/user-app-v2/dist/assets/{FormItemContext-Bxnh5gKQ.js => FormItemContext-C33n6IMx.js} (99%) rename apps/user-app-v2/dist/assets/{HomeView-BLj03XEk.js => HomeView-C0cpdx4l.js} (98%) rename apps/user-app-v2/dist/assets/{KeyCode-CA5MXqE7.js => KeyCode-DAs3W-5E.js} (96%) rename apps/user-app-v2/dist/assets/{LoginRegisterView-CFYOzXdH.js => LoginRegisterView-GyFoinkN.js} (98%) rename apps/user-app-v2/dist/assets/{NewestView--pb6tWn4.js => NewestView-BG4MNUeW.js} (90%) rename apps/user-app-v2/dist/assets/{NotificationsView-QOE6v-gp.js => NotificationsView-BuhDQ6dh.js} (78%) rename apps/user-app-v2/dist/assets/{OrdersView-B7LDWHTY.css => OrdersView-BULq1WHJ.css} (64%) delete mode 100644 apps/user-app-v2/dist/assets/OrdersView-BcT-EgU-.js create mode 100644 apps/user-app-v2/dist/assets/OrdersView-C8fvzMFb.js rename apps/user-app-v2/dist/assets/{PageBar-D5DXU6sO.js => PageBar-El-laHqK.js} (92%) rename apps/user-app-v2/dist/assets/{ProductCard-nL92ZIkB.js => ProductCard-CvKEozHI.js} (96%) rename apps/user-app-v2/dist/assets/{ProfileView-Bcb3A35W.js => ProfileView-qElFZKrE.js} (95%) rename apps/user-app-v2/dist/assets/{RateStrip-0Viss8IX.js => RateStrip-Cjr1qlEL.js} (87%) delete mode 100644 apps/user-app-v2/dist/assets/ReportView-NtWL-hNL.js create mode 100644 apps/user-app-v2/dist/assets/ReportView-ooq-YW_N.js rename apps/user-app-v2/dist/assets/{ReportView-DjU8BNPp.css => ReportView-tLoo_9HZ.css} (59%) rename apps/user-app-v2/dist/assets/{SearchInput-BZCG2e_m.js => SearchInput-OrOd8Tqr.js} (93%) rename apps/user-app-v2/dist/assets/{SearchView-uJ2hiU7a.js => SearchView-DNae1fsD.js} (99%) rename apps/user-app-v2/dist/assets/{SectionHead-BiCEpXAe.js => SectionHead-DNG9ywW4.js} (90%) rename apps/user-app-v2/dist/assets/{TransactionsView-BaIYETDv.js => TransactionsView-CUA8xQcy.js} (91%) rename apps/user-app-v2/dist/assets/{classCallCheck-Ou87VTNv.js => classCallCheck-BTVV3tFI.js} (80%) rename apps/user-app-v2/dist/assets/{filters-DVocLz3o.js => filters-CUgGgSea.js} (99%) rename apps/user-app-v2/dist/assets/{index-ecOSUWQv.js => index-B0RgkHMm.js} (97%) rename apps/user-app-v2/dist/assets/{index-BWyw3RAx.js => index-Dp9sxvBv.js} (90%) rename apps/user-app-v2/dist/assets/{index-7kdFQ8tV.js => index-UkXhTnpw.js} (99%) rename apps/user-app-v2/dist/assets/{index-sLHXZqt3.js => index-UuozCFb-.js} (99%) rename apps/user-app/dist/assets/{AppearanceView-BURkFSmu.js => AppearanceView-JPeTyrw8.js} (98%) rename apps/user-app/dist/assets/{CartView-DetkKSek.js => CartView-CE6utvgI.js} (94%) delete mode 100644 apps/user-app/dist/assets/ChildOrdersView-9SqS1v8K.css create mode 100644 apps/user-app/dist/assets/ChildOrdersView-B4JRVT-K.js delete mode 100644 apps/user-app/dist/assets/ChildOrdersView-CAI7QnOO.js create mode 100644 apps/user-app/dist/assets/ChildOrdersView-CIYWCc4O.css rename apps/user-app/dist/assets/{CollectionView-C-Ms58li.js => CollectionView-DyHx7znU.js} (86%) rename apps/user-app/dist/assets/{CompleteProfileView-ykGh4iyF.js => CompleteProfileView-C-sZIS6E.js} (96%) create mode 100644 apps/user-app/dist/assets/CustomerChoiceView-CyQmjcMe.css delete mode 100644 apps/user-app/dist/assets/CustomerChoiceView-DGvV7Kp-.js create mode 100644 apps/user-app/dist/assets/CustomerChoiceView-DR1AjujO.js delete mode 100644 apps/user-app/dist/assets/CustomerChoiceView-DsBBQpD2.css create mode 100644 apps/user-app/dist/assets/DashboardView-BzQl9sTm.css delete mode 100644 apps/user-app/dist/assets/DashboardView-CD8ZNbpT.css create mode 100644 apps/user-app/dist/assets/DashboardView-D-6ud1e0.js delete mode 100644 apps/user-app/dist/assets/DashboardView-DeyX-I-q.js rename apps/user-app/dist/assets/{FavoritesView-DlJ27tPl.js => FavoritesView-5PtRZ-Og.js} (87%) rename apps/user-app/dist/assets/{FormItemContext-leu2AbNf.js => FormItemContext-SUJOG-MO.js} (99%) rename apps/user-app/dist/assets/{HomeView-Bf0e5pmS.js => HomeView-BghGLzTy.js} (96%) rename apps/user-app/dist/assets/{KeyCode-Cq_g5D61.js => KeyCode-DSd4o8Xn.js} (96%) rename apps/user-app/dist/assets/{LoginRegisterView-DVskCA7F.js => LoginRegisterView-B_oBms2p.js} (98%) rename apps/user-app/dist/assets/{NewestView-D4LqxUjf.js => NewestView-CUwNENLc.js} (89%) rename apps/user-app/dist/assets/{NotificationsView-Cec6vOwf.js => NotificationsView-WnKh1Hfo.js} (78%) rename apps/user-app/dist/assets/{OrdersView-C3fIDAAH.css => OrdersView-CqIe9R9T.css} (63%) create mode 100644 apps/user-app/dist/assets/OrdersView-DI0Eszkl.js delete mode 100644 apps/user-app/dist/assets/OrdersView-c1hwULHC.js rename apps/user-app/dist/assets/{PageBar-Ce9JfTDp.js => PageBar-DeTSeN2V.js} (92%) rename apps/user-app/dist/assets/{ProductCard-DPbWAcGz.js => ProductCard-VIsRKw9N.js} (96%) rename apps/user-app/dist/assets/{ProfileView-DG88eShx.js => ProfileView-CWtKqpE_.js} (95%) rename apps/user-app/dist/assets/{RateStrip-lG3TrpVS.js => RateStrip-DRSPLvmj.js} (86%) create mode 100644 apps/user-app/dist/assets/ReportView-Cn0B_xne.js delete mode 100644 apps/user-app/dist/assets/ReportView-D0dhOiVU.js rename apps/user-app/dist/assets/{ReportView-rZPotJne.css => ReportView-DgEDfhFW.css} (60%) rename apps/user-app/dist/assets/{SearchInput-B8FmHJhZ.js => SearchInput-D_58732w.js} (93%) rename apps/user-app/dist/assets/{SearchView-CWbz_TPq.js => SearchView-BKb5nF_Q.js} (99%) rename apps/user-app/dist/assets/{SectionHead-wIJAAwTj.js => SectionHead-CLPy7Yf4.js} (90%) rename apps/user-app/dist/assets/{TransactionsView-mwAkyYzD.js => TransactionsView-CXfaxF5z.js} (91%) rename apps/user-app/dist/assets/{classCallCheck-CbaFv7Ew.js => classCallCheck-Bw-Na1wZ.js} (80%) rename apps/user-app/dist/assets/{filters-Dlnb2GO7.js => filters-BPVyS_DN.js} (99%) rename apps/user-app/dist/assets/{filtersStore-8XVmmAFb.js => filtersStore-CQ9c22FV.js} (75%) rename apps/user-app/dist/assets/{index-Pu-AYmD8.js => index-9k1Jdmtu.js} (99%) rename apps/user-app/dist/assets/{index-CKLnG6u7.js => index-B5ImOnMw.js} (97%) rename apps/user-app/dist/assets/{index-Bc5NMYvk.js => index-BINTtggB.js} (99%) rename apps/user-app/dist/assets/{index-Dg78Fjh9.js => index-DOpGZRF9.js} (89%) rename apps/user-app/dist/assets/{useReveal-BVRIc6La.js => useReveal-Ct1W2y5M.js} (80%) create mode 100644 docs/ACCOUNTING-INTEGRATION-PLAN.md create mode 100644 docs/DATA-MIGRATION-MAP.md create mode 100644 docs/SMS-RELAY-PLAN.md create mode 100644 docs/migration-precheck-2.sql create mode 100644 docs/migration-precheck.sql create mode 100644 oapi-struncture.sql diff --git a/.env.example b/.env.example index f98e1c3..5ae98f3 100644 --- a/.env.example +++ b/.env.example @@ -38,6 +38,20 @@ JWT_CUSTOMER_SECRET= # Customer token lifetime (default 30d). JWT_CUSTOMER_EXPIRES_IN= +# --------------------------------------------------------------------------- +# Accounting software integration (Tahesab / Zarrin, D27). Everything else — +# which software, address, token, mappings — is set in the admin panel +# («پیکر بندی ← اتصال حسابداری»), and the integration is off until then. +# --------------------------------------------------------------------------- +# Encrypts the accounting token at rest. Set a long random value. Blank falls +# back to a key derived from JWT_SECRET (with a boot warning); changing that +# key later means re-entering the token in the admin panel. +ACCOUNTING_SECRET_KEY= +# "off" keeps this API instance out of the background sync (only needed when +# several instances run and you want exactly one doing it; a lease already +# stops two from running the same job). +ACCOUNTING_WORKER= + # --------------------------------------------------------------------------- # Central IAM — delegated admin login (docs/iam-sso.md) # --------------------------------------------------------------------------- @@ -88,12 +102,21 @@ AUTH_SESSION_TRACKING= OTP_MASTER_CODE= # --------------------------------------------------------------------------- -# SMS gateway (Trez). Leave blank to disable sending: the server still boots, -# messages are logged instead of sent, and customers cannot receive a login -# code (D20). Never commit real values. +# SMS gateway. The default "relay" driver works with everything blank (D26). +# A failed SMS never stops the server or an operation (D20). # --------------------------------------------------------------------------- -# "trez" (default) or "none" to disable explicitly. +# "relay" (default), "trez", or "none" to disable explicitly. SMS_PROVIDER= +# relay — the owner's createsms gateway. All four are optional. +# URL and secret have built-in defaults. +SMS_RELAY_URL= +SMS_RELAY_SECRET= +# The "host" field. Blank sends this machine's first external IPv4 — inside +# Docker that is the container's address. +SMS_RELAY_HOST= +# "kave" (default, Kavenegar) or "default" to let the gateway pick the line. +SMS_RELAY_PLATFORM= +# trez — only used with SMS_PROVIDER=trez. Never commit real values. # Override only for staging; defaults to the provider's live endpoint. SMS_TREZ_URL= SMS_TREZ_USERNAME= diff --git a/DELIVERY.md b/DELIVERY.md index d063d65..397b40d 100644 --- a/DELIVERY.md +++ b/DELIVERY.md @@ -39,10 +39,9 @@ Everything else is optional and may be left blank. Two you may want now: # real release (see "Before the real release" below). OTP_MASTER_CODE=1379 -# Leave blank and SMS is logged, not sent. The server still starts. -SMS_TREZ_USERNAME= -SMS_TREZ_PASSWORD= -SMS_TREZ_SENDER_LINE= +# SMS goes through the "relay" gateway with nothing to set (D26). +# SMS_PROVIDER=none turns sending off; the server still starts either way. +SMS_PROVIDER= ``` ### Step 2 — build @@ -115,7 +114,9 @@ before it is a production release. The first three are blocking. | **1** | **Set `JWT_CUSTOMER_SECRET` to its own random value**, different from `JWT_SECRET`. | Not a cosmetic default. Unset, the API signs customer and sales-expert **app** tokens with `JWT_SECRET` — *the same key admin tokens use* — and the two token realms stop being cryptographically separate. The only remaining barrier is the `typ` check in `jwt.strategy.ts`, and a sales expert's app token carries their **AdminUser id** in `sub`. Two independent defences collapse into one. A loud boot banner fires while it is missing. **REL-03 (Critical).** | | **2** | **Remove `OTP_MASTER_CODE` from the environment.** | While set, **any active customer signs in with that one fixed code**. Unset or empty disables it completely; the API prints a banner at boot for as long as it is armed. **REL-01 (Critical).** | | **3** | **Set real `JWT_SECRET`.** | Without it the API falls back to a well-known development string, so anyone can forge an admin token. | -| **4** | **Configure the SMS credentials** (`SMS_TREZ_USERNAME`, `SMS_TREZ_PASSWORD`, `SMS_TREZ_SENDER_LINE`). | Until then **no customer can receive a real login code** — messages are written to the log instead of sent. The server still boots (D20). **REL-02.** | +| **4** | **Confirm SMS is going out.** The default `relay` gateway needs no credentials (D26); check `docker compose logs api` for `SMS provider: relay` and send yourself a login code. | If the gateway refuses the `host` value (inside Docker it is the container's IP), set `SMS_RELAY_HOST`. A failed send is only a log line — the server still boots (D20). **REL-02.** | + +| **5** | **Accounting integration (D27), only if it will be switched on:** set `ACCOUNTING_SECRET_KEY`; count products with no image (they disappear from the app — query in ISSUES ACC-05) and photograph them first; for Zarrin, run the trial on temporary documents first (ACC-01). | The integration itself is off until an admin turns it on in «اتصال حسابداری»; nothing changes before that except the no-image rule, which applies to every product. | After changing any of these: `docker compose up -d --build` and confirm the `OTP_MASTER_CODE` banner is **gone** from `docker compose logs api`. @@ -189,14 +190,21 @@ container. | `ADMIN_PANEL_PORT`, `USER_APP_PORT`, `USER_APP_V2_PORT` | 5180–5182 | Dev servers only. | | `RUN_MIGRATIONS` | `true` | Set `false` to skip the boot-time migration run. | | `RUN_SEED` | `true` | Set `false` to skip seeding. | +| `ACCOUNTING_SECRET_KEY` | *(derived from `JWT_SECRET`)* | Encrypts the accounting-software token the admin enters (D27). Set its own long random value; changing it later means re-entering the token. | +| `ACCOUNTING_WORKER` | `on` | `off` keeps this instance out of the accounting background sync. | | `PROFILE_ADMIN_MOBILES` | *(blank)* | Comma-separated admin mobiles told when a customer completes their profile. The reference hardcoded four numbers; blank means nobody is notified and the upload still succeeds. | -### SMS — all optional; blank means "log, do not send" +### SMS — all optional -`SMS_PROVIDER` (`trez` default, or `none`), `SMS_TREZ_URL`, -`SMS_TREZ_USERNAME`, `SMS_TREZ_PASSWORD`, `SMS_TREZ_SENDER_LINE`. +`SMS_PROVIDER`: `relay` (default), `trez`, or `none` (D26). -With these unset the server **still starts normally** and logs a warning; a +- **relay**: `SMS_RELAY_URL`, `SMS_RELAY_SECRET` (both have built-in + defaults), `SMS_RELAY_HOST` (blank = the machine's first external IPv4), + `SMS_RELAY_PLATFORM` (`kave` default, or `default` to let the gateway pick). +- **trez**: `SMS_TREZ_URL`, `SMS_TREZ_USERNAME`, `SMS_TREZ_PASSWORD`, + `SMS_TREZ_SENDER_LINE`. + +The server **always starts**; a misconfigured provider is a warning, and a failed or skipped SMS never blocks an operation, including customer creation. ### ⚠ `OTP_MASTER_CODE` — delivery only @@ -405,4 +413,6 @@ Recorded in `docs/parity/DECISIONS.md`: the lowest-risk option, change nothing protected. - **D20** — SMS can never block a boot or an operation; `OTP_MASTER_CODE` for the delivery. +- **D26** — SMS goes through the owner's `relay` gateway by default; Trez is + kept as a selectable driver. - **D11 is cancelled** — superseded by D13. diff --git a/apps/admin-panel/src/components/accounting/AccountingConnection.vue b/apps/admin-panel/src/components/accounting/AccountingConnection.vue new file mode 100644 index 0000000..6b7cc03 --- /dev/null +++ b/apps/admin-panel/src/components/accounting/AccountingConnection.vue @@ -0,0 +1,743 @@ + + + + + diff --git a/apps/admin-panel/src/components/accounting/AccountingSyncButton.vue b/apps/admin-panel/src/components/accounting/AccountingSyncButton.vue new file mode 100644 index 0000000..66da21d --- /dev/null +++ b/apps/admin-panel/src/components/accounting/AccountingSyncButton.vue @@ -0,0 +1,76 @@ + + + diff --git a/apps/admin-panel/src/components/accounting/CustomerAccountingCard.vue b/apps/admin-panel/src/components/accounting/CustomerAccountingCard.vue new file mode 100644 index 0000000..6c54ac0 --- /dev/null +++ b/apps/admin-panel/src/components/accounting/CustomerAccountingCard.vue @@ -0,0 +1,142 @@ + + + + + diff --git a/apps/admin-panel/src/layouts/navMenuItems.ts b/apps/admin-panel/src/layouts/navMenuItems.ts index 48baeeb..7bcec2f 100644 --- a/apps/admin-panel/src/layouts/navMenuItems.ts +++ b/apps/admin-panel/src/layouts/navMenuItems.ts @@ -463,6 +463,14 @@ export const adminMenu: NavMenuNode[] = [ i18n: 'مدیریت کیف پول', permissionId:"config.wallet" }, + // D27 — Tahesab / Zarrin integration. + { + url: '/config/manage/accounting', + name: 'accounting Integration', + slug: 'manage-accounting', + i18n: 'اتصال حسابداری', + permissionId:"config.accounting" + }, // Moved under "پیکر بندی" per request — same node shape as before // (own submenu / plain leaf), just relocated in the tree. { diff --git a/apps/admin-panel/src/router/admin.ts b/apps/admin-panel/src/router/admin.ts index 1235055..546e17e 100644 --- a/apps/admin-panel/src/router/admin.ts +++ b/apps/admin-panel/src/router/admin.ts @@ -101,6 +101,27 @@ export const adminRoute: RouteRecordRaw[] = [ no_scroll: true } }, + { + path: '/config/manage/accounting', + component: () => import('../views/manage/accounting.vue'), + meta: { + breadcrumb: [ + { + title: 'خانه', + url: '/' + }, + { + title: 'اتصال حسابداری', + active: true + } + ], + pageTitle: 'اتصال حسابداری', + rule: 'editor', + role: 'config.accounting', + parent: 'manage', + no_scroll: true + } + }, { path: '/config/manage/report', component: () => import('../views/manage/report.vue'), diff --git a/apps/admin-panel/src/views/apps/product/AddProduct.vue b/apps/admin-panel/src/views/apps/product/AddProduct.vue index 4774561..bdbf116 100644 --- a/apps/admin-panel/src/views/apps/product/AddProduct.vue +++ b/apps/admin-panel/src/views/apps/product/AddProduct.vue @@ -83,16 +83,18 @@
- - + + + - + @@ -286,6 +288,8 @@ const users = useUsersStore(); const hasPermission = (rid: string) => Boolean(users.hasPermission(rid)); const id = route.params.id as string | undefined; +const accountingLocked = ref(false); +const accountingWage = ref(undefined); const loading = ref(false); const brands = ref<{ id: string; title: string }[]>([]); @@ -382,7 +386,8 @@ function showModal(record?: VariantRow, index?: number) { id: undefined, title: '', grams: undefined, - percentage_pay: undefined, + // D27 — the accounting software's sale making charge, as a starting value. + percentage_pay: accountingWage.value, qty: 0, is_active: true, is_pre_order: false, @@ -470,6 +475,9 @@ onMounted(async () => { if (id) { try { const { data } = await api.get(`product/show/${id}`); + accountingLocked.value = Boolean(data.accounting?.locked); + accountingWage.value = + data.accounting?.sale_wage_percent != null ? Number(data.accounting.sale_wage_percent) : undefined; Object.assign(form, { title: data.title ?? '', product_code: data.product_code ?? '', diff --git a/apps/admin-panel/src/views/apps/product/ProductList.vue b/apps/admin-panel/src/views/apps/product/ProductList.vue index bb3d251..5fd654c 100644 --- a/apps/admin-panel/src/views/apps/product/ProductList.vue +++ b/apps/admin-panel/src/views/apps/product/ProductList.vue @@ -6,6 +6,10 @@ -->
+
تعداد {{ selectedRows.length }} محصول انتخاب شده است.
+ + + + diff --git a/apps/admin-panel/src/views/user/permissionConst.ts b/apps/admin-panel/src/views/user/permissionConst.ts index a7f16ea..e658980 100644 --- a/apps/admin-panel/src/views/user/permissionConst.ts +++ b/apps/admin-panel/src/views/user/permissionConst.ts @@ -838,6 +838,10 @@ export const treeData: PermissionNode[] = [ "title": "گزارش", "key": "config.report", }, + { + "title": "اتصال حسابداری", + "key": "config.accounting", + }, ] }, { diff --git a/apps/api/.env.example b/apps/api/.env.example index f4e4f29..29837ac 100644 --- a/apps/api/.env.example +++ b/apps/api/.env.example @@ -15,19 +15,28 @@ JWT_CUSTOMER_EXPIRES_IN=30d # --------------------------------------------------------------------------- # SMS gateway — Trez panel (port of henza_server/app/Models/Sms.php:57-82) # --------------------------------------------------------------------------- -# NEVER commit real values. The reference hardcoded its live production +# Trez: NEVER commit real values. The reference hardcoded its live production # credentials in the source (SEC-12); those are treated as compromised and are # not reused. Set the real values in .env, which is gitignored. # -# In production the server REFUSES TO START when the three required variables -# below are unset, because without them no customer can receive a login code. -# Outside production it only warns, and OTP codes are logged locally instead. +# The server always starts (D20). A misconfigured provider only warns, and +# outside production OTP codes are then logged locally instead. +# With nothing set, the relay driver SENDS REAL SMS (D26) — set +# SMS_PROVIDER=none on a development machine that must not. -# "trez" (default) or "none" to disable sending entirely. -SMS_PROVIDER=trez +# "relay" (default, D26), "trez", or "none" to disable sending entirely. +SMS_PROVIDER=relay +# relay — all optional; URL and secret have built-in defaults. +SMS_RELAY_URL= +SMS_RELAY_SECRET= +# The "host" field; blank sends this machine's first external IPv4. +SMS_RELAY_HOST= +# "kave" (default, Kavenegar) or "default" to let the gateway pick the line. +SMS_RELAY_PLATFORM= +# trez — only used with SMS_PROVIDER=trez. # Defaults to the reference endpoint when unset; override for staging. SMS_TREZ_URL= -# Required in production: +# Required for trez: SMS_TREZ_USERNAME= SMS_TREZ_PASSWORD= # The panel's sender line — the `PhoneNumber` form field. @@ -36,3 +45,9 @@ SMS_TREZ_SENDER_LINE= # hardcoded six mobile numbers across its controllers (STUB-05); empty means # no admin notifications are sent. SMS_ADMIN_RECIPIENTS= + +# Accounting integration (D27) — configured in the admin panel; these two only +# protect the stored token and control the background worker. +ACCOUNTING_SECRET_KEY= +# "off" keeps this instance out of the background sync. +ACCOUNTING_WORKER= diff --git a/apps/api/prisma/migrations/20261005120000_accounting_integration/migration.sql b/apps/api/prisma/migrations/20261005120000_accounting_integration/migration.sql new file mode 100644 index 0000000..d3e9193 --- /dev/null +++ b/apps/api/prisma/migrations/20261005120000_accounting_integration/migration.sql @@ -0,0 +1,110 @@ +-- Accounting integration (D27): Tahesab / Zarrin, chosen in the admin panel. +-- Plan: docs/ACCOUNTING-INTEGRATION-PLAN.md. +-- +-- Adds the link table (app row <-> accounting record), the outbox the push +-- jobs run from, the issue list pulls report into, and the cached balance and +-- stock columns read back from the accounting software. Nothing existing +-- changes meaning: goldDebtGrams/fiatDebtRial stay the internal ledger caches. + +-- CreateEnum +CREATE TYPE "AccountingEntityType" AS ENUM ('CUSTOMER', 'PRODUCT'); + +-- CreateEnum +CREATE TYPE "AccountingOutboxKind" AS ENUM ('CUSTOMER_PUSH', 'PRODUCT_PUSH', 'ORDER_DOCUMENT', 'ORDER_DOCUMENT_DELETE'); + +-- CreateEnum +CREATE TYPE "AccountingOutboxStatus" AS ENUM ('PENDING', 'SENDING', 'SENT', 'FAILED', 'NEEDS_REVIEW', 'RESOLVED'); + +-- AlterTable +ALTER TABLE "Customer" ADD COLUMN "accountingBalanceAt" TIMESTAMP(3), +ADD COLUMN "accountingGoldBalance" DECIMAL(14,4), +ADD COLUMN "accountingRialBalance" DECIMAL(20,2); + +-- AlterTable +ALTER TABLE "Product" ADD COLUMN "accountingStockAt" TIMESTAMP(3), +ADD COLUMN "accountingStockCount" DECIMAL(14,4), +ADD COLUMN "accountingStockWeight" DECIMAL(14,4); + +-- CreateTable +CREATE TABLE "AccountingLink" ( + "id" TEXT NOT NULL, + "provider" TEXT NOT NULL, + "entityType" "AccountingEntityType" NOT NULL, + "entityId" TEXT NOT NULL, + "externalCode" TEXT NOT NULL, + "externalName" TEXT, + "origin" TEXT NOT NULL, + "snapshot" JSONB, + "syncedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "AccountingLink_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "AccountingOutbox" ( + "id" TEXT NOT NULL, + "provider" TEXT NOT NULL, + "kind" "AccountingOutboxKind" NOT NULL, + "entityId" TEXT NOT NULL, + "status" "AccountingOutboxStatus" NOT NULL DEFAULT 'PENDING', + "attempts" INTEGER NOT NULL DEFAULT 0, + "nextAttemptAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "lastError" TEXT, + "externalRef" TEXT, + "progress" JSONB, + "lastRequest" JSONB, + "lastResponse" JSONB, + "sentAt" TIMESTAMP(3), + "resolvedById" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "AccountingOutbox_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "AccountingIssue" ( + "id" TEXT NOT NULL, + "provider" TEXT NOT NULL, + "kind" TEXT NOT NULL, + "externalCode" TEXT NOT NULL, + "entityId" TEXT, + "message" TEXT NOT NULL, + "data" JSONB, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + "resolvedAt" TIMESTAMP(3), + + CONSTRAINT "AccountingIssue_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE INDEX "AccountingLink_entityType_entityId_idx" ON "AccountingLink"("entityType", "entityId"); + +-- CreateIndex +CREATE UNIQUE INDEX "AccountingLink_provider_entityType_entityId_key" ON "AccountingLink"("provider", "entityType", "entityId"); + +-- CreateIndex +CREATE UNIQUE INDEX "AccountingLink_provider_entityType_externalCode_key" ON "AccountingLink"("provider", "entityType", "externalCode"); + +-- CreateIndex +CREATE INDEX "AccountingOutbox_status_nextAttemptAt_idx" ON "AccountingOutbox"("status", "nextAttemptAt"); + +-- CreateIndex +CREATE INDEX "AccountingOutbox_kind_entityId_idx" ON "AccountingOutbox"("kind", "entityId"); + +-- CreateIndex +CREATE INDEX "AccountingIssue_resolvedAt_idx" ON "AccountingIssue"("resolvedAt"); + +-- CreateIndex +CREATE UNIQUE INDEX "AccountingIssue_provider_kind_externalCode_key" ON "AccountingIssue"("provider", "kind", "externalCode"); + + +-- The new admin screen's permission. The seeded super-admin user type (85, +-- prisma/seed.ts) gets every rid in ALL_RIDS on a fresh seed; an existing +-- database has to be granted the new one here. +INSERT INTO "permission" ("rid", "userTypeId") +SELECT 'config.accounting', 85 +WHERE EXISTS (SELECT 1 FROM "user_type" WHERE "id" = 85) +ON CONFLICT DO NOTHING; diff --git a/apps/api/prisma/schema.prisma b/apps/api/prisma/schema.prisma index 0fc7797..18fadd2 100644 --- a/apps/api/prisma/schema.prisma +++ b/apps/api/prisma/schema.prisma @@ -400,6 +400,14 @@ model Customer { goldDebtGrams Decimal @default(0) @db.Decimal(14, 4) // legacy remain fiatDebtRial Decimal @default(0) @db.Decimal(20, 2) // legacy rial_remain + /// Balance as last read from the accounting software (D27), in the app's own + /// sign convention (positive = owes). Shown to the customer when the + /// integration is on; the credit-limit check still uses goldDebtGrams above. + /// Null until the first successful sync. + accountingGoldBalance Decimal? @db.Decimal(14, 4) + accountingRialBalance Decimal? @db.Decimal(20, 2) + accountingBalanceAt DateTime? + /// Legacy `customers.percent` — the per-customer making-charge offset. It is /// ADDED to the variant's making charge when pricing an order line /// (henza_pwa src/Mixins/product/index.ts:69-75: @@ -557,6 +565,14 @@ model Product { isActive Boolean @default(true) createdAt DateTime @default(now()) + /// Stock of the linked کارساخته as last read from the accounting software + /// (D27). Weight for gram-type items, count for count-type ones — whichever + /// the software reports. At zero or below the product is unavailable in the + /// app (pre-order variants excepted). Null = not linked or never synced. + accountingStockWeight Decimal? @db.Decimal(14, 4) + accountingStockCount Decimal? @db.Decimal(14, 4) + accountingStockAt DateTime? + variants ProductVariant[] images ProductImage[] collections CollectionProduct[] @@ -911,6 +927,115 @@ model Setting { updatedAt DateTime @updatedAt } +// ───────────────────────────────────────────────────────────────────────── +// Accounting integration (D27) — the shop's accounting software, Tahesab or +// Zarrin, chosen in the admin panel. Configuration lives in the Setting row +// `accounting.config` (never served by the generic `const` routes). Plan: +// docs/ACCOUNTING-INTEGRATION-PLAN.md. +// +// `provider` is the driver name ('tahesab' | 'zarrin'), a plain string like +// SMS_PROVIDER so a new driver needs no migration. Links are per provider, so +// switching provider and back loses nothing. +// ───────────────────────────────────────────────────────────────────────── + +enum AccountingEntityType { + CUSTOMER + PRODUCT +} + +/// One app row ↔ one record in the accounting software (customer account or +/// کارساخته). +model AccountingLink { + id String @id @default(cuid()) + provider String + entityType AccountingEntityType + entityId String + /// The record's code in the accounting software (Tahesab Moshtari_Code / + /// Zarrin idHesab; for products the Zarrin idKar or the Tahesab Name_Kar). + externalCode String + externalName String? + /// How the link came to be: LINKED (matched by mobile/name), IMPORTED (app + /// row created from the accounting record), PUSHED (accounting record created + /// from the app row) or MANUAL (an admin typed the code). + origin String + /// The record as last read, for display only. + snapshot Json? + syncedAt DateTime @default(now()) + createdAt DateTime @default(now()) + + @@unique([provider, entityType, entityId]) + @@unique([provider, entityType, externalCode]) + @@index([entityType, entityId]) +} + +enum AccountingOutboxKind { + CUSTOMER_PUSH + PRODUCT_PUSH + ORDER_DOCUMENT + ORDER_DOCUMENT_DELETE +} + +enum AccountingOutboxStatus { + PENDING + /// A call was in flight. Found at startup, it means the process died mid-call + /// and the outcome is unknown — see AccountingOutboxWorker. + SENDING + SENT + FAILED + /// Unsafe to retry automatically (e.g. a Zarrin call timed out: Zarrin has no + /// idempotency key, so a blind retry could post the document twice). + NEEDS_REVIEW + /// Closed by an admin from the log screen. + RESOLVED +} + +/// Work to push to the accounting software. Written in the SAME transaction as +/// the change that causes it, so an outage of the accounting software never +/// loses an event and never blocks the app. +model AccountingOutbox { + id String @id @default(cuid()) + provider String + kind AccountingOutboxKind + entityId String + status AccountingOutboxStatus @default(PENDING) + attempts Int @default(0) + nextAttemptAt DateTime @default(now()) + lastError String? + /// What the accounting software returned as the document/record id. + externalRef String? + /// Per-step progress of multi-call jobs (a Zarrin document is one call per + /// line), so a failure resumes where it stopped. + progress Json? + /// Last request/response, for the log screen. Never contains the token. + lastRequest Json? + lastResponse Json? + sentAt DateTime? + resolvedById String? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + @@index([status, nextAttemptAt]) + @@index([kind, entityId]) +} + +/// Something a pull found that needs a human: an account with no mobile, two +/// accounts sharing one mobile, a کارساخته group with no category mapping. +model AccountingIssue { + id String @id @default(cuid()) + provider String + kind String + externalCode String + entityId String? + message String + data Json? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + resolvedAt DateTime? + + @@unique([provider, kind, externalCode]) + @@index([resolvedAt]) +} + // ───────────────────────────────────────────────────────────────────────── // Promotions / discounts — legacy views/promotion/*, served by // PromotionController (`product/variant/promotion`). The redesigned schema had diff --git a/apps/api/scripts/test-accounting-tahesab.ts b/apps/api/scripts/test-accounting-tahesab.ts new file mode 100644 index 0000000..b99dd4d --- /dev/null +++ b/apps/api/scripts/test-accounting-tahesab.ts @@ -0,0 +1,254 @@ +/** + * Accounting integration (D27) — end to end against Tahesab's PUBLIC TEST + * server (https://api-test.tahesab.ir), on a THROWAWAY database. + * + * Runs the real services (Nest application context), not mocks: + * 1. config: provider switch, token sealed, generic `const` routes fenced off + * 2. connection test + * 3. F1 verified customer → pushed (searched by mobile first, so re-runs reuse + * the same test account) → linked + * 4. F1 customer pull (one group only) imports accounts into the app + * 5. F2 balance pull + the figure /customer/me now shows + * 6. F5 a product with no image is not in the catalog and cannot be ordered + * 7. F3 an order reaching DELIVERED_TO_AGENT queues a document; the worker + * posts it as TEMPORARY; the rows in Tahesab move exactly the order's + * gold (karat-with-charge rule) + * 8. F6 «گزارش» reads the Tahesab statement + * 9. F3 cancelling the order deletes the (still temporary) document + * 10. F4 item pull: Tahesab items become hidden products + * + * The document is created temporary and deleted again; the only lasting trace + * on the test server is one test account (mobile 09990001111) that later runs + * reuse. + * + * Usage (database name must contain "test" or "e2e" — it is written freely): + * DATABASE_URL=postgresql://…/goldbank_acc_e2e TAHESAB_TEST_TOKEN= \ + * ACCOUNTING_SECRET_KEY=x npx ts-node --transpile-only scripts/test-accounting-tahesab.ts + */ +import { NestFactory } from '@nestjs/core'; +import { Logger } from '@nestjs/common'; +import { OrderStatus, Prisma, PrismaClient, VerificationStep } from '@prisma/client'; + +process.env.ACCOUNTING_WORKER = 'off'; +process.env.IAM_ENABLED = 'false'; + +const DB = process.env.DATABASE_URL ?? ''; +const TOKEN = process.env.TAHESAB_TEST_TOKEN ?? ''; +if (!/test|e2e/i.test(new URL(DB.replace(/^postgresql/, 'http')).pathname)) { + console.error('Refusing: DATABASE_URL must point to a throwaway database (name containing "test" or "e2e").'); + process.exit(2); +} +if (!TOKEN) { + console.error('TAHESAB_TEST_TOKEN is required (the bearer token shown on https://tahesab.ir/APiDoc/).'); + process.exit(2); +} + +let pass = 0; +let fail = 0; +const chk = (c: unknown, m: string) => { + if (c) { + pass += 1; + console.log(` PASS ${m}`); + } else { + fail += 1; + console.log(` FAIL ${m}`); + } +}; +const step = (t: string) => console.log(`\n${t}`); + +async function main() { + const prisma0 = new PrismaClient(); + const { runMigrations } = await import('../src/prisma/migrate'); + await runMigrations(prisma0); + await prisma0.$disconnect(); + + const { AppModule } = await import('../src/app.module'); + const app = await NestFactory.createApplicationContext(AppModule, { logger: ['error'] }); + const { PrismaService } = await import('../src/prisma/prisma.service'); + const { AccountingConfigService } = await import('../src/modules/accounting-sync/accounting-config.service'); + const { AccountingAdminService } = await import('../src/modules/accounting-sync/accounting-admin.service'); + const { AccountingSyncService, factorCodeFor } = await import('../src/modules/accounting-sync/accounting-sync.service'); + const { AccountingWorkerService } = await import('../src/modules/accounting-sync/accounting-worker.service'); + const { AdminCustomersService } = await import('../src/modules/admin-customers/admin-customers.service'); + const { AdminMiscService } = await import('../src/modules/admin-misc/admin-misc.service'); + const { OrdersService } = await import('../src/modules/orders/orders.service'); + const { CatalogService } = await import('../src/modules/catalog/catalog.service'); + const { CustomersService } = await import('../src/modules/customers/customers.service'); + const { CustomerReportService } = await import('../src/modules/customer-report/customer-report.service'); + + const prisma = app.get(PrismaService); + const config = app.get(AccountingConfigService); + const admin = app.get(AccountingAdminService); + const sync = app.get(AccountingSyncService); + const worker = app.get(AccountingWorkerService); + const customersAdmin = app.get(AdminCustomersService); + const misc = app.get(AdminMiscService); + const orders = app.get(OrdersService); + const catalog = app.get(CatalogService); + const customers = app.get(CustomersService); + const report = app.get(CustomerReportService); + + // ── 1 ── + step('1. configuration'); + await config.save({ + provider: 'tahesab', + tahesab: { baseUrl: 'https://api-test.tahesab.ir', dbName: 'TahesabDB', token: TOKEN, timeoutMs: 30000 }, + features: { customers: true, balances: true, report: true, products: true, documents: true }, + mapping: { importCustomerGroups: [{ id: '0', name: 'مشتري' }], newCustomerGroup: { id: '2', name: 'بنکدار' }, karat: 750 }, + }); + const pub = await config.getPublic(); + chk(pub.provider === 'tahesab', 'provider switch saved'); + chk(pub.tahesab.tokenSet && pub.tahesab.tokenReadable, 'token stored and readable by the server'); + chk(!JSON.stringify(pub).includes(TOKEN), 'the admin view never contains the token'); + const row = await prisma.setting.findUnique({ where: { key: 'accounting.config' } }); + chk(!JSON.stringify(row?.value).includes(TOKEN), 'the token is not stored in plain text'); + const consts = await misc.listConsts(); + chk(!consts.some((c: { key: string }) => c.key.startsWith('accounting.')), 'GET const does not list accounting.* rows'); + + // ── 2 ── + step('2. connection test'); + const t = await admin.test('tahesab'); + chk(t.ok, `health: ${JSON.stringify(t).slice(0, 160)}`); + + // ── 3 ── + step('3. F1 push a verified customer'); + const mobile = '09990001111'; + const customer = await prisma.customer.upsert({ + where: { mobile }, + update: {}, + create: { fullName: 'gold-bank smoke', firstName: 'gold-bank', lastName: 'smoke', mobile, nationalCode: mobile, passwordHash: '' }, + }); + await prisma.customer.update({ where: { id: customer.id }, data: { verificationStep: VerificationStep.STEP_TWO_SUBMITTED } }); + await customersAdmin.verify({ customer_id: customer.id, sts_verify_step_two: 2 }); + const queued = await prisma.accountingOutbox.findFirst({ where: { kind: 'CUSTOMER_PUSH', entityId: customer.id } }); + chk(queued?.status === 'PENDING', 'VERIFIED queues a CUSTOMER_PUSH in the same transaction'); + await worker.tick('outbox'); + const pushed = await prisma.accountingOutbox.findUnique({ where: { id: queued!.id } }); + chk(pushed?.status === 'SENT', `push sent (${pushed?.status} ${pushed?.lastError ?? ''})`); + const link = await prisma.accountingLink.findFirst({ where: { entityType: 'CUSTOMER', entityId: customer.id } }); + chk(!!link?.externalCode, `customer linked to Tahesab account ${link?.externalCode} (${link?.origin})`); + + // ── 4 ── + step('4. F1 pull (GID 0 «مشتري» only)'); + const before = await prisma.customer.count(); + const pulled = await sync.pullCustomers((await config.active())!); + const after = await prisma.customer.count(); + chk(pulled.scanned > 0, `scanned ${pulled.scanned} accounts, ${pulled.inScope} in scope`); + chk(after - before === pulled.imported, `imported ${pulled.imported}, linked ${pulled.linked}, issues ${pulled.issues}`); + const imported = await prisma.accountingLink.findFirst({ where: { origin: 'IMPORTED' } }); + if (imported) { + const c = await prisma.customer.findUnique({ where: { id: imported.entityId } }); + chk(c?.mobile?.startsWith('09') && c.passwordHash === '' && c.goldCreditLimitGrams.eq(0), 'imported customer keyed by mobile, OTP-only, credit 0'); + } + + // ── 5 ── + step('5. F2 balances'); + const b = await sync.pullBalances((await config.active())!); + chk(b.updated > 0, `balances updated for ${b.updated}/${b.linked} linked customers`); + const me = await customers.getOrThrow(customer.id); + chk(me.balanceSource === 'accounting', `/customer/me shows the accounting balance (${String(me.goldDebtGrams)} g)`); + + // ── 6 ── + step('6. F5 no image, no app'); + const bare = await prisma.product.create({ + data: { title: 'gb-e2e-noimage', variants: { create: { title: 'v', rashWeightGrams: 1, defaultWagePercent: 10, qty: 5 } } }, + include: { variants: true }, + }); + chk(!(await catalog.listProducts()).some((p) => p.id === bare.id), 'imageless product is not in the catalog'); + let refused = false; + try { + await catalog.getVariantOrThrow(bare.variants[0].id); + } catch { + refused = true; + } + chk(refused, 'imageless product cannot be ordered'); + + // ── 7 ── + step('7. F3 order document'); + const product = await prisma.product.create({ + data: { + title: 'gb-e2e-انگشتر', + images: { create: { url: '/uploads/e2e.jpg' } }, + variants: { + create: [ + { title: '4.2g', rashWeightGrams: '4.2', defaultWagePercent: 10, qty: 10 }, + { title: '10g', rashWeightGrams: '10', defaultWagePercent: 18.5, qty: 10 }, + ], + }, + }, + include: { variants: true }, + }); + chk((await catalog.listProducts()).some((p) => p.id === product.id), 'product with an image is in the catalog'); + const order = await orders.createOrder( + { + items: [ + { productVariantId: product.variants[0].id, quantity: 2, wagePercent: 10 }, + { productVariantId: product.variants[1].id, quantity: 1, wagePercent: 18.5, flatRialCharge: 500000 }, + ], + } as never, + customer.id, + ); + await orders.updateStatus(order.id, OrderStatus.DELIVERED_TO_AGENT); + const docJob = await prisma.accountingOutbox.findFirst({ where: { kind: 'ORDER_DOCUMENT', entityId: order.id } }); + chk(docJob?.status === 'PENDING', 'delivery queued the document with the debt'); + await worker.tick('outbox'); + const docSent = await prisma.accountingOutbox.findUnique({ where: { id: docJob!.id } }); + chk(docSent?.status === 'SENT', `document posted (${docSent?.status} ${docSent?.lastError ?? ''})`); + const a = (await config.active())!; + const factorCode = factorCodeFor(order.id); + // Whatever happens below, the test document must not stay on the shared server. + cleanup = async () => { + await a.provider.deleteDocument(a.settings, { factorCode, ref: null, customerCode: link!.externalCode }).catch(() => undefined); + }; + chk(await a.provider.documentExists(a.settings, { factorCode, ref: null }), `Tahesab finds ${factorCode}`); + const st = await a.provider.getStatement(a.settings, { code: link!.externalCode, from: toJ(), to: toJ() }); + const rows = st.filter((r) => r.documentRef === factorCode); + chk(rows.length === 2 && rows.every((r) => r.temporary), `2 temporary rows in Tahesab (${rows.length})`); + const moved = rows.reduce((s, r) => s.add(r.goldOut), new Prisma.Decimal(0)); + const total = new Prisma.Decimal(order.totalGoldWeightGrams); + chk(moved.sub(total).abs().lte('0.001'), `rows move ${moved.toFixed(3)} g = order total ${total.toFixed(3)} g`); + + // ── 8 ── + step('8. F6 report from Tahesab'); + const sum = (await report.summary(customer.id, 1)) as { source?: string; result: { factor_Code: string }[] }; + chk(sum.source === 'accounting', 'summary comes from the accounting software'); + chk(sum.result.some((r) => r.factor_Code === factorCode), 'the new document is in the statement'); + const other = (await report.detail(customer.id, 'not-mine-000000000000')) as { result: unknown[] }; + chk(other.result.length === 0, 'SEC-16: an id outside the account matches nothing'); + + // ── 9 ── + step('9. F3 cancellation removes the temporary document'); + await orders.updateStatus(order.id, OrderStatus.CANCELLED); + await worker.tick('outbox'); + const del = await prisma.accountingOutbox.findFirst({ where: { kind: 'ORDER_DOCUMENT_DELETE', entityId: order.id } }); + chk(del?.status === 'SENT', `delete job sent (${del?.status} ${del?.lastError ?? ''})`); + chk(!(await a.provider.documentExists(a.settings, { factorCode, ref: null })), 'document gone from Tahesab'); + + // ── 10 ── + step('10. F4 item pull'); + const items = await sync.pullProducts(a); + chk(items.items > 0, `items ${items.items}: imported ${items.imported}, linked ${items.linked}, updated ${items.updated}`); + const itemLink = await prisma.accountingLink.findFirst({ where: { entityType: 'PRODUCT', origin: 'IMPORTED' } }); + if (itemLink) { + chk(!(await catalog.listProducts()).some((p) => p.id === itemLink.entityId), 'an imported item stays hidden until it gets an image'); + } + + await cleanup(); + await app.close(); + console.log(`\n${pass} passed, ${fail} failed`); + process.exit(fail ? 1 : 0); +} + +let cleanup: () => Promise = async () => undefined; + +function toJ() { + // eslint-disable-next-line @typescript-eslint/no-var-requires + const { toJalali } = require('../src/modules/accounting-sync/jalali'); + return toJalali(new Date()); +} + +main().catch(async (err) => { + Logger.error(err); + await cleanup(); + process.exit(1); +}); diff --git a/apps/api/src/app.module.ts b/apps/api/src/app.module.ts index 1faf14f..058e66f 100644 --- a/apps/api/src/app.module.ts +++ b/apps/api/src/app.module.ts @@ -9,6 +9,7 @@ import { CustomerReportModule } from './modules/customer-report/customer-report. import { SmsModule } from './modules/sms/sms.module'; import { OrdersModule } from './modules/orders/orders.module'; import { AccountingModule } from './modules/accounting/accounting.module'; +import { AccountingSyncModule } from './modules/accounting-sync/accounting-sync.module'; import { PricingModule } from './modules/pricing/pricing.module'; import { AuthModule } from './modules/auth/auth.module'; import { IamModule } from './modules/iam/iam.module'; @@ -66,6 +67,8 @@ import { SalesAgentModule } from './modules/sales-agent/sales-agent.module'; SalesAgentModule, OrdersModule, AccountingModule, + // Tahesab / Zarrin integration (D27) — inert until switched on in the admin panel + AccountingSyncModule, PricingModule, ], }) diff --git a/apps/api/src/modules/accounting-sync/accounting-admin.controller.ts b/apps/api/src/modules/accounting-sync/accounting-admin.controller.ts new file mode 100644 index 0000000..403dbb4 --- /dev/null +++ b/apps/api/src/modules/accounting-sync/accounting-admin.controller.ts @@ -0,0 +1,107 @@ +import { Body, Controller, Delete, Get, HttpCode, Param, Post, Put, Query } from '@nestjs/common'; +import { CurrentAdmin, RequirePermission } from '../auth/guards'; +import type { AuthenticatedAdmin } from '../auth/jwt.strategy'; +import { AccountingAdminService } from './accounting-admin.service'; + +/** + * «اتصال حسابداری» (D27) — every route behind `config.accounting`. Nothing + * here ever returns a token: the configuration comes back with tokens reduced + * to `tokenSet` / `tokenReadable` flags. + */ +@Controller('admin/accounting') +@RequirePermission('config.accounting') +export class AccountingAdminController { + constructor(private readonly admin: AccountingAdminService) {} + + @Get() + overview() { + return this.admin.overview(); + } + + @Put('config') + save(@Body() body: Record) { + return this.admin.save(body); + } + + @Post('test') + @HttpCode(200) + test(@Body() body: { provider?: string; connection?: Record }) { + return this.admin.test(body?.provider, body?.connection); + } + + @Post('certificate') + @HttpCode(200) + certificate(@Body() body: { baseUrl?: string }) { + return this.admin.certificate(body?.baseUrl); + } + + @Get('options') + options(@Query('provider') provider?: string) { + return this.admin.options(provider); + } + + @Post('run/:job') + @HttpCode(200) + run(@Param('job') job: string) { + return this.admin.run(job); + } + + @Get('outbox') + outbox(@Query() q: Record) { + return this.admin.outbox(q); + } + + @Post('outbox/:id/retry') + @HttpCode(200) + retry(@Param('id') id: string) { + return this.admin.retry(id); + } + + @Post('outbox/:id/resolve') + @HttpCode(200) + resolve(@Param('id') id: string, @CurrentAdmin() me: AuthenticatedAdmin, @Body() body: { note?: string }) { + return this.admin.resolve(id, me.id, body?.note); + } + + @Get('issues') + issues(@Query() q: Record) { + return this.admin.issues(q); + } + + @Post('issues/:id/resolve') + @HttpCode(200) + resolveIssue(@Param('id') id: string) { + return this.admin.resolveIssue(id); + } + + @Get('links') + links(@Query() q: Record) { + return this.admin.links(q); + } + + @Post('links') + @HttpCode(200) + link(@Body() body: Record) { + return this.admin.manualLink(body); + } + + @Delete('links/:id') + unlink(@Param('id') id: string) { + return this.admin.unlink(id); + } + + @Get('customers/:id') + customer(@Param('id') id: string) { + return this.admin.customer(id); + } + + @Get('products/status') + productsStatus(@Query('ids') ids: string) { + return this.admin.productsStatus(ids); + } + + @Get('movement') + movement(@Query() q: Record) { + return this.admin.movement(q); + } +} diff --git a/apps/api/src/modules/accounting-sync/accounting-admin.service.ts b/apps/api/src/modules/accounting-sync/accounting-admin.service.ts new file mode 100644 index 0000000..bbea9e1 --- /dev/null +++ b/apps/api/src/modules/accounting-sync/accounting-admin.service.ts @@ -0,0 +1,366 @@ +import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common'; +import { AccountingEntityType, AccountingOutboxStatus, Prisma } from '@prisma/client'; +import { PrismaService } from '../../prisma/prisma.service'; +import { cleanUrl } from './accounting-config'; +import { AccountingConfigService, JobName } from './accounting-config.service'; +import { fetchServerCertificate } from './accounting-http'; +import { AccountingSyncService } from './accounting-sync.service'; +import { AccountingWorkerService, PULL_FEATURE } from './accounting-worker.service'; +import { parseJalali, toJalali } from './jalali'; +import { ACCOUNTING_PROVIDERS, ProviderName, isProviderName } from './providers'; + +const JOBS: JobName[] = ['customers', 'balances', 'products', 'outbox']; +const STATUSES: AccountingOutboxStatus[] = ['PENDING', 'SENDING', 'SENT', 'FAILED', 'NEEDS_REVIEW', 'RESOLVED']; + +function page(v: unknown) { + const n = Number(v); + return Number.isInteger(n) && n > 0 ? n : 1; +} + +function limit(v: unknown, max = 100) { + const n = Number(v); + return Number.isInteger(n) && n > 0 ? Math.min(n, max) : 25; +} + +/** Backs the «اتصال حسابداری» admin screen (plan §5). */ +@Injectable() +export class AccountingAdminService { + constructor( + private readonly prisma: PrismaService, + private readonly config: AccountingConfigService, + private readonly sync: AccountingSyncService, + private readonly worker: AccountingWorkerService, + ) {} + + async overview() { + const [config, state, counts, openIssues, raw] = await Promise.all([ + this.config.getPublic(), + this.config.getState(), + this.prisma.accountingOutbox.groupBy({ by: ['status'], _count: { _all: true } }), + this.prisma.accountingIssue.count({ where: { resolvedAt: null } }), + this.config.get(), + ]); + return { + config, + inactiveReason: this.config.inactiveReason(raw), + state, + busy: this.worker.busy, + realtime: this.worker.realtime, + outbox: Object.fromEntries(counts.map((c) => [c.status, c._count._all])), + openIssues, + }; + } + + async save(body: Record) { + const { providerChanged } = await this.config.save(body); + return { ...(await this.overview()), providerChanged }; + } + + private async settingsOf(name: unknown) { + const config = await this.config.get(); + const provider = isProviderName(name) ? name : config.provider; + if (provider === 'none') throw new BadRequestException('نرم‌افزار حسابداری انتخاب نشده است'); + const settings = this.config.settingsFor(config, provider); + if (!settings) throw new BadRequestException('آدرس یا توکن این نرم‌افزار تنظیم نشده (یا توکن قابل‌خواندن نیست)'); + return { provider: ACCOUNTING_PROVIDERS[provider], settings, config }; + } + + /** For the sync buttons on the lists: connected or not, nothing more. */ + async connectionStatus() { + const config = await this.config.get(); + const reason = this.config.inactiveReason(config); + return { + connected: !reason, + provider: reason || config.provider === 'none' ? null : ACCOUNTING_PROVIDERS[config.provider].label, + }; + } + + /** The list-page sync buttons (plan §12): run now, wait, report. */ + async syncNow(jobs: ('customers' | 'balances' | 'products')[]) { + const reason = this.config.inactiveReason(await this.config.get()); + if (reason) throw new BadRequestException(`سینک با حسابداری انجام نمی‌شود: ${reason}`); + const results = await this.worker.runPullsNow(jobs); + if (!results) throw new BadRequestException('یک همگام‌سازی دیگر در حال اجراست؛ کمی بعد دوباره امتحان کنید'); + return { ok: Object.values(results).every((r) => r.ok), results }; + } + + /** Tests the connection as typed in the form (`connection`), falling back to what is saved. */ + async test(name: unknown, connection?: Record) { + if (!isProviderName(name)) throw new BadRequestException('نرم‌افزار حسابداری نامعتبر است'); + const provider = ACCOUNTING_PROVIDERS[name]; + const settings = this.config.draftSettings(await this.config.get(), name, connection); + if (!settings) throw new BadRequestException('آدرس و توکن را وارد کنید'); + const started = Date.now(); + try { + const info = await provider.health(settings); + return { ok: true, provider: provider.label, ms: Date.now() - started, info }; + } catch (err) { + return { ok: false, provider: provider.label, ms: Date.now() - started, error: this.sync.describeError(err) }; + } + } + + /** + * The certificate the server at `baseUrl` presents, for the admin to compare + * and pin (a self-signed Tahesab install cannot be verified otherwise). + */ + async certificate(baseUrl: unknown) { + const url = cleanUrl(baseUrl, 'آدرس'); + if (!url) throw new BadRequestException('آدرس را وارد کنید'); + try { + return await fetchServerCertificate(url, 10_000); + } catch (err) { + throw new BadRequestException(`گواهی دریافت نشد: ${this.sync.describeError(err)}`); + } + } + + /** Dropdown options for the mapping tab; each list fails on its own. */ + async options(name: unknown) { + const { provider, settings } = await this.settingsOf(name); + const safe = async (fn: () => Promise) => { + try { + return { ok: true as const, items: await fn() }; + } catch (err) { + return { ok: false as const, items: [] as never[], error: this.sync.describeError(err) }; + } + }; + const [customerGroups, karSakhteGroups, karSakhteTypes] = await Promise.all([ + safe(() => provider.listCustomerGroups(settings)), + safe(() => provider.listKarSakhteGroups(settings)), + safe(() => provider.listKarSakhteTypes(settings)), + ]); + const categories = await this.prisma.category.findMany({ select: { id: true, title: true }, orderBy: { title: 'asc' } }); + return { provider: provider.name, customerGroups, karSakhteGroups, karSakhteTypes, categories }; + } + + async run(job: string) { + if (!JOBS.includes(job as JobName)) throw new BadRequestException('کار نامعتبر است'); + const config = await this.config.get(); + const reason = this.config.inactiveReason(config); + if (reason) throw new BadRequestException(`همگام‌سازی انجام نمی‌شود: ${reason}`); + if (job !== 'outbox' && !config.features[PULL_FEATURE[job as Exclude]]) { + throw new BadRequestException('این قابلیت در تب «قابلیت‌ها و زمان‌بندی» خاموش است؛ اول روشن و ذخیره کنید'); + } + const started = this.worker.runNow(job as JobName); + return { started, message: started ? 'شروع شد' : 'یک همگام‌سازی دیگر در حال اجراست؛ کمی بعد دوباره امتحان کنید' }; + } + + // ── outbox log ────────────────────────────────────────────────────── + + async outbox(q: Record) { + const where: Prisma.AccountingOutboxWhereInput = {}; + if (typeof q.status === 'string' && STATUSES.includes(q.status as AccountingOutboxStatus)) { + where.status = q.status as AccountingOutboxStatus; + } + if (typeof q.kind === 'string' && q.kind) where.kind = q.kind as Prisma.AccountingOutboxWhereInput['kind']; + if (typeof q.entityId === 'string' && q.entityId) where.entityId = q.entityId; + const p = page(q.page); + const l = limit(q.limit); + const [rows, total] = await Promise.all([ + this.prisma.accountingOutbox.findMany({ where, orderBy: { createdAt: 'desc' }, skip: (p - 1) * l, take: l }), + this.prisma.accountingOutbox.count({ where }), + ]); + const labels = await this.labelsFor(rows.map((r) => ({ kind: r.kind, entityId: r.entityId }))); + return { rows: rows.map((r) => ({ ...r, entityLabel: labels.get(r.entityId) ?? null })), total, page: p, limit: l }; + } + + private async labelsFor(items: { kind: string; entityId: string }[]) { + const orderIds = items.filter((i) => i.kind.startsWith('ORDER')).map((i) => i.entityId); + const customerIds = items.filter((i) => i.kind === 'CUSTOMER_PUSH').map((i) => i.entityId); + const productIds = items.filter((i) => i.kind === 'PRODUCT_PUSH').map((i) => i.entityId); + const [orders, customers, products] = await Promise.all([ + orderIds.length ? this.prisma.order.findMany({ where: { id: { in: orderIds } }, select: { id: true, orderNumber: true, customer: { select: { fullName: true } } } }) : [], + customerIds.length ? this.prisma.customer.findMany({ where: { id: { in: customerIds } }, select: { id: true, fullName: true, mobile: true } }) : [], + productIds.length ? this.prisma.product.findMany({ where: { id: { in: productIds } }, select: { id: true, title: true } }) : [], + ]); + const m = new Map(); + for (const o of orders) m.set(o.id, `سفارش ${o.orderNumber} — ${o.customer.fullName}`); + for (const c of customers) m.set(c.id, `${c.fullName} (${c.mobile})`); + for (const p of products) m.set(p.id, p.title); + return m; + } + + async retry(id: string) { + const row = await this.prisma.accountingOutbox.findUnique({ where: { id } }); + if (!row) throw new NotFoundException('ردیف پیدا نشد'); + if (row.status === 'SENT' || row.status === 'SENDING') throw new BadRequestException('این ردیف قابل تلاش دوباره نیست'); + return this.prisma.accountingOutbox.update({ + where: { id }, + data: { status: 'PENDING', nextAttemptAt: new Date(), attempts: row.status === 'PENDING' ? row.attempts : 0 }, + }); + } + + async resolve(id: string, adminId: string, note?: string) { + const row = await this.prisma.accountingOutbox.findUnique({ where: { id } }); + if (!row) throw new NotFoundException('ردیف پیدا نشد'); + if (row.status === 'SENDING') throw new BadRequestException('در حال ارسال است'); + return this.prisma.accountingOutbox.update({ + where: { id }, + data: { status: 'RESOLVED', resolvedById: adminId, lastError: note ? `حل‌شده: ${note}` : row.lastError }, + }); + } + + // ── issues ────────────────────────────────────────────────────────── + + async issues(q: Record) { + const where: Prisma.AccountingIssueWhereInput = q.resolved === '1' ? { resolvedAt: { not: null } } : { resolvedAt: null }; + const p = page(q.page); + const l = limit(q.limit); + const [rows, total] = await Promise.all([ + this.prisma.accountingIssue.findMany({ where, orderBy: { updatedAt: 'desc' }, skip: (p - 1) * l, take: l }), + this.prisma.accountingIssue.count({ where }), + ]); + return { rows, total, page: p, limit: l }; + } + + resolveIssue(id: string) { + return this.prisma.accountingIssue.update({ where: { id }, data: { resolvedAt: new Date() } }); + } + + // ── links ─────────────────────────────────────────────────────────── + + async links(q: Record) { + const config = await this.config.get(); + const where: Prisma.AccountingLinkWhereInput = {}; + if (q.entityType === 'CUSTOMER' || q.entityType === 'PRODUCT') where.entityType = q.entityType; + where.provider = isProviderName(q.provider) ? q.provider : config.provider === 'none' ? undefined : config.provider; + if (typeof q.entityId === 'string' && q.entityId) where.entityId = q.entityId; + if (typeof q.q === 'string' && q.q.trim()) { + where.OR = [{ externalCode: { contains: q.q.trim() } }, { externalName: { contains: q.q.trim() } }]; + } + const p = page(q.page); + const l = limit(q.limit); + const [rows, total] = await Promise.all([ + this.prisma.accountingLink.findMany({ where, orderBy: { createdAt: 'desc' }, skip: (p - 1) * l, take: l }), + this.prisma.accountingLink.count({ where }), + ]); + return { rows, total, page: p, limit: l }; + } + + async manualLink(body: Record) { + const config = await this.config.get(); + if (config.provider === 'none') throw new BadRequestException('نرم‌افزار حسابداری انتخاب نشده است'); + const provider = config.provider as ProviderName; + const entityType = body.entityType === 'PRODUCT' ? AccountingEntityType.PRODUCT : AccountingEntityType.CUSTOMER; + const entityId = String(body.entityId ?? '').trim(); + const externalCode = String(body.externalCode ?? '').trim(); + if (!entityId || !externalCode) throw new BadRequestException('شناسه و کد حسابداری الزامی است'); + + const exists = + entityType === 'CUSTOMER' + ? await this.prisma.customer.findUnique({ where: { id: entityId }, select: { id: true } }) + : await this.prisma.product.findUnique({ where: { id: entityId }, select: { id: true } }); + if (!exists) throw new NotFoundException('ردیف اپ پیدا نشد'); + + const taken = await this.prisma.accountingLink.findUnique({ + where: { provider_entityType_externalCode: { provider, entityType, externalCode } }, + }); + if (taken && taken.entityId !== entityId) throw new BadRequestException('این کد به ردیف دیگری لینک است'); + + return this.prisma.accountingLink.upsert({ + where: { provider_entityType_entityId: { provider, entityType, entityId } }, + update: { externalCode, origin: 'MANUAL', syncedAt: new Date() }, + create: { provider, entityType, entityId, externalCode, origin: 'MANUAL', externalName: (body.externalName as string) || null }, + }); + } + + async unlink(id: string) { + await this.prisma.accountingLink.delete({ where: { id } }).catch(() => { + throw new NotFoundException('لینک پیدا نشد'); + }); + return { success: true }; + } + + // ── per-row panels ────────────────────────────────────────────────── + + async customer(id: string) { + const config = await this.config.get(); + const c = await this.prisma.customer.findUnique({ + where: { id }, + select: { + id: true, + goldDebtGrams: true, + fiatDebtRial: true, + accountingGoldBalance: true, + accountingRialBalance: true, + accountingBalanceAt: true, + }, + }); + if (!c) throw new NotFoundException('مشتری یافت نشد'); + const link = + config.provider === 'none' + ? null + : await this.prisma.accountingLink.findUnique({ + where: { provider_entityType_entityId: { provider: config.provider, entityType: 'CUSTOMER', entityId: id } }, + }); + const fresh = link ? await this.sync.customerBalance(id) : null; + const jobs = await this.prisma.accountingOutbox.findMany({ + where: { entityId: id, kind: 'CUSTOMER_PUSH' }, + orderBy: { createdAt: 'desc' }, + take: 5, + }); + return { + provider: config.provider, + link, + internal: { gold: c.goldDebtGrams, rial: c.fiatDebtRial }, + accounting: fresh + ? { gold: fresh.gold, rial: fresh.rial, at: fresh.at } + : c.accountingBalanceAt + ? { gold: c.accountingGoldBalance, rial: c.accountingRialBalance, at: c.accountingBalanceAt } + : null, + jobs, + }; + } + + async productsStatus(idsCsv: string) { + const ids = String(idsCsv ?? '') + .split(',') + .map((s) => s.trim()) + .filter(Boolean) + .slice(0, 500); + const config = await this.config.get(); + if (ids.length === 0) return {}; + const [products, links] = await Promise.all([ + this.prisma.product.findMany({ + where: { id: { in: ids } }, + select: { + id: true, + accountingStockWeight: true, + accountingStockCount: true, + accountingStockAt: true, + _count: { select: { images: true } }, + }, + }), + config.provider === 'none' + ? [] + : this.prisma.accountingLink.findMany({ where: { provider: config.provider, entityType: 'PRODUCT', entityId: { in: ids } } }), + ]); + const linkBy = new Map(links.map((l) => [l.entityId, l])); + return Object.fromEntries( + products.map((p) => { + const l = linkBy.get(p.id); + return [ + p.id, + { + linked: !!l, + locked: !!l && config.features.products, + code: l?.externalCode ?? null, + origin: l?.origin ?? null, + stockWeight: p.accountingStockWeight, + stockCount: p.accountingStockCount, + stockAt: p.accountingStockAt, + hasImage: p._count.images > 0, + }, + ]; + }), + ); + } + + async movement(q: Record) { + const a = await this.config.active(); + if (!a) throw new BadRequestException('اتصال حسابداری فعال نیست'); + const to = parseJalali(q.to as string) ?? toJalali(new Date()); + const from = parseJalali(q.from as string) ?? toJalali(new Date(Date.now() - 30 * 24 * 3600 * 1000)); + const rows = await a.provider.getKarSakhteMovement(a.settings, from, to); + return { provider: a.provider.label, scope: a.provider.capabilities.movementScope, rows }; + } +} diff --git a/apps/api/src/modules/accounting-sync/accounting-config.service.ts b/apps/api/src/modules/accounting-sync/accounting-config.service.ts new file mode 100644 index 0000000..b8aff8e --- /dev/null +++ b/apps/api/src/modules/accounting-sync/accounting-config.service.ts @@ -0,0 +1,298 @@ +import { BadRequestException, Injectable, Logger, OnModuleInit } from '@nestjs/common'; +import { Prisma } from '@prisma/client'; +import { PrismaService } from '../../prisma/prisma.service'; +import { + ACCOUNTING_CONFIG_KEY, + ACCOUNTING_STATE_KEY, + AccountingConfig, + StoredConnection, + cleanBool, + cleanCa, + cleanGroup, + cleanGroups, + cleanInt, + cleanUrl, + documentStatusRank, + withDefaults, +} from './accounting-config'; +import { ACCOUNTING_PROVIDERS, AccountingProvider, ProviderName, ProviderSettings, isProviderName } from './providers'; +import { openSecret, sealSecret, secretKeySource } from './secret-box'; +import { parsePemCertificates } from './accounting-http'; + +/** The first certificate of a pasted bundle, for display; null when none parses. */ +function describeCertificate(pem: string | null) { + const [c] = parsePemCertificates(pem); + if (!c) return null; + return { + subject: c.subject, + subjectAltName: c.subjectAltName ?? null, + validTo: c.validTo, + expired: new Date(c.validTo).getTime() < Date.now(), + fingerprint256: c.fingerprint256, + }; +} + +export interface ActiveProvider { + provider: AccountingProvider; + settings: ProviderSettings; + config: AccountingConfig; +} + +export type JobName = 'customers' | 'balances' | 'products' | 'outbox'; + +export interface JobState { + lastRunAt?: string; + lastOkAt?: string; + lastError?: string | null; + summary?: Record; +} + +export interface AccountingState { + jobs: Partial>; +} + +/** How long a read config is reused before going back to the database. */ +const CACHE_MS = 5_000; + +@Injectable() +export class AccountingConfigService implements OnModuleInit { + private readonly logger = new Logger('Accounting'); + private cache: { at: number; config: AccountingConfig } | null = null; + + constructor(private readonly prisma: PrismaService) {} + + onModuleInit() { + if (secretKeySource() !== 'ACCOUNTING_SECRET_KEY') { + this.logger.warn( + '⚠️ ACCOUNTING_SECRET_KEY تنظیم نشده است. توکن نرم‌افزار حسابداری با کلیدی مشتق از JWT_SECRET رمز می‌شود؛ ' + + 'با عوض‌شدن JWT_SECRET توکن ذخیره‌شده قابل‌خواندن نمی‌ماند و باید دوباره وارد شود. (D27)', + ); + } + } + + async get(): Promise { + if (this.cache && Date.now() - this.cache.at < CACHE_MS) return this.cache.config; + const row = await this.prisma.setting.findUnique({ where: { key: ACCOUNTING_CONFIG_KEY } }); + const config = withDefaults(row?.value); + this.cache = { at: Date.now(), config }; + return config; + } + + /** The configuration as the admin screen sees it: tokens reduced to flags. */ + async getPublic() { + const c = await this.get(); + const publicConn = (conn: StoredConnection) => { + const { tokenSealed, ...rest } = conn; + return { + ...rest, + tokenSet: !!tokenSealed, + tokenReadable: !!tokenSealed && openSecret(tokenSealed) !== null, + // What the pinned certificate is, so the screen can show it instead of PEM. + caInfo: describeCertificate(rest.caCert), + }; + }; + return { + ...c, + tahesab: publicConn(c.tahesab), + zarrin: publicConn(c.zarrin), + secretKeySource: secretKeySource(), + providers: Object.values(ACCOUNTING_PROVIDERS).map((p) => ({ + name: p.name, + label: p.label, + capabilities: p.capabilities, + })), + }; + } + + /** + * Applies an admin's edit. Anything not sent is kept. A token is replaced + * only by a non-empty string and removed only by an explicit null — so the + * form can be saved without ever having seen the token. + */ + async save(input: Record): Promise<{ providerChanged: boolean }> { + const current = await this.get(); + const next: AccountingConfig = JSON.parse(JSON.stringify(current)); + + if (input.provider !== undefined) { + if (input.provider !== 'none' && !isProviderName(input.provider)) { + throw new BadRequestException('نرم‌افزار حسابداری نامعتبر است'); + } + next.provider = input.provider; + } + + const conn = (key: ProviderName) => { + const src = input[key]; + if (!src || typeof src !== 'object') return; + const label = ACCOUNTING_PROVIDERS[key].label; + const dst: StoredConnection = next[key]; + if (src.baseUrl !== undefined) dst.baseUrl = cleanUrl(src.baseUrl, `آدرس ${label}`); + if (src.caCert !== undefined) dst.caCert = cleanCa(src.caCert); + if (src.timeoutMs !== undefined) dst.timeoutMs = cleanInt(src.timeoutMs, 'مهلت پاسخ (میلی‌ثانیه)', 3000, 120000, dst.timeoutMs); + if (src.token === null) dst.tokenSealed = null; + else if (typeof src.token === 'string' && src.token.trim()) { + try { + dst.tokenSealed = sealSecret(src.token.trim()); + } catch (err) { + throw new BadRequestException((err as Error).message); + } + } + }; + conn('tahesab'); + conn('zarrin'); + + if (input.tahesab?.dbName !== undefined) { + const db = String(input.tahesab.dbName ?? '').trim(); + if (!/^[A-Za-z0-9_]{1,64}$/.test(db)) throw new BadRequestException('نام دیتابیس ته‌حساب نامعتبر است'); + next.tahesab.dbName = db; + } + if (input.zarrin?.balanceOwesWhen !== undefined) { + if (input.zarrin.balanceOwesWhen !== 'negative' && input.zarrin.balanceOwesWhen !== 'positive') { + throw new BadRequestException('علامت مانده‌ی زرین نامعتبر است'); + } + next.zarrin.balanceOwesWhen = input.zarrin.balanceOwesWhen; + } + + if (input.features && typeof input.features === 'object') { + for (const k of Object.keys(next.features) as (keyof AccountingConfig['features'])[]) { + next.features[k] = cleanBool(input.features[k], next.features[k]); + } + } + + if (input.intervals && typeof input.intervals === 'object') { + const i = input.intervals; + next.intervals.customersMinutes = cleanInt(i.customersMinutes, 'بازه‌ی سینک مشتری', 5, 1440, next.intervals.customersMinutes); + next.intervals.balancesMinutes = cleanInt(i.balancesMinutes, 'بازه‌ی سینک مانده', 1, 1440, next.intervals.balancesMinutes); + next.intervals.productsMinutes = cleanInt(i.productsMinutes, 'بازه‌ی سینک کارساخته', 5, 1440, next.intervals.productsMinutes); + } + + if (input.mapping && typeof input.mapping === 'object') { + const m = input.mapping; + if (m.importCustomerGroups !== undefined) next.mapping.importCustomerGroups = cleanGroups(m.importCustomerGroups); + if (m.newCustomerGroup !== undefined) next.mapping.newCustomerGroup = cleanGroup(m.newCustomerGroup); + if (m.newKarSakhteGroup !== undefined) next.mapping.newKarSakhteGroup = cleanGroup(m.newKarSakhteGroup); + if (m.newKarSakhteType !== undefined) next.mapping.newKarSakhteType = cleanGroup(m.newKarSakhteType); + if (m.categoryGroups !== undefined) { + next.mapping.categoryGroups = (Array.isArray(m.categoryGroups) ? m.categoryGroups : []) + .map((x: any) => ({ categoryId: String(x?.categoryId ?? '').trim(), group: cleanGroup(x?.group) })) + .filter((x: any) => x.categoryId && x.group); + } + if (m.karat !== undefined) next.mapping.karat = cleanInt(m.karat, 'عیار پایه', 1, 1000, next.mapping.karat); + } + + if (input.documents && typeof input.documents === 'object' && input.documents.triggerStatus !== undefined) { + if (!documentStatusRank(String(input.documents.triggerStatus))) { + throw new BadRequestException('وضعیت ثبت سند سفارش نامعتبر است'); + } + next.documents.triggerStatus = input.documents.triggerStatus; + } + + if (input.report && typeof input.report === 'object') { + next.report.windowDays = cleanInt(input.report.windowDays, 'بازه‌ی گزارش (روز)', 7, 3650, next.report.windowDays); + } + + // Selecting a software that has no address/token would switch the sync + // off without a word (the worker finds nothing usable). + if (next.provider !== 'none' && (!next[next.provider].baseUrl || !next[next.provider].tokenSealed)) { + const label = ACCOUNTING_PROVIDERS[next.provider].label; + throw new BadRequestException(`«${label}» انتخاب شده ولی آدرس یا توکن آن وارد نشده است`); + } + + await this.prisma.setting.upsert({ + where: { key: ACCOUNTING_CONFIG_KEY }, + update: { value: next as unknown as Prisma.InputJsonValue }, + create: { key: ACCOUNTING_CONFIG_KEY, value: next as unknown as Prisma.InputJsonValue }, + }); + this.cache = null; + return { providerChanged: current.provider !== next.provider }; + } + + /** Decrypted settings for one provider; null when it is not usable. */ + settingsFor(config: AccountingConfig, name: ProviderName): ProviderSettings | null { + const conn = config[name]; + if (!conn.baseUrl) return null; + const token = openSecret(conn.tokenSealed); + if (!token) return null; + return { + baseUrl: conn.baseUrl, + token, + caCert: conn.caCert, + timeoutMs: conn.timeoutMs, + dbName: name === 'tahesab' ? config.tahesab.dbName : undefined, + balanceOwesWhen: name === 'zarrin' ? config.zarrin.balanceOwesWhen : undefined, + }; + } + + /** + * Settings as the admin form currently shows them, saved or not, so «تست + * اتصال» checks what is on screen. A blank token means "the saved one". + * Validated like a save; nothing is stored. + */ + draftSettings(config: AccountingConfig, name: ProviderName, input: Record | undefined): ProviderSettings | null { + const src = input && typeof input === 'object' ? input : {}; + const label = ACCOUNTING_PROVIDERS[name].label; + const saved = config[name]; + const baseUrl = src.baseUrl !== undefined ? cleanUrl(src.baseUrl, `آدرس ${label}`) : saved.baseUrl; + const token = typeof src.token === 'string' && src.token.trim() ? src.token.trim() : openSecret(saved.tokenSealed); + if (!baseUrl || !token) return null; + let dbName = config.tahesab.dbName; + if (name === 'tahesab' && src.dbName !== undefined) { + dbName = String(src.dbName ?? '').trim(); + if (!/^[A-Za-z0-9_]{1,64}$/.test(dbName)) throw new BadRequestException('نام دیتابیس ته‌حساب نامعتبر است'); + } + let balanceOwesWhen = config.zarrin.balanceOwesWhen; + if (name === 'zarrin' && (src.balanceOwesWhen === 'negative' || src.balanceOwesWhen === 'positive')) { + balanceOwesWhen = src.balanceOwesWhen; + } + return { + baseUrl, + token, + caCert: src.caCert !== undefined ? cleanCa(src.caCert) : saved.caCert, + timeoutMs: cleanInt(src.timeoutMs, 'مهلت پاسخ (میلی‌ثانیه)', 3000, 120000, saved.timeoutMs), + dbName: name === 'tahesab' ? dbName : undefined, + balanceOwesWhen: name === 'zarrin' ? balanceOwesWhen : undefined, + }; + } + + /** Why nothing syncs, in words for the admin screen; null when a provider is usable. */ + inactiveReason(config: AccountingConfig): string | null { + if (config.provider === 'none') return 'سوییچ روی «بدون اتصال» است'; + const label = ACCOUNTING_PROVIDERS[config.provider].label; + const conn = config[config.provider]; + if (!conn.baseUrl || !conn.tokenSealed) return `«${label}» انتخاب شده ولی آدرس یا توکن آن وارد نشده است`; + if (!this.settingsFor(config, config.provider)) return `توکن ذخیره‌شده‌ی «${label}» قابل‌خواندن نیست؛ دوباره وارد کنید`; + return null; + } + + /** The selected, fully configured provider — or null when the switch is off. */ + async active(): Promise { + const config = await this.get(); + if (config.provider === 'none') return null; + const settings = this.settingsFor(config, config.provider); + if (!settings) return null; + return { provider: ACCOUNTING_PROVIDERS[config.provider], settings, config }; + } + + /** Active provider with this feature switched on, or null. */ + async activeFor(feature: keyof AccountingConfig['features']): Promise { + const a = await this.active(); + return a && a.config.features[feature] ? a : null; + } + + // ── job bookkeeping (shown on the admin screen) ─────────────────────── + + async getState(): Promise { + const row = await this.prisma.setting.findUnique({ where: { key: ACCOUNTING_STATE_KEY } }); + const v = (row?.value ?? {}) as Partial; + return { jobs: v.jobs ?? {} }; + } + + async recordJob(job: JobName, patch: JobState) { + const state = await this.getState(); + state.jobs[job] = { ...(state.jobs[job] ?? {}), ...patch }; + await this.prisma.setting.upsert({ + where: { key: ACCOUNTING_STATE_KEY }, + update: { value: state as unknown as Prisma.InputJsonValue }, + create: { key: ACCOUNTING_STATE_KEY, value: state as unknown as Prisma.InputJsonValue }, + }); + } +} diff --git a/apps/api/src/modules/accounting-sync/accounting-config.ts b/apps/api/src/modules/accounting-sync/accounting-config.ts new file mode 100644 index 0000000..4ab71b2 --- /dev/null +++ b/apps/api/src/modules/accounting-sync/accounting-config.ts @@ -0,0 +1,181 @@ +import { BadRequestException } from '@nestjs/common'; +import { ExternalGroup, ProviderName } from './providers/accounting-provider'; + +/** + * The admin-editable configuration of the accounting integration (D27), + * stored as one Setting row. Every `accounting.*` Setting key is refused by + * the generic `const` routes (admin-misc), so the only way in or out is the + * dedicated, `config.accounting`-guarded screen — and even that never returns + * a token. + */ + +export const ACCOUNTING_SETTING_PREFIX = 'accounting.'; +export const ACCOUNTING_CONFIG_KEY = 'accounting.config'; +export const ACCOUNTING_STATE_KEY = 'accounting.state'; + +/** Keys the generic `const` settings routes must never read or write. */ +export function isAccountingSettingKey(key: string) { + return key.trim().toLowerCase().startsWith(ACCOUNTING_SETTING_PREFIX); +} + +export type ProviderChoice = 'none' | ProviderName; + +export interface StoredConnection { + baseUrl: string; + /** AES-GCM sealed (secret-box.ts). Never leaves the server. */ + tokenSealed: string | null; + /** PEM CA of a self-signed installation; verification is never turned off. */ + caCert: string | null; + timeoutMs: number; +} + +export interface AccountingFeatures { + /** F1 — customer import/link and push. */ + customers: boolean; + /** F2 — balance pull; the customer sees the accounting balance. */ + balances: boolean; + /** F6 — «گزارش» reads the accounting statement. */ + report: boolean; + /** F4 — کارساخته ↔ product sync and the out-of-stock lock. */ + products: boolean; + /** F3 — order documents. */ + documents: boolean; +} + +export interface AccountingConfig { + provider: ProviderChoice; + tahesab: StoredConnection & { dbName: string }; + zarrin: StoredConnection & { balanceOwesWhen: 'negative' | 'positive' }; + features: AccountingFeatures; + intervals: { + customersMinutes: number; + balancesMinutes: number; + productsMinutes: number; + }; + mapping: { + /** Account groups imported into the app; empty = every group. */ + importCustomerGroups: ExternalGroup[]; + /** Group a customer created from the app is put in. */ + newCustomerGroup: ExternalGroup | null; + /** Zarrin: group (گروه ساخته) for a product created in the admin… */ + newKarSakhteGroup: ExternalGroup | null; + /** …overridden per app category. */ + categoryGroups: { categoryId: string; group: ExternalGroup }[]; + /** Zarrin: item type (گرمی/تعدادی…) for a product created in the admin. */ + newKarSakhteType: ExternalGroup | null; + /** Purity the app's grams are in. */ + karat: number; + }; + /** How far back «گزارش» reads the accounting statement. */ + report: { windowDays: number }; + /** F3 — the order status at (or past) which the temporary document (پیش‌فاکتور) is posted. */ + documents: { triggerStatus: DocumentTriggerStatus }; +} + +/** Order statuses in the order an order passes them; SUSPENDED/CANCELLED never trigger. */ +export const DOCUMENT_TRIGGER_STATUSES = [ + 'PLACED', + 'ADMIN_APPROVED', + 'SOURCING', + 'PREPARING', + 'DELIVERED_TO_AGENT', + 'DELIVERED_TO_CUSTOMER', +] as const; +export type DocumentTriggerStatus = (typeof DOCUMENT_TRIGGER_STATUSES)[number]; + +/** 1-based place of a status in DOCUMENT_TRIGGER_STATUSES; 0 = never triggers. */ +export function documentStatusRank(status: string): number { + return DOCUMENT_TRIGGER_STATUSES.indexOf(status as DocumentTriggerStatus) + 1; +} + +export const DEFAULT_TIMEOUT_MS = 20_000; + +export function defaultConfig(): AccountingConfig { + return { + provider: 'none', + tahesab: { baseUrl: '', tokenSealed: null, caCert: null, timeoutMs: DEFAULT_TIMEOUT_MS, dbName: 'TahesabDB' }, + zarrin: { baseUrl: '', tokenSealed: null, caCert: null, timeoutMs: DEFAULT_TIMEOUT_MS, balanceOwesWhen: 'negative' }, + features: { customers: false, balances: false, report: false, products: false, documents: false }, + intervals: { customersMinutes: 60, balancesMinutes: 10, productsMinutes: 30 }, + mapping: { + importCustomerGroups: [], + newCustomerGroup: null, + newKarSakhteGroup: null, + categoryGroups: [], + newKarSakhteType: null, + karat: 750, + }, + report: { windowDays: 365 }, + // The point the debt is recognised — the behaviour before the rule existed. + documents: { triggerStatus: 'DELIVERED_TO_AGENT' }, + }; +} + +/** Stored JSON → a complete config, tolerating rows written by older code. */ +export function withDefaults(raw: unknown): AccountingConfig { + const d = defaultConfig(); + const r = (raw && typeof raw === 'object' ? raw : {}) as Partial; + return { + provider: r.provider === 'tahesab' || r.provider === 'zarrin' ? r.provider : 'none', + tahesab: { ...d.tahesab, ...(r.tahesab ?? {}) }, + zarrin: { ...d.zarrin, ...(r.zarrin ?? {}) }, + features: { ...d.features, ...(r.features ?? {}) }, + intervals: { ...d.intervals, ...(r.intervals ?? {}) }, + mapping: { ...d.mapping, ...(r.mapping ?? {}) }, + report: { ...d.report, ...(r.report ?? {}) }, + documents: { ...d.documents, ...(r.documents ?? {}) }, + }; +} + +// ── input validation ──────────────────────────────────────────────────── + +export function cleanUrl(v: unknown, label: string): string { + const s = typeof v === 'string' ? v.trim() : ''; + if (!s) return ''; + let u: URL; + try { + u = new URL(s); + } catch { + throw new BadRequestException(`${label}: آدرس معتبر نیست`); + } + if (u.protocol !== 'http:' && u.protocol !== 'https:') { + throw new BadRequestException(`${label}: آدرس باید با http:// یا https:// شروع شود`); + } + if (u.username || u.password) throw new BadRequestException(`${label}: آدرس نباید نام کاربری/رمز داشته باشد`); + return s; +} + +export function cleanCa(v: unknown): string | null { + const s = typeof v === 'string' ? v.trim() : ''; + if (!s) return null; + if (!s.includes('-----BEGIN CERTIFICATE-----')) { + throw new BadRequestException('گواهی CA باید با قالب PEM (BEGIN CERTIFICATE) باشد'); + } + return s; +} + +export function cleanInt(v: unknown, label: string, min: number, max: number, fallback: number): number { + if (v === undefined || v === null || v === '') return fallback; + const n = Number(v); + if (!Number.isInteger(n) || n < min || n > max) { + throw new BadRequestException(`${label}: عدد صحیح بین ${min} و ${max}`); + } + return n; +} + +export function cleanGroup(v: unknown): ExternalGroup | null { + if (!v || typeof v !== 'object') return null; + const g = v as Record; + const id = g.id === undefined || g.id === null ? '' : String(g.id).trim(); + const name = typeof g.name === 'string' ? g.name.trim() : ''; + if (!id && !name) return null; + return { id, name }; +} + +export function cleanGroups(v: unknown): ExternalGroup[] { + return Array.isArray(v) ? v.map(cleanGroup).filter((g): g is ExternalGroup => !!g) : []; +} + +export function cleanBool(v: unknown, fallback: boolean): boolean { + return typeof v === 'boolean' ? v : fallback; +} diff --git a/apps/api/src/modules/accounting-sync/accounting-hooks.service.spec.ts b/apps/api/src/modules/accounting-sync/accounting-hooks.service.spec.ts new file mode 100644 index 0000000..68c2f31 --- /dev/null +++ b/apps/api/src/modules/accounting-sync/accounting-hooks.service.spec.ts @@ -0,0 +1,106 @@ +import { AccountingHooksService } from './accounting-hooks.service'; +import { AccountingConfig, defaultConfig } from './accounting-config'; + +type Row = { id: string; provider: string; kind: string; entityId: string; status: string }; + +/** Just enough of a Prisma transaction client for the outbox rules. */ +function fakeTx(rows: Row[]) { + const match = (r: Row, where: any) => + (!where.provider || r.provider === where.provider) && + (!where.kind || r.kind === where.kind) && + (!where.entityId || r.entityId === where.entityId) && + (!where.status || + (where.status.in ? where.status.in.includes(r.status) : true) && + (where.status.notIn ? !where.status.notIn.includes(r.status) : true) && + (where.status.not ? r.status !== where.status.not : true)); + return { + accountingOutbox: { + findFirst: async ({ where }: any) => rows.find((r) => match(r, where)) ?? null, + findMany: async ({ where }: any) => rows.filter((r) => match(r, where)), + create: async ({ data }: any) => { + rows.push({ id: String(rows.length + 1), status: 'PENDING', ...data }); + }, + update: async ({ where, data }: any) => { + Object.assign(rows.find((r) => r.id === where.id)!, data); + }, + }, + }; +} + +function hooks(trigger: AccountingConfig['documents']['triggerStatus'], provider: 'tahesab' | 'zarrin' = 'tahesab') { + const c = defaultConfig(); + c.provider = provider; + c.features.documents = true; + c.documents.triggerStatus = trigger; + const config = { get: async () => c } as any; + const worker = { kickSoon: jest.fn() } as any; + return new AccountingHooksService({} as any, config, {} as any, worker); +} + +const docs = (rows: Row[], kind = 'ORDER_DOCUMENT') => rows.filter((r) => r.kind === kind); + +describe('document rule (پیش‌فاکتور at a chosen status)', () => { + it('rule «ثبت سفارش»: the document is queued as the order is placed', async () => { + const rows: Row[] = []; + await hooks('PLACED').orderStatusReached(fakeTx(rows) as any, 'o1', 'PLACED'); + expect(docs(rows)).toHaveLength(1); + }); + + it('default rule: nothing before «تحویل مسئول فروش», then once', async () => { + const rows: Row[] = []; + const h = hooks('DELIVERED_TO_AGENT'); + for (const s of ['PLACED', 'ADMIN_APPROVED', 'PREPARING']) await h.orderStatusReached(fakeTx(rows) as any, 'o1', s); + expect(docs(rows)).toHaveLength(0); + await h.orderStatusReached(fakeTx(rows) as any, 'o1', 'DELIVERED_TO_AGENT'); + await h.orderStatusReached(fakeTx(rows) as any, 'o1', 'DELIVERED_TO_CUSTOMER'); + expect(docs(rows)).toHaveLength(1); + }); + + it('an order that jumps past the rule status still gets its document', async () => { + const rows: Row[] = []; + await hooks('PREPARING').orderStatusReached(fakeTx(rows) as any, 'o1', 'DELIVERED_TO_CUSTOMER'); + expect(docs(rows)).toHaveLength(1); + }); + + it('a suspended order never triggers', async () => { + const rows: Row[] = []; + await hooks('PLACED').orderStatusReached(fakeTx(rows) as any, 'o1', 'SUSPENDED'); + expect(rows).toHaveLength(0); + }); + + it('rolled back below the rule: a waiting document is dropped, a sent one gets a delete job', async () => { + const waiting: Row[] = [{ id: '1', provider: 'tahesab', kind: 'ORDER_DOCUMENT', entityId: 'o1', status: 'PENDING' }]; + await hooks('PREPARING').orderStatusReached(fakeTx(waiting) as any, 'o1', 'ADMIN_APPROVED'); + expect(waiting[0].status).toBe('RESOLVED'); + + const sent: Row[] = [{ id: '1', provider: 'tahesab', kind: 'ORDER_DOCUMENT', entityId: 'o1', status: 'SENT' }]; + await hooks('PREPARING').orderStatusReached(fakeTx(sent) as any, 'o1', 'ADMIN_APPROVED'); + expect(docs(sent, 'ORDER_DOCUMENT_DELETE')).toHaveLength(1); + }); + + it('Tahesab: reaching the rule again after a withdrawal queues a new document behind the delete', async () => { + const rows: Row[] = [ + { id: '1', provider: 'tahesab', kind: 'ORDER_DOCUMENT', entityId: 'o1', status: 'SENT' }, + { id: '2', provider: 'tahesab', kind: 'ORDER_DOCUMENT_DELETE', entityId: 'o1', status: 'PENDING' }, + ]; + await hooks('PREPARING').orderStatusReached(fakeTx(rows) as any, 'o1', 'PREPARING'); + expect(docs(rows)).toHaveLength(2); + }); + + it('Zarrin: never queued twice (no duplicate guard in its API)', async () => { + const rows: Row[] = [ + { id: '1', provider: 'zarrin', kind: 'ORDER_DOCUMENT', entityId: 'o1', status: 'SENT' }, + { id: '2', provider: 'zarrin', kind: 'ORDER_DOCUMENT_DELETE', entityId: 'o1', status: 'PENDING' }, + ]; + await hooks('PREPARING', 'zarrin').orderStatusReached(fakeTx(rows) as any, 'o1', 'PREPARING'); + expect(docs(rows)).toHaveLength(1); + }); + + it('does nothing while the document feature is off', async () => { + const rows: Row[] = []; + const h = hooks('PLACED'); + ((await (h as any).config.get()) as AccountingConfig).features.documents = false; + await h.orderStatusReached(fakeTx(rows) as any, 'o1', 'PLACED'); + expect(rows).toHaveLength(0); + }); +}); diff --git a/apps/api/src/modules/accounting-sync/accounting-hooks.service.ts b/apps/api/src/modules/accounting-sync/accounting-hooks.service.ts new file mode 100644 index 0000000..7234ccd --- /dev/null +++ b/apps/api/src/modules/accounting-sync/accounting-hooks.service.ts @@ -0,0 +1,164 @@ +import { Injectable } from '@nestjs/common'; +import { AccountingEntityType, AccountingOutboxKind, AccountingOutboxStatus, Prisma } from '@prisma/client'; +import { PrismaService } from '../../prisma/prisma.service'; +import { AccountingConfigService } from './accounting-config.service'; +import { AccountingFeatures, documentStatusRank } from './accounting-config'; +import { AccountingSyncService } from './accounting-sync.service'; +import { AccountingWorkerService } from './accounting-worker.service'; +import { ACCOUNTING_PROVIDERS } from './providers'; + +type Tx = Prisma.TransactionClient | PrismaService; + +const OPEN: AccountingOutboxStatus[] = ['PENDING', 'SENDING']; + +/** + * The narrow surface the rest of the app calls into (D27): orders, customer + * admin, product admin, catalog. Every write goes through the caller's own + * transaction client, so the outbox row commits or rolls back with the change + * that caused it. Nothing here talks to the accounting software. + */ +@Injectable() +export class AccountingHooksService { + constructor( + private readonly prisma: PrismaService, + private readonly config: AccountingConfigService, + private readonly sync: AccountingSyncService, + private readonly worker: AccountingWorkerService, + ) {} + + private async enqueue(tx: Tx, feature: keyof AccountingFeatures, kind: AccountingOutboxKind, entityId: string) { + const c = await this.config.get(); + if (c.provider === 'none' || !c.features[feature]) return false; + const open = await tx.accountingOutbox.findFirst({ + where: { provider: c.provider, kind, entityId, status: { in: OPEN } }, + select: { id: true }, + }); + if (open) return false; + await tx.accountingOutbox.create({ data: { provider: c.provider, kind, entityId } }); + this.worker.kickSoon(); + return true; + } + + /** + * F3 — the order is now in `status` (created, advanced, or rolled back). + * The owner's rule (`documents.triggerStatus`, «اتصال حسابداری») says from + * which status on the temporary document (پیش‌فاکتور) belongs in the books: + * at or past it the document is queued once; back below it, a document + * already sent is withdrawn like a cancellation. + */ + async orderStatusReached(tx: Tx, orderId: string, status: string) { + const c = await this.config.get(); + if (c.provider === 'none' || !c.features.documents) return; + const rank = documentStatusRank(status); + if (!rank) return; + if (rank >= documentStatusRank(c.documents.triggerStatus)) await this.queueOrderDocument(tx, c.provider, orderId); + else await this.orderCancelled(tx, orderId); + } + + private async queueOrderDocument(tx: Tx, provider: string, orderId: string) { + const existing = await tx.accountingOutbox.findFirst({ + where: { provider, kind: 'ORDER_DOCUMENT', entityId: orderId, status: { notIn: ['RESOLVED'] } }, + select: { id: true }, + }); + if (existing) { + // Withdrawn and wanted again: Tahesab deletes first (older job), then + // the new one posts — and a duplicate is refused by its Factor_Code key. + // Zarrin has no such key, so its document is never queued twice. + const deleting = await tx.accountingOutbox.findFirst({ + where: { provider, kind: 'ORDER_DOCUMENT_DELETE', entityId: orderId, status: { in: ['PENDING', 'SENDING'] } }, + select: { id: true }, + }); + if (!(provider === 'tahesab' && deleting)) return; + } + await this.enqueue(tx, 'documents', 'ORDER_DOCUMENT', orderId); + } + + /** + * F3 — the order was cancelled. A document still waiting is simply dropped; + * one that may already be in the books gets a delete job, which itself only + * deletes a document that is still temporary (worker). + */ + async orderCancelled(tx: Tx, orderId: string) { + const docs = await tx.accountingOutbox.findMany({ + where: { kind: 'ORDER_DOCUMENT', entityId: orderId, status: { not: 'RESOLVED' } }, + }); + for (const doc of docs) { + if (doc.status === 'PENDING') { + await tx.accountingOutbox.update({ + where: { id: doc.id }, + data: { status: 'RESOLVED', lastError: 'سفارش پیش از ارسال سند لغو شد' }, + }); + continue; + } + const open = await tx.accountingOutbox.findFirst({ + where: { provider: doc.provider, kind: 'ORDER_DOCUMENT_DELETE', entityId: orderId, status: { not: 'RESOLVED' } }, + select: { id: true }, + }); + if (!open) { + await tx.accountingOutbox.create({ + data: { provider: doc.provider, kind: 'ORDER_DOCUMENT_DELETE', entityId: orderId }, + }); + } + } + } + + /** F1 — an admin marked the customer VERIFIED. */ + async customerVerified(tx: Tx, customerId: string) { + await this.enqueue(tx, 'customers', 'CUSTOMER_PUSH', customerId); + } + + /** F1 — a linked customer's contact details changed. */ + async customerEdited(tx: Tx, customerId: string) { + const c = await this.config.get(); + if (c.provider === 'none' || !c.features.customers) return; + const link = await tx.accountingLink.findUnique({ + where: { provider_entityType_entityId: { provider: c.provider, entityType: 'CUSTOMER', entityId: customerId } }, + select: { id: true }, + }); + if (link) await this.enqueue(tx, 'customers', 'CUSTOMER_PUSH', customerId); + } + + /** F4 — a product was created in the admin panel. */ + async productCreated(tx: Tx, productId: string) { + const c = await this.config.get(); + if (c.provider === 'none' || !ACCOUNTING_PROVIDERS[c.provider].capabilities.createKarSakhte) return; + await this.enqueue(tx, 'products', 'PRODUCT_PUSH', productId); + } + + /** + * F4 — title and code of a linked product belong to the accounting software + * (D27); the admin form locks them. Null when the product is not linked. + */ + async productLink(productId: string) { + const c = await this.config.get(); + if (c.provider === 'none' || !c.features.products) return null; + return this.prisma.accountingLink.findUnique({ + where: { provider_entityType_entityId: { provider: c.provider, entityType: AccountingEntityType.PRODUCT, entityId: productId } }, + }); + } + + /** + * Order time: the product with its stock read live from the accounting + * software, or as last stored when that cannot answer in a moment. + */ + liveStock(product: T) { + return this.sync.liveStock(product); + } + + /** + * F4 — is this product out of stock in the accounting software? Only + * meaningful while the product sync is on; stock fields of products that are + * not linked under the active provider are cleared by every product pull. + */ + async stockBlocked(product: { + accountingStockAt: Date | null; + accountingStockWeight: Prisma.Decimal | null; + accountingStockCount: Prisma.Decimal | null; + }) { + if (!product.accountingStockAt) return false; + const c = await this.config.get(); + if (c.provider === 'none' || !c.features.products) return false; + const stock = product.accountingStockWeight ?? product.accountingStockCount; + return stock !== null && new Prisma.Decimal(stock).lte(0); + } +} diff --git a/apps/api/src/modules/accounting-sync/accounting-http.spec.ts b/apps/api/src/modules/accounting-sync/accounting-http.spec.ts new file mode 100644 index 0000000..4594f86 --- /dev/null +++ b/apps/api/src/modules/accounting-sync/accounting-http.spec.ts @@ -0,0 +1,87 @@ +import * as https from 'https'; +import { AddressInfo } from 'net'; +import { AccountingHttpError, fetchServerCertificate, httpRequest, pinnedFingerprints } from './accounting-http'; + +// Throwaway self-signed test certificates (EC P-256, valid to 2126), issued +// for *.invalid names so connecting to 127.0.0.1 never matches them — the +// same situation as a Tahesab install whose certificate says `localhost`. +const CERT_A = `-----BEGIN CERTIFICATE----- +MIIBxTCCAWugAwIBAgIUNaqVnWRRUyN8hOGPQtARjZymRcUwCgYIKoZIzj0EAwIw +JDEiMCAGA1UEAwwZYWNjb3VudGluZy10ZXN0LWEuaW52YWxpZDAgFw0yNjEwMDUx +MjA3NDJaGA8yMTI2MDkxMTEyMDc0MlowJDEiMCAGA1UEAwwZYWNjb3VudGluZy10 +ZXN0LWEuaW52YWxpZDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABFC+h8KB1h41 +56L9+l8nHbMZ5hrrp9nwqmz5RoAqrkVI8Ii5RFYUjssaH2Y0P9+B9L9SvijfB5Xi +Wwk6eVzGKtSjeTB3MB0GA1UdDgQWBBSokIrPzA6ur33vyVeBY+2/NWHx1TAfBgNV +HSMEGDAWgBSokIrPzA6ur33vyVeBY+2/NWHx1TAPBgNVHRMBAf8EBTADAQH/MCQG +A1UdEQQdMBuCGWFjY291bnRpbmctdGVzdC1hLmludmFsaWQwCgYIKoZIzj0EAwID +SAAwRQIgCLZVDlrE2aO8poWAdZMOd+obOeB23TU1Jfh3nnbEDF0CIQCB5+8PNRQe +aWzW6sgCcDWdiga81Nhm7FxYj4AorbPO1w== +-----END CERTIFICATE-----`; +const KEY_A = `-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgOQ//h9ZRCK1KaiXW +Ij3FN+77RDPYSWgY6DwZqC5x0A6hRANCAARQvofCgdYeNeei/fpfJx2zGeYa66fZ +8Kps+UaAKq5FSPCIuURWFI7LGh9mND/fgfS/Ur4o3weV4lsJOnlcxirU +-----END PRIVATE KEY-----`; +const CERT_B = `-----BEGIN CERTIFICATE----- +MIIBxjCCAWugAwIBAgIUMO+HE/U7Z4EXTnw9ucoKjRz/u7MwCgYIKoZIzj0EAwIw +JDEiMCAGA1UEAwwZYWNjb3VudGluZy10ZXN0LWIuaW52YWxpZDAgFw0yNjEwMDUx +MjA3NDJaGA8yMTI2MDkxMTEyMDc0MlowJDEiMCAGA1UEAwwZYWNjb3VudGluZy10 +ZXN0LWIuaW52YWxpZDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABI2Naohejia1 +fQnFx33/5jasQJudFTmAdPEHxlIyBlUUi2IoaMWbSyMBBfgy+dX6gM7QetK/99ex +rt/d5OQNyvqjeTB3MB0GA1UdDgQWBBSgpkkpJptOajy+1aSgPZ8gre559TAfBgNV +HSMEGDAWgBSgpkkpJptOajy+1aSgPZ8gre559TAPBgNVHRMBAf8EBTADAQH/MCQG +A1UdEQQdMBuCGWFjY291bnRpbmctdGVzdC1iLmludmFsaWQwCgYIKoZIzj0EAwID +SQAwRgIhALJMbkGHT256tdNcVJfnB0eqxivGD7hooljD6epmvTgbAiEA1r/cX59l +0bu56aMEi0TeoQAAQRiEpdBIwe0F/YjWXL4= +-----END CERTIFICATE-----`; + +describe('accounting HTTP client — TLS with a pinned certificate', () => { + let server: https.Server; + let url: string; + + beforeAll(async () => { + server = https.createServer({ cert: CERT_A, key: KEY_A }, (_req, res) => { + res.writeHead(200, { 'Content-Type': 'application/json' }); + res.end('{"Status":"OK"}'); + }); + await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve)); + url = `https://127.0.0.1:${(server.address() as AddressInfo).port}/`; + }); + + afterAll(async () => { + server.closeAllConnections(); + await new Promise((resolve) => server.close(resolve)); + }); + + const call = (ca: string | null) => httpRequest({ method: 'POST', url, body: '{}', timeoutMs: 5000, ca }); + + it('rejects a self-signed server when nothing is pinned, without claiming it may have been received', async () => { + const err = await call(null).catch((e) => e); + expect(err).toBeInstanceOf(AccountingHttpError); + expect(err.ambiguous).toBe(false); + expect(err.message).toContain('بررسی گواهی سرور'); + }); + + it('accepts exactly the pinned certificate even though it names another host', async () => { + await expect(call(CERT_A)).resolves.toEqual({ status: 200, body: '{"Status":"OK"}' }); + }); + + it('still rejects when a different certificate is pinned', async () => { + const err = await call(CERT_B).catch((e) => e); + expect(err).toBeInstanceOf(AccountingHttpError); + expect(err.message).toContain('یکی نیست'); + }); + + it('reads the presented certificate for the admin to compare and pin', async () => { + const c = await fetchServerCertificate(url, 5000); + expect(c.fingerprint256).toBe([...pinnedFingerprints(CERT_A)][0]); + expect(c.selfSigned).toBe(true); + expect(c.trustedBySystem).toBe(false); + expect(c.subjectAltName).toContain('accounting-test-a.invalid'); + expect(pinnedFingerprints(c.pem).has(c.fingerprint256)).toBe(true); + }); + + it('refuses to fetch a certificate from a plain-http address', async () => { + await expect(fetchServerCertificate('http://127.0.0.1:1/', 1000)).rejects.toThrow('https'); + }); +}); diff --git a/apps/api/src/modules/accounting-sync/accounting-http.ts b/apps/api/src/modules/accounting-sync/accounting-http.ts new file mode 100644 index 0000000..470a6c5 --- /dev/null +++ b/apps/api/src/modules/accounting-sync/accounting-http.ts @@ -0,0 +1,281 @@ +import { X509Certificate } from 'crypto'; +import * as http from 'http'; +import * as https from 'https'; +import * as net from 'net'; +import * as tls from 'tls'; + +/** + * The one HTTP client both accounting drivers use. + * + * Built on node:http(s) rather than global fetch because a self-hosted + * Tahesab/Zarrin often serves a self-signed certificate, and fetch cannot be + * given a CA without an extra dependency. The reference "solved" that with + * `Http::withoutVerifying()` (SEC-17); here verification is ALWAYS on and the + * admin can paste the installation's certificate instead. + * + * A pasted certificate is trusted two ways: as a CA (the normal chain and + * hostname checks), and as a pin — when the server presents exactly that + * certificate it is accepted whatever name it was issued for. Tahesab's own + * certificate is self-signed for `localhost`, so a remote install reached by + * IP can only be verified by the pin. + * + * Errors say whether the request may have reached the server. That decides + * what the outbox may do next: a refused connection is safe to retry, a + * timeout after the request went out is not (Zarrin has no idempotency key). + */ + +export interface HttpRequest { + method: 'GET' | 'POST'; + url: string; + headers?: Record; + body?: string; + timeoutMs: number; + /** PEM CA certificate(s) to trust in addition to the system store. */ + ca?: string | null; +} + +export interface HttpResponse { + status: number; + body: string; +} + +export class AccountingHttpError extends Error { + constructor( + message: string, + /** True when the request may have been received and acted on. */ + readonly ambiguous: boolean, + readonly code?: string, + ) { + super(message); + this.name = 'AccountingHttpError'; + } +} + +const MAX_BODY_BYTES = 20 * 1024 * 1024; + +const TLS_CERT_ERRORS = /CERT|SELF_SIGNED|UNABLE_TO_VERIFY|UNABLE_TO_GET_ISSUER/; + +/** The PEM blocks in a pasted bundle, parsed; unparsable blocks are skipped. */ +export function parsePemCertificates(pem: string | null | undefined): X509Certificate[] { + const blocks = (pem ?? '').match(/-----BEGIN CERTIFICATE-----[\s\S]+?-----END CERTIFICATE-----/g) ?? []; + const out: X509Certificate[] = []; + for (const block of blocks) { + try { + out.push(new X509Certificate(block)); + } catch { + // not a certificate — the CA list below will reject it too + } + } + return out; +} + +/** SHA-256 fingerprints, as Node prints them (`AB:CD:…`), of the pasted certificates. */ +export function pinnedFingerprints(pem: string | null | undefined): Set { + return new Set(parsePemCertificates(pem).map((c) => c.fingerprint256)); +} + +function tlsErrorMessage(err: NodeJS.ErrnoException, pinned: boolean): string { + if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') { + return pinned + ? `گواهی سرور برای این آدرس صادر نشده و با گواهی ثبت‌شده در تنظیمات هم یکی نیست (${err.code}) — اگر گواهی سرور عوض شده، در بخش «گواهی امنیتی سرور» «بررسی دوباره» را بزنید` + : `گواهی TLS سرور برای این آدرس صادر نشده (${err.code}) — در تب «اتصال»، بخش «گواهی امنیتی سرور»، «بررسی گواهی سرور» را بزنید و پس از تطبیق اثرانگشت تأیید و ذخیره کنید`; + } + return pinned + ? `گواهی فعلی سرور با گواهی ثبت‌شده در تنظیمات یکی نیست (${err.code}) — اگر گواهی سرور عوض شده، در بخش «گواهی امنیتی سرور» «بررسی دوباره» را بزنید` + : `گواهی TLS سرور قابل‌اعتماد نیست (${err.code}) — در تب «اتصال»، بخش «گواهی امنیتی سرور»، «بررسی گواهی سرور» را بزنید و پس از تطبیق اثرانگشت تأیید و ذخیره کنید`; +} + +export function httpRequest(req: HttpRequest): Promise { + let url: URL; + try { + url = new URL(req.url); + } catch { + return Promise.reject(new AccountingHttpError('آدرس سرور حسابداری نامعتبر است', false, 'BAD_URL')); + } + const isHttps = url.protocol === 'https:'; + if (!isHttps && url.protocol !== 'http:') { + return Promise.reject(new AccountingHttpError('آدرس باید با http یا https شروع شود', false, 'BAD_URL')); + } + + const headers: Record = { ...(req.headers ?? {}) }; + if (req.body !== undefined) headers['Content-Length'] = Buffer.byteLength(req.body); + + const options: https.RequestOptions = { + method: req.method, + hostname: url.hostname, + port: url.port || (isHttps ? 443 : 80), + path: `${url.pathname}${url.search}`, + headers, + }; + const pins = isHttps ? pinnedFingerprints(req.ca) : new Set(); + if (isHttps) { + options.rejectUnauthorized = true; + if (req.ca && req.ca.trim()) { + // Extra CA on top of the system store, never instead of verification. + options.ca = [...tls.rootCertificates, req.ca]; + // Runs only after the chain verified. The exact pasted certificate is + // accepted under any name; anything else gets the normal name check. + // (Pooled sockets are keyed by `ca`, so a reused one had the same pins.) + options.checkServerIdentity = (host, cert) => + pins.has(cert.fingerprint256) ? undefined : tls.checkServerIdentity(host, cert); + } + } + + return new Promise((resolve, reject) => { + let connected = false; + let settled = false; + const finish = (fn: () => void) => { + if (settled) return; + settled = true; + clearTimeout(timer); + fn(); + }; + + const client = isHttps ? https : http; + const request = client.request(options, (res) => { + const chunks: Buffer[] = []; + let size = 0; + res.on('data', (chunk: Buffer) => { + size += chunk.length; + if (size > MAX_BODY_BYTES) { + request.destroy(); + finish(() => reject(new AccountingHttpError('پاسخ سرور حسابداری بیش از حد بزرگ است', true, 'TOO_LARGE'))); + return; + } + chunks.push(chunk); + }); + res.on('end', () => + finish(() => resolve({ status: res.statusCode ?? 0, body: Buffer.concat(chunks).toString('utf8') })), + ); + res.on('error', (err) => finish(() => reject(new AccountingHttpError(err.message, true, 'RESPONSE')))); + }); + + request.on('socket', (socket) => { + // A kept-alive socket is already connected; listening on it again would + // pile up a listener per request. + if (!(socket as { connecting?: boolean }).connecting) { + connected = true; + return; + } + socket.once(isHttps ? 'secureConnect' : 'connect', () => { + connected = true; + }); + }); + + const timer = setTimeout(() => { + request.destroy(); + finish(() => + reject( + new AccountingHttpError( + connected ? 'پاسخ سرور حسابداری در زمان مقرر نرسید' : 'اتصال به سرور حسابداری برقرار نشد (timeout)', + connected, + 'TIMEOUT', + ), + ), + ); + }, req.timeoutMs); + + request.on('error', (err: NodeJS.ErrnoException) => { + // Node's own text for these suggests flags that do not apply here. + const text = isHttps && err.code && TLS_CERT_ERRORS.test(err.code) ? tlsErrorMessage(err, pins.size > 0) : err.message; + finish(() => reject(new AccountingHttpError(text, connected, err.code))); + }); + + if (req.body !== undefined) request.write(req.body); + request.end(); + }); +} + +export interface ServerCertificate { + pem: string; + subject: string; + issuer: string; + subjectAltName: string | null; + validFrom: string; + validTo: string; + expired: boolean; + fingerprint256: string; + selfSigned: boolean; + /** Valid chain to a system CA and issued for this host: no pin needed. */ + trustedBySystem: boolean; +} + +/** + * Reads the certificate an https server presents, WITHOUT trusting it, so the + * admin can compare its fingerprint with the one on the accounting server and + * pin it. Nothing but the TLS handshake is sent. + */ +export function fetchServerCertificate(baseUrl: string, timeoutMs: number): Promise { + let url: URL; + try { + url = new URL(baseUrl); + } catch { + return Promise.reject(new AccountingHttpError('آدرس سرور حسابداری نامعتبر است', false, 'BAD_URL')); + } + if (url.protocol !== 'https:') { + return Promise.reject(new AccountingHttpError('این آدرس https نیست؛ گواهی ندارد', false, 'NOT_HTTPS')); + } + const host = url.hostname.replace(/^\[|\]$/g, ''); + return new Promise((resolve, reject) => { + const socket = tls.connect({ + host, + port: Number(url.port || 443), + servername: net.isIP(host) ? undefined : host, + rejectUnauthorized: false, + }); + const timer = setTimeout(() => { + socket.destroy(); + reject(new AccountingHttpError('اتصال به سرور حسابداری برقرار نشد (timeout)', false, 'TIMEOUT')); + }, timeoutMs); + socket.once('secureConnect', () => { + clearTimeout(timer); + const peer = socket.getPeerCertificate(); + const chainOk = socket.authorized; + socket.end(); + if (!peer?.raw) { + reject(new AccountingHttpError('سرور گواهی ارسال نکرد', false, 'NO_CERT')); + return; + } + const cert = new X509Certificate(peer.raw); + const nameOk = net.isIP(host) ? !!cert.checkIP(host) : !!cert.checkHost(host); + const b64 = peer.raw.toString('base64').match(/.{1,64}/g)!.join('\n'); + resolve({ + pem: `-----BEGIN CERTIFICATE-----\n${b64}\n-----END CERTIFICATE-----`, + subject: cert.subject, + issuer: cert.issuer, + subjectAltName: cert.subjectAltName ?? null, + validFrom: cert.validFrom, + validTo: cert.validTo, + expired: new Date(cert.validTo).getTime() < Date.now(), + fingerprint256: cert.fingerprint256, + // checkIssued() also wants keyCertSign, which Tahesab's certificate lacks. + selfSigned: cert.subject === cert.issuer && cert.verify(cert.publicKey), + trustedBySystem: chainOk && nameOk, + }); + }); + socket.once('error', (err: NodeJS.ErrnoException) => { + clearTimeout(timer); + reject(new AccountingHttpError(err.message, false, err.code)); + }); + }); +} + +/** + * Parses a JSON body that may carry junk around it. Tahesab replies have been + * seen with a BOM, raw control characters and unescaped backslashes inside + * strings (henza_server TahesabController::test had to scrub them the same + * way before json_decode would accept the body). + */ +export function parseLooseJson(body: string): unknown { + try { + return JSON.parse(body); + } catch { + // fall through to the scrubbed attempt + } + let raw = body.replace(/^/, ''); + raw = raw.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, ''); + raw = raw.replace(/\\(?!["\\/bfnrtu])/g, '-'); + const start = raw.search(/[{[]/); + if (start > 0) raw = raw.slice(start); + return JSON.parse(raw); +} diff --git a/apps/api/src/modules/accounting-sync/accounting-quick.controller.ts b/apps/api/src/modules/accounting-sync/accounting-quick.controller.ts new file mode 100644 index 0000000..09fe0c3 --- /dev/null +++ b/apps/api/src/modules/accounting-sync/accounting-quick.controller.ts @@ -0,0 +1,48 @@ +import { Controller, Get, HttpCode, Post } from '@nestjs/common'; +import { CurrentCustomer, CustomerAuth } from '../customer-auth/customer.guards'; +import type { AuthenticatedCustomer } from '../customer-auth/customer-jwt.strategy'; +import { RequirePermission } from '../auth/guards'; +import { AccountingAdminService } from './accounting-admin.service'; +import { AccountingSyncService } from './accounting-sync.service'; + +/** + * D27, plan §12 — sync where people work, on top of the «اتصال حسابداری» + * screen: a button on the wholesale-customer list and on the product list, + * and the customer's own balance read live each time the app's profile opens. + * Each is behind the permission of the screen it sits on, and works whenever a + * provider is connected, whatever the feature switches say (owner's ruling). + */ +@Controller() +export class AccountingQuickController { + constructor( + private readonly admin: AccountingAdminService, + private readonly sync: AccountingSyncService, + ) {} + + /** Whether to show the sync buttons. Any signed-in admin; reveals no settings. */ + @Get('admin/accounting-status') + status() { + return this.admin.connectionStatus(); + } + + @Post('admin/customers-omde/accounting-sync') + @HttpCode(200) + @RequirePermission('persons.list.client.omde') + syncCustomers() { + return this.admin.syncNow(['customers', 'balances']); + } + + @Post('admin/products/accounting-sync') + @HttpCode(200) + @RequirePermission('product.list') + syncProducts() { + return this.admin.syncNow(['products']); + } + + /** The app's profile: this customer's balance, read from the software now. */ + @CustomerAuth() + @Get('customer/me/accounting-balance') + myBalance(@CurrentCustomer() me: AuthenticatedCustomer) { + return this.sync.customerBalanceLive(me.id); + } +} diff --git a/apps/api/src/modules/accounting-sync/accounting-sync.module.ts b/apps/api/src/modules/accounting-sync/accounting-sync.module.ts new file mode 100644 index 0000000..5a6fb11 --- /dev/null +++ b/apps/api/src/modules/accounting-sync/accounting-sync.module.ts @@ -0,0 +1,27 @@ +import { Global, Module } from '@nestjs/common'; +import { AccountingAdminController } from './accounting-admin.controller'; +import { AccountingAdminService } from './accounting-admin.service'; +import { AccountingConfigService } from './accounting-config.service'; +import { AccountingHooksService } from './accounting-hooks.service'; +import { AccountingQuickController } from './accounting-quick.controller'; +import { AccountingSyncService } from './accounting-sync.service'; +import { AccountingWorkerService } from './accounting-worker.service'; + +/** + * Accounting software integration (D27). Global so orders, customer admin, + * product admin, the catalog and the report can call the hooks without each + * re-importing it — the same reason SmsModule is global. + */ +@Global() +@Module({ + controllers: [AccountingAdminController, AccountingQuickController], + providers: [ + AccountingConfigService, + AccountingHooksService, + AccountingSyncService, + AccountingWorkerService, + AccountingAdminService, + ], + exports: [AccountingConfigService, AccountingHooksService, AccountingSyncService], +}) +export class AccountingSyncModule {} diff --git a/apps/api/src/modules/accounting-sync/accounting-sync.service.ts b/apps/api/src/modules/accounting-sync/accounting-sync.service.ts new file mode 100644 index 0000000..1f308ce --- /dev/null +++ b/apps/api/src/modules/accounting-sync/accounting-sync.service.ts @@ -0,0 +1,949 @@ +import { Injectable, Logger } from '@nestjs/common'; +import { AccountingOutbox, Prisma } from '@prisma/client'; +import { PrismaService } from '../../prisma/prisma.service'; +import { ActiveProvider, AccountingConfigService } from './accounting-config.service'; +import { AccountingConfig } from './accounting-config'; +import { JalaliDate, parseJalali, toJalali } from './jalali'; +import { + AccountingProviderError, + CustomerPayload, + DocumentLine, + ExternalCustomer, + ExternalGroup, + ExternalKarSakhte, + ProviderName, + StatementRow, + normalizeMobile, + splitName, +} from './providers'; + +/** A job that must stop and wait for a human, not be retried. */ +export class NeedsReviewError extends Error { + constructor(message: string) { + super(message); + this.name = 'NeedsReviewError'; + } +} + +const MAX_CUSTOMER_PAGES = 1000; +// Real-time (owner, 2026-10-05): the change poll keeps stored figures a few +// seconds old; these windows only absorb a burst of reads of the same figure. +const STATEMENT_CACHE_MS = 10_000; +const BALANCE_FRESH_MS = 5_000; +const BALANCE_ON_DEMAND_TIMEOUT_MS = 3_000; +const STOCK_ON_DEMAND_TIMEOUT_MS = 2_500; + +/** Lowercase alphanumeric, ≥ 20 chars: Tahesab lowercases Factor_Code and dedupes on it. */ +export function factorCodeFor(orderId: string) { + return `gbord${orderId}`.toLowerCase().replace(/[^a-z0-9]/g, ''); +} + +function groupMatches(selected: ExternalGroup[], c: { groupId: string | null; groupName: string | null }) { + if (selected.length === 0) return true; + return selected.some( + (g) => (g.id !== '' && c.groupId !== null && g.id === c.groupId) || (!!g.name && !!c.groupName && g.name === c.groupName), + ); +} + +/** A real Iranian national code (10 digits, checksum), excluding the all-same placeholders. */ +export function validNationalCode(v: string | null): string | null { + if (!v) return null; + const d = v.replace(/\D/g, ''); + if (!/^\d{10}$/.test(d) || /^(\d)\1{9}$/.test(d)) return null; + const check = Number(d[9]); + const sum = d + .slice(0, 9) + .split('') + .reduce((s, ch, i) => s + Number(ch) * (10 - i), 0); + const r = sum % 11; + return (r < 2 ? check === r : check === 11 - r) ? d : null; +} + +/** + * Everything the accounting integration does (D27, plan + * docs/ACCOUNTING-INTEGRATION-PLAN.md §4): pulls on a schedule, outbox jobs, + * and the reads the customer app makes. Each public pull takes the active + * provider so the worker resolves configuration once per run. + */ +@Injectable() +export class AccountingSyncService { + private readonly logger = new Logger('Accounting'); + private readonly statementCache = new Map(); + private itemCache: { provider: string; at: number; items: ExternalKarSakhte[] } | null = null; + + constructor( + private readonly prisma: PrismaService, + private readonly config: AccountingConfigService, + ) {} + + // ════════════════════════════════════════════════════════════════════ + // F1 — customers + // ════════════════════════════════════════════════════════════════════ + + /** + * Reads every account (in the selected groups) and links or imports it. + * Two passes: all accounts first, so two accounts sharing one mobile are + * caught before either is linked. + */ + async pullCustomers(a: ActiveProvider) { + // No groups must not mean "all": cash boxes, staff and investors are + // accounts too, and would become app customers. + if (a.config.mapping.importCustomerGroups.length === 0) { + throw new Error('هیچ گروه مشتری برای ورود انتخاب نشده است (تب «نگاشت»)'); + } + const provider = a.provider.name; + const all: ExternalCustomer[] = []; + let cursor: string | null = null; + for (let page = 0; page < MAX_CUSTOMER_PAGES; page += 1) { + const res = await a.provider.listCustomers(a.settings, cursor); + all.push(...res.items); + if (!res.next) break; + cursor = res.next; + } + + const inScope = all.filter((c) => groupMatches(a.config.mapping.importCustomerGroups, c)); + const byMobile = new Map(); + for (const c of inScope) { + if (!c.mobile) continue; + byMobile.set(c.mobile, [...(byMobile.get(c.mobile) ?? []), c]); + } + + const existingLinks = await this.prisma.accountingLink.findMany({ + where: { provider, entityType: 'CUSTOMER' }, + select: { id: true, entityId: true, externalCode: true }, + }); + const linkByCode = new Map(existingLinks.map((l) => [l.externalCode, l])); + const linkedCustomerIds = new Set(existingLinks.map((l) => l.entityId)); + + const summary = { scanned: all.length, inScope: inScope.length, refreshed: 0, linked: 0, imported: 0, issues: 0 }; + + for (const ext of inScope) { + const snapshot = ext as unknown as Prisma.InputJsonValue; + const link = linkByCode.get(ext.code); + if (link) { + await this.prisma.accountingLink.update({ + where: { id: link.id }, + data: { externalName: ext.name, snapshot, syncedAt: new Date() }, + }); + summary.refreshed += 1; + continue; + } + + if (!ext.mobile) { + await this.issue(provider, 'CUSTOMER_NO_MOBILE', ext.code, `حساب «${ext.name}» (کد ${ext.code}) موبایل معتبر ندارد`, ext); + summary.issues += 1; + continue; + } + const siblings = byMobile.get(ext.mobile) ?? []; + if (siblings.length > 1) { + await this.issue( + provider, + 'CUSTOMER_DUPLICATE_MOBILE', + ext.code, + `موبایل ${ext.mobile} در ${siblings.length} حساب حسابداری تکرار شده (کدها: ${siblings.map((s) => s.code).join('، ')})`, + siblings, + ); + summary.issues += 1; + continue; + } + + const appCustomer = await this.prisma.customer.findUnique({ where: { mobile: ext.mobile }, select: { id: true } }); + if (appCustomer) { + if (linkedCustomerIds.has(appCustomer.id)) { + await this.issue( + provider, + 'CUSTOMER_LINK_CONFLICT', + ext.code, + `مشتری با موبایل ${ext.mobile} قبلاً به حساب دیگری لینک شده؛ حساب ${ext.code} لینک نشد`, + ext, + appCustomer.id, + ); + summary.issues += 1; + continue; + } + await this.prisma.accountingLink.create({ + data: { provider, entityType: 'CUSTOMER', entityId: appCustomer.id, externalCode: ext.code, externalName: ext.name, origin: 'LINKED', snapshot }, + }); + linkedCustomerIds.add(appCustomer.id); + summary.linked += 1; + continue; + } + + const created = await this.importCustomer(provider, ext); + linkedCustomerIds.add(created); + summary.imported += 1; + } + + return summary; + } + + /** + * An account that exists only in the accounting software becomes an app + * customer, keyed by mobile (owner: «اولویت با شماره هست نه کد ملی»). The + * national code is the account's own when it is a real one and still free, + * else the mobile — the fallback admin-customers and customer-auth already use. + * Credit limit 0 and UNVERIFIED: everything beyond identity is the app's. + */ + private async importCustomer(provider: ProviderName, ext: ExternalCustomer): Promise { + const mobile = ext.mobile as string; + const candidates = [validNationalCode(ext.nationalCode), mobile, `${mobile}-${provider}-${ext.code}`].filter( + (v): v is string => !!v, + ); + let nationalCode = candidates[candidates.length - 1]; + for (const c of candidates) { + const taken = await this.prisma.customer.findUnique({ where: { nationalCode: c }, select: { id: true } }); + if (!taken) { + nationalCode = c; + break; + } + } + const { firstName, lastName } = splitName(ext.name || mobile); + + return this.prisma.$transaction(async (tx) => { + const customer = await tx.customer.create({ + data: { + // The DB trigger rebuilds fullName from the parts (schema.prisma). + fullName: [firstName, lastName].filter(Boolean).join(' ') || mobile, + firstName: firstName || null, + lastName: lastName || null, + mobile, + nationalCode, + passwordHash: '', + phone: ext.phone, + address: ext.address, + }, + select: { id: true }, + }); + await tx.accountingLink.create({ + data: { + provider, + entityType: 'CUSTOMER', + entityId: customer.id, + externalCode: ext.code, + externalName: ext.name, + origin: 'IMPORTED', + snapshot: ext as unknown as Prisma.InputJsonValue, + }, + }); + return customer.id; + }); + } + + private customerPayload( + c: { firstName: string | null; lastName: string | null; fullName: string; mobile: string; phone: string | null; address: string | null; nationalCode: string }, + group: ExternalGroup | null, + ): CustomerPayload { + const parts = c.firstName || c.lastName ? { firstName: c.firstName ?? '', lastName: c.lastName ?? '' } : splitName(c.fullName); + return { + firstName: parts.firstName, + lastName: parts.lastName, + fullName: c.fullName || [parts.firstName, parts.lastName].filter(Boolean).join(' '), + mobile: normalizeMobile(c.mobile) ?? c.mobile, + phone: c.phone, + address: c.address, + nationalCode: validNationalCode(c.nationalCode), + group: { id: group?.id || null, name: group?.name || null }, + }; + } + + /** + * Makes sure the customer has an account in the accounting software and + * returns its code: existing link → update it (when `update`); else search + * by mobile → link; else create → link. Search-before-create is what makes a + * retried push safe on both providers. + */ + async ensureCustomerAccount(a: ActiveProvider, customerId: string, opts: { update: boolean }) { + const provider = a.provider.name; + const customer = await this.prisma.customer.findUnique({ where: { id: customerId } }); + if (!customer) throw new NeedsReviewError('مشتری در اپ پیدا نشد'); + + const link = await this.prisma.accountingLink.findUnique({ + where: { provider_entityType_entityId: { provider, entityType: 'CUSTOMER', entityId: customerId } }, + }); + + if (link) { + if (opts.update) { + // Keep the account in its current group: Zarrin moves it otherwise. + const snap = (link.snapshot ?? {}) as Partial; + const group = snap.groupName || snap.groupId ? { id: snap.groupId ?? '', name: snap.groupName ?? '' } : a.config.mapping.newCustomerGroup; + const payload = this.customerPayload(customer, group); + const res = await a.provider.updateCustomer(a.settings, link.externalCode, payload); + await this.prisma.accountingLink.update({ where: { id: link.id }, data: { syncedAt: new Date() } }); + return { code: link.externalCode, request: { action: 'update', code: link.externalCode, payload }, response: res.response }; + } + return { code: link.externalCode, request: { action: 'none' }, response: null }; + } + + const mobile = normalizeMobile(customer.mobile); + if (!mobile) throw new NeedsReviewError(`موبایل مشتری (${customer.mobile}) معتبر نیست`); + + const matches = await a.provider.findCustomersByMobile(a.settings, mobile); + const free = []; + for (const m of matches) { + const taken = await this.prisma.accountingLink.findUnique({ + where: { provider_entityType_externalCode: { provider, entityType: 'CUSTOMER', externalCode: m.code } }, + select: { id: true }, + }); + if (!taken) free.push(m); + } + if (free.length > 1) { + throw new NeedsReviewError( + `موبایل ${mobile} در چند حساب حسابداری هست (کدها: ${free.map((m) => m.code).join('، ')}). از «لینک دستی» یکی را انتخاب کنید.`, + ); + } + if (free.length === 1) { + const m = free[0]; + await this.prisma.accountingLink.create({ + data: { provider, entityType: 'CUSTOMER', entityId: customerId, externalCode: m.code, externalName: m.name, origin: 'LINKED', snapshot: m as unknown as Prisma.InputJsonValue }, + }); + return { code: m.code, request: { action: 'link', mobile }, response: m }; + } + + if (!a.config.mapping.newCustomerGroup) { + throw new NeedsReviewError('گروه مشتری جدید در تب «نگاشت» تعیین نشده؛ بعد از تعیین، «تلاش دوباره» را بزنید'); + } + const payload = this.customerPayload(customer, a.config.mapping.newCustomerGroup); + const res = await a.provider.createCustomer(a.settings, payload); + await this.prisma.accountingLink.create({ + data: { + provider, + entityType: 'CUSTOMER', + entityId: customerId, + externalCode: res.code, + externalName: payload.fullName, + origin: 'PUSHED', + snapshot: { ...payload, groupId: payload.group.id, groupName: payload.group.name } as unknown as Prisma.InputJsonValue, + }, + }); + return { code: res.code, request: { action: 'create', payload }, response: res.response }; + } + + // ════════════════════════════════════════════════════════════════════ + // F2 — balances + // ════════════════════════════════════════════════════════════════════ + + async pullBalances(a: ActiveProvider) { + const links = await this.prisma.accountingLink.findMany({ + where: { provider: a.provider.name, entityType: 'CUSTOMER' }, + select: { entityId: true, externalCode: true }, + }); + if (links.length === 0) return { linked: 0, updated: 0 }; + const balances = await a.provider.getBalances( + a.settings, + links.map((l) => l.externalCode), + ); + const byCode = new Map(balances.map((b) => [b.code, b])); + const now = new Date(); + let updated = 0; + for (const l of links) { + const b = byCode.get(l.externalCode); + if (!b) continue; + await this.prisma.customer.update({ + where: { id: l.entityId }, + data: { accountingGoldBalance: b.goldGrams, accountingRialBalance: b.rial, accountingBalanceAt: now }, + }); + updated += 1; + } + return { linked: links.length, updated }; + } + + /** + * The balance the customer sees (D27): the accounting software's, refreshed + * on demand when older than a minute, with a short timeout so the app never + * waits on a slow installation — on any failure the last stored figure is + * served. Null when the integration does not apply to this customer. + */ + async customerBalance(customerId: string) { + const a = await this.config.activeFor('balances'); + if (!a) return null; + const link = await this.prisma.accountingLink.findUnique({ + where: { provider_entityType_entityId: { provider: a.provider.name, entityType: 'CUSTOMER', entityId: customerId } }, + }); + if (!link) return null; + + let c = await this.prisma.customer.findUnique({ + where: { id: customerId }, + select: { accountingGoldBalance: true, accountingRialBalance: true, accountingBalanceAt: true }, + }); + const stale = !c?.accountingBalanceAt || Date.now() - c.accountingBalanceAt.getTime() > BALANCE_FRESH_MS; + if (stale) { + try { + const [b] = await a.provider.getBalances( + { ...a.settings, timeoutMs: Math.min(a.settings.timeoutMs, BALANCE_ON_DEMAND_TIMEOUT_MS) }, + [link.externalCode], + ); + if (b) { + c = await this.prisma.customer.update({ + where: { id: customerId }, + data: { accountingGoldBalance: b.goldGrams, accountingRialBalance: b.rial, accountingBalanceAt: new Date() }, + select: { accountingGoldBalance: true, accountingRialBalance: true, accountingBalanceAt: true }, + }); + } + } catch (err) { + this.logger.warn(`On-demand balance for ${customerId} failed, serving the stored one: ${(err as Error).message}`); + } + } + if (!c?.accountingBalanceAt) return null; + return { + gold: c.accountingGoldBalance ?? new Prisma.Decimal(0), + rial: c.accountingRialBalance ?? new Prisma.Decimal(0), + at: c.accountingBalanceAt, + provider: a.provider.label, + }; + } + + + // ════════════════════════════════════════════════════════════════════ + // Real-time: change poll + live reads + // ════════════════════════════════════════════════════════════════════ + + /** + * One poll of the software's change feed. Only the accounts and کارساخته + * that changed are re-read, so this is cheap enough to run every few + * seconds. Returns the new cursor and what the slow jobs should still do. + */ + async pollChanges(a: ActiveProvider, cursor: string | null) { + const batch = await a.provider.getChanges(a.settings, cursor); + const out = { cursor: batch.cursor, balances: 0, stocks: 0, fullBalances: false, fullProducts: false, newAccounts: false }; + if (cursor === null) return out; + const provider = a.provider.name; + + if (a.config.features.balances) { + if (batch.overflow) out.fullBalances = true; + else if (batch.accountCodes.length > 0) { + const links = await this.prisma.accountingLink.findMany({ + where: { provider, entityType: 'CUSTOMER', externalCode: { in: batch.accountCodes } }, + select: { entityId: true, externalCode: true }, + }); + out.newAccounts = links.length < batch.accountCodes.length; + if (links.length > 0) out.balances = await this.storeBalances(a, links); + } + } + + if (a.config.features.products) { + if (batch.overflow) out.fullProducts = true; + else if (batch.itemNames.length > 0) { + const links = await this.prisma.accountingLink.findMany({ + where: { provider, entityType: 'PRODUCT', externalCode: { in: batch.itemNames } }, + select: { entityId: true, externalCode: true }, + }); + // A name with no product yet is a new کارساخته: the product pull imports it. + if (links.length < batch.itemNames.length) out.fullProducts = true; + for (const l of links) { + if (await this.storeStock(a, l.entityId, l.externalCode, l.externalCode)) out.stocks += 1; + } + } + } + return out; + } + + /** Reads the balances of these linked customers and stores them. */ + private async storeBalances(a: ActiveProvider, links: { entityId: string; externalCode: string }[]) { + const balances = await a.provider.getBalances(a.settings, links.map((l) => l.externalCode)); + const byCode = new Map(balances.map((b) => [b.code, b])); + const now = new Date(); + let n = 0; + for (const l of links) { + const b = byCode.get(l.externalCode); + if (!b) continue; + await this.prisma.customer.update({ + where: { id: l.entityId }, + data: { accountingGoldBalance: b.goldGrams, accountingRialBalance: b.rial, accountingBalanceAt: now }, + }); + n += 1; + } + return n; + } + + private async storeStock(a: ActiveProvider, productId: string, code: string, name: string, timeoutMs?: number) { + const settings = timeoutMs ? { ...a.settings, timeoutMs: Math.min(a.settings.timeoutMs, timeoutMs) } : a.settings; + const stock = await a.provider.getKarSakhteStock(settings, { code, name }); + const known = stock.weight !== null || stock.count !== null; + await this.prisma.product.update({ + where: { id: productId }, + data: { + accountingStockWeight: stock.weight, + accountingStockCount: stock.count, + accountingStockAt: known ? new Date() : null, + }, + }); + return known; + } + + /** + * At order time: the product's stock straight from the accounting software. + * If it cannot answer in time the order goes ahead on the last stored figure + * (owner's ruling) and the next change poll corrects it. Returns the product + * fields stockBlocked() reads, fresh when it could be. + */ + async liveStock( + product: T, + ): Promise { + const a = await this.config.activeFor('products'); + if (!a) return product; + const link = await this.prisma.accountingLink.findUnique({ + where: { provider_entityType_entityId: { provider: a.provider.name, entityType: 'PRODUCT', entityId: product.id } }, + select: { externalCode: true, externalName: true }, + }); + if (!link) return product; + try { + await this.storeStock(a, product.id, link.externalCode, link.externalName ?? link.externalCode, STOCK_ON_DEMAND_TIMEOUT_MS); + const fresh = await this.prisma.product.findUnique({ + where: { id: product.id }, + select: { accountingStockAt: true, accountingStockWeight: true, accountingStockCount: true }, + }); + return fresh ? { ...product, ...fresh } : product; + } catch (err) { + this.logger.warn(`Live stock of product ${product.id} unavailable, using the stored figure: ${(err as Error).message}`); + return product; + } + } + + /** + * The app's profile (plan §12): this one customer's balance, read from the + * accounting software on every call — no freshness window, no feature + * switch, only a connected provider. On no answer the stored figure is + * served and labelled as such. + */ + async customerBalanceLive(customerId: string) { + const none = { source: 'none' as const, gold: null, rial: null, at: null, provider: null }; + const a = await this.config.active(); + if (!a) return none; + const link = await this.prisma.accountingLink.findUnique({ + where: { provider_entityType_entityId: { provider: a.provider.name, entityType: 'CUSTOMER', entityId: customerId } }, + select: { externalCode: true }, + }); + if (!link) return none; + try { + const [b] = await a.provider.getBalances( + { ...a.settings, timeoutMs: Math.min(a.settings.timeoutMs, BALANCE_ON_DEMAND_TIMEOUT_MS) }, + [link.externalCode], + ); + if (b) { + const at = new Date(); + await this.prisma.customer.update({ + where: { id: customerId }, + data: { accountingGoldBalance: b.goldGrams, accountingRialBalance: b.rial, accountingBalanceAt: at }, + }); + return { source: 'accounting' as const, gold: b.goldGrams.toString(), rial: b.rial.toString(), at, provider: a.provider.label }; + } + } catch (err) { + this.logger.warn(`Live balance for ${customerId} failed, serving the stored one: ${(err as Error).message}`); + } + const c = await this.prisma.customer.findUnique({ + where: { id: customerId }, + select: { accountingGoldBalance: true, accountingRialBalance: true, accountingBalanceAt: true }, + }); + if (!c?.accountingBalanceAt) return none; + return { + source: 'stored' as const, + gold: (c.accountingGoldBalance ?? 0).toString(), + rial: (c.accountingRialBalance ?? 0).toString(), + at: c.accountingBalanceAt, + provider: a.provider.label, + }; + } + + // ════════════════════════════════════════════════════════════════════ + // F6 — statement («گزارش») + // ════════════════════════════════════════════════════════════════════ + + /** + * The customer's statement from the accounting software, oldest first, or + * null when the integration does not apply (the report then falls back to + * the internal ledger). Cached for a minute per customer so paging through + * the report costs one call. + */ + async customerStatement(customerId: string, range?: { from?: string; to?: string }) { + const a = await this.config.activeFor('report'); + if (!a) return null; + const link = await this.prisma.accountingLink.findUnique({ + where: { provider_entityType_entityId: { provider: a.provider.name, entityType: 'CUSTOMER', entityId: customerId } }, + }); + if (!link) return null; + + const to: JalaliDate = parseJalali(range?.to) ?? toJalali(new Date()); + const from: JalaliDate = + parseJalali(range?.from) ?? toJalali(new Date(Date.now() - a.config.report.windowDays * 24 * 3600 * 1000)); + const key = `${a.provider.name}:${link.externalCode}:${from.jy}-${from.jm}-${from.jd}:${to.jy}-${to.jm}-${to.jd}`; + const hit = this.statementCache.get(key); + if (hit && Date.now() - hit.at < STATEMENT_CACHE_MS) return { rows: hit.rows, code: link.externalCode, provider: a.provider.label }; + + const rows = await a.provider.getStatement(a.settings, { code: link.externalCode, from, to }); + // SEC-16: never hand back a line that belongs to another account, whatever + // the software returned. + const own = rows.filter((r) => !r.accountCode || r.accountCode === link.externalCode); + this.statementCache.set(key, { at: Date.now(), rows: own }); + if (this.statementCache.size > 500) this.statementCache.delete(this.statementCache.keys().next().value as string); + return { rows: own, code: link.externalCode, provider: a.provider.label }; + } + + // ════════════════════════════════════════════════════════════════════ + // F4 — کارساخته ↔ products + // ════════════════════════════════════════════════════════════════════ + + /** + * Accounting items → app products. A new item becomes a product with no + * image and no variant, so it stays out of the app (F5) until an admin + * photographs it and adds its weights. Title, code and stock follow the + * accounting software; everything else is the app's (D27). + */ + async pullProducts(a: ActiveProvider) { + const provider = a.provider.name; + const items = await a.provider.listKarSakhte(a.settings); + const links = await this.prisma.accountingLink.findMany({ where: { provider, entityType: 'PRODUCT' } }); + const linkByCode = new Map(links.map((l) => [l.externalCode, l])); + const linkedProductIds = new Set(links.map((l) => l.entityId)); + const summary = { items: items.length, updated: 0, linked: 0, imported: 0, stockErrors: 0, issues: 0 }; + const now = new Date(); + const touched = new Set(); + + for (const item of items) { + let stock = { weight: item.stockWeight, count: item.stockCount }; + if (stock.weight === null && stock.count === null) { + try { + stock = await a.provider.getKarSakhteStock(a.settings, item); + } catch (err) { + summary.stockErrors += 1; + this.logger.warn(`Stock of «${item.name}» unavailable: ${(err as Error).message}`); + } + } + const stockData = { + accountingStockWeight: stock.weight, + accountingStockCount: stock.count, + accountingStockAt: stock.weight !== null || stock.count !== null ? now : null, + }; + const snapshot = item as unknown as Prisma.InputJsonValue; + + const link = linkByCode.get(item.code); + if (link) { + await this.applyItemToProduct(provider, link.entityId, item, stockData); + await this.prisma.accountingLink.update({ + where: { id: link.id }, + data: { externalName: item.name, snapshot, syncedAt: now }, + }); + touched.add(link.entityId); + summary.updated += 1; + continue; + } + + // A product an admin created by the same name (in Tahesab an item only + // appears after its first document, which is how it gets linked). + const sameName = await this.prisma.product.findMany({ where: { title: item.name }, select: { id: true } }); + const candidates = sameName.filter((p) => !linkedProductIds.has(p.id)); + if (candidates.length > 1) { + await this.issue(provider, 'PRODUCT_DUPLICATE_TITLE', item.code, `چند محصول با عنوان «${item.name}» هست؛ کارساخته لینک نشد`, item); + summary.issues += 1; + continue; + } + if (candidates.length === 1) { + const productId = candidates[0].id; + await this.prisma.accountingLink.create({ + data: { provider, entityType: 'PRODUCT', entityId: productId, externalCode: item.code, externalName: item.name, origin: 'LINKED', snapshot }, + }); + await this.applyItemToProduct(provider, productId, item, stockData); + linkedProductIds.add(productId); + touched.add(productId); + summary.linked += 1; + continue; + } + + const productId = await this.prisma.$transaction(async (tx) => { + const product = await tx.product.create({ + data: { title: item.name, ...stockData }, + select: { id: true }, + }); + await tx.accountingLink.create({ + data: { provider, entityType: 'PRODUCT', entityId: product.id, externalCode: item.code, externalName: item.name, origin: 'IMPORTED', snapshot }, + }); + return product.id; + }); + await this.setProductCode(provider, productId, item); + linkedProductIds.add(productId); + touched.add(productId); + summary.imported += 1; + } + + // Stock figures only mean something for products linked under the active + // provider; anything else (unlinked, or from a provider switched away + // from) must not keep blocking orders. + await this.prisma.product.updateMany({ + where: { accountingStockAt: { not: null }, id: { notIn: [...touched] } }, + data: { accountingStockWeight: null, accountingStockCount: null, accountingStockAt: null }, + }); + + return summary; + } + + private async applyItemToProduct( + provider: ProviderName, + productId: string, + item: ExternalKarSakhte, + stockData: Prisma.ProductUpdateInput, + ) { + await this.prisma.product.update({ where: { id: productId }, data: { title: item.name, ...stockData } }); + await this.setProductCode(provider, productId, item); + } + + /** + * Zarrin items have a numeric id, which becomes the product's code. Tahesab + * items have none (the name is the key), so the code stays the app's. + */ + private async setProductCode(provider: ProviderName, productId: string, item: ExternalKarSakhte) { + if (provider !== 'zarrin') return; + const owner = await this.prisma.product.findUnique({ where: { productCode: item.code }, select: { id: true } }); + if (owner && owner.id !== productId) { + await this.issue(provider, 'PRODUCT_CODE_TAKEN', item.code, `کد ${item.code} روی محصول دیگری است؛ کد محصول «${item.name}» عوض نشد`, item, productId); + return; + } + if (!owner) await this.prisma.product.update({ where: { id: productId }, data: { productCode: item.code } }); + } + + /** + * Makes sure a product has its کارساخته: existing link → done; an item by + * the same name → link; else create it (Zarrin). Tahesab cannot create items + * through its API — the item comes into being with the first document under + * the product's title, and the next pull links it by name. + */ + async ensureProductItem(a: ActiveProvider, productId: string): Promise<{ code: string; name: string; created: boolean } | null> { + const provider = a.provider.name; + const link = await this.prisma.accountingLink.findUnique({ + where: { provider_entityType_entityId: { provider, entityType: 'PRODUCT', entityId: productId } }, + }); + const product = await this.prisma.product.findUnique({ where: { id: productId }, select: { id: true, title: true, categoryId: true } }); + if (!product) throw new NeedsReviewError('محصول در اپ پیدا نشد'); + if (link) return { code: link.externalCode, name: link.externalName ?? product.title, created: false }; + + if (!a.provider.capabilities.createKarSakhte) return null; + + const existing = (await this.itemsCached(a)).filter((i) => i.name === product.title); + for (const item of existing) { + const taken = await this.prisma.accountingLink.findUnique({ + where: { provider_entityType_externalCode: { provider, entityType: 'PRODUCT', externalCode: item.code } }, + select: { id: true }, + }); + if (!taken) { + await this.prisma.accountingLink.create({ + data: { provider, entityType: 'PRODUCT', entityId: productId, externalCode: item.code, externalName: item.name, origin: 'LINKED', snapshot: item as unknown as Prisma.InputJsonValue }, + }); + await this.setProductCode(provider, productId, item); + return { code: item.code, name: item.name, created: false }; + } + } + + const m = a.config.mapping; + const group = (product.categoryId && m.categoryGroups.find((x) => x.categoryId === product.categoryId)?.group) || m.newKarSakhteGroup; + if (!group?.id) throw new NeedsReviewError('گروه ساخته برای این دسته‌بندی/پیش‌فرض در تنظیمات حسابداری تعیین نشده'); + if (!m.newKarSakhteType?.id) throw new NeedsReviewError('نوع کارساخته‌ی پیش‌فرض در تنظیمات حسابداری تعیین نشده'); + + const res = await a.provider.createKarSakhte(a.settings, { name: product.title, groupId: group.id, typeId: m.newKarSakhteType.id }); + const item: ExternalKarSakhte = { + code: res.code, + name: product.title, + groupId: group.id, + groupName: group.name, + typeId: m.newKarSakhteType.id, + typeName: m.newKarSakhteType.name, + saleWagePercent: null, + stockWeight: null, + stockCount: null, + }; + await this.prisma.accountingLink.create({ + data: { provider, entityType: 'PRODUCT', entityId: productId, externalCode: res.code, externalName: product.title, origin: 'PUSHED', snapshot: item as unknown as Prisma.InputJsonValue }, + }); + await this.setProductCode(provider, productId, item); + return { code: res.code, name: product.title, created: true }; + } + + /** Zarrin's listKarSakhte takes seconds; an order with several lines needs it once. */ + private async itemsCached(a: ActiveProvider) { + const c = this.itemCache; + if (c && c.provider === a.provider.name && Date.now() - c.at < STATEMENT_CACHE_MS) return c.items; + const items = await a.provider.listKarSakhte(a.settings); + this.itemCache = { provider: a.provider.name, at: Date.now(), items }; + return items; + } + + // ════════════════════════════════════════════════════════════════════ + // F3 — order documents + // ════════════════════════════════════════════════════════════════════ + + async buildOrderDocument(a: ActiveProvider, orderId: string) { + const order = await this.prisma.order.findUnique({ + where: { id: orderId }, + include: { items: { include: { productVariant: { include: { product: true } } } } }, + }); + if (!order) throw new NeedsReviewError('سفارش در اپ پیدا نشد'); + if (order.items.length === 0) throw new NeedsReviewError('سفارش قلمی ندارد'); + + const customer = await this.ensureCustomerAccount(a, order.customerId, { update: false }); + + const lines: DocumentLine[] = []; + let total = new Prisma.Decimal(0); + for (const item of order.items) { + const product = item.productVariant.product; + let ref: { code: string; name: string }; + const ensured = await this.ensureProductItem(a, product.id); + if (ensured) ref = ensured; + else { + // Tahesab: the item is identified by name and created by this document. + ref = { code: product.title, name: product.title }; + } + const qty = item.quantity; + const wage = new Prisma.Decimal(item.wagePercentSnapshot).sub(item.discountPercentSnapshot); + const weight = new Prisma.Decimal(item.rashWeightGramsSnapshot).mul(qty); + total = total.add(new Prisma.Decimal(item.computedWeightGrams).mul(qty)); + lines.push({ + itemCode: ref.code, + itemName: ref.name, + weightGrams: weight, + count: qty, + wagePercent: wage, + flatRial: new Prisma.Decimal(item.flatRialCharge).mul(qty), + karat: a.config.mapping.karat, + description: `${product.title} — ${item.productVariant.title} — سفارش ${order.orderNumber} — اجرت ${wage.toString()}٪`, + }); + } + + // Acceptance rule of F3: the gold the document moves must equal the + // order's own total, or the two books disagree from the first day. + const docGold = lines.reduce( + (s, l) => s.add(l.weightGrams.mul(new Prisma.Decimal(1).add(l.wagePercent.div(100)))), + new Prisma.Decimal(0), + ); + const mismatch = docGold.sub(order.totalGoldWeightGrams).abs(); + if (mismatch.gt('0.01')) { + throw new NeedsReviewError( + `جمع وزن سند (${docGold.toFixed(3)}) با وزن سفارش (${new Prisma.Decimal(order.totalGoldWeightGrams).toFixed(3)}) نمی‌خواند`, + ); + } + + return { + order, + input: { + factorCode: factorCodeFor(order.id), + customerCode: customer.code, + date: order.deliveredAt ?? new Date(), + description: `سفارش ${order.orderNumber} از اپ`, + temporary: true, // D27: the accountant finalises + lines, + }, + check: { orderTotal: new Prisma.Decimal(order.totalGoldWeightGrams).toFixed(3), documentGold: docGold.toFixed(3), linesTotal: total.toFixed(3) }, + }; + } + + // ════════════════════════════════════════════════════════════════════ + // outbox jobs + // ════════════════════════════════════════════════════════════════════ + + /** Runs one outbox job. Throws to signal failure; the worker decides retry vs review. */ + async runJob(a: ActiveProvider, job: AccountingOutbox): Promise<{ externalRef?: string | null; request?: unknown; response?: unknown }> { + switch (job.kind) { + case 'CUSTOMER_PUSH': { + const res = await this.ensureCustomerAccount(a, job.entityId, { update: true }); + return { externalRef: res.code, request: res.request, response: res.response }; + } + + case 'PRODUCT_PUSH': { + const res = await this.ensureProductItem(a, job.entityId); + return { + externalRef: res?.code ?? null, + request: { productId: job.entityId }, + response: res ?? { note: `${a.provider.label} ساخت کارساخته ندارد؛ با اولین سند ساخته می‌شود` }, + }; + } + + case 'ORDER_DOCUMENT': { + const doc = await this.buildOrderDocument(a, job.entityId); + const request = { ...doc.input, lines: doc.input.lines.map((l) => ({ ...l, weightGrams: l.weightGrams.toFixed(3), wagePercent: l.wagePercent.toString(), flatRial: l.flatRial.toFixed(0) })), check: doc.check }; + await this.prisma.accountingOutbox.update({ where: { id: job.id }, data: { lastRequest: request as unknown as Prisma.InputJsonValue } }); + const result = await a.provider.postOrderDocument( + a.settings, + doc.input, + (job.progress ?? {}) as Record, + async (p) => { + await this.prisma.accountingOutbox.update({ where: { id: job.id }, data: { progress: p as unknown as Prisma.InputJsonValue } }); + }, + ); + return { externalRef: result.ref, request, response: result.response }; + } + + case 'ORDER_DOCUMENT_DELETE': { + const sent = await this.prisma.accountingOutbox.findFirst({ + where: { provider: job.provider, kind: 'ORDER_DOCUMENT', entityId: job.entityId, status: { in: ['SENT', 'SENDING', 'NEEDS_REVIEW', 'FAILED'] } }, + orderBy: { createdAt: 'desc' }, + }); + if (!sent) return { response: { note: 'سندی برای حذف ثبت نشده بود' } }; + // The order row may be gone (deleted from the admin panel); the sent + // document's own request says which account it went to. + const order = await this.prisma.order.findUnique({ where: { id: job.entityId }, select: { customerId: true, deliveredAt: true } }); + let customerCode = (sent.lastRequest as { customerCode?: string } | null)?.customerCode ?? null; + if (!customerCode && order) { + const link = await this.prisma.accountingLink.findUnique({ + where: { provider_entityType_entityId: { provider: job.provider, entityType: 'CUSTOMER', entityId: order.customerId } }, + }); + customerCode = link?.externalCode ?? null; + } + if (!customerCode) throw new NeedsReviewError('حساب مشتری در حسابداری معلوم نیست؛ سند را دستی حذف کنید'); + const link = { externalCode: customerCode }; + const factorCode = factorCodeFor(job.entityId); + + // Only a document still temporary may be deleted automatically (plan + // F3). Tahesab reports that per row; Zarrin cannot, so a person checks. + if (job.provider === 'tahesab') { + // The document is dated when it was built (or at delivery, if earlier). + const posted = order?.deliveredAt && order.deliveredAt < sent.createdAt ? order.deliveredAt : sent.createdAt; + const date = toJalali(posted); + const rows = await a.provider.getStatement(a.settings, { code: link.externalCode, from: date, to: toJalali(new Date()) }); + const docRows = rows.filter((r) => r.documentRef === factorCode); + if (docRows.some((r) => !r.temporary)) { + throw new NeedsReviewError('سند در حسابداری نهایی شده؛ حذف خودکار انجام نشد. حسابدار باید دستی اصلاح کند.'); + } + } else { + throw new NeedsReviewError( + `${a.provider.label} وضعیت موقت/نهایی سند را گزارش نمی‌دهد؛ سند ${sent.externalRef ?? ''} را حسابدار بررسی و حذف کند.`, + ); + } + const res = await a.provider.deleteDocument(a.settings, { factorCode, ref: sent.externalRef, customerCode: link.externalCode }); + await this.prisma.accountingOutbox.update({ + where: { id: sent.id }, + data: { status: 'RESOLVED', lastError: 'سند به‌خاطر لغو سفارش حذف شد' }, + }); + return { externalRef: sent.externalRef, request: { factorCode }, response: res.response }; + } + } + } + + /** + * Is a job whose call may or may not have landed safe to send again? + * Customer/product pushes search before they create; Tahesab rejects a + * repeated document row; a Zarrin document has no such guard. + */ + isRetrySafe(provider: ProviderName, kind: AccountingOutbox['kind']) { + if (kind === 'ORDER_DOCUMENT') return provider === 'tahesab'; + return true; + } + + // ════════════════════════════════════════════════════════════════════ + + async issue(provider: ProviderName, kind: string, externalCode: string, message: string, data?: unknown, entityId?: string) { + const json = + data === undefined || data === null ? Prisma.JsonNull : (JSON.parse(JSON.stringify(data)) as Prisma.InputJsonValue); + await this.prisma.accountingIssue.upsert({ + where: { provider_kind_externalCode: { provider, kind, externalCode } }, + update: { message, data: json, entityId: entityId ?? null, resolvedAt: null }, + create: { provider, kind, externalCode, message, data: json, entityId: entityId ?? null }, + }); + } + + describeError(err: unknown) { + if (err instanceof AccountingProviderError) return err.message; + if (err instanceof NeedsReviewError) return err.message; + return (err as Error)?.message ?? String(err); + } + + /** For callers that only need to know the configuration. */ + activeConfig(): Promise { + return this.config.get(); + } +} diff --git a/apps/api/src/modules/accounting-sync/accounting-utils.spec.ts b/apps/api/src/modules/accounting-sync/accounting-utils.spec.ts new file mode 100644 index 0000000..f96cb59 --- /dev/null +++ b/apps/api/src/modules/accounting-sync/accounting-utils.spec.ts @@ -0,0 +1,128 @@ +import { Prisma } from '@prisma/client'; +import { formatJalali, jalaliToIsoDate, parseJalali, toIsoDateTehran, toJalali } from './jalali'; +import { openSecret, sealSecret } from './secret-box'; +import { dec, normalizeMobile, splitName } from './providers/accounting-provider'; +import { factorCodeFor, validNationalCode } from './accounting-sync.service'; +import { parseLooseJson } from './accounting-http'; +import { isAccountingSettingKey, withDefaults } from './accounting-config'; + +describe('jalali', () => { + it('converts a Tehran calendar day', () => { + // The Tahesab test server reported 1405/07/13 on 2026-10-05. + expect(formatJalali(toJalali(new Date('2026-10-05T08:00:00Z')), '/')).toBe('1405/07/13'); + // Nowruz 1404: 2025-03-21 00:30 in Tehran is still 20 March in UTC. + expect(formatJalali(toJalali(new Date('2025-03-20T21:00:00Z')))).toBe('1404-01-01'); + }); + + it('goes back to Gregorian', () => { + expect(jalaliToIsoDate({ jy: 1405, jm: 7, jd: 13 })).toBe('2026-10-05'); + expect(jalaliToIsoDate({ jy: 1403, jm: 12, jd: 30 })).toBe('2025-03-20'); + }); + + it('parses the forms the apps and Tahesab use, and rejects impossible days', () => { + expect(parseJalali('1405/7/13')).toEqual({ jy: 1405, jm: 7, jd: 13 }); + expect(parseJalali('۱۴۰۵-۰۷-۱۳')).toEqual({ jy: 1405, jm: 7, jd: 13 }); + expect(parseJalali('1403/12/30')).not.toBeNull(); // leap year + expect(parseJalali('1404/12/30')).toBeNull(); // common year + expect(parseJalali('1405/07/31')).toBeNull(); + expect(parseJalali('2026-10-05x')).toBeNull(); + }); + + it('formats a Tehran ISO day', () => { + expect(toIsoDateTehran(new Date('2026-10-04T21:00:00Z'))).toBe('2026-10-05'); + }); +}); + +describe('secret-box', () => { + const saved = { ...process.env }; + afterEach(() => { + process.env = { ...saved }; + }); + + it('round-trips and never stores the plain token', () => { + process.env.ACCOUNTING_SECRET_KEY = 'k1'; + const sealed = sealSecret('M3Y3D2Y7'); + expect(sealed.startsWith('enc:v1:')).toBe(true); + expect(sealed).not.toContain('M3Y3D2Y7'); + expect(openSecret(sealed)).toBe('M3Y3D2Y7'); + }); + + it('cannot be opened with another key', () => { + process.env.ACCOUNTING_SECRET_KEY = 'k1'; + const sealed = sealSecret('secret'); + process.env.ACCOUNTING_SECRET_KEY = 'k2'; + expect(openSecret(sealed)).toBeNull(); + expect(openSecret('plain-text')).toBeNull(); + }); + + it('falls back to JWT_SECRET when the dedicated key is blank', () => { + process.env.ACCOUNTING_SECRET_KEY = ' '; + process.env.JWT_SECRET = 'jwt'; + expect(openSecret(sealSecret('x'))).toBe('x'); + }); +}); + +describe('helpers', () => { + it('normalises every mobile form the two programs store', () => { + expect(normalizeMobile('9121234567')).toBe('09121234567'); + expect(normalizeMobile('09121234567')).toBe('09121234567'); + expect(normalizeMobile('+98 912 123 4567')).toBe('09121234567'); + expect(normalizeMobile('00989121234567')).toBe('09121234567'); + expect(normalizeMobile('۰۹۱۲۱۲۳۴۵۶۷')).toBe('09121234567'); + expect(normalizeMobile('02155662233')).toBeNull(); + expect(normalizeMobile('')).toBeNull(); + expect(normalizeMobile(null)).toBeNull(); + }); + + it('reads the numbers Tahesab sends as strings, and its literal "null"', () => { + expect(dec('-177.431')?.toString()).toBe('-177.431'); + expect(dec('1,234')?.toString()).toBe('1234'); + expect(dec('null')).toBeNull(); + expect(dec(null)).toBeNull(); + expect(dec('abc')).toBeNull(); + }); + + it('accepts only real national codes', () => { + expect(validNationalCode('0499370899')).toBe('0499370899'); + expect(validNationalCode('0000000000')).toBeNull(); // seen on the Tahesab test server + expect(validNationalCode('1234567890')).toBeNull(); + expect(validNationalCode(null)).toBeNull(); + }); + + it('builds a Tahesab-safe Factor_Code from an order id', () => { + const code = factorCodeFor('cm1abcdefghijklmnopqrstuv'); + expect(code).toBe(code.toLowerCase()); + expect(code).toMatch(/^[a-z0-9]+$/); + expect(code.length).toBeGreaterThanOrEqual(20); + }); + + it('splits a name the way the DB trigger does', () => { + expect(splitName('علی رضا محمدی')).toEqual({ firstName: 'علی', lastName: 'رضا محمدی' }); + expect(splitName('masoud')).toEqual({ firstName: 'masoud', lastName: '' }); + }); + + it('scrubs the junk Tahesab replies have carried', () => { + expect(parseLooseJson('{"a":"x\\y"}')).toEqual({ a: 'x-y' }); + expect(parseLooseJson('garbage [1,2]')).toEqual([1, 2]); + }); + + it('fences off every accounting Setting key from the const routes', () => { + expect(isAccountingSettingKey('accounting.config')).toBe(true); + expect(isAccountingSettingKey('Accounting.lease')).toBe(true); + expect(isAccountingSettingKey('wallet.config')).toBe(false); + }); + + it('fills a partial stored config with defaults', () => { + const c = withDefaults({ provider: 'tahesab', features: { balances: true } }); + expect(c.provider).toBe('tahesab'); + expect(c.features).toEqual({ customers: false, balances: true, report: false, products: false, documents: false }); + expect(c.tahesab.dbName).toBe('TahesabDB'); + expect(c.mapping.karat).toBe(750); + expect(withDefaults({ provider: 'other' }).provider).toBe('none'); + }); + + it('keeps Decimal maths exact for the wage-as-karat rule', () => { + const w = new Prisma.Decimal(18.5); + expect(new Prisma.Decimal(750).mul(new Prisma.Decimal(1).add(w.div(100))).toString()).toBe('888.75'); + }); +}); diff --git a/apps/api/src/modules/accounting-sync/accounting-worker.service.ts b/apps/api/src/modules/accounting-sync/accounting-worker.service.ts new file mode 100644 index 0000000..90bf623 --- /dev/null +++ b/apps/api/src/modules/accounting-sync/accounting-worker.service.ts @@ -0,0 +1,375 @@ +import { Injectable, Logger, OnApplicationBootstrap, OnModuleDestroy } from '@nestjs/common'; +import { AccountingOutbox, Prisma } from '@prisma/client'; +import { randomUUID } from 'crypto'; +import { envOr } from '../../common/env'; +import { PrismaService } from '../../prisma/prisma.service'; +import { ActiveProvider, AccountingConfigService, JobName } from './accounting-config.service'; +import { AccountingSyncService, NeedsReviewError } from './accounting-sync.service'; +import { AccountingNotSupportedError, AccountingProviderError } from './providers'; + +/** Scheduled pulls (customers, full balances, full products): the safety net. */ +const TICK_MS = 30_000; +/** Outbox and change poll, the real-time path: checked this often. */ +const FAST_TICK_MS = 2_000; +/** How often the change feed is polled. */ +const CHANGES_POLL_MS = 5_000; +/** Long enough for a full customer import; renewed before every step. */ +const LEASE_MS = 10 * 60_000; +const LEASE_KEY = 'accounting.lease'; +const OUTBOX_BATCH = 25; +const MAX_ATTEMPTS = 8; + +type PullJob = Exclude; + +export const PULL_FEATURE: Record = { + customers: 'customers', + balances: 'balances', + products: 'products', +}; + +function toJson(v: unknown): Prisma.InputJsonValue | typeof Prisma.JsonNull { + if (v === undefined || v === null) return Prisma.JsonNull; + return JSON.parse(JSON.stringify(v)) as Prisma.InputJsonValue; +} + +/** + * Runs the accounting integration in the background (D27, plan §3.4). Two + * loops: a fast one (every couple of seconds) for the outbox and the change + * feed, the real-time path; and the 30-second one for the scheduled pulls that + * reconcile what the feed cannot see (new customers, edits and deletions, + * overflow). + * + * In-process, no queue dependency. A lease row in the Setting table + * (`accounting.lease`) keeps a second API instance from running the same jobs + * at the same time; the in-memory flag keeps one instance's ticks from + * overlapping. Set ACCOUNTING_WORKER=off to keep an instance out entirely. + */ +@Injectable() +export class AccountingWorkerService implements OnApplicationBootstrap, OnModuleDestroy { + private readonly logger = new Logger('Accounting'); + private readonly owner = randomUUID(); + private timer: NodeJS.Timeout | null = null; + private running = false; + private fastRunning = false; + private fastTimer: NodeJS.Timeout | null = null; + private kickTimer: NodeJS.Timeout | null = null; + private changes: { provider: string; cursor: string | null } = { provider: '', cursor: null }; + private lastChangePollAt = 0; + private lastChangeWarnAt = 0; + private forced = new Set(); + private lastForcedCustomersAt = 0; + /** Shown on the admin screen. */ + readonly realtime: { + lastPollAt?: string; + lastOkAt?: string; + lastError?: string | null; + lastChangeAt?: string; + lastSummary?: Record; + } = {}; + private recovered = new Set(); + + constructor( + private readonly prisma: PrismaService, + private readonly config: AccountingConfigService, + private readonly sync: AccountingSyncService, + ) {} + + onApplicationBootstrap() { + if (envOr('ACCOUNTING_WORKER', 'on') === 'off' || process.env.NODE_ENV === 'test') return; + this.timer = setInterval(() => void this.tick(), TICK_MS); + this.timer.unref?.(); + this.fastTimer = setInterval(() => void this.fastTick(), FAST_TICK_MS); + this.fastTimer.unref?.(); + } + + onModuleDestroy() { + if (this.timer) clearInterval(this.timer); + if (this.fastTimer) clearInterval(this.fastTimer); + if (this.kickTimer) clearTimeout(this.kickTimer); + } + + /** + * Something was just queued. Hooks run inside the caller's transaction, so + * wake the outbox a moment later, once it has committed, instead of waiting + * for the next tick. + */ + kickSoon() { + if (this.kickTimer || !this.fastTimer) return; + this.kickTimer = setTimeout(() => { + this.kickTimer = null; + void this.fastTick(true); + }, 700); + this.kickTimer.unref?.(); + } + + /** True when this instance holds (or just took) the lease. */ + private async acquireLease(): Promise { + const value = JSON.stringify({ owner: this.owner, until: new Date(Date.now() + LEASE_MS).toISOString() }); + await this.prisma.$executeRaw` + INSERT INTO "Setting" ("key", "value", "updatedAt") VALUES (${LEASE_KEY}, ${value}::jsonb, now()) + ON CONFLICT ("key") DO NOTHING`; + const n = await this.prisma.$executeRaw` + UPDATE "Setting" SET "value" = ${value}::jsonb, "updatedAt" = now() + WHERE "key" = ${LEASE_KEY} + AND ("value"->>'owner' = ${this.owner} OR ("value"->>'until')::timestamptz < now())`; + return n > 0; + } + + async tick(only?: JobName): Promise { + if (this.running) return false; + this.running = true; + try { + if (!(await this.acquireLease())) return false; + const a = await this.config.active(); + if (!a) return false; + + if (!this.recovered.has(a.provider.name)) { + await this.recoverInterrupted(a); + this.recovered.add(a.provider.name); + } + + if (only === 'outbox') await this.processOutbox(a); + for (const job of ['balances', 'customers', 'products'] as PullJob[]) { + if (only && only !== job) continue; + if (!a.config.features[PULL_FEATURE[job]]) continue; + const wasForced = this.forced.delete(job); + if (!only && !wasForced && !(await this.isDue(job, a))) continue; + await this.acquireLease(); + await this.runPull(job, a); + } + return true; + } catch (err) { + this.logger.error(`Accounting tick failed: ${(err as Error).message}`); + return false; + } finally { + this.running = false; + } + } + + /** + * The real-time path, every couple of seconds: send queued documents and + * edits at once, and poll the software's change feed so a balance or a stock + * figure changed there is changed here moments later. Never waits behind a + * long scheduled pull (it has its own guard, apart from tick()). + */ + async fastTick(force = false): Promise { + if (this.fastRunning) return; + this.fastRunning = true; + try { + if (!(await this.acquireLease())) return; + const a = await this.config.active(); + if (!a) return; + if (!this.recovered.has(a.provider.name)) { + await this.recoverInterrupted(a); + this.recovered.add(a.provider.name); + } + await this.processOutbox(a); + + if (!force && Date.now() - this.lastChangePollAt < CHANGES_POLL_MS) return; + if (!a.provider.capabilities.changeFeed || !(a.config.features.balances || a.config.features.products)) return; + this.lastChangePollAt = Date.now(); + await this.pollChanges(a); + } catch (err) { + this.logger.error(`Accounting fast tick failed: ${(err as Error).message}`); + } finally { + this.fastRunning = false; + } + } + + private async pollChanges(a: ActiveProvider) { + if (this.changes.provider !== a.provider.name) this.changes = { provider: a.provider.name, cursor: null }; + this.realtime.lastPollAt = new Date().toISOString(); + try { + const baseline = this.changes.cursor === null; + const r = await this.sync.pollChanges(a, this.changes.cursor); + this.changes.cursor = r.cursor; + this.realtime.lastOkAt = new Date().toISOString(); + this.realtime.lastError = null; + if (r.balances > 0 || r.stocks > 0) { + this.realtime.lastChangeAt = this.realtime.lastOkAt; + this.realtime.lastSummary = { balances: r.balances, stocks: r.stocks }; + } + if (baseline) return; + // What the feed cannot describe goes to the scheduled jobs right away. + if (r.fullBalances) this.forced.add('balances'); + if (r.fullProducts) this.forced.add('products'); + if (r.newAccounts && a.config.features.customers && Date.now() - this.lastForcedCustomersAt > 60_000) { + this.lastForcedCustomersAt = Date.now(); + this.forced.add('customers'); + } + if (this.forced.size > 0) void this.tick(); + } catch (err) { + const msg = this.sync.describeError(err); + this.realtime.lastError = msg; + if (Date.now() - this.lastChangeWarnAt > 60_000) { + this.lastChangeWarnAt = Date.now(); + this.logger.warn(`Accounting change poll failed: ${msg}`); + } + } + } + + /** + * A sync button (plan §12): runs these pulls now and waits for them. Needs + * only a connected provider — the feature switches do not apply. Each job + * reports on its own, so one failing does not hide the others. + */ + async runPullsNow(jobs: PullJob[]): Promise | null> { + if (this.running) return null; + this.running = true; + try { + const a = await this.config.active(); + if (!a) return null; + const out: Record = {}; + for (const job of jobs) { + await this.acquireLease(); + const startedAt = new Date().toISOString(); + await this.config.recordJob(job, { lastRunAt: startedAt }); + try { + const summary = + job === 'customers' + ? await this.sync.pullCustomers(a) + : job === 'balances' + ? await this.sync.pullBalances(a) + : await this.sync.pullProducts(a); + await this.config.recordJob(job, { lastOkAt: new Date().toISOString(), lastError: null, summary }); + out[job] = { ok: true, summary }; + } catch (err) { + const error = this.sync.describeError(err); + await this.config.recordJob(job, { lastError: error }); + out[job] = { ok: false, error }; + } + } + return out; + } finally { + this.running = false; + } + } + + /** «سینک الان» from the admin screen: runs in the background, returns at once. */ + runNow(job: JobName): boolean { + if (job === 'outbox') { + if (this.fastRunning) return false; + void this.fastTick(true); + return true; + } + if (this.running) return false; + void this.tick(job); + return true; + } + + get busy() { + return this.running; + } + + private async isDue(job: PullJob, a: ActiveProvider) { + const minutes = { + customers: a.config.intervals.customersMinutes, + balances: a.config.intervals.balancesMinutes, + products: a.config.intervals.productsMinutes, + }[job]; + const state = await this.config.getState(); + const last = state.jobs[job]?.lastRunAt; + return !last || Date.now() - new Date(last).getTime() >= minutes * 60_000; + } + + private async runPull(job: PullJob, a: ActiveProvider) { + const startedAt = new Date().toISOString(); + await this.config.recordJob(job, { lastRunAt: startedAt }); + try { + const summary = + job === 'customers' + ? await this.sync.pullCustomers(a) + : job === 'balances' + ? await this.sync.pullBalances(a) + : await this.sync.pullProducts(a); + await this.config.recordJob(job, { lastOkAt: new Date().toISOString(), lastError: null, summary }); + } catch (err) { + const msg = this.sync.describeError(err); + this.logger.warn(`Accounting ${job} pull failed: ${msg}`); + await this.config.recordJob(job, { lastError: msg }); + } + } + + /** + * A job left in SENDING means the process stopped mid-call: its outcome is + * unknown. Safe kinds go back to the queue; a Zarrin document goes to a + * person, since sending it again could post it twice. + */ + private async recoverInterrupted(a: ActiveProvider) { + const stuck = await this.prisma.accountingOutbox.findMany({ where: { provider: a.provider.name, status: 'SENDING' } }); + for (const job of stuck) { + const safe = this.sync.isRetrySafe(a.provider.name, job.kind); + await this.prisma.accountingOutbox.update({ + where: { id: job.id }, + data: safe + ? { status: 'PENDING', nextAttemptAt: new Date() } + : { + status: 'NEEDS_REVIEW', + lastError: 'سرور هنگام ارسال متوقف شد؛ معلوم نیست سند ثبت شده یا نه. پیش از «تلاش دوباره» در حسابداری بررسی کنید.', + }, + }); + } + } + + private async processOutbox(a: ActiveProvider) { + const jobs = await this.prisma.accountingOutbox.findMany({ + where: { provider: a.provider.name, status: 'PENDING', nextAttemptAt: { lte: new Date() } }, + orderBy: { createdAt: 'asc' }, + take: OUTBOX_BATCH, + }); + const startedAt = new Date().toISOString(); + let sent = 0; + let failed = 0; + for (const job of jobs) { + await this.acquireLease(); + const ok = await this.runOne(a, job); + if (ok) sent += 1; + else failed += 1; + } + if (jobs.length > 0) { + await this.config.recordJob('outbox', { lastRunAt: startedAt, lastOkAt: new Date().toISOString(), summary: { picked: jobs.length, sent, failed } }); + } + } + + private async runOne(a: ActiveProvider, job: AccountingOutbox): Promise { + const attempts = job.attempts + 1; + await this.prisma.accountingOutbox.update({ where: { id: job.id }, data: { status: 'SENDING', attempts } }); + const fresh = { ...job, attempts }; + try { + const res = await this.sync.runJob(a, fresh); + await this.prisma.accountingOutbox.update({ + where: { id: job.id }, + data: { + status: 'SENT', + sentAt: new Date(), + externalRef: res.externalRef ?? null, + lastRequest: toJson(res.request), + lastResponse: toJson(res.response), + lastError: null, + }, + }); + return true; + } catch (err) { + const msg = this.sync.describeError(err); + const response = err instanceof AccountingProviderError ? err.response : undefined; + let data: Prisma.AccountingOutboxUpdateInput; + if (err instanceof NeedsReviewError || err instanceof AccountingNotSupportedError) { + data = { status: 'NEEDS_REVIEW', lastError: msg }; + } else if (err instanceof AccountingProviderError && err.ambiguous && !this.sync.isRetrySafe(a.provider.name, job.kind)) { + data = { + status: 'NEEDS_REVIEW', + lastError: `${msg} — ممکن است سند ثبت شده باشد؛ پیش از «تلاش دوباره» در حسابداری بررسی کنید.`, + }; + } else if (attempts >= MAX_ATTEMPTS) { + data = { status: 'FAILED', lastError: msg }; + } else { + const delayMin = Math.min(2 ** (attempts - 1), 60); + data = { status: 'PENDING', lastError: msg, nextAttemptAt: new Date(Date.now() + delayMin * 60_000) }; + } + if (response !== undefined) data.lastResponse = toJson(response); + await this.prisma.accountingOutbox.update({ where: { id: job.id }, data }); + this.logger.warn(`Accounting job ${job.kind} ${job.entityId} → ${String(data.status)}: ${msg}`); + return false; + } + } +} diff --git a/apps/api/src/modules/accounting-sync/jalali.ts b/apps/api/src/modules/accounting-sync/jalali.ts new file mode 100644 index 0000000..342f738 --- /dev/null +++ b/apps/api/src/modules/accounting-sync/jalali.ts @@ -0,0 +1,152 @@ +/** + * Jalali (Shamsi) ⇄ Gregorian conversion. + * + * Tahesab wants a document date as separate Shamsi year/month/day integers and + * its list filters as `1405-04-24`; the customer app sends report ranges as + * `1405/04/24`; Zarrin wants Gregorian `2024-10-12` on most calls. One small + * converter covers all three without a dependency. + * + * The arithmetic is the well-known jalaali-js algorithm (Borkowski's leap-year + * break table), valid for Jalali years -61 … 3177. + */ + +export interface JalaliDate { + jy: number; + jm: number; + jd: number; +} + +const BREAKS = [ + -61, 9, 38, 199, 426, 686, 756, 818, 1111, 1181, 1210, 1635, 2060, 2097, 2192, 2262, 2324, 2394, 2456, + 3178, +]; + +function div(a: number, b: number) { + return ~~(a / b); +} + +function mod(a: number, b: number) { + return a - ~~(a / b) * b; +} + +function jalCal(jy: number) { + const gy = jy + 621; + let leapJ = -14; + let jp = BREAKS[0]; + let jump = 0; + if (jy < jp || jy >= BREAKS[BREAKS.length - 1]) throw new RangeError(`Invalid Jalali year ${jy}`); + + for (let i = 1; i < BREAKS.length; i += 1) { + const jm = BREAKS[i]; + jump = jm - jp; + if (jy < jm) break; + leapJ = leapJ + div(jump, 33) * 8 + div(mod(jump, 33), 4); + jp = jm; + } + let n = jy - jp; + leapJ = leapJ + div(n, 33) * 8 + div(mod(n, 33) + 3, 4); + if (mod(jump, 33) === 4 && jump - n === 4) leapJ += 1; + const leapG = div(gy, 4) - div((div(gy, 100) + 1) * 3, 4) - 150; + const march = 20 + leapJ - leapG; + if (jump - n < 6) n = n - jump + div(jump + 4, 33) * 33; + let leap = mod(mod(n + 1, 33) - 1, 4); + if (leap === -1) leap = 4; + return { leap, gy, march }; +} + +function g2d(gy: number, gm: number, gd: number) { + let d = + div((gy + div(gm - 8, 6) + 100100) * 1461, 4) + div(153 * mod(gm + 9, 12) + 2, 5) + gd - 34840408; + d = d - div(div(gy + 100100 + div(gm - 8, 6), 100) * 3, 4) + 752; + return d; +} + +function d2g(jdn: number) { + let j = 4 * jdn + 139361631; + j = j + div(div(4 * jdn + 183187720, 146097) * 3, 4) * 4 - 3908; + const i = div(mod(j, 1461), 4) * 5 + 308; + const gd = div(mod(i, 153), 5) + 1; + const gm = mod(div(i, 153), 12) + 1; + const gy = div(j, 1461) - 100100 + div(8 - gm, 6); + return { gy, gm, gd }; +} + +function j2d(jy: number, jm: number, jd: number) { + const r = jalCal(jy); + return g2d(r.gy, 3, r.march) + (jm - 1) * 31 - div(jm, 7) * (jm - 7) + jd - 1; +} + +function d2j(jdn: number): JalaliDate { + const gy = d2g(jdn).gy; + let jy = gy - 621; + const r = jalCal(jy); + const jdn1f = g2d(gy, 3, r.march); + let k = jdn - jdn1f; + if (k >= 0) { + if (k <= 185) return { jy, jm: 1 + div(k, 31), jd: mod(k, 31) + 1 }; + k -= 186; + } else { + jy -= 1; + k += 179; + if (r.leap === 1) k += 1; + } + return { jy, jm: 7 + div(k, 30), jd: mod(k, 30) + 1 }; +} + +/** Iran has had no DST since 2022, so a fixed +03:30 gives the local calendar day. */ +const TEHRAN_OFFSET_MS = (3 * 60 + 30) * 60 * 1000; + +/** The Jalali calendar day of an instant, as seen in Tehran. */ +export function toJalali(date: Date): JalaliDate { + const local = new Date(date.getTime() + TEHRAN_OFFSET_MS); + return d2j(g2d(local.getUTCFullYear(), local.getUTCMonth() + 1, local.getUTCDate())); +} + +/** Gregorian calendar day for a Jalali day: `{ gy, gm, gd }`. */ +export function jalaliToGregorian(jy: number, jm: number, jd: number) { + return d2g(j2d(jy, jm, jd)); +} + +/** + * Parses `1405/04/24`, `1405-4-24` or Persian digits. Returns null for anything + * that is not a real Jalali date. + */ +export function parseJalali(input: string | null | undefined): JalaliDate | null { + if (!input) return null; + const ascii = String(input) + .trim() + .replace(/[۰-۹]/g, (d) => String('۰۱۲۳۴۵۶۷۸۹'.indexOf(d))) + .replace(/[٠-٩]/g, (d) => String('٠١٢٣٤٥٦٧٨٩'.indexOf(d))); + const m = ascii.match(/^(\d{4})[/-](\d{1,2})[/-](\d{1,2})$/); + if (!m) return null; + const jy = Number(m[1]); + const jm = Number(m[2]); + const jd = Number(m[3]); + if (jm < 1 || jm > 12 || jd < 1 || jd > 31 || (jm > 6 && jd > 30)) return null; + try { + // Round-trip rejects 30 Esfand in a common year. + const back = d2j(j2d(jy, jm, jd)); + return back.jy === jy && back.jm === jm && back.jd === jd ? { jy, jm, jd } : null; + } catch { + return null; + } +} + +const pad = (n: number) => String(n).padStart(2, '0'); + +/** `1405-04-24` (or with another separator). */ +export function formatJalali(d: JalaliDate, sep = '-') { + return `${d.jy}${sep}${pad(d.jm)}${sep}${pad(d.jd)}`; +} + +/** `2026-07-15` for a Jalali day. */ +export function jalaliToIsoDate(d: JalaliDate) { + const g = jalaliToGregorian(d.jy, d.jm, d.jd); + return `${g.gy}-${pad(g.gm)}-${pad(g.gd)}`; +} + +/** `2026-07-15` for an instant, Tehran calendar day. */ +export function toIsoDateTehran(date: Date) { + const local = new Date(date.getTime() + TEHRAN_OFFSET_MS); + return `${local.getUTCFullYear()}-${pad(local.getUTCMonth() + 1)}-${pad(local.getUTCDate())}`; +} diff --git a/apps/api/src/modules/accounting-sync/providers/accounting-provider.ts b/apps/api/src/modules/accounting-sync/providers/accounting-provider.ts new file mode 100644 index 0000000..c0bd30a --- /dev/null +++ b/apps/api/src/modules/accounting-sync/providers/accounting-provider.ts @@ -0,0 +1,310 @@ +import { Prisma } from '@prisma/client'; +import { JalaliDate } from '../jalali'; + +/** + * One accounting software (D27). AccountingSyncService picks a driver by the + * admin's switch and owns everything around the call — links, outbox, retries, + * logging — so a driver only translates between the app's shapes and its + * software's API. + * + * Every figure a driver returns is ALREADY in the app's convention: + * * gold in grams of 750, positive balance = the customer owes; + * * rial in rial, positive balance = the customer owes. + * Each software's own sign and unit quirks stay inside its driver. + */ + +export type ProviderName = 'tahesab' | 'zarrin'; + +/** Decrypted connection settings, handed to every call. */ +export interface ProviderSettings { + baseUrl: string; + token: string; + caCert: string | null; + timeoutMs: number; + /** Tahesab only: the `DBname` header (`TahesabDB` for SQL Server, `DB` for Access). */ + dbName?: string; + /** Zarrin only, until verified on a real installation (plan §9). */ + balanceOwesWhen?: 'negative' | 'positive'; +} + +export interface ExternalGroup { + id: string; + name: string; +} + +export interface ExternalCustomer { + code: string; + name: string; + /** Normalised to 09xxxxxxxxx, or null when the account has no usable mobile. */ + mobile: string | null; + phone: string | null; + nationalCode: string | null; + address: string | null; + groupId: string | null; + groupName: string | null; +} + +export interface CustomerPayload { + firstName: string; + lastName: string; + fullName: string; + mobile: string; + phone: string | null; + address: string | null; + nationalCode: string | null; + group: { id: string | null; name: string | null }; +} + +export interface ExternalBalance { + code: string; + goldGrams: Prisma.Decimal; + rial: Prisma.Decimal; +} + +export interface StatementQuery { + code: string; + from: JalaliDate; + to: JalaliDate; +} + +/** One line of a customer's statement, normalised across providers. */ +export interface StatementRow { + /** Stable within the provider (Tahesab ID + Radif, Zarrin idRadif). */ + key: string; + /** The document the line belongs to — what a detail lookup is keyed on. */ + documentRef: string; + /** The account the line belongs to, for the SEC-16 ownership check. */ + accountCode: string; + documentNo: string; + /** Jalali `1405/07/12`. */ + date: string; + time: string | null; + title: string; + description: string | null; + itemName: string | null; + weight: Prisma.Decimal | null; + karat: number | null; + count: Prisma.Decimal | null; + unitPrice: Prisma.Decimal | null; + wagePercent: Prisma.Decimal | null; + /** 750-equivalent gold received from the customer (reduces what they owe). */ + goldIn: Prisma.Decimal; + goldOut: Prisma.Decimal; + rialIn: Prisma.Decimal; + rialOut: Prisma.Decimal; + /** Running balance after this line, when the software reports one. */ + goldBalance: Prisma.Decimal | null; + rialBalance: Prisma.Decimal | null; + metal: string | null; + temporary: boolean; +} + +export interface ExternalKarSakhte { + /** Zarrin idKar; for Tahesab, which has no item ids, the item name itself. */ + code: string; + name: string; + groupId: string | null; + groupName: string | null; + typeId: string | null; + typeName: string | null; + saleWagePercent: Prisma.Decimal | null; + stockWeight: Prisma.Decimal | null; + stockCount: Prisma.Decimal | null; +} + +export interface KarSakhteStock { + weight: Prisma.Decimal | null; + count: Prisma.Decimal | null; +} + +export interface MovementRow { + itemCode: string | null; + itemName: string; + date: string; + description: string | null; + weight: Prisma.Decimal | null; + amount: Prisma.Decimal | null; + count: Prisma.Decimal | null; +} + +export interface DocumentLine { + /** The linked کارساخته: Zarrin idKar / Tahesab Name_Kar. */ + itemCode: string; + itemName: string; + /** Physical (raw) weight of the line, all pieces. */ + weightGrams: Prisma.Decimal; + count: number; + /** Effective making charge: variant wage minus discount, in percent. */ + wagePercent: Prisma.Decimal; + /** Flat rial charge of the line (stones), all pieces. */ + flatRial: Prisma.Decimal; + karat: number; + description: string; +} + +export interface OrderDocumentInput { + /** Deterministic per order; Tahesab dedupes on it (≥ 20 chars, lowercase). */ + factorCode: string; + customerCode: string; + date: Date; + description: string; + temporary: boolean; + lines: DocumentLine[]; +} + +/** Resumable state of a multi-call document (Zarrin posts one call per line). */ +export interface DocumentProgress { + factorId?: string; + doneLines?: number; +} + +export interface DocumentPostResult { + ref: string; + progress: DocumentProgress; + response: unknown; +} + +/** What changed in the accounting software since the last poll (real-time sync). */ +export interface ChangeBatch { + /** Opaque; hand it back on the next poll. */ + cursor: string; + /** Accounts that got a new or edited document. */ + accountCodes: string[]; + /** کارساخته names that got a new or edited document. */ + itemNames: string[]; + /** More changed than one poll can see: the caller must do a full refresh. */ + overflow: boolean; +} + +export interface ProviderCapabilities { + /** Can a کارساخته be created through the API? (Zarrin yes, Tahesab no.) */ + createKarSakhte: boolean; + /** Can a posted document be looked up by our own key before a retry? */ + documentInquiry: boolean; + /** Does the movement report cover every account, or only recent documents? */ + movementScope: 'all' | 'recent-documents'; + /** Can recent changes be polled cheaply (see getChanges)? */ + changeFeed: boolean; +} + +export interface AccountingProvider { + readonly name: ProviderName; + readonly label: string; + readonly capabilities: ProviderCapabilities; + + health(s: ProviderSettings): Promise>; + + listCustomerGroups(s: ProviderSettings): Promise; + /** One page of accounts; `next` is null after the last page. */ + listCustomers(s: ProviderSettings, cursor: string | null): Promise<{ items: ExternalCustomer[]; next: string | null }>; + findCustomersByMobile(s: ProviderSettings, mobile: string): Promise; + createCustomer(s: ProviderSettings, p: CustomerPayload): Promise<{ code: string; response: unknown }>; + updateCustomer(s: ProviderSettings, code: string, p: CustomerPayload): Promise<{ response: unknown }>; + + getBalances(s: ProviderSettings, codes: string[]): Promise; + /** + * Documents added or edited since `cursor` (null = first poll: only returns + * the starting cursor). Cheap enough to call every few seconds. + */ + getChanges(s: ProviderSettings, cursor: string | null): Promise; + getStatement(s: ProviderSettings, q: StatementQuery): Promise; + + listKarSakhteGroups(s: ProviderSettings): Promise; + listKarSakhteTypes(s: ProviderSettings): Promise; + listKarSakhte(s: ProviderSettings): Promise; + getKarSakhteStock(s: ProviderSettings, item: { code: string; name: string }): Promise; + getKarSakhteMovement(s: ProviderSettings, from: JalaliDate, to: JalaliDate): Promise; + createKarSakhte( + s: ProviderSettings, + item: { name: string; groupId: string | null; typeId: string | null }, + ): Promise<{ code: string; response: unknown }>; + + postOrderDocument( + s: ProviderSettings, + doc: OrderDocumentInput, + progress: DocumentProgress, + onProgress: (p: DocumentProgress) => Promise, + ): Promise; + /** True when a document with this key exists. */ + documentExists(s: ProviderSettings, doc: { factorCode: string; ref: string | null }): Promise; + deleteDocument( + s: ProviderSettings, + doc: { factorCode: string; ref: string | null; customerCode: string }, + ): Promise<{ response: unknown }>; +} + +/** + * A call the software answered with an error, or could not be made. + * `ambiguous` = the software may have acted on it anyway (timeout after send). + */ +export class AccountingProviderError extends Error { + constructor( + message: string, + readonly ambiguous = false, + readonly response?: unknown, + readonly notFound = false, + ) { + super(message); + this.name = 'AccountingProviderError'; + } +} + +/** Not offered by this software's API. */ +export class AccountingNotSupportedError extends AccountingProviderError { + constructor(what: string) { + super(`${what} در API این نرم‌افزار وجود ندارد`); + this.name = 'AccountingNotSupportedError'; + } +} + +// ── shared helpers ───────────────────────────────────────────────────── + +const PERSIAN_DIGITS = '۰۱۲۳۴۵۶۷۸۹'; +const ARABIC_DIGITS = '٠١٢٣٤٥٦٧٨٩'; + +export function asciiDigits(v: string) { + return v + .replace(/[۰-۹]/g, (d) => String(PERSIAN_DIGITS.indexOf(d))) + .replace(/[٠-٩]/g, (d) => String(ARABIC_DIGITS.indexOf(d))); +} + +/** + * `9121234567`, `09121234567`, `+989121234567`, `00989121234567`, Persian + * digits → `09121234567`. Anything that is not an Iranian mobile → null. + */ +export function normalizeMobile(v: unknown): string | null { + if (v === null || v === undefined) return null; + let d = asciiDigits(String(v)).replace(/\D/g, ''); + if (d.startsWith('0098')) d = d.slice(4); + else if (d.startsWith('98') && d.length === 12) d = d.slice(2); + if (d.length === 10 && d.startsWith('9')) d = `0${d}`; + return /^09\d{9}$/.test(d) ? d : null; +} + +/** A Prisma.Decimal from a value the software sent, or null for "null"/blank/NaN. */ +export function dec(v: unknown): Prisma.Decimal | null { + if (v === null || v === undefined) return null; + const s = asciiDigits(String(v)).replace(/,/g, '').trim(); + if (s === '' || s.toLowerCase() === 'null' || s.toLowerCase() === 'nan') return null; + try { + const d = new Prisma.Decimal(s); + return d.isFinite() ? d : null; + } catch { + return null; + } +} + +export const ZERO = new Prisma.Decimal(0); + +export function str(v: unknown): string | null { + if (v === null || v === undefined) return null; + const s = String(v).trim(); + return s === '' || s.toLowerCase() === 'null' ? null : s; +} + +/** Split a full name into first/last the way the app's DB trigger does. */ +export function splitName(full: string): { firstName: string; lastName: string } { + const parts = full.trim().split(/\s+/).filter(Boolean); + if (parts.length <= 1) return { firstName: parts[0] ?? '', lastName: '' }; + return { firstName: parts[0], lastName: parts.slice(1).join(' ') }; +} diff --git a/apps/api/src/modules/accounting-sync/providers/index.ts b/apps/api/src/modules/accounting-sync/providers/index.ts new file mode 100644 index 0000000..b496fc9 --- /dev/null +++ b/apps/api/src/modules/accounting-sync/providers/index.ts @@ -0,0 +1,18 @@ +import { AccountingProvider, ProviderName } from './accounting-provider'; +import { tahesabProvider } from './tahesab.provider'; +import { zarrinProvider } from './zarrin.provider'; + +/** + * Every accounting software, keyed by the admin switch's value. A new one is a + * driver file plus one line here — the same shape as the SMS drivers (D26). + */ +export const ACCOUNTING_PROVIDERS: Readonly> = { + tahesab: tahesabProvider, + zarrin: zarrinProvider, +}; + +export function isProviderName(v: unknown): v is ProviderName { + return typeof v === 'string' && Object.prototype.hasOwnProperty.call(ACCOUNTING_PROVIDERS, v); +} + +export * from './accounting-provider'; diff --git a/apps/api/src/modules/accounting-sync/providers/tahesab.provider.spec.ts b/apps/api/src/modules/accounting-sync/providers/tahesab.provider.spec.ts new file mode 100644 index 0000000..2aca68d --- /dev/null +++ b/apps/api/src/modules/accounting-sync/providers/tahesab.provider.spec.ts @@ -0,0 +1,298 @@ +import { Prisma } from '@prisma/client'; +import { httpRequest } from '../accounting-http'; +import { AccountingProviderError, OrderDocumentInput, ProviderSettings } from './accounting-provider'; +import { karatWithWage, tahesabProvider as t } from './tahesab.provider'; + +jest.mock('../accounting-http', () => ({ + ...jest.requireActual('../accounting-http'), + httpRequest: jest.fn(), +})); +const http = httpRequest as jest.MockedFunction; + +const s: ProviderSettings = { baseUrl: 'https://tahesab.local:8081/', token: 'TOK', caCert: null, timeoutMs: 5000, dbName: 'TahesabDB' }; + +const reply = (status: number, body: unknown) => + Promise.resolve({ status, body: typeof body === 'string' ? body : JSON.stringify(body) }); + +/** The body of the n-th request, parsed. */ +const sent = (n = 0) => JSON.parse(http.mock.calls[n][0].body as string); + +beforeEach(() => http.mockReset()); + +describe('wire format', () => { + it('posts {"Method": [args]} to the root with the bearer token and DBname', async () => { + http.mockReturnValueOnce(reply(200, [{ Name: 'بنکدار', GID: 2 }])); + const groups = await t.listCustomerGroups(s); + const req = http.mock.calls[0][0]; + expect(req.method).toBe('POST'); + expect(req.url).toBe('https://tahesab.local:8081/'); + expect(req.headers).toMatchObject({ Authorization: 'Bearer TOK', DBname: 'TahesabDB' }); + expect(sent()).toEqual({ DoListGorooh: [] }); + // GID 0 (accounts in no group) is offered too. + expect(groups).toEqual([ + { id: '2', name: 'بنکدار' }, + { id: '0', name: 'بدون گروه (GID 0)' }, + ]); + }); + + it('turns {"ERROR": …} into a provider error, flagging "not found"', async () => { + http.mockReturnValueOnce(reply(404, { ERROR: 'هیچ رکوردی یافت نشد.', Command: 'POST', SSL: '1' })); + await expect(t.updateCustomer(s, '5', { firstName: 'a', lastName: 'b', fullName: 'a b', mobile: '09120000000', phone: null, address: null, nationalCode: null, group: { id: null, name: null } })).rejects.toMatchObject({ + notFound: true, + response: { ERROR: 'هیچ رکوردی یافت نشد.' }, + }); + }); + + it('reports a timeout after the request went out as ambiguous', async () => { + const { AccountingHttpError } = jest.requireActual('../accounting-http'); + http.mockRejectedValueOnce(new AccountingHttpError('timeout', true, 'TIMEOUT')); + await expect(t.listCustomerGroups(s)).rejects.toMatchObject({ ambiguous: true }); + }); +}); + +describe('customers', () => { + it('pages through code windows and stops after empty ones', async () => { + http.mockReturnValueOnce( + reply(200, { + '1': { Code: 1, Name: 'masoud', GID: '2', GoroupName: 'بنکدار', Mobile: '9121234567', CodeMelli: '', Address: 'آدرس' }, + }), + ); + const page1 = await t.listCustomers(s, null); + expect(sent()).toEqual({ Dolistmoshtari: [1, 500] }); + expect(page1.items[0]).toMatchObject({ code: '1', mobile: '09121234567', groupId: '2', nationalCode: null }); + expect(page1.next).toBe('501:0'); + + http.mockReturnValue(reply(404, { ERROR: 'هیچ رکوردی یافت نشد.' })); + let cursor: string | null = page1.next; + let calls = 0; + while (cursor) { + cursor = (await t.listCustomers(s, cursor)).next; + calls += 1; + } + expect(calls).toBe(4); + }); + + it('looks a mobile up in both stored forms and keeps exact matches only', async () => { + http + .mockReturnValueOnce(reply(200, { '1': { Code: 1, Name: 'a', Mobile: '9121234567' }, '790': { Code: 790, Name: 'b', Mobile: '9121234567' } })) + .mockReturnValueOnce(reply(404, { ERROR: 'هیچ رکوردی یافت نشد.' })); + const found = await t.findCustomersByMobile(s, '09121234567'); + expect(sent(0)).toEqual({ DoListMoshtari: [9121234567] }); + expect(sent(1)).toEqual({ DoListMoshtari: ['09121234567'] }); + expect(found.map((c) => c.code)).toEqual(['1', '790']); + }); + + it('creates with an auto code and returns it', async () => { + http.mockReturnValueOnce(reply(200, { OK: 35 })); + const res = await t.createCustomer(s, { + firstName: 'علی', + lastName: 'محمدی', + fullName: 'علی محمدی', + mobile: '09121112233', + phone: null, + address: null, + nationalCode: null, + group: { id: '13', name: 'مشتري' }, + }); + expect(res.code).toBe('35'); + const args = sent().DoNewMoshtari; + expect(args[0]).toBe('علی محمدی'); + expect(args[1]).toBe('مشتري'); + expect(args[2]).toBe('09121112233'); + expect(args[8]).toBe(-1); + }); +}); + +describe('balances and statement', () => { + it('flips the sign: in Tahesab negative means the customer owes', async () => { + http.mockReturnValueOnce( + reply(200, { MandeHesab: [{ Code: '1', MandeyeMali: '-238999230', MandeyeVazni: '-177.431' }, { Code: '2', MandeyeMali: '5', MandeyeVazni: '1.5' }] }), + ); + const b = await t.getBalances(s, ['1', '2', '999']); + expect(sent()).toEqual({ getmandehesabbycode: ['1', '2', '999'] }); + expect(b).toEqual([ + { code: '1', goldGrams: new Prisma.Decimal('177.431'), rial: new Prisma.Decimal('238999230') }, + { code: '2', goldGrams: new Prisma.Decimal('-1.5'), rial: new Prisma.Decimal('-5') }, + ]); + }); + + it('maps DoListAsnad rows (real test-server rows)', async () => { + http.mockReturnValueOnce( + reply(200, { + '11558': { + ID: 11558, Radif: 1, Factor_Code: '123456789123421578191111985', MCode: 1, Tarikh: '1405/07/11', Tarikh_Time: '19:47:44', + NO: 'ورود کارساخته', Sh_Factor: 228, Vazn: 1.25, No_Kar: 'testmm', Ayar: 750, Fi: 10000, Mazaneh: 'null', Count: 1, + TabdilVazn: 1.25, Mali: 100000, Sharh1: 'sharhtest', TahesabVazni: 11526.174, TahesabMali: -209358396276, + Arz: 'IRR', Jens_Felez: 0, isSanadMovaghat: false, DarsadSood: 5.5, + }, + '12261': { + ID: 12261, Radif: 1, Factor_Code: 'GBORDX', MCode: 1, Tarikh: '1405/07/12', NO: 'خروج کارساخته', Vazn: 2, + TabdilVazn: -2, Mali: 'null', TahesabVazni: 0, TahesabMali: 0, Arz: 'IRR', Jens_Felez: 0, isSanadMovaghat: true, + }, + }), + ); + const rows = await t.getStatement(s, { code: '1', from: { jy: 1405, jm: 6, jd: 1 }, to: { jy: 1405, jm: 7, jd: 13 } }); + expect(sent()).toEqual({ DoListAsnad: [-1, 1, '1405-06-01', '1405-07-13', '', 0, 'IRR'] }); + expect(rows[0]).toMatchObject({ + documentRef: '123456789123421578191111985', + accountCode: '1', + title: 'ورود کارساخته', + itemName: 'testmm', + metal: 'طلا', + temporary: false, + }); + expect(rows[0].goldIn.toString()).toBe('1.25'); + expect(rows[0].goldOut.toString()).toBe('0'); + expect(rows[0].rialIn.toString()).toBe('100000'); + expect(rows[0].goldBalance?.toString()).toBe('-11526.174'); + expect(rows[0].rialBalance?.toString()).toBe('209358396276'); + // A temporary row moves nothing yet: no balance of its own. + expect(rows[1]).toMatchObject({ documentRef: 'gbordx', temporary: true, goldBalance: null }); + expect(rows[1].goldOut.toString()).toBe('2'); + }); +}); + +describe('order documents', () => { + const doc: OrderDocumentInput = { + factorCode: 'gbordcm1abcdefghijklmnopqrstuv', + customerCode: '2', + date: new Date('2026-10-05T08:00:00Z'), + description: 'سفارش 1001 از اپ', + temporary: true, + lines: [ + { itemCode: 'انگشتر', itemName: 'انگشتر', weightGrams: new Prisma.Decimal('4.200'), count: 2, wagePercent: new Prisma.Decimal(10), flatRial: new Prisma.Decimal(0), karat: 750, description: 'line 1' }, + { itemCode: 'النگو', itemName: 'النگو', weightGrams: new Prisma.Decimal('10'), count: 1, wagePercent: new Prisma.Decimal('18.5'), flatRial: new Prisma.Decimal(500000), karat: 750, description: 'line 2' }, + ], + }; + + it('raises the karat by the making charge — the only field that moves the gold balance', () => { + expect(karatWithWage(750, new Prisma.Decimal(10)).toString()).toBe('825'); + expect(karatWithWage(750, new Prisma.Decimal('18.5')).toString()).toBe('888.75'); + }); + + it('posts one temporary exit row per line under one Factor_Code', async () => { + http.mockReturnValue(reply(200, { OK: doc.factorCode, Factor_Code: doc.factorCode })); + const progress: unknown[] = []; + const res = await t.postOrderDocument(s, doc, {}, async (p) => { + progress.push(p); + }); + + const r1 = sent(0).DoNewSanadVKHKar; + const r2 = sent(1).DoNewSanadVKHKar; + expect(r1).toHaveLength(27); + expect(r1[0]).toBe(0); // temporary + expect(r1[1]).toBe(2); // Moshtari_Code + expect([r1[3], r2[3]]).toEqual([1, 2]); // Radif_Number + expect([r1[4], r1[5], r1[6]]).toEqual([1405, 7, 13]); + expect(r1[7]).toBe(4.2); // physical weight + expect(r1[8]).toBe(825); // karat with the charge + expect(r1[9]).toBe(2); + expect(r1[10]).toBe('انگشتر'); + expect(r1[11]).toBe(1); // exit + expect(r1[16]).toBe(0); // Darsad_Talayee never double-counts + expect(r2[13]).toBe(500000); // stones in MablaghKol + expect(r2[20]).toBe(0); // not PoolSang + expect(r1[22]).toBe(doc.factorCode); + expect(r1[24]).toBe(1); // MultiRadif + expect(progress).toEqual([{ doneLines: 1 }, { doneLines: 2 }]); + expect(res.ref).toBe(doc.factorCode); + }); + + it('resumes after the last confirmed line', async () => { + http.mockReturnValue(reply(200, { OK: doc.factorCode, Factor_Code: doc.factorCode })); + await t.postOrderDocument(s, doc, { doneLines: 1 }, async () => undefined); + expect(http).toHaveBeenCalledTimes(1); + expect(sent(0).DoNewSanadVKHKar[3]).toBe(2); + }); + + it('treats a duplicate-row rejection as "already there", which makes a retry safe', async () => { + http + .mockReturnValueOnce( + reply(400, { + ERROR: + "[EUniError] The statement has been terminated.\r\nCannot insert duplicate key row in object 'dbo.hesab_detail' with unique index 'UX_hesab_detail_UniqRowID'.", + }), + ) + .mockReturnValueOnce(reply(200, { OK: doc.factorCode, Factor_Code: doc.factorCode })); + const res = await t.postOrderDocument(s, doc, {}, async () => undefined); + expect(res.progress).toEqual({ doneLines: 2 }); + }); + + it('does not swallow other errors', async () => { + http.mockReturnValueOnce(reply(400, { ERROR: 'کد حساب نامعتبر است' })); + await expect(t.postOrderDocument(s, doc, {}, async () => undefined)).rejects.toBeInstanceOf(AccountingProviderError); + }); + + it('inquires and deletes by Factor_Code', async () => { + http.mockReturnValueOnce(reply(200, { Found: doc.factorCode })).mockReturnValueOnce(reply(404, { ERROR: 'Not_Found' })); + expect(await t.documentExists(s, { factorCode: doc.factorCode, ref: null })).toBe(true); + expect(await t.documentExists(s, { factorCode: 'x', ref: null })).toBe(false); + + http.mockReturnValueOnce(reply(404, { ERROR: 'سند یافت نشد.' })); + expect((await t.deleteDocument(s, { factorCode: 'x', ref: null, customerCode: '2' })).response).toEqual({ alreadyDeleted: true }); + }); +}); + +describe('items', () => { + it('skips item names that lost their encoding and reads stock per name', async () => { + http.mockReturnValueOnce(reply(200, [{ Name: 'انگشتر', Ayar: 750 }, { Name: '???????0.400????' }])); + const items = await t.listKarSakhte(s); + expect(items.map((i) => i.name)).toEqual(['انگشتر']); + + http.mockReturnValueOnce(reply(200, { Name: 'انگشتر', VaznMojood: 12.5, TedadMojood: 3, MaxAyar: 750 })); + const stock = await t.getKarSakhteStock(s, { code: 'انگشتر', name: 'انگشتر' }); + expect(sent(1)).toEqual({ GetMojoodiKarSakhte: ['انگشتر', 0] }); + expect(stock.weight?.toString()).toBe('12.5'); + expect(stock.count?.toString()).toBe('3'); + }); + + it('cannot create items through the API', async () => { + await expect(t.createKarSakhte(s, { name: 'x', groupId: null, typeId: null })).rejects.toThrow('وجود ندارد'); + }); +}); + +describe('change feed (real-time sync)', () => { + const row = (ID: number, MCode: number, extra: Record = {}) => ({ + ID, + MCode, + NO: 'فروش طلا', + No_Kar: 'null', + ZamanEdit: null, + ...extra, + }); + const feed = (rows: ReturnType[]) => reply(200, Object.fromEntries(rows.map((r) => [String(r.ID), r]))); + + it('the first poll only returns the starting cursor', async () => { + http.mockReturnValueOnce(feed([row(10, 1), row(11, 2)])); + expect(await t.getChanges(s, null)).toEqual({ cursor: '11|', accountCodes: [], itemNames: [], overflow: false }); + expect(sent()).toEqual({ DoListUpdatedAsnad: [200] }); + }); + + it('later polls report the accounts and کارساخته of new documents only', async () => { + http.mockReturnValueOnce( + feed([row(11, 2), row(12, 7), row(13, 7), row(14, 9, { NO: 'خروج کارساخته', No_Kar: 'انگشتر' })]), + ); + const r = await t.getChanges(s, '11|'); + expect(r.accountCodes.sort()).toEqual(['7', '9']); + expect(r.itemNames).toEqual(['انگشتر']); + expect(r.cursor).toBe('14|'); + expect(r.overflow).toBe(false); + }); + + it('sees an edit of an old document through ZamanEdit', async () => { + http.mockReturnValueOnce(feed([row(11, 2, { ZamanEdit: '1405/07/12 18:00:00' }), row(12, 3)])); + const r = await t.getChanges(s, '12|1405/07/12 17:00:00'); + expect(r.accountCodes).toEqual(['2']); + }); + + it('says overflow when every row of the window is new', async () => { + const rows = Array.from({ length: 200 }, (_, i) => row(100 + i, i)); + http.mockReturnValueOnce(feed(rows)); + expect((await t.getChanges(s, '50|')).overflow).toBe(true); + }); + + it('reports nothing when nothing changed', async () => { + http.mockReturnValueOnce(feed([row(11, 2), row(12, 3)])); + expect(await t.getChanges(s, '12|')).toMatchObject({ accountCodes: [], itemNames: [], overflow: false }); + }); +}); diff --git a/apps/api/src/modules/accounting-sync/providers/tahesab.provider.ts b/apps/api/src/modules/accounting-sync/providers/tahesab.provider.ts new file mode 100644 index 0000000..208a11f --- /dev/null +++ b/apps/api/src/modules/accounting-sync/providers/tahesab.provider.ts @@ -0,0 +1,511 @@ +import { Prisma } from '@prisma/client'; +import { AccountingHttpError, httpRequest, parseLooseJson } from '../accounting-http'; +import { formatJalali, toJalali } from '../jalali'; +import { + AccountingNotSupportedError, + AccountingProvider, + AccountingProviderError, + ExternalCustomer, + ProviderSettings, + StatementRow, + ZERO, + dec, + normalizeMobile, + str, +} from './accounting-provider'; + +/** + * Tahesab (ته‌حساب) — https://tahesab.ir/APiDoc/ (OpenAPI 3.1, API 10.1405.x). + * + * Wire format, confirmed against the public test server on 2026-10-05: + * POST / body {"": [args by position]} + * headers Authorization: Bearer , DBname: TahesabDB (SQL Server) | DB (Access) + * The server dispatches on the body key; the path in the docs is cosmetic. + * Errors come back as {"ERROR": "..."} with HTTP 400/404. + * + * Behaviour measured on the test server (plan §9), which this driver relies on: + * * Balance sign: an exit (خروج) LOWERS MandeyeVazni — negative = the + * customer owes, as henza_server's `* -1` assumed. Flipped here. + * * A temporary (موقت) document does not move the balance until the + * accountant finalises it. + * * The gold a document moves is Vazn × Ayar / 750. Darsad_Talayee and + * Ojrat are stored but do NOT move the balance, so the making charge is sent + * as a raised Ayar (750 at 10% → 825); Vazn stays the physical weight. + * * PoolSang does not move the rial balance; MablaghKol does. + * * Factor_Code is stored lowercased; re-sending a row with the same + * Factor_Code + Radif_Number is rejected as a duplicate key — which is what + * makes a retry safe. + */ + +const CUSTOMER_PAGE = 500; +/** Consecutive empty code windows before the account list is considered done. */ +const EMPTY_WINDOWS_TO_STOP = 4; +const MAX_CUSTOMER_CODE = 2_000_000; +const BALANCE_CHUNK = 100; +const RECENT_DOCUMENTS = 1000; +const CHANGE_WINDOW = 200; + +function baseUrl(s: ProviderSettings) { + return s.baseUrl.replace(/\/+$/, ''); +} + +function headers(s: ProviderSettings) { + return { + Authorization: `Bearer ${s.token}`, + DBname: s.dbName || 'TahesabDB', + 'Content-Type': 'application/json', + Accept: 'application/json', + }; +} + +function isNotFoundMessage(msg: string) { + return /یافت نشد|Not_Found|not found/i.test(msg); +} + +async function call(s: ProviderSettings, method: string, args: unknown[]): Promise { + let res; + try { + res = await httpRequest({ + method: 'POST', + url: `${baseUrl(s)}/`, + headers: headers(s), + body: JSON.stringify({ [method]: args }), + timeoutMs: s.timeoutMs, + ca: s.caCert, + }); + } catch (err) { + if (err instanceof AccountingHttpError) { + throw new AccountingProviderError(`ته‌حساب (${method}): ${err.message}`, err.ambiguous); + } + throw err; + } + + let json: unknown; + try { + json = parseLooseJson(res.body); + } catch { + throw new AccountingProviderError( + `ته‌حساب (${method}): پاسخ نامعتبر (HTTP ${res.status})`, + res.status >= 200 && res.status < 300, + res.body.slice(0, 500), + ); + } + + const error = json && typeof json === 'object' && !Array.isArray(json) ? (json as { ERROR?: unknown }).ERROR : undefined; + if (error !== undefined || res.status < 200 || res.status >= 300) { + const msg = typeof error === 'string' ? error : `HTTP ${res.status}`; + throw new AccountingProviderError( + `ته‌حساب (${method}): ${msg.split('\r\n')[0]}`, + false, + trimDiagnostics(json), + res.status === 404 || isNotFoundMessage(msg), + ); + } + return json; +} + +/** Tahesab error bodies carry ~30 diagnostic fields; keep only the message. */ +function trimDiagnostics(json: unknown) { + if (json && typeof json === 'object' && 'ERROR' in (json as object)) { + return { ERROR: (json as { ERROR: unknown }).ERROR }; + } + return json; +} + +/** A method that answers "nothing found" with an ERROR, as an empty result. */ +async function callList(s: ProviderSettings, method: string, args: unknown[]) { + try { + return await call(s, method, args); + } catch (err) { + if (err instanceof AccountingProviderError && err.notFound) return null; + throw err; + } +} + +/** Tahesab keys row objects by id: {"1": {...}, "2": {...}}. */ +function rowsOf(json: unknown): Record[] { + if (!json) return []; + if (Array.isArray(json)) return json as Record[]; + if (typeof json === 'object') { + return Object.values(json as Record).filter( + (v): v is Record => !!v && typeof v === 'object', + ); + } + return []; +} + +function toCustomer(r: Record): ExternalCustomer { + return { + code: String(r.Code), + name: str(r.Name) ?? '', + mobile: normalizeMobile(r.Mobile), + phone: null, + nationalCode: str(r.CodeMelli), + address: str(r.Address), + groupId: str(r.GID), + groupName: str(r.GoroupName), + }; +} + +const neg = (d: Prisma.Decimal | null) => (d ? d.negated() : null); + +const METALS: Record = { '0': 'طلا', '1': 'پلاتین', '2': 'نقره' }; + +/** + * Rounds the raised karat to 3 decimals, which is what the desktop app keeps. + * 750 × (1 + 10/100) = 825. + */ +export function karatWithWage(karat: number, wagePercent: Prisma.Decimal) { + return new Prisma.Decimal(karat).mul(new Prisma.Decimal(1).add(wagePercent.div(100))).toDecimalPlaces(3); +} + +export const tahesabProvider: AccountingProvider = { + name: 'tahesab', + label: 'ته‌حساب', + capabilities: { createKarSakhte: false, documentInquiry: true, movementScope: 'recent-documents', changeFeed: true }, + + async health(s) { + const path = baseUrl(s).startsWith('https:') ? 'CheckHealth-SSL' : 'CheckHealth-No-SSL'; + let info: Record = {}; + try { + const res = await httpRequest({ + method: 'GET', + url: `${baseUrl(s)}/${path}`, + headers: headers(s), + timeoutMs: s.timeoutMs, + ca: s.caCert, + }); + const json = parseLooseJson(res.body) as Record; + info = { + status: json.Status, + api: json.Api_Status, + db: json.DB_Status, + version: json.TahesabVersion, + dbType: json.DBType, + dbName: json.DBName, + }; + } catch (err) { + if (err instanceof AccountingHttpError) throw new AccountingProviderError(`ته‌حساب: ${err.message}`); + throw new AccountingProviderError('ته‌حساب: پاسخ CheckHealth نامعتبر است'); + } + // CheckHealth ignores the token and DBname; a real call proves both. + const groups = rowsOf(await call(s, 'DoListGorooh', [])); + return { ...info, customerGroups: groups.length }; + }, + + async listCustomerGroups(s) { + const groups = rowsOf(await call(s, 'DoListGorooh', [])).map((g) => ({ + id: String(g.GID), + name: str(g.Name) ?? String(g.GID), + })); + // Accounts outside every defined group carry GID 0 (seen on the test + // server as «مشتري»); offer it so it can be picked for import. + if (!groups.some((g) => g.id === '0')) groups.push({ id: '0', name: 'بدون گروه (GID 0)' }); + return groups; + }, + + async listCustomers(s, cursor) { + let [start, empty] = (cursor ?? '1:0').split(':').map(Number); + if (!Number.isFinite(start) || start < 1) start = 1; + if (!Number.isFinite(empty)) empty = 0; + + const json = await callList(s, 'Dolistmoshtari', [start, start + CUSTOMER_PAGE - 1]); + const items = rowsOf(json).map(toCustomer); + empty = items.length === 0 ? empty + 1 : 0; + const nextStart = start + CUSTOMER_PAGE; + const done = empty >= EMPTY_WINDOWS_TO_STOP || nextStart > MAX_CUSTOMER_CODE; + return { items, next: done ? null : `${nextStart}:${empty}` }; + }, + + async findCustomersByMobile(s, mobile) { + const target = normalizeMobile(mobile); + if (!target) return []; + // The account's Mobile is free text: some rows hold 9121234567, others + // 09121234567, and the lookup matches the stored form. Ask both ways. + const found = new Map(); + for (const form of [Number(target.slice(1)), target]) { + for (const r of rowsOf(await callList(s, 'DoListMoshtari', [form]))) { + const c = toCustomer(r); + if (c.mobile === target) found.set(c.code, c); + } + } + return [...found.values()]; + }, + + async createCustomer(s, p) { + const json = (await call(s, 'DoNewMoshtari', [ + p.fullName, + p.group.name ?? '', + p.mobile, + p.address ?? '', + p.nationalCode ?? '', + '', + '', + '-1', + -1, // Moshtari_Code -1: Tahesab assigns the code + 0, // Jens_Felez: gold + ])) as { OK?: unknown }; + if (json?.OK === undefined || json.OK === null) { + throw new AccountingProviderError('ته‌حساب: کد حساب جدید برنگشت', false, json); + } + return { code: String(json.OK), response: json }; + }, + + async updateCustomer(s, code, p) { + // "-1" leaves a field unchanged (DoEditMoshtari example in the docs). + const json = await call(s, 'DoEditMoshtari', [ + p.fullName, + p.group.name ?? '-1', + p.mobile, + p.address ?? '-1', + p.nationalCode ?? '-1', + '-1', + '-1', + '-1', + Number(code), + ]); + return { response: json }; + }, + + async getBalances(s, codes) { + const out = []; + for (let i = 0; i < codes.length; i += BALANCE_CHUNK) { + const chunk = codes.slice(i, i + BALANCE_CHUNK); + // Unknown codes are simply left out of MandeHesab. + const json = (await callList(s, 'getmandehesabbycode', chunk)) as { MandeHesab?: unknown } | null; + for (const r of rowsOf(json?.MandeHesab)) { + out.push({ + code: String(r.Code), + goldGrams: (dec(r.MandeyeVazni) ?? ZERO).negated(), + rial: (dec(r.MandeyeMali) ?? ZERO).negated(), + }); + } + } + return out; + }, + + async getChanges(s, cursor) { + // DoListUpdatedAsnad lists the newest documents by registration/edit time. + // Cursor "maxId|latestEdit": a row is news when its ID is higher, or it + // carries a later ZamanEdit. Nothing older than the window is visible, so + // a window with no already-seen row means "too many changes: refresh all". + const rows = rowsOf(await callList(s, 'DoListUpdatedAsnad', [CHANGE_WINDOW])); + let maxId = 0; + let latestEdit = ''; + for (const r of rows) { + maxId = Math.max(maxId, Number(r.ID) || 0); + const edited = String(r.ZamanEdit ?? ''); + if (edited && edited !== 'null' && edited > latestEdit) latestEdit = edited; + } + const next = `${maxId}|${latestEdit}`; + if (cursor === null) return { cursor: next, accountCodes: [], itemNames: [], overflow: false }; + + const [seenId, seenEdit] = [Number(cursor.split('|')[0]) || 0, cursor.split('|')[1] ?? '']; + const fresh = rows.filter((r) => { + const edited = String(r.ZamanEdit ?? ''); + return (Number(r.ID) || 0) > seenId || (!!edited && edited !== 'null' && edited > seenEdit); + }); + const accounts = new Set(); + const items = new Set(); + for (const r of fresh) { + const code = str(r.MCode); + if (code) accounts.add(code); + const kar = str(r.No_Kar); + if (kar && /کار/.test(String(r.NO ?? ''))) items.add(kar); + } + return { + cursor: next, + accountCodes: [...accounts], + itemNames: [...items], + overflow: rows.length >= CHANGE_WINDOW && fresh.length === rows.length, + }; + }, + + async getStatement(s, q) { + // Count_Last = -1 asks for the running balance on every row. + const json = await callList(s, 'DoListAsnad', [ + -1, + Number(q.code), + formatJalali(q.from), + formatJalali(q.to), + '', + 0, + 'IRR', + ]); + return rowsOf(json).map((r) => toStatementRow(r)); + }, + + async listKarSakhteGroups() { + return []; + }, + + async listKarSakhteTypes() { + return []; + }, + + async listKarSakhte(s) { + // Only items that already have a document appear here (Tahesab has no + // item master in its API). Names that arrive as "????" lost their + // encoding upstream and cannot be matched back; they are skipped. + return rowsOf(await callList(s, 'DoListNameKarsakhte', [])) + .map((r) => str(r.Name)) + .filter((name): name is string => !!name && !name.includes('??')) + .map((name) => ({ + code: name, + name, + groupId: null, + groupName: null, + typeId: null, + typeName: null, + saleWagePercent: null, + stockWeight: null, + stockCount: null, + })); + }, + + async getKarSakhteStock(s, item) { + const json = (await callList(s, 'GetMojoodiKarSakhte', [item.name, 0])) as Record | null; + return { weight: dec(json?.VaznMojood), count: dec(json?.TedadMojood) }; + }, + + async getKarSakhteMovement(s, from, to) { + // Tahesab cannot list documents across all accounts by date; the closest + // is the most recent N documents, filtered here. + const lo = formatJalali(from, '/'); + const hi = formatJalali(to, '/'); + return rowsOf(await callList(s, 'DoListUpdatedAsnad', [RECENT_DOCUMENTS])) + .filter((r) => /کار/.test(String(r.NO ?? ''))) + .filter((r) => { + const d = String(r.Tarikh ?? ''); + return d >= lo && d <= hi; + }) + .map((r) => ({ + itemCode: str(r.No_Kar), + itemName: str(r.No_Kar) ?? '—', + date: String(r.Tarikh ?? ''), + description: [str(r.NO), str(r.Sharh1)].filter(Boolean).join(' — ') || null, + weight: dec(r.Vazn), + amount: dec(r.Mali), + count: dec(r.Count), + })); + }, + + async createKarSakhte() { + throw new AccountingNotSupportedError('ساخت کارساخته'); + }, + + async postOrderDocument(s, doc, progress, onProgress) { + const d = toJalali(doc.date); + const multi = doc.lines.length > 1 ? 1 : -1; + let done = progress.doneLines ?? 0; + let last: unknown = null; + + for (let i = done; i < doc.lines.length; i += 1) { + const line = doc.lines[i]; + const args = [ + doc.temporary ? 0 : 1, // Sabte_Kol_Or_Movaghat: 0 = temporary + Number(doc.customerCode), + -1, // Factor_Number: assigned by Tahesab + i + 1, // Radif_Number + d.jy, + d.jm, + d.jd, + Number(line.weightGrams.toFixed(3)), + Number(karatWithWage(line.karat, line.wagePercent).toString()), + line.count, + line.itemName, + 1, // IsVoroodOrKhorooj: 1 = exit (goods to the customer) + 1, // OjratTedadiOrGerami: per gram + Number(line.flatRial.toFixed(0)), // MablaghKol — the only rial field that moves the balance + 0, + 0, + 0, // Darsad_Talayee: the charge is already in Ayar; never count it twice + 0, + '', + 0, + 0, // PoolSang: does not move the balance; the stones are in MablaghKol + line.description, + doc.factorCode, + -1, + multi, + 0, + 0, + ]; + try { + last = await call(s, 'DoNewSanadVKHKar', args); + } catch (err) { + // The row is already there (an earlier attempt landed but its reply + // was lost): Factor_Code + Radif_Number is a unique key in Tahesab. + if (!(err instanceof AccountingProviderError && /duplicate key/i.test(err.message + JSON.stringify(err.response ?? '')))) { + throw err; + } + last = { duplicate: true }; + } + done = i + 1; + await onProgress({ doneLines: done }); + } + + const ref = String((last as { Factor_Code?: unknown })?.Factor_Code ?? doc.factorCode).toLowerCase(); + return { ref, progress: { doneLines: done }, response: last }; + }, + + async documentExists(s, doc) { + try { + await call(s, 'DoNewSanadInquiry', [doc.factorCode]); + return true; + } catch (err) { + if (err instanceof AccountingProviderError && err.notFound) return false; + // A multi-row document answers {"ERROR":"Duplicate"}: found, more than + // one row under the code (seen on the test server). + if (err instanceof AccountingProviderError && /:\s*Duplicate$/i.test(err.message)) return true; + throw err; + } + }, + + async deleteDocument(s, doc) { + try { + return { response: await call(s, 'DoDeleteSanad', [doc.factorCode]) }; + } catch (err) { + // Already gone — the goal is reached. + if (err instanceof AccountingProviderError && err.notFound) return { response: { alreadyDeleted: true } }; + throw err; + } + }, +}; + +function toStatementRow(r: Record): StatementRow { + const metal = String(r.Jens_Felez ?? '0'); + const temporary = r.isSanadMovaghat === true; + const isGold = metal === '0'; + const isRial = !r.Arz || String(r.Arz).toUpperCase() === 'IRR'; + // Positive TabdilVazn / Mali = in the customer's favour (they gave us gold + // or money); negative = they took goods or money from us. + const tabdil = isGold ? dec(r.TabdilVazn) ?? ZERO : ZERO; + const mali = isRial ? dec(r.Mali) ?? ZERO : ZERO; + return { + key: `${r.ID}-${r.Radif ?? 1}`, + documentRef: String(r.Factor_Code ?? r.ID).toLowerCase(), + accountCode: String(r.MCode ?? ''), + documentNo: String(r.Sh_Factor ?? ''), + date: String(r.Tarikh ?? ''), + time: str(r.Tarikh_Time), + title: str(r.NO) ?? '', + description: [str(r.Sharh1), str(r.Sharh2), str(r.Baabat)].filter(Boolean).join(' — ') || null, + itemName: str(r.No_Kar), + weight: dec(r.Vazn), + karat: dec(r.Ayar)?.toNumber() ?? null, + count: dec(r.Count), + unitPrice: dec(r.Fi) ?? dec(r.Mazaneh), + wagePercent: dec(r.DarsadSood), + goldIn: tabdil.gt(0) ? tabdil : ZERO, + goldOut: tabdil.lt(0) ? tabdil.negated() : ZERO, + rialIn: mali.gt(0) ? mali : ZERO, + rialOut: mali.lt(0) ? mali.negated() : ZERO, + // A temporary row reports TahesabVazni/Mali = 0 because it moves nothing + // yet; null lets the report carry the previous balance forward instead. + goldBalance: temporary ? null : neg(dec(r.TahesabVazni)), + rialBalance: temporary ? null : neg(dec(r.TahesabMali)), + metal: METALS[metal] ?? metal, + temporary, + }; +} diff --git a/apps/api/src/modules/accounting-sync/providers/zarrin.provider.spec.ts b/apps/api/src/modules/accounting-sync/providers/zarrin.provider.spec.ts new file mode 100644 index 0000000..794b569 --- /dev/null +++ b/apps/api/src/modules/accounting-sync/providers/zarrin.provider.spec.ts @@ -0,0 +1,215 @@ +import { Prisma } from '@prisma/client'; +import { httpRequest } from '../accounting-http'; +import { OrderDocumentInput, ProviderSettings } from './accounting-provider'; +import { __zarrinInternals, zarrinProvider as z } from './zarrin.provider'; + +jest.mock('../accounting-http', () => ({ + ...jest.requireActual('../accounting-http'), + httpRequest: jest.fn(), +})); +const http = httpRequest as jest.MockedFunction; + +const s: ProviderSettings = { + baseUrl: 'http://zarrin.local:8000/ZarrinService/accounting', + token: 'SECRET', + caCert: null, + timeoutMs: 5000, + balanceOwesWhen: 'negative', +}; + +const reply = (body: unknown, status = 200) => + Promise.resolve({ status, body: typeof body === 'string' ? body : JSON.stringify(body) }); + +const url = (n = 0) => new URL(http.mock.calls[n][0].url); + +beforeEach(() => http.mockReset()); + +describe('wire format', () => { + it('sends GET ?kind=…&token=… with the parameters, and nothing blank', async () => { + http.mockReturnValueOnce(reply({ state: true, msg: 'OK', data: [{ id: '4', name: 'مشتری (خریدار)' }] })); + const groups = await z.listCustomerGroups(s); + const u = url(); + expect(http.mock.calls[0][0].method).toBe('GET'); + expect(u.pathname).toBe('/ZarrinService/accounting'); + expect(u.searchParams.get('kind')).toBe('listGorooheHesabha'); + expect(u.searchParams.get('token')).toBe('SECRET'); + expect(groups).toEqual([{ id: '4', name: 'مشتری (خریدار)' }]); + }); + + it('unwraps the JSON-in-a-string replies the documentation shows', async () => { + const inner = JSON.stringify({ state: true, msg: 'حساب با موفقیت ایجاد شد', id: 132 }); + http.mockReturnValueOnce(reply(JSON.stringify(inner))); + const res = await z.createCustomer(s, { + firstName: 'تست', + lastName: 'تست', + fullName: 'تست تست', + mobile: '09121112233', + phone: null, + address: null, + nationalCode: null, + group: { id: '4', name: 'مشتری' }, + }); + expect(res.code).toBe('132'); + expect(url().searchParams.get('fkNoe')).toBe('4'); + expect(url().searchParams.has('telephone')).toBe(false); + }); + + it('turns state:false into an error carrying the message', async () => { + http.mockReturnValueOnce(reply({ state: false, msg: 'دسترسی مجاز نیست' })); + await expect(z.listCustomerGroups(s)).rejects.toThrow('دسترسی مجاز نیست'); + }); + + it('lists the different envelopes Zarrin uses', () => { + const { listOf, fullJalali } = __zarrinInternals; + expect(listOf({ data: [1] })).toEqual([1]); + expect(listOf({ date: [2] })).toEqual([2]); // Get100Account's typo + expect(listOf([3])).toEqual([3]); + expect(listOf({ id: '84', nam: 'x' })).toEqual([{ id: '84', nam: 'x' }]); + expect(fullJalali('04/05/29')).toBe('1404/05/29'); + }); +}); + +describe('customers', () => { + it('pages with Get100Account and fills groups from listhesabha', async () => { + const page = Array.from({ length: 100 }, (_, i) => ({ code: 81 + i, name: 'n', namKhanevadegi: `f${i}`, mobile: i === 0 ? '09121112233' : '' })); + http + .mockReturnValueOnce(reply({ state: true, msg: '', date: page })) + .mockReturnValueOnce(reply({ data: [{ id: '81', nam: 'حسین اصغری', gorooh: 'مشتری (خریدار)', tell: '021', mobile: '09121112233', codeMeli: '' }] })); + const res = await z.listCustomers(s, null); + expect(url(0).searchParams.get('id')).toBe('0'); + expect(url(1).searchParams.get('az')).toBe('81'); + expect(url(1).searchParams.get('ta')).toBe('180'); + expect(res.items[0]).toMatchObject({ code: '81', name: 'حسین اصغری', mobile: '09121112233', groupName: 'مشتری (خریدار)', phone: '021' }); + expect(res.next).toBe('181'); + }); + + it('keeps the account in its group on edit', async () => { + http.mockReturnValueOnce(reply({ state: true, msg: 'ویرایش اطلاعات با موفقیت انجام شد' })); + await z.updateCustomer(s, '101', { + firstName: 'حسین', + lastName: 'اصغری', + fullName: 'حسین اصغری', + mobile: '09121427233', + phone: null, + address: 'خیابان مولوی', + nationalCode: null, + group: { id: null, name: 'واسطه' }, + }); + expect(url().searchParams.get('nameG')).toBe('واسطه'); + expect(url().searchParams.get('id')).toBe('101'); + }); +}); + +describe('balances and statement', () => { + it('applies the configured sign', async () => { + http.mockReturnValue(reply({ state: true, msg: 'OK', data: [{ id: '108', name: 'x', geram: '-75.409', pool: '-3.211960271E9' }, { id: '9', geram: '1', pool: '1' }] })); + const neg = await z.getBalances(s, ['108', '5']); + expect(neg).toHaveLength(1); + expect(neg[0].goldGrams.toString()).toBe('75.409'); + expect(neg[0].rial.toString()).toBe('3211960271'); + const pos = await z.getBalances({ ...s, balanceOwesWhen: 'positive' }, ['108', '9']); + expect(pos[0].goldGrams.toString()).toBe('-75.409'); + }); + + it('folds a running balance from «مانده از قبل»', async () => { + http.mockReturnValueOnce( + reply({ + state: true, + detail: 'OK', + data: [ + { idRadif: '0', idFactor: '0', idHesab: '81', sharh: 'مانده از قبل', vaznTarazooPardakht: '10.0', vaznTarazooDaryaft: '0.0', poolPardakht: '0', poolDaryaft: '0' }, + { idRadif: '470', idFactor: '221', idHesab: '81', noeRadif: 'چک', tarikh: '04/05/29', vaznTarazooPardakht: '0.0', vaznTarazooDaryaft: '2.5', poolPardakht: '810000000', poolDaryaft: '0', ayar: '0' }, + ], + }), + ); + const rows = await z.getStatement(s, { code: '81', from: { jy: 1404, jm: 5, jd: 1 }, to: { jy: 1404, jm: 5, jd: 31 } }); + expect(url().searchParams.get('dateAz')).toBe('2025-07-23'); + expect(rows[0].goldBalance?.toString()).toBe('10'); + expect(rows[1]).toMatchObject({ documentRef: '221', date: '1404/05/29', title: 'چک' }); + expect(rows[1].goldBalance?.toString()).toBe('7.5'); + expect(rows[1].rialBalance?.toString()).toBe('810000000'); + }); +}); + +describe('order documents', () => { + const line = (code: string, wage: number) => ({ + itemCode: code, + itemName: code, + weightGrams: new Prisma.Decimal('10'), + count: 1, + wagePercent: new Prisma.Decimal(wage), + flatRial: new Prisma.Decimal(0), + karat: 750, + description: 'd', + }); + const doc: OrderDocumentInput = { + factorCode: 'gbordx00000000000000000', + customerCode: '81', + date: new Date(), + description: 'سفارش', + temporary: true, + lines: [line('19', 12), line('20', 8)], + }; + + it('opens the invoice with the account, appends with the invoice id, in bonak mode', async () => { + http.mockReturnValueOnce(reply({ state: true, msg: 'OK', data: { idFactor: 117764 } })).mockReturnValueOnce(reply({ state: true, msg: 'OK', data: { idFactor: 117764 } })); + const progress: unknown[] = []; + const res = await z.postOrderDocument(s, doc, {}, async (p) => { + progress.push(p); + }); + const a = url(0).searchParams; + const b = url(1).searchParams; + expect(a.get('kind')).toBe('foroushSakhte'); + expect(a.get('idHesab')).toBe('81'); + expect(a.has('idFactor')).toBe(false); + expect(a.get('idSakhte')).toBe('19'); + expect(a.get('darsad')).toBe('12'); + expect(a.get('vazn')).toBe('10.000'); + expect(a.get('pd')).toBe('-1'); + expect(a.get('bonak')).toBe('1'); + expect(a.get('movaghat')).toBe('1'); + expect(b.get('idFactor')).toBe('117764'); + expect(b.has('idHesab')).toBe(false); + expect(b.get('movaghat')).toBe('1'); // temporary, as the owner ruled + expect(progress).toEqual([ + { factorId: '117764', doneLines: 1 }, + { factorId: '117764', doneLines: 2 }, + ]); + expect(res.ref).toBe('117764'); + }); + + it('resumes into the same invoice', async () => { + http.mockReturnValueOnce(reply({ state: true, data: { idFactor: 5 } })); + await z.postOrderDocument(s, doc, { factorId: '5', doneLines: 1 }, async () => undefined); + expect(http).toHaveBeenCalledTimes(1); + expect(url().searchParams.get('idFactor')).toBe('5'); + expect(url().searchParams.get('idSakhte')).toBe('20'); + }); + + it('finds the row to delete in the ledger, since foroushSakhte never returned it', async () => { + http + .mockReturnValueOnce(reply({ state: true, data: [{ idRadif: '0', idFactor: '0' }, { idRadif: '731', idFactor: '390' }] })) + .mockReturnValueOnce(reply({ state: true, msg: 'حذف با موفقیت انجام شد :)' })); + await z.deleteDocument(s, { factorCode: 'x', ref: '390', customerCode: '81' }); + expect(url(1).searchParams.get('kind')).toBe('hazfRadifSanad'); + expect(url(1).searchParams.get('pkRadifSanad')).toBe('731'); + expect(url(1).searchParams.get('kol')).toBe('1'); + }); +}); + +describe('change feed (real-time sync)', () => { + it('reads the newest journal rows and reports accounts above the cursor', async () => { + http.mockReturnValueOnce( + reply({ state: true, data: [{ idRadif: '731', idHesab: '118' }, { idRadif: '733', idHesab: '40' }, { idRadif: '734', idHesab: '40' }] }), + ); + const r = await z.getChanges(s, '731'); + expect(url().searchParams.get('kind')).toBe('parLastTenRadif'); + expect(url().searchParams.has('idHesab')).toBe(false); + expect(r).toMatchObject({ cursor: '734', accountCodes: ['40'], overflow: false }); + }); + + it('first poll only returns the cursor', async () => { + http.mockReturnValueOnce(reply({ state: true, data: [{ idRadif: '731', idHesab: '118' }] })); + expect(await z.getChanges(s, null)).toEqual({ cursor: '731', accountCodes: [], itemNames: [], overflow: false }); + }); +}); diff --git a/apps/api/src/modules/accounting-sync/providers/zarrin.provider.ts b/apps/api/src/modules/accounting-sync/providers/zarrin.provider.ts new file mode 100644 index 0000000..cd3d4a6 --- /dev/null +++ b/apps/api/src/modules/accounting-sync/providers/zarrin.provider.ts @@ -0,0 +1,466 @@ +import { Prisma } from '@prisma/client'; +import { AccountingHttpError, httpRequest, parseLooseJson } from '../accounting-http'; +import { jalaliToIsoDate, toIsoDateTehran } from '../jalali'; +import { + AccountingProvider, + AccountingProviderError, + ExternalCustomer, + ProviderSettings, + StatementRow, + ZERO, + dec, + normalizeMobile, + splitName, + str, +} from './accounting-provider'; + +/** + * Zarrin (زرین) — https://zarrin.ir/api-docs/ (the page renders + * /wp-content/themes/Hirad/data/api.json, 82 entries). + * + * Wire format: GET ?kind=&token=&, where is + * the installation's `http://host:8000/ZarrinService/accounting`. The token + * travels in the query string, so a URL built here must never be logged. + * + * NOT verified against a live installation — the owner has none to test on + * (plan, decision 11). Everything below follows the documentation and its + * sample outputs, and is covered by unit tests built from those samples. The + * open points (balance sign, which rial field the stones belong in) are + * configurable or flagged, and the integration is to be switched on for real + * only after a trial period on temporary documents. + * + * Differences from Tahesab that shape the sync: + * * No idempotency key on foroushSakhte. A timed-out document call cannot be + * retried blindly — the worker parks it as NEEDS_REVIEW. + * * foroushSakhte does not return the row id needed to delete a document; + * deleteDocument looks it up from the account's ledger (parvande). + * * کارساخته can be created (addFelezsakhteModel) but never edited. + */ + +const STATEMENT_PAGE = 250; +const CHANGE_WINDOW = 50; +const MAX_STATEMENT_PAGES = 20; + +function endpoint(s: ProviderSettings) { + return s.baseUrl.trim(); +} + +async function call( + s: ProviderSettings, + kind: string, + params: Record = {}, +): Promise | unknown[]> { + let url: URL; + try { + url = new URL(endpoint(s)); + } catch { + throw new AccountingProviderError('زرین: آدرس سرور نامعتبر است'); + } + url.searchParams.set('kind', kind); + url.searchParams.set('token', s.token); + for (const [k, v] of Object.entries(params)) { + if (v !== null && v !== undefined && v !== '') url.searchParams.set(k, String(v)); + } + + let res; + try { + res = await httpRequest({ method: 'GET', url: url.toString(), timeoutMs: s.timeoutMs, ca: s.caCert }); + } catch (err) { + if (err instanceof AccountingHttpError) { + throw new AccountingProviderError(`زرین (${kind}): ${err.message}`, err.ambiguous); + } + throw err; + } + + if (res.status < 200 || res.status >= 300) { + throw new AccountingProviderError(`زرین (${kind}): HTTP ${res.status}`, false, res.body.slice(0, 500), res.status === 404); + } + + let json: unknown; + try { + json = parseLooseJson(res.body); + // The documented outputs are JSON-encoded strings of JSON ("{\"state\":…}"). + if (typeof json === 'string' && /^\s*[{[]/.test(json)) json = parseLooseJson(json); + } catch { + throw new AccountingProviderError(`زرین (${kind}): پاسخ نامعتبر`, true, res.body.slice(0, 500)); + } + if (!json || typeof json !== 'object') { + throw new AccountingProviderError(`زرین (${kind}): پاسخ نامعتبر`, true, json); + } + + const o = json as Record; + if (o.state === false || o.status === false) { + const msg = str(o.msg) ?? str(o.detail) ?? str(o.message) ?? 'خطای نامشخص'; + throw new AccountingProviderError(`زرین (${kind}): ${msg}`, false, json, /یافت نشد|موجود نیست/.test(msg)); + } + return json as Record | unknown[]; +} + +/** Zarrin wraps lists as `data`, once as `date` (Get100Account), or not at all. */ +function listOf(json: unknown): Record[] { + if (Array.isArray(json)) return json as Record[]; + if (json && typeof json === 'object') { + const o = json as Record; + for (const key of ['data', 'date', 'mande']) { + if (Array.isArray(o[key])) return o[key] as Record[]; + } + if ('id' in o || 'code' in o) return [o]; + } + return []; +} + +function dataOf(json: unknown): Record { + const o = (json ?? {}) as Record; + const d = o.data; + if (d && typeof d === 'object' && !Array.isArray(d)) return d as Record; + return o; +} + +function joinName(first: unknown, last: unknown) { + return [str(first), str(last)].filter(Boolean).join(' ').trim(); +} + +/** Zarrin prints dates as yy/mm/dd of the 1400s: "04/05/29" → "1404/05/29". */ +function fullJalali(v: unknown): string { + const s = str(v) ?? ''; + const m = s.match(/^(\d{2})\/(\d{1,2})\/(\d{1,2})$/); + if (!m) return s; + return `14${m[1]}/${m[2].padStart(2, '0')}/${m[3].padStart(2, '0')}`; +} + +function signed(s: ProviderSettings, v: Prisma.Decimal) { + // Until checked on a real installation (plan §9) the sign is a setting. + return (s.balanceOwesWhen ?? 'negative') === 'negative' ? v.negated() : v; +} + +export const zarrinProvider: AccountingProvider = { + name: 'zarrin', + label: 'زرین', + capabilities: { createKarSakhte: true, documentInquiry: false, movementScope: 'all', changeFeed: true }, + + async health(s) { + const v = (await call(s, 'version')) as Record; + // `version` may not check the token; a group listing does. + const groups = listOf(await call(s, 'listGorooheHesabha')); + return { version: v.version, message: v.message, customerGroups: groups.length }; + }, + + async listCustomerGroups(s) { + return listOf(await call(s, 'listGorooheHesabha')).map((g) => ({ + id: String(g.id), + name: str(g.name) ?? String(g.id), + })); + }, + + async listCustomers(s, cursor) { + const from = Number(cursor ?? 0) || 0; + // Get100Account pages by code (100 accounts from `id` on) but carries no + // group or address; listhesabha over the same code span fills those in. + const page = listOf(await call(s, 'Get100Account', { id: from })); + if (page.length === 0) return { items: [], next: null }; + + const codes = page.map((r) => Number(r.code)).filter(Number.isFinite); + const lo = Math.min(...codes); + const hi = Math.max(...codes); + const details = new Map>(); + for (const r of listOf(await call(s, 'listhesabha', { az: lo, ta: hi }))) details.set(String(r.id), r); + + const items: ExternalCustomer[] = page.map((r) => { + const code = String(r.code); + const d = details.get(code) ?? {}; + return { + code, + name: str(d.nam) ?? joinName(r.name, r.namKhanevadegi), + mobile: normalizeMobile(d.mobile ?? r.mobile), + phone: str(d.tell), + nationalCode: str(d.codeMeli), + address: str(d.address), + groupId: null, + groupName: str(d.gorooh), + }; + }); + const next = page.length < 100 ? null : String(hi + 1); + return { items, next }; + }, + + async findCustomersByMobile(s, mobile) { + const target = normalizeMobile(mobile); + if (!target) return []; + let rows: Record[]; + try { + rows = listOf(await call(s, 'getinfoByPhone', { number: target })); + } catch (err) { + if (err instanceof AccountingProviderError && err.notFound) return []; + throw err; + } + return rows + .filter((r) => r.code !== undefined && normalizeMobile(r.mobile) === target) + .map((r) => ({ + code: String(r.code), + name: joinName(r.nam, r.namKhanevadegi), + mobile: target, + phone: str(r.tel), + nationalCode: null, + address: str(r.address), + groupId: null, + groupName: null, + })); + }, + + async createCustomer(s, p) { + const json = (await call(s, 'addAccount', { + firstName: p.firstName || p.fullName, + lastName: p.lastName || '-', + fkNoe: p.group.id, + mobile: p.mobile, + telephone: p.phone, + address: p.address, + codeMelli: p.nationalCode, + })) as Record; + const id = json.id ?? dataOf(json).id; + if (id === undefined || id === null) throw new AccountingProviderError('زرین: کد حساب جدید برنگشت', false, json); + return { code: String(id), response: json }; + }, + + async updateCustomer(s, code, p) { + const json = await call(s, 'edithesab', { + id: code, + name: p.firstName || p.fullName, + family: p.lastName, + mobile: p.mobile, + tel: p.phone, + address: p.address, + codeMeli: p.nationalCode, + // Without nameG Zarrin moves the account into its customers group, so the + // current group is always sent back. + nameG: p.group.name, + }); + return { response: json }; + }, + + async getBalances(s, codes) { + if (codes.length === 0) return []; + const wanted = new Set(codes); + const rows = + codes.length === 1 + ? listOf(await call(s, 'listMandeHesabha', { id: codes[0], isRial: 0 })) + : listOf(await call(s, 'listMandeHesabha', { isRial: 0 })); + return rows + .filter((r) => wanted.has(String(r.id))) + .map((r) => ({ + code: String(r.id), + goldGrams: signed(s, dec(r.geram) ?? ZERO), + rial: signed(s, dec(r.pool) ?? ZERO), + })); + }, + + async getChanges(s, cursor) { + // parLastTenRadif without an account is the newest rows of the whole + // journal; each row names its account (idHesab) and has an ascending idRadif. + // Not yet seen on a real install (ACC-01). + const rows = listOf(await call(s, 'parLastTenRadif', { limit: CHANGE_WINDOW })); + let maxId = 0; + for (const r of rows) maxId = Math.max(maxId, Number(r.idRadif) || 0); + if (cursor === null) return { cursor: String(maxId), accountCodes: [], itemNames: [], overflow: false }; + const seen = Number(cursor) || 0; + const fresh = rows.filter((r) => (Number(r.idRadif) || 0) > seen); + const accounts = new Set(); + for (const r of fresh) { + const code = str(r.idHesab); + if (code) accounts.add(code); + } + return { + cursor: String(Math.max(maxId, seen)), + accountCodes: [...accounts], + itemNames: [], + overflow: rows.length >= CHANGE_WINDOW && fresh.length === rows.length, + }; + }, + + async getStatement(s, q) { + const rows: Record[] = []; + for (let page = 1; page <= MAX_STATEMENT_PAGES; page += 1) { + const batch = listOf( + await call(s, 'parvande', { + id: q.code, + dateAz: jalaliToIsoDate(q.from), + dateTa: jalaliToIsoDate(q.to), + pageNum: page, + detailCount: STATEMENT_PAGE, + }), + ); + rows.push(...batch); + if (batch.length < STATEMENT_PAGE) break; + } + + // parvande has no running balance; it opens with «مانده از قبل» and the + // balance is folded from there. پرداخت = we gave = the customer owes more. + let gold = ZERO; + let rial = ZERO; + return rows.map((r): StatementRow => { + const goldIn = dec(r.vaznTarazooDaryaft) ?? ZERO; + const goldOut = dec(r.vaznTarazooPardakht) ?? ZERO; + const rialIn = dec(r.poolDaryaft) ?? ZERO; + const rialOut = dec(r.poolPardakht) ?? ZERO; + gold = gold.add(goldOut).sub(goldIn); + rial = rial.add(rialOut).sub(rialIn); + const factor = str(r.idFactor); + return { + key: String(r.idRadif ?? ''), + documentRef: factor && factor !== '0' ? factor : '', + accountCode: String(r.idHesab ?? q.code), + documentNo: factor && factor !== '0' ? factor : '', + date: fullJalali(r.tarikh), + time: null, + title: str(r.noeRadif) ?? str(r.noeFactor) ?? str(r.sharh) ?? '', + description: str(r.sharh), + itemName: str(r.namFelez), + weight: dec(r.vaznDaryaft)?.gt(0) ? dec(r.vaznDaryaft) : dec(r.vaznPardakht), + karat: dec(r.ayar)?.toNumber() || null, + count: null, + unitPrice: null, + wagePercent: null, + goldIn, + goldOut, + rialIn, + rialOut, + goldBalance: gold, + rialBalance: rial, + metal: null, + temporary: false, + }; + }); + }, + + async listKarSakhteGroups(s) { + return listOf(await call(s, 'goroohSakhte')).map((g) => ({ id: String(g.id), name: str(g.name) ?? String(g.id) })); + }, + + async listKarSakhteTypes(s) { + const types = new Map(); + for (const r of listOf(await call(s, 'listKarSakhte'))) { + if (r.fkNoe !== undefined) types.set(String(r.fkNoe), str(r.NoeName) ?? String(r.fkNoe)); + } + return [...types].map(([id, name]) => ({ id, name })); + }, + + async listKarSakhte(s) { + return listOf(await call(s, 'listKarSakhte')) + .filter((r) => r.id !== undefined && str(r.namFelezsakhthe)) + .map((r) => ({ + code: String(r.id), + name: str(r.namFelezsakhthe) as string, + // listKarSakhte carries the item's type (گرمی/تعدادی…) but not its + // group (النگو/انگشتر…); category stays the app's call (D27). + groupId: null, + groupName: null, + typeId: str(r.fkNoe), + typeName: str(r.NoeName), + saleWagePercent: dec(r.darsadForoosh), + stockWeight: dec(r.vazn), + stockCount: dec(r.tedad), + })); + }, + + async getKarSakhteStock(s, item) { + const d = dataOf(await call(s, 'mojoodiKala', { id: item.code, dateTa: toIsoDateTehran(new Date()) })); + const qty = dec(d.mojoodi); + const byWeight = /گرم/.test(String(d.noeName ?? 'گرمی')); + return { weight: byWeight ? qty : null, count: byWeight ? null : qty }; + }, + + async getKarSakhteMovement(s, from, to) { + return listOf(await call(s, 'infogardeshsakhte', { az: jalaliToIsoDate(from), ta: jalaliToIsoDate(to) })).map( + (r) => ({ + itemCode: str(r.code_kar), + itemName: str(r.nam_kar) ?? '—', + date: str(r.tarikh_akharin_gardesh) ?? '', + description: str(r.sharh_akharin_gardesh), + weight: dec(r.vazn_akharin_gardesh), + amount: dec(r.mablagh_akharin_gardesh), + count: null, + }), + ); + }, + + async createKarSakhte(s, item) { + const json = (await call(s, 'addFelezsakhteModel', { + nameKar: item.name, + noeKar: item.typeId, + gorooheKar: item.groupId, + })) as Record; + const id = json.idKar ?? dataOf(json).idKar; + if (id === undefined || id === null) throw new AccountingProviderError('زرین: کد کارساخته‌ی جدید برنگشت', false, json); + return { code: String(id), response: json }; + }, + + async postOrderDocument(s, doc, progress, onProgress) { + let factorId = progress.factorId; + let done = progress.doneLines ?? 0; + let last: unknown = null; + + for (let i = done; i < doc.lines.length; i += 1) { + const line = doc.lines[i]; + const isLast = i === doc.lines.length - 1; + last = await call(s, 'foroushSakhte', { + // The first call opens the invoice for the account; the rest append. + ...(factorId ? { idFactor: factorId } : { idHesab: doc.customerCode }), + idSakhte: line.itemCode, + // Bonak mode: mablagh is the rial charge, darsad the per-gram making charge. + mablagh: line.flatRial.toFixed(0), + sharh: line.description, + vazn: line.weightGrams.toFixed(3), + vaznSang: 0, + mablaghSang: 0, + pd: -1, // پرداخت: goods leave to the customer + darsad: line.wagePercent.toString(), + // The invoice has to stay open while lines are still to come; the last + // line closes it unless the document is to stay temporary (D27: it is). + movaghat: doc.temporary || !isLast ? 1 : 0, + bonak: 1, + }); + const id = (dataOf(last).idFactor ?? (last as Record).idFactor) as unknown; + if (!factorId) { + if (id === undefined || id === null) throw new AccountingProviderError('زرین: شماره فاکتور برنگشت', true, last); + factorId = String(id); + } + done = i + 1; + await onProgress({ factorId, doneLines: done }); + } + + return { ref: String(factorId ?? ''), progress: { factorId, doneLines: done }, response: last }; + }, + + async documentExists() { + // No lookup by our own key exists in Zarrin's API. + return false; + }, + + async deleteDocument(s, doc) { + if (!doc.ref) throw new AccountingProviderError('زرین: شماره فاکتور سند معلوم نیست'); + // hazfRadifSanad needs a row id, which foroushSakhte never returned; find + // one in the account's ledger for the last year. + const today = new Date(); + const yearAgo = new Date(today.getTime() - 366 * 24 * 3600 * 1000); + const rows = listOf( + await call(s, 'parvande', { + id: doc.customerCode, + dateAz: toIsoDateTehran(yearAgo), + dateTa: toIsoDateTehran(today), + pageNum: 1, + detailCount: STATEMENT_PAGE, + }), + ); + const row = rows.find((r) => String(r.idFactor) === doc.ref && str(r.idRadif) && String(r.idRadif) !== '0'); + if (!row) return { response: { alreadyDeleted: true } }; + const json = await call(s, 'hazfRadifSanad', { + pkRadifSanad: String(row.idRadif), + kol: 1, + commentUser: 'لغو سفارش در اپ', + }); + return { response: json }; + }, +}; + +/** Exposed for tests. */ +export const __zarrinInternals = { listOf, fullJalali }; diff --git a/apps/api/src/modules/accounting-sync/secret-box.ts b/apps/api/src/modules/accounting-sync/secret-box.ts new file mode 100644 index 0000000..ed93abb --- /dev/null +++ b/apps/api/src/modules/accounting-sync/secret-box.ts @@ -0,0 +1,56 @@ +import { createCipheriv, createDecipheriv, createHash, randomBytes } from 'crypto'; +import { envOrNull } from '../../common/env'; + +/** + * Encrypts the accounting-software token at rest (D27). + * + * The token sits in the Setting table, so a database dump or a backup would + * otherwise hand out a live credential to the shop's books. AES-256-GCM with a + * key derived from `ACCOUNTING_SECRET_KEY`. + * + * When that variable is unset the key falls back to one derived from + * `JWT_SECRET`, with a loud warning at boot — the same "warn, don't refuse" + * trade-off D23 made — so an admin can configure the integration before ops + * add the variable. The cost: rotating JWT_SECRET then makes the stored token + * unreadable and the admin has to enter it again (the screen says so). + */ + +const PREFIX = 'enc:v1:'; + +export function secretKeySource(): 'ACCOUNTING_SECRET_KEY' | 'JWT_SECRET' | null { + if (envOrNull('ACCOUNTING_SECRET_KEY')) return 'ACCOUNTING_SECRET_KEY'; + if (envOrNull('JWT_SECRET')) return 'JWT_SECRET'; + return null; +} + +function key(): Buffer { + const material = envOrNull('ACCOUNTING_SECRET_KEY') ?? envOrNull('JWT_SECRET'); + if (!material) { + throw new Error('ACCOUNTING_SECRET_KEY تنظیم نشده است؛ ذخیره‌ی توکن حسابداری ممکن نیست.'); + } + return createHash('sha256').update(`goldbank-accounting:${material}`).digest(); +} + +export function sealSecret(plain: string): string { + const iv = randomBytes(12); + const cipher = createCipheriv('aes-256-gcm', key(), iv); + const body = Buffer.concat([cipher.update(plain, 'utf8'), cipher.final()]); + const tag = cipher.getAuthTag(); + return PREFIX + Buffer.concat([iv, tag, body]).toString('base64'); +} + +/** Null when the value cannot be decrypted (wrong key, tampered, malformed). */ +export function openSecret(sealed: string | null | undefined): string | null { + if (!sealed || !sealed.startsWith(PREFIX)) return null; + try { + const raw = Buffer.from(sealed.slice(PREFIX.length), 'base64'); + const iv = raw.subarray(0, 12); + const tag = raw.subarray(12, 28); + const body = raw.subarray(28); + const decipher = createDecipheriv('aes-256-gcm', key(), iv); + decipher.setAuthTag(tag); + return Buffer.concat([decipher.update(body), decipher.final()]).toString('utf8'); + } catch { + return null; + } +} diff --git a/apps/api/src/modules/admin-customers/admin-customers.service.ts b/apps/api/src/modules/admin-customers/admin-customers.service.ts index e92888e..322302f 100644 --- a/apps/api/src/modules/admin-customers/admin-customers.service.ts +++ b/apps/api/src/modules/admin-customers/admin-customers.service.ts @@ -6,6 +6,7 @@ import { TableService } from '../admin-table/table.service'; import type { TableQueryDto } from '../admin-table/table-query.dto'; import { faToEn } from '../customer-auth/digits'; import { SmsService } from '../sms/sms.service'; +import { AccountingHooksService } from '../accounting-sync/accounting-hooks.service'; /** * Wholesale ("عمده") customer lists — legacy views/customer/omde/*. @@ -97,6 +98,7 @@ export class AdminCustomersService { private readonly prisma: PrismaService, private readonly table: TableService, private readonly sms: SmsService, + private readonly accounting: AccountingHooksService, ) {} /** @@ -802,7 +804,16 @@ export class AdminCustomersService { patch.shopImageUrl = (data.shop_image as string) || null; } - return this.prisma.customer.update({ where: { id }, data: patch }); + // D27 — the fields the accounting account carries. A change to one of them + // is pushed to a linked account. + const contactChanged = ['fname', 'lname', 'name', 'mobile', 'national_code', 'phone', 'address'].some( + (k) => data[k] !== undefined, + ); + return this.prisma.$transaction(async (tx) => { + const updated = await tx.customer.update({ where: { id }, data: patch }); + if (contactChanged) await this.accounting.customerEdited(tx, id); + return updated; + }); } /** @@ -957,7 +968,15 @@ export class AdminCustomersService { throw new BadRequestException('مرحله‌ی تایید مشخص نشده است'); } - return this.prisma.customer.update({ where: { id }, data: { verificationStep: next } }); + return this.prisma.$transaction(async (tx) => { + const updated = await tx.customer.update({ where: { id }, data: { verificationStep: next } }); + // D27 — a verified customer gets an account in the accounting software + // (queued; searched by mobile first, so an existing account is linked). + if (next === VerificationStep.VERIFIED && c.verificationStep !== VerificationStep.VERIFIED) { + await this.accounting.customerVerified(tx, id); + } + return updated; + }); } /** Legacy `GET major/archive/{id}` — MajorCustomerController::archive. */ diff --git a/apps/api/src/modules/admin-misc/admin-misc.controller.ts b/apps/api/src/modules/admin-misc/admin-misc.controller.ts index f22f8e5..2e6a46d 100644 --- a/apps/api/src/modules/admin-misc/admin-misc.controller.ts +++ b/apps/api/src/modules/admin-misc/admin-misc.controller.ts @@ -13,6 +13,7 @@ import { AdminMiscService } from './admin-misc.service'; import { TableQueryDto } from '../admin-table/table-query.dto'; import { CurrentAdmin, RequirePermission } from '../auth/guards'; import type { AuthenticatedAdmin } from '../auth/jwt.strategy'; +import { isAccountingSettingKey } from '../accounting-sync/accounting-config'; /** * Cities, SMS, notifications, newsletter, activity log and settings — the @@ -227,7 +228,7 @@ export class AdminMiscController { // `custom.config.statics.slider`) simply by calling `const/mobile_main_slider` // directly, since the underlying Setting row is keyed the same either way. private assertNotSliderKey(key: string) { - if (key === 'mobile_main_slider') { + if (key === 'mobile_main_slider' || isAccountingSettingKey(key)) { throw new ForbiddenException('این تنظیم فقط از مسیر اختصاصی خود قابل دسترسی است'); } } diff --git a/apps/api/src/modules/admin-misc/admin-misc.service.ts b/apps/api/src/modules/admin-misc/admin-misc.service.ts index 332d753..b0a41e2 100644 --- a/apps/api/src/modules/admin-misc/admin-misc.service.ts +++ b/apps/api/src/modules/admin-misc/admin-misc.service.ts @@ -3,6 +3,7 @@ import { MessageAudience, Prisma } from '@prisma/client'; import { PrismaService } from '../../prisma/prisma.service'; import { TableService } from '../admin-table/table.service'; import type { TableQueryDto } from '../admin-table/table-query.dto'; +import { ACCOUNTING_SETTING_PREFIX } from '../accounting-sync/accounting-config'; /** * The remaining admin screens — legacy views/city, views/sms, views/notify, @@ -477,7 +478,13 @@ export class AdminMiscService { } async listConsts() { - const rows = await this.prisma.setting.findMany({ orderBy: { key: 'asc' } }); + // The accounting integration's rows (connection, encrypted token, worker + // lease) have their own `config.accounting` screen and never appear here + // (D27); the single-key routes refuse them in the controller. + const rows = await this.prisma.setting.findMany({ + where: { NOT: { key: { startsWith: ACCOUNTING_SETTING_PREFIX } } }, + orderBy: { key: 'asc' }, + }); return rows.map((r) => ({ key: r.key, value: r.value, updated_at: r.updatedAt })); } diff --git a/apps/api/src/modules/admin-orders/admin-orders.service.ts b/apps/api/src/modules/admin-orders/admin-orders.service.ts index da4d427..5dd2aef 100644 --- a/apps/api/src/modules/admin-orders/admin-orders.service.ts +++ b/apps/api/src/modules/admin-orders/admin-orders.service.ts @@ -3,6 +3,7 @@ import { OrderChannel, OrderStatus, Prisma } from '@prisma/client'; import { PrismaService } from '../../prisma/prisma.service'; import { TableService } from '../admin-table/table.service'; import type { TableQueryDto } from '../admin-table/table-query.dto'; +import { AccountingHooksService } from '../accounting-sync/accounting-hooks.service'; import { OrdersService } from '../orders/orders.service'; import type { UpdateOrderStatusDto } from './update-status.dto'; @@ -40,6 +41,7 @@ export class AdminOrdersService { private readonly prisma: PrismaService, private readonly table: TableService, private readonly orders: OrdersService, + private readonly accounting: AccountingHooksService, ) {} /** Fields the XTable filter bar and sorter may reference. */ @@ -220,11 +222,14 @@ export class AdminOrdersService { ); } - await this.prisma.$transaction([ - this.prisma.orderStatusEvent.deleteMany({ where: { orderId: id } }), - this.prisma.orderItem.deleteMany({ where: { orderId: id } }), - this.prisma.order.delete({ where: { id } }), - ]); + await this.prisma.$transaction(async (tx) => { + // D27 — a temporary document may already be in the books (the rule can + // post it at placement); withdraw it like a cancellation. + await this.accounting.orderCancelled(tx, id); + await tx.orderStatusEvent.deleteMany({ where: { orderId: id } }); + await tx.orderItem.deleteMany({ where: { orderId: id } }); + await tx.order.delete({ where: { id } }); + }); return { success: true }; } @@ -405,9 +410,12 @@ export class AdminOrdersService { where: { orderId }, orderBy: { createdAt: 'desc' }, }); - return this.prisma.order.update({ - where: { id: orderId }, - data: { status: latest?.toStatus ?? OrderStatus.PLACED }, + const rolledBackTo = latest?.toStatus ?? OrderStatus.PLACED; + return this.prisma.$transaction(async (tx) => { + const updated = await tx.order.update({ where: { id: orderId }, data: { status: rolledBackTo } }); + // D27 — rolled back below the document rule: the پیش‌فاکتور is withdrawn. + await this.accounting.orderStatusReached(tx, orderId, rolledBackTo); + return updated; }); } } diff --git a/apps/api/src/modules/admin-products/admin-products.service.ts b/apps/api/src/modules/admin-products/admin-products.service.ts index 4a5cfbd..57d0b68 100644 --- a/apps/api/src/modules/admin-products/admin-products.service.ts +++ b/apps/api/src/modules/admin-products/admin-products.service.ts @@ -3,6 +3,7 @@ import { Prisma } from '@prisma/client'; import { PrismaService } from '../../prisma/prisma.service'; import { TableService } from '../admin-table/table.service'; import type { TableQueryDto } from '../admin-table/table-query.dto'; +import { AccountingHooksService } from '../accounting-sync/accounting-hooks.service'; /** * Product administration — legacy views/apps/product/* served by @@ -24,6 +25,7 @@ export class AdminProductsService { constructor( private readonly prisma: PrismaService, private readonly table: TableService, + private readonly accounting: AccountingHooksService, ) {} private static readonly ALLOWED = [ @@ -115,6 +117,11 @@ export class AdminProductsService { : null, // legacy grid slot reads `ProductImage` ProductImage: p.images.map((i) => ({ id: i.id, image: i.url, full: i.url, url: i.url })), + // D27 — stock as last read from the accounting software (null = not + // linked / never synced). + accounting_stock: p.accountingStockAt + ? { weight: p.accountingStockWeight, count: p.accountingStockCount, at: p.accountingStockAt } + : null, images: p.images.map((i) => ({ id: i.id, url: i.url, sortOrder: i.sortOrder, role: i.role })), // The order builder's grid reads `thumb.full` and `variants_all` directly // off each row, so both travel with the list as they did in legacy. Legacy's @@ -159,8 +166,16 @@ export class AdminProductsService { }); if (!p) throw new NotFoundException('محصول یافت نشد'); + // D27 — the form locks title/code of a linked product, and offers the + // accounting software's sale making charge as the default for new variants. + const link = await this.accounting.productLink(p.id); + const snapshot = (link?.snapshot ?? {}) as { saleWagePercent?: string | null }; + return { ...this.toRow(p), + accounting: link + ? { locked: true, code: link.externalCode, origin: link.origin, sale_wage_percent: snapshot.saleWagePercent ?? null } + : null, body_html: p.description, brand_id: p.brandId, cats: p.categoryId ? [p.categoryId] : [], @@ -446,6 +461,10 @@ export class AdminProductsService { } } + // D27 — create the matching کارساخته in the accounting software (queued; + // only where the software's API can create items). + await this.accounting.productCreated(this.prisma, created.id); + return this.findOne(created.id); } @@ -454,6 +473,21 @@ export class AdminProductsService { const existing = await this.prisma.product.findUnique({ where: { id } }); if (!existing) throw new NotFoundException('محصول یافت نشد'); + // D27 — title and code of a product linked to the accounting software are + // that software's; the form shows them locked. Re-posting the same values + // is fine, changing them is not. + const link = await this.accounting.productLink(id); + if (link) { + const titleChanged = data.title !== undefined && String(data.title).trim() !== existing.title; + const codeChanged = + data.product_code !== undefined && ((data.product_code as string) || null) !== existing.productCode; + if (titleChanged || codeChanged) { + throw new BadRequestException( + 'عنوان و کد این محصول از نرم‌افزار حسابداری می‌آید؛ برای تغییر، آن را در حسابداری ویرایش کنید.', + ); + } + } + const patch: Prisma.ProductUpdateInput = {}; if (data.title !== undefined) patch.title = String(data.title); if (data.body_html !== undefined) patch.description = String(data.body_html); diff --git a/apps/api/src/modules/auth/acl.constants.ts b/apps/api/src/modules/auth/acl.constants.ts index f09825f..0b09b8d 100644 --- a/apps/api/src/modules/auth/acl.constants.ts +++ b/apps/api/src/modules/auth/acl.constants.ts @@ -32,6 +32,8 @@ export const ALL_RIDS = [ 'comment.state', 'comment.view', 'comment.view.edit', + // D27 — «اتصال حسابداری» (Tahesab / Zarrin). Not a legacy rid. + 'config.accounting', 'config.report', 'config.statics', 'config.statics.brand', diff --git a/apps/api/src/modules/catalog/catalog.service.ts b/apps/api/src/modules/catalog/catalog.service.ts index 43600cd..d0cdeca 100644 --- a/apps/api/src/modules/catalog/catalog.service.ts +++ b/apps/api/src/modules/catalog/catalog.service.ts @@ -1,13 +1,20 @@ -import { Injectable, NotFoundException } from '@nestjs/common'; +import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common'; import { PrismaService } from '../../prisma/prisma.service'; +import { AccountingHooksService } from '../accounting-sync/accounting-hooks.service'; @Injectable() export class CatalogService { - constructor(private readonly prisma: PrismaService) {} + constructor( + private readonly prisma: PrismaService, + private readonly accounting: AccountingHooksService, + ) {} - listProducts() { - return this.prisma.product.findMany({ - where: { isActive: true }, + async listProducts() { + const products = await this.prisma.product.findMany({ + // D27 — a product with no image is never shown in the app. Products now + // also arrive from the accounting software, which carries no pictures; + // they appear once an admin photographs them. + where: { isActive: true, images: { some: {} } }, include: { // Only orderable variants reach the storefront. An inactive one used to // be listed and then rejected by getVariantOrThrow at checkout, so the @@ -26,13 +33,49 @@ export class CatalogService { collections: { include: { collection: true } }, }, }); + + const out = []; + for (const p of products) { + const { accountingStockWeight, accountingStockCount, accountingStockAt, ...product } = p; + // D27 — out of stock in the accounting software: every variant reads as + // qty 0, which the apps already render as «ناموجود» and refuse to add to + // the cart unless it is a pre-order variant. The stock figures themselves + // stay server-side; this endpoint is public. + const blocked = await this.accounting.stockBlocked({ accountingStockWeight, accountingStockCount, accountingStockAt }); + out.push(blocked ? { ...product, variants: product.variants.map((v) => (v.isPreOrder ? v : { ...v, qty: 0 })) } : product); + } + return out; } async getVariantOrThrow(variantId: string) { - const variant = await this.prisma.productVariant.findUnique({ where: { id: variantId } }); + const variant = await this.prisma.productVariant.findUnique({ + where: { id: variantId }, + include: { + product: { + select: { + id: true, + accountingStockWeight: true, + accountingStockCount: true, + accountingStockAt: true, + _count: { select: { images: true } }, + }, + }, + }, + }); if (!variant || !variant.isActive) { throw new NotFoundException(`Product variant ${variantId} not found or inactive`); } - return variant; + // The same two rules the listing applies, so a stale client cannot order + // around them. + if (variant.product._count.images === 0) { + throw new BadRequestException('این محصول هنوز تصویر ندارد و قابل سفارش نیست'); + } + // Live from the accounting software at order time; on no answer the last + // stored figure decides (liveStock). + if (!variant.isPreOrder && (await this.accounting.stockBlocked(await this.accounting.liveStock(variant.product)))) { + throw new BadRequestException('این محصول در انبار موجود نیست'); + } + const { product: _product, ...plain } = variant; + return plain; } } diff --git a/apps/api/src/modules/customer-auth/customer-auth.service.ts b/apps/api/src/modules/customer-auth/customer-auth.service.ts index 0f23742..a68bc71 100644 --- a/apps/api/src/modules/customer-auth/customer-auth.service.ts +++ b/apps/api/src/modules/customer-auth/customer-auth.service.ts @@ -558,11 +558,11 @@ export class CustomerAuthService { } /** - * Hands the code to the SMS gateway (SmsService -> Trez, per Sms.php:57-82). + * Hands the code to the SMS gateway (SmsService -> the SMS_PROVIDER driver, + * relay by default per D26). * - * When no credentials are configured, SmsService does not send and the code - * is logged instead — development only; production refuses to boot without - * credentials (assertSmsConfigured in main.ts). + * When no gateway is configured, SmsService does not send and the code is + * logged instead — outside production only (D20). * * A failed send does NOT throw. The reference ignored Sms::Send's result, so * a gateway outage never blocked the flow that triggered it; the customer diff --git a/apps/api/src/modules/customer-report/customer-report.service.ts b/apps/api/src/modules/customer-report/customer-report.service.ts index 51b0b61..0924ea0 100644 --- a/apps/api/src/modules/customer-report/customer-report.service.ts +++ b/apps/api/src/modules/customer-report/customer-report.service.ts @@ -1,6 +1,9 @@ -import { Injectable } from '@nestjs/common'; +import { Injectable, Logger } from '@nestjs/common'; import { Prisma } from '@prisma/client'; import { PrismaService } from '../../prisma/prisma.service'; +import { AccountingSyncService } from '../accounting-sync/accounting-sync.service'; +import { jalaliToGregorian, parseJalali } from '../accounting-sync/jalali'; +import type { StatementRow } from '../accounting-sync/providers'; /** * "گزارش" — the customer's account statement. @@ -30,7 +33,26 @@ import { PrismaService } from '../../prisma/prisma.service'; */ @Injectable() export class CustomerReportService { - constructor(private readonly prisma: PrismaService) {} + private readonly logger = new Logger(CustomerReportService.name); + + constructor( + private readonly prisma: PrismaService, + private readonly accounting: AccountingSyncService, + ) {} + + /** + * The accounting statement, or null to fall back to the internal ledger — + * when the integration is off, the customer is not linked, or the software + * cannot be reached (the report must still open). + */ + private async accountingStatement(customerId: string) { + try { + return await this.accounting.customerStatement(customerId); + } catch (err) { + this.logger.warn(`Accounting statement unavailable for ${customerId}, using the ledger: ${(err as Error).message}`); + return null; + } + } /** The reference's page size (report/index.vue:96). */ private static readonly LIMIT = 50; @@ -51,6 +73,21 @@ export class CustomerReportService { * display (report/index.vue:191), so the app shows newest first. Same here. */ async summary(customerId: string, page = 1) { + // D27 — from the accounting software when the integration covers this + // customer, so the statement agrees with the balance they are shown. + const statement = await this.accountingStatement(customerId); + if (statement) { + const rows = statementToSummary(statement.rows).reverse(); + const start = (Math.max(1, page) - 1) * CustomerReportService.LIMIT; + return { + result: rows.slice(start, start + CustomerReportService.LIMIT), + count: rows.length, + page: Math.max(1, page), + limit: CustomerReportService.LIMIT, + source: 'accounting', + }; + } + const entries = await this.prisma.ledgerEntry.findMany({ // Only confirmed entries move a balance — the same rule the cached // Customer.goldDebtGrams / fiatDebtRial follow, so the statement's final @@ -129,6 +166,22 @@ export class CustomerReportService { * from the client beyond being a filter. */ async detail(customerId: string, entryId?: string, page = 1) { + const statement = await this.accountingStatement(customerId); + if (statement) { + // SEC-16 holds: the rows are already limited to this customer's own + // account (AccountingSyncService.customerStatement), and the id is only a + // filter over them — another customer's document id matches nothing. + let rows = statement.rows.map(statementToDetail).reverse(); + if (entryId) rows = rows.filter((r) => r.factor_Code === entryId); + const start = (Math.max(1, page) - 1) * CustomerReportService.LIMIT; + return { + result: entryId ? rows : rows.slice(start, start + CustomerReportService.LIMIT), + page: Math.max(1, page), + limit: CustomerReportService.LIMIT, + source: 'accounting', + }; + } + const where: Prisma.LedgerEntryWhereInput = { customerId, confirmed: true, @@ -215,6 +268,22 @@ export class CustomerReportService { * flip is applied and the figure matches every other screen. */ async balances(customerId: string) { + // D27 — the accounting software's balance when the integration covers + // this customer; the same figure /customer/me shows. + const accounting = await this.accounting.customerBalance(customerId); + if (accounting) { + return { + status: 200, + message: '', + source: 'accounting', + at: accounting.at, + result: [ + { arz: 'IRR', mandeh: accounting.rial.toFixed(2) }, + { arz: 'gold', mandeh: accounting.gold.toFixed(3) }, + ], + }; + } + const c = await this.prisma.customer.findUnique({ where: { id: customerId }, select: { goldDebtGrams: true, fiatDebtRial: true }, @@ -242,3 +311,82 @@ const SOURCE_LABELS: Record = { WALLET_BONUS: 'هدیه', ADJUSTMENT: 'اصلاحیه', }; + +// ── D27: accounting statement → the report's existing shape ───────────── +// +// The apps bind the reference's field names (henza_pwa/src/type/accounting.ts) +// and format `tarikh` as an ISO instant, so the accounting rows are mapped onto +// exactly what the ledger-based report already returns. + +/** `1405/07/12` + `20:20:41` → ISO in Tehran time, which the apps' jdate() reads. */ +function isoFromJalali(date: string, time: string | null): string { + const j = parseJalali(date); + if (!j) return date; + const g = jalaliToGregorian(j.jy, j.jm, j.jd); + const pad = (n: number) => String(n).padStart(2, '0'); + const t = time && /^\d{1,2}:\d{2}(:\d{2})?$/.test(time) ? (time.length === 5 ? `${time}:00` : time) : '12:00:00'; + return `${g.gy}-${pad(g.gm)}-${pad(g.gd)}T${t.padStart(8, '0')}+03:30`; +} + +const fixed = (d: Prisma.Decimal | null, places: number) => (d ?? new Prisma.Decimal(0)).toFixed(places); + +/** + * Oldest first, with a running balance on every row. The software's own + * running balance wins where it reports one; a row without one (a temporary + * Tahesab document, which moves nothing yet) carries the previous figure. + */ +function statementToSummary(rows: StatementRow[]) { + let gold = new Prisma.Decimal(0); + let rial = new Prisma.Decimal(0); + return rows.map((r, index) => { + if (r.goldBalance) gold = r.goldBalance; + else if (!r.temporary) gold = gold.add(r.goldOut).sub(r.goldIn); + if (r.rialBalance) rial = r.rialBalance; + else if (!r.temporary) rial = rial.add(r.rialOut).sub(r.rialIn); + return { + id: index + 1, + factor_Code: r.documentRef || r.key, + sh_factor: r.documentNo, + tarikh: isoFromJalali(r.date, r.time), + geram_v: fixed(r.goldIn, 3), + geram_kh: fixed(r.goldOut, 3), + rial_v: fixed(r.rialIn, 2), + rial_kh: fixed(r.rialOut, 2), + tahesab_T: gold.toFixed(3), + tahesab_P: rial.toFixed(2), + rial_V2: '0.00', + rial_Kh2: '0.00', + tahesabP2: '0.00', + sourceType: 'ACCOUNTING', + note: [r.title, r.description, r.temporary ? '(موقت — هنوز در مانده اثر ندارد)' : null].filter(Boolean).join(' — '), + }; + }); +} + +function statementToDetail(r: StatementRow) { + return { + factor_Code: r.documentRef || r.key, + sh_factor: r.documentNo, + tarikh: isoFromJalali(r.date, r.time), + vazn: fixed(r.weight, 3), + ayar: r.karat, + no: r.title, + sh_sharti: null, + name_az: null, + tabdil750_v: fixed(r.goldIn, 3), + tabdil750_kh: fixed(r.goldOut, 3), + fi: r.unitPrice ? r.unitPrice.toFixed(2) : null, + fiF: r.rialIn.gt(0) ? r.rialIn.toFixed(2) : r.rialOut.gt(0) ? r.rialOut.toFixed(2) : null, + Darsad_Talayee: r.wagePercent ? r.wagePercent.toString() : null, + accountName: null, + bankName: null, + transferTo: null, + receivedAt: null, + note: [r.description, r.temporary ? 'سند موقت' : null].filter(Boolean).join(' — ') || null, + // REP-01: the accounting software does carry these. + nO_kar: r.itemName, + jens_felez: r.metal, + Darsad: null, + maliatDarsad: null, + }; +} diff --git a/apps/api/src/modules/customers/customers.service.ts b/apps/api/src/modules/customers/customers.service.ts index f2d6586..7ab8040 100644 --- a/apps/api/src/modules/customers/customers.service.ts +++ b/apps/api/src/modules/customers/customers.service.ts @@ -1,6 +1,7 @@ import { Injectable, NotFoundException } from '@nestjs/common'; import { Prisma } from '@prisma/client'; import { PrismaService } from '../../prisma/prisma.service'; +import { AccountingSyncService } from '../accounting-sync/accounting-sync.service'; // passwordHash must never leave the API — every customer read goes through this. const PUBLIC_CUSTOMER_SELECT = { @@ -35,7 +36,10 @@ const PUBLIC_CUSTOMER_SELECT = { */ @Injectable() export class CustomersService { - constructor(private readonly prisma: PrismaService) {} + constructor( + private readonly prisma: PrismaService, + private readonly accounting: AccountingSyncService, + ) {} async getOrThrow(customerId: string) { const customer = await this.prisma.customer.findUnique({ @@ -43,7 +47,21 @@ export class CustomersService { select: PUBLIC_CUSTOMER_SELECT, }); if (!customer) throw new NotFoundException(`Customer ${customerId} not found`); - return customer; + + // D27 — with the accounting integration on, the customer sees the balance + // the accounting software holds. The apps only display these two fields; + // the credit-limit check runs server-side on the internal ledger, untouched. + const accounting = await this.accounting.customerBalance(customerId); + if (accounting) { + return { + ...customer, + goldDebtGrams: accounting.gold, + fiatDebtRial: accounting.rial, + balanceSource: 'accounting' as const, + balanceAt: accounting.at, + }; + } + return { ...customer, balanceSource: 'app' as const, balanceAt: null }; } getOrders(customerId: string) { diff --git a/apps/api/src/modules/orders/orders.service.ts b/apps/api/src/modules/orders/orders.service.ts index 19a7289..eb6b70b 100644 --- a/apps/api/src/modules/orders/orders.service.ts +++ b/apps/api/src/modules/orders/orders.service.ts @@ -3,6 +3,7 @@ import { OrderChannel, OrderStatus, Prisma } from '@prisma/client'; import { PrismaService } from '../../prisma/prisma.service'; import { CatalogService } from '../catalog/catalog.service'; import { LedgerService } from '../accounting/ledger.service'; +import { AccountingHooksService } from '../accounting-sync/accounting-hooks.service'; import { CreateOrderDto } from './dto/create-order.dto'; interface ComputedItem { @@ -23,6 +24,7 @@ export class OrdersService { private readonly prisma: PrismaService, private readonly catalog: CatalogService, private readonly ledger: LedgerService, + private readonly accounting: AccountingHooksService, ) {} /** @@ -121,6 +123,9 @@ export class OrdersService { include: { items: true, statusEvents: true }, }); + // D27 — the document rule may say «at order placement». + await this.accounting.orderStatusReached(tx, order.id, initialStatus); + return order; }); } @@ -151,6 +156,14 @@ export class OrdersService { await this.ledger.postOrderDebt(orderId, tx); } + // D27 — the accounting document (پیش‌فاکتور) follows the owner's rule on + // which status posts it, queued in this same transaction. + if (newStatus === OrderStatus.CANCELLED && order.status !== OrderStatus.CANCELLED) { + await this.accounting.orderCancelled(tx, orderId); + } else if (newStatus !== order.status) { + await this.accounting.orderStatusReached(tx, orderId, newStatus); + } + return updated; }); } diff --git a/apps/api/src/modules/sms/drivers/index.ts b/apps/api/src/modules/sms/drivers/index.ts new file mode 100644 index 0000000..2955049 --- /dev/null +++ b/apps/api/src/modules/sms/drivers/index.ts @@ -0,0 +1,17 @@ +import { relayDriver } from './relay.driver'; +import { SmsDriver } from './sms-driver'; +import { trezDriver } from './trez.driver'; + +/** + * Every SMS gateway, keyed by its `SMS_PROVIDER` value. A new provider is one + * driver file plus one line here. + */ +export const SMS_DRIVERS: Readonly> = { + [relayDriver.name]: relayDriver, + [trezDriver.name]: trezDriver, +}; + +/** Used when `SMS_PROVIDER` is unset or blank (D26). */ +export const DEFAULT_SMS_PROVIDER = relayDriver.name; + +export type { SmsDriver, SmsSendResult } from './sms-driver'; diff --git a/apps/api/src/modules/sms/drivers/relay.driver.ts b/apps/api/src/modules/sms/drivers/relay.driver.ts new file mode 100644 index 0000000..0e066f8 --- /dev/null +++ b/apps/api/src/modules/sms/drivers/relay.driver.ts @@ -0,0 +1,110 @@ +import { networkInterfaces } from 'node:os'; +import { envOr, envOrNull } from '../../../common/env'; +import { SmsDriver, postWithTimeout } from './sms-driver'; + +/** + * The owner's SMS gateway (`/api/createsms`) — a relay that serves the SMS of + * several panels and apps and forwards to the actual provider. The default + * driver since D26. + * + * Shape, from the owner's PHP client: + * * POST JSON, 15s timeout, auth header `secret_key` + * * body: { phone, host, text, platform } + * * `host` identifies the sending server: a configured value, else the + * server's own IP (`gethostbyname(gethostname())`) + * * `platform: "kave"` routes through Kavenegar; null lets the gateway pick. + * The owner wants every message through Kavenegar. + * + * The secret is in source on the owner's decision (D26): the gateway has a + * second verification factor held elsewhere. `SMS_RELAY_SECRET` overrides it. + * + * The PHP client forced IPv4 (CURLOPT_IPRESOLVE); the URL is an IP literal, so + * there is nothing to resolve and fetch needs no equivalent. + */ + +const DEFAULT_RELAY_URL = 'http://185.231.112.101/api/createsms'; +const DEFAULT_RELAY_SECRET = 'f21debfb-83ac-4624-a2f4-f08375043181'; +const DEFAULT_RELAY_PLATFORM = 'kave'; + +/** `Http::timeout(15)` in the owner's client. */ +const REQUEST_TIMEOUT_MS = 15_000; + +/** The first external IPv4 of this machine — Node's `gethostbyname(gethostname())`. */ +export function serverIpv4(): string | null { + for (const addresses of Object.values(networkInterfaces())) { + for (const a of addresses ?? []) { + if (a.family === 'IPv4' && !a.internal) return a.address; + } + } + return null; +} + +export function relayConfig() { + const platform = envOr('SMS_RELAY_PLATFORM', DEFAULT_RELAY_PLATFORM); + return { + url: envOr('SMS_RELAY_URL', DEFAULT_RELAY_URL), + secret: envOr('SMS_RELAY_SECRET', DEFAULT_RELAY_SECRET), + host: envOrNull('SMS_RELAY_HOST') ?? serverIpv4(), + // "default" sends null, so the gateway chooses the line itself. + }; +} + +/** + * The gateway's reply format is not documented, so a 2xx is trusted unless the + * body plainly says otherwise. Returns the reason, or null when the reply + * reads as accepted. + * + * A non-empty body that is not JSON counts as a failure: the gateway is a JSON + * API, and its own PHP errors arrive as bare text with HTTP 200 — seen live on + * 2026-10-05 as "cURL library is not loaded", with nothing delivered. + */ +export function relayRejection(body: string): string | null { + const text = body.trim(); + if (text === '') return null; + + let data: unknown; + try { + data = JSON.parse(text); + } catch { + return text.slice(0, 200); + } + if (!data || typeof data !== 'object' || Array.isArray(data)) return null; + + const d = data as Record; + const failedStatus = + d.status === false || + (typeof d.status === 'string' && /^(error|fail|failed|failure)$/i.test(d.status)); + const failed = failedStatus || d.success === false || d.ok === false || Boolean(d.error); + if (!failed) return null; + + if (typeof d.error === 'string' && d.error) return d.error; + if (typeof d.message === 'string' && d.message) return d.message; + return 'rejected-by-gateway'; +} + +export const relayDriver: SmsDriver = { + name: 'relay', + + missingConfig() { + // The URL and secret always have defaults; only the host can be missing, + // on a machine with no external IPv4. + return relayConfig().host ? [] : ['SMS_RELAY_HOST']; + }, + + async deliver(mobile, text) { + const c = relayConfig(); + const reply = await postWithTimeout( + c.url, + { 'Content-Type': 'application/json', secret_key: c.secret }, + JSON.stringify({ phone: mobile, host: c.host, text }), + REQUEST_TIMEOUT_MS, + ); + + if (!reply.ok) return { ok: false, response: reply.body, error: `http-${reply.status}` }; + + const rejection = relayRejection(reply.body); + if (rejection) return { ok: false, response: reply.body, error: rejection }; + + return { ok: true, response: reply.body }; + }, +}; diff --git a/apps/api/src/modules/sms/drivers/sms-driver.ts b/apps/api/src/modules/sms/drivers/sms-driver.ts new file mode 100644 index 0000000..fc53e9b --- /dev/null +++ b/apps/api/src/modules/sms/drivers/sms-driver.ts @@ -0,0 +1,55 @@ +/** + * One SMS gateway. SmsService picks a driver by `SMS_PROVIDER` and owns + * everything around the call — trimming, persistence, logging and the + * never-throw guarantee — so a driver only has to talk to its provider. + */ + +export interface SmsSendResult { + ok: boolean; + /** Provider response body, when one was received. */ + response?: string; + error?: string; +} + +export interface SmsDriver { + /** The `SMS_PROVIDER` value that selects this driver. */ + readonly name: string; + + /** Names of the env variables this driver still needs; empty when it can send. */ + missingConfig(): string[]; + + /** + * Sends one already-trimmed message. May throw on a network error or + * timeout — SmsService turns that into `{ ok: false }`. + */ + deliver(mobile: string, text: string): Promise; +} + +export interface HttpReply { + ok: boolean; + status: number; + body: string; +} + +/** POST with an abort-based timeout. Throws on network failure or timeout. */ +export async function postWithTimeout( + url: string, + headers: Record, + body: string, + timeoutMs: number, +): Promise { + const controller = new AbortController(); + const timer = setTimeout(() => controller.abort(), timeoutMs); + + try { + const response = await fetch(url, { + method: 'POST', + headers, + body, + signal: controller.signal, + }); + return { ok: response.ok, status: response.status, body: await response.text() }; + } finally { + clearTimeout(timer); + } +} diff --git a/apps/api/src/modules/sms/drivers/trez.driver.ts b/apps/api/src/modules/sms/drivers/trez.driver.ts new file mode 100644 index 0000000..69f888f --- /dev/null +++ b/apps/api/src/modules/sms/drivers/trez.driver.ts @@ -0,0 +1,66 @@ +import { envOr } from '../../../common/env'; +import { SmsDriver, postWithTimeout } from './sms-driver'; + +/** + * Trez panel — port of henza_server/app/Models/Sms.php. + * + * Reference behaviour (`Sms::Send`, `Sms.php:57-82`): + * * POST, form-urlencoded, 20s timeout + * * fields: PhoneNumber (sender line), Username, Password, Mobile, Message + * + * Credentials come from the environment. The reference hardcodes live + * production credentials in the source (SEC-12); they are not copied here. + * + * No longer the default since D26, kept selectable with `SMS_PROVIDER=trez`. + */ + +/** Reference endpoint (`Sms.php:69`). Overridable for staging. */ +export const DEFAULT_TREZ_URL = 'https://smspanel.trez.ir/SendMessageWithCode.ashx'; + +/** `Http::timeout(20)` in the reference (`Sms.php:72`). */ +const REQUEST_TIMEOUT_MS = 20_000; + +export function trezConfig() { + return { + url: envOr('SMS_TREZ_URL', DEFAULT_TREZ_URL), + username: process.env.SMS_TREZ_USERNAME ?? '', + password: process.env.SMS_TREZ_PASSWORD ?? '', + senderLine: process.env.SMS_TREZ_SENDER_LINE ?? '', + }; +} + +export const trezDriver: SmsDriver = { + name: 'trez', + + missingConfig() { + const c = trezConfig(); + return ( + [ + ['SMS_TREZ_USERNAME', c.username], + ['SMS_TREZ_PASSWORD', c.password], + ['SMS_TREZ_SENDER_LINE', c.senderLine], + ] as const + ) + .filter(([, v]) => !v) + .map(([name]) => name); + }, + + async deliver(mobile, text) { + const c = trezConfig(); + const reply = await postWithTimeout( + c.url, + { 'Content-Type': 'application/x-www-form-urlencoded' }, + new URLSearchParams({ + PhoneNumber: c.senderLine, + Username: c.username, + Password: c.password, + Mobile: mobile, + Message: text, + }).toString(), + REQUEST_TIMEOUT_MS, + ); + + if (!reply.ok) return { ok: false, response: reply.body, error: `http-${reply.status}` }; + return { ok: true, response: reply.body }; + }, +}; diff --git a/apps/api/src/modules/sms/sms.service.spec.ts b/apps/api/src/modules/sms/sms.service.spec.ts index bfbfd73..cf8d410 100644 --- a/apps/api/src/modules/sms/sms.service.spec.ts +++ b/apps/api/src/modules/sms/sms.service.spec.ts @@ -1,125 +1,308 @@ +import { NetworkInterfaceInfo, networkInterfaces } from 'node:os'; import { Logger } from '@nestjs/common'; -import { assertSmsConfigured, smsConfig, smsConfigured } from './sms.service'; +import { PrismaService } from '../../prisma/prisma.service'; +import { DEFAULT_TREZ_URL, trezConfig } from './drivers/trez.driver'; +import { relayConfig, relayRejection } from './drivers/relay.driver'; +import { + SmsService, + assertSmsConfigured, + smsConfigured, + smsProvider, +} from './sms.service'; + +const SMS_ENV = [ + 'SMS_PROVIDER', + 'SMS_RELAY_URL', + 'SMS_RELAY_SECRET', + 'SMS_RELAY_HOST', + 'SMS_RELAY_PLATFORM', + 'SMS_TREZ_URL', + 'SMS_TREZ_USERNAME', + 'SMS_TREZ_PASSWORD', + 'SMS_TREZ_SENDER_LINE', + 'NODE_ENV', +]; + +// Node's own module namespace cannot be spied on, so the lookup is mocked. +jest.mock('node:os', () => ({ ...jest.requireActual('node:os'), networkInterfaces: jest.fn() })); +const interfaces = networkInterfaces as jest.MockedFunction; + +const iface = (address: string, internal: boolean) => + ({ address, internal, family: 'IPv4' }) as NetworkInterfaceInfo; + +/** A machine with only loopback, so the relay has no host to report. */ +const noExternalIp = () => interfaces.mockReturnValue({ lo: [iface('127.0.0.1', true)] }); + +const saved = { ...process.env }; + +beforeEach(() => { + for (const key of SMS_ENV) delete process.env[key]; + jest.restoreAllMocks(); + interfaces.mockReturnValue({ eth0: [iface('10.9.9.9', false)] }); +}); + +afterAll(() => { + process.env = { ...saved }; +}); /** - * Covers the boot-time contract as REVISED by D20: - * * while no key is set, development behaviour is unchanged; + * Covers the boot-time contract as REVISED by D20 and the driver choice of D26: * * a missing key NEVER stops the boot, in any environment — it warns, and - * sending silently declines. (D14's "fail to boot in production" rule was - * removed by the owner for the delivery.) + * sending silently declines; + * * `relay` is the default provider; `trez` stays selectable. */ describe('SMS configuration', () => { - const saved = { ...process.env }; // Silence the warnings these tests deliberately provoke. const logger = { warn: jest.fn(), log: jest.fn(), error: jest.fn() } as unknown as Logger; + const warned = () => (logger.warn as jest.Mock).mock.calls.flat().join(' '); - beforeEach(() => { - for (const key of [ - 'SMS_PROVIDER', - 'SMS_TREZ_URL', - 'SMS_TREZ_USERNAME', - 'SMS_TREZ_PASSWORD', - 'SMS_TREZ_SENDER_LINE', - 'NODE_ENV', - ]) { - delete process.env[key]; - } - jest.clearAllMocks(); - }); + beforeEach(() => jest.clearAllMocks()); - afterAll(() => { - process.env = { ...saved }; - }); - - const configureFully = () => { - process.env.SMS_TREZ_USERNAME = 'u'; - process.env.SMS_TREZ_PASSWORD = 'p'; - process.env.SMS_TREZ_SENDER_LINE = '9998882797'; - }; - - describe('smsConfig', () => { - it('defaults the provider to trez and the URL to the reference endpoint', () => { - const c = smsConfig(); - expect(c.provider).toBe('trez'); - expect(c.url).toBe('https://smspanel.trez.ir/SendMessageWithCode.ashx'); + describe('provider selection (D26)', () => { + it('defaults to relay', () => { + expect(smsProvider()).toBe('relay'); }); - it('lets the URL be overridden for staging', () => { - process.env.SMS_TREZ_URL = 'https://staging.example/send'; - expect(smsConfig().url).toBe('https://staging.example/send'); + it('treats a blank SMS_PROVIDER, as docker-compose passes it, as the default', () => { + process.env.SMS_PROVIDER = ''; + expect(smsProvider()).toBe('relay'); + }); + + it('still selects trez on request', () => { + process.env.SMS_PROVIDER = 'Trez'; + expect(smsProvider()).toBe('trez'); }); }); - describe('smsConfigured', () => { - it('is false when nothing is set', () => { - expect(smsConfigured()).toBe(false); - }); - - it('is false when only some credentials are set', () => { - process.env.SMS_TREZ_USERNAME = 'u'; - process.env.SMS_TREZ_PASSWORD = 'p'; - expect(smsConfigured()).toBe(false); - }); - - it('is true once all three are set', () => { - configureFully(); + describe('relay', () => { + it('works out of the box, sending through Kavenegar', () => { + process.env.SMS_RELAY_HOST = '10.0.0.5'; + const c = relayConfig(); + expect(c.url).toBe('http://185.231.112.101/api/createsms'); + expect(c.secret).toBeTruthy(); + expect(c.platform).toBe('kave'); expect(smsConfigured()).toBe(true); }); - it('is false when the provider is explicitly disabled', () => { - configureFully(); - process.env.SMS_PROVIDER = 'none'; + it('falls back to the server IP for host, skipping loopback', () => { + interfaces.mockReturnValue({ + lo: [iface('127.0.0.1', true)], + eth0: [iface('192.168.1.20', false)], + }); + expect(relayConfig().host).toBe('192.168.1.20'); + }); + + it('lets SMS_RELAY_HOST override the server IP', () => { + process.env.SMS_RELAY_HOST = 'gold.example'; + expect(relayConfig().host).toBe('gold.example'); + }); + + it('sends platform null when SMS_RELAY_PLATFORM=default', () => { + process.env.SMS_RELAY_PLATFORM = 'default'; + expect(relayConfig().platform).toBeNull(); + }); + + it('is not configured, and warns by name, when no host can be found', () => { + noExternalIp(); expect(smsConfigured()).toBe(false); + expect(() => assertSmsConfigured(logger)).not.toThrow(); + expect(warned()).toMatch(/SMS_RELAY_HOST/); + }); + + it('passes silently once a host is known', () => { + process.env.SMS_RELAY_HOST = '10.0.0.5'; + assertSmsConfigured(logger); + expect(logger.warn).not.toHaveBeenCalled(); }); }); - /** - * D20 REVERSED the original boot contract. SMS must never stop the server - * from starting, in any environment — an earlier revision of these tests - * asserted the opposite (a throw in production) and is intentionally gone. - */ - describe('assertSmsConfigured (D20 — never throws)', () => { - it('warns outside production when keys are missing', () => { - process.env.NODE_ENV = 'development'; - expect(() => assertSmsConfigured(logger)).not.toThrow(); - expect(logger.warn).toHaveBeenCalled(); + describe('trez', () => { + beforeEach(() => { + process.env.SMS_PROVIDER = 'trez'; + }); + + const configureFully = () => { + process.env.SMS_TREZ_USERNAME = 'u'; + process.env.SMS_TREZ_PASSWORD = 'p'; + process.env.SMS_TREZ_SENDER_LINE = '9998882797'; + }; + + it('defaults the URL to the reference endpoint and lets staging override it', () => { + expect(trezConfig().url).toBe(DEFAULT_TREZ_URL); + process.env.SMS_TREZ_URL = 'https://staging.example/send'; + expect(trezConfig().url).toBe('https://staging.example/send'); + }); + + it('is configured only once all three credentials are set', () => { + expect(smsConfigured()).toBe(false); + process.env.SMS_TREZ_USERNAME = 'u'; + process.env.SMS_TREZ_PASSWORD = 'p'; + expect(smsConfigured()).toBe(false); + process.env.SMS_TREZ_SENDER_LINE = '9998882797'; + expect(smsConfigured()).toBe(true); }); it('warns in production when keys are missing, naming them, and still boots', () => { process.env.NODE_ENV = 'production'; expect(() => assertSmsConfigured(logger)).not.toThrow(); - const warned = (logger.warn as jest.Mock).mock.calls.flat().join(' '); - expect(warned).toMatch(/SMS_TREZ_USERNAME/); - expect(warned).toMatch(/SMS_TREZ_PASSWORD/); - expect(warned).toMatch(/SMS_TREZ_SENDER_LINE/); + expect(warned()).toMatch(/SMS_TREZ_USERNAME/); + expect(warned()).toMatch(/SMS_TREZ_PASSWORD/); + expect(warned()).toMatch(/SMS_TREZ_SENDER_LINE/); }); it('passes silently in production once everything is set', () => { process.env.NODE_ENV = 'production'; configureFully(); - expect(() => assertSmsConfigured(logger)).not.toThrow(); + assertSmsConfigured(logger); expect(logger.warn).not.toHaveBeenCalled(); }); + }); - it('allows SMS to be explicitly disabled in production', () => { + describe('none and unknown providers (D20 — never throws)', () => { + it('allows SMS to be explicitly disabled, in production too', () => { process.env.NODE_ENV = 'production'; process.env.SMS_PROVIDER = 'none'; + process.env.SMS_RELAY_HOST = '10.0.0.5'; + expect(smsConfigured()).toBe(false); expect(() => assertSmsConfigured(logger)).not.toThrow(); expect(logger.warn).toHaveBeenCalled(); }); - it('allows SMS to be disabled outside production', () => { - process.env.NODE_ENV = 'test'; - process.env.SMS_PROVIDER = 'none'; - expect(() => assertSmsConfigured(logger)).not.toThrow(); - }); - it('warns about an unknown provider name instead of refusing to boot', () => { process.env.SMS_PROVIDER = 'kavenegar'; + expect(smsConfigured()).toBe(false); expect(() => assertSmsConfigured(logger)).not.toThrow(); - expect((logger.warn as jest.Mock).mock.calls.flat().join(' ')).toMatch( - /Unknown SMS_PROVIDER/, - ); + expect(warned()).toMatch(/Unknown SMS_PROVIDER/); + expect(warned()).toMatch(/"relay", "trez", "none"/); + }); + }); +}); + +describe('relayRejection', () => { + it('accepts empty and neutral JSON bodies', () => { + expect(relayRejection('')).toBeNull(); + expect(relayRejection('{"status":true,"id":12}')).toBeNull(); + expect(relayRejection('{"status":"success"}')).toBeNull(); + expect(relayRejection('[1,2]')).toBeNull(); + }); + + it('rejects bodies that say they failed', () => { + expect(relayRejection('{"status":false}')).toBe('rejected-by-gateway'); + expect(relayRejection('{"success":false,"message":"bad phone"}')).toBe('bad phone'); + expect(relayRejection('{"status":"error"}')).toBe('rejected-by-gateway'); + expect(relayRejection('{"error":"invalid key"}')).toBe('invalid key'); + }); + + it('rejects a bare-text body — the gateway reports its own PHP errors that way', () => { + expect(relayRejection('cURL library is not loaded')).toBe('cURL library is not loaded'); + }); +}); + +describe('SmsService.send', () => { + const create = jest.fn(); + const service = new SmsService({ smsMessage: { create } } as unknown as PrismaService); + let fetchMock: jest.SpyInstance; + + const reply = (status: number, body: string) => + fetchMock.mockResolvedValue(new Response(body, { status })); + + beforeEach(() => { + create.mockReset().mockResolvedValue({}); + fetchMock = jest.spyOn(globalThis, 'fetch'); + // Keep the deliberate failure logs out of the test output. + jest.spyOn(Logger.prototype, 'error').mockImplementation(() => undefined); + jest.spyOn(Logger.prototype, 'warn').mockImplementation(() => undefined); + process.env.SMS_RELAY_HOST = '10.0.0.5'; + }); + + it('posts the shape of the owner PHP client to the relay', async () => { + reply(200, '{"status":true}'); + + const result = await service.send('09120000000', ' سلام '); + + expect(result).toEqual({ ok: true, response: '{"status":true}' }); + const [url, init] = fetchMock.mock.calls[0]; + expect(url).toBe('http://185.231.112.101/api/createsms'); + expect(init.method).toBe('POST'); + expect(init.headers).toEqual({ + 'Content-Type': 'application/json', + secret_key: relayConfig().secret, + }); + expect(JSON.parse(init.body)).toEqual({ + phone: '09120000000', + host: '10.0.0.5', + text: 'سلام', + platform: 'kave', + }); + expect(create).toHaveBeenCalledWith({ + data: expect.objectContaining({ recipients: '09120000000', body: 'سلام' }), + }); + }); + + it('reports an HTTP error without throwing, and still records the message', async () => { + reply(500, 'boom'); + await expect(service.send('09120000000', 'x')).resolves.toEqual({ + ok: false, + response: 'boom', + error: 'http-500', + }); + expect(create).toHaveBeenCalled(); + }); + + it('reports a 200 that the gateway marks as failed', async () => { + reply(200, '{"status":false,"message":"no credit"}'); + const result = await service.send('09120000000', 'x'); + expect(result.ok).toBe(false); + expect(result.error).toBe('no credit'); + }); + + it('turns a network failure into ok:false', async () => { + fetchMock.mockRejectedValue(new Error('ECONNREFUSED')); + await expect(service.send('09120000000', 'x')).resolves.toEqual({ + ok: false, + error: 'ECONNREFUSED', + }); + }); + + it('reports the gateway bare-text PHP error, as seen live', async () => { + reply(200, 'cURL library is not loaded'); + await expect(service.send('09120000000', 'x')).resolves.toEqual({ + ok: false, + response: 'cURL library is not loaded', + error: 'cURL library is not loaded', + }); + }); + + it('honours persist:false', async () => { + reply(200, '{}'); + await service.send('09120000000', 'x', { persist: false }); + expect(create).not.toHaveBeenCalled(); + }); + + it('sends nothing when the provider is disabled', async () => { + process.env.SMS_PROVIDER = 'none'; + const result = await service.send('09120000000', 'x'); + expect(result).toEqual({ ok: false, error: 'sms-not-configured' }); + expect(fetchMock).not.toHaveBeenCalled(); + }); + + it('still drives trez when selected', async () => { + process.env.SMS_PROVIDER = 'trez'; + process.env.SMS_TREZ_USERNAME = 'u'; + process.env.SMS_TREZ_PASSWORD = 'p'; + process.env.SMS_TREZ_SENDER_LINE = '9998882797'; + reply(200, '1'); + + await service.send('09120000000', 'x'); + + const [url, init] = fetchMock.mock.calls[0]; + expect(url).toBe(DEFAULT_TREZ_URL); + expect(Object.fromEntries(new URLSearchParams(init.body))).toEqual({ + PhoneNumber: '9998882797', + Username: 'u', + Password: 'p', + Mobile: '09120000000', + Message: 'x', }); }); }); diff --git a/apps/api/src/modules/sms/sms.service.ts b/apps/api/src/modules/sms/sms.service.ts index a233a2f..cd5bf21 100644 --- a/apps/api/src/modules/sms/sms.service.ts +++ b/apps/api/src/modules/sms/sms.service.ts @@ -2,22 +2,22 @@ import { Injectable, Logger } from '@nestjs/common'; import { MessageAudience } from '@prisma/client'; import { PrismaService } from '../../prisma/prisma.service'; import { envOr } from '../../common/env'; +import { DEFAULT_SMS_PROVIDER, SMS_DRIVERS, SmsDriver, SmsSendResult } from './drivers'; /** - * SMS delivery — port of henza_server/app/Models/Sms.php. + * SMS delivery — port of henza_server/app/Models/Sms.php, with the gateway + * pulled out into drivers (`./drivers`) selected by `SMS_PROVIDER`: + * * `relay` (default, D26) — the owner's createsms gateway + * * `trez` — the reference's Trez panel + * * `none` — send nothing * - * Reference behaviour (`Sms::Send`, `Sms.php:57-82`): - * * POST, form-urlencoded, to the Trez panel, 20s timeout - * * fields: PhoneNumber (sender line), Username, Password, Mobile, Message - * * the message is trim()ed before sending + * Reference behaviour kept for every driver: + * * the message is trim()ed before sending (`Sms.php:77`) * * EVERY message is persisted, via `Sms::set()` (`:80`) * * the response body is returned and the callers ignore it * - * Two things differ, both deliberate: - * 1. Credentials come from the environment. The reference hardcodes live - * production credentials in the source (SEC-12); they are not copied here. - * 2. The OTP message body is NOT persisted in readable form — see - * CustomerAuthService.deliver() and SEC-11. + * The OTP message body is NOT persisted in readable form — see + * CustomerAuthService.deliver() and SEC-11. * * Failure handling matches the reference: `Sms::Send` is called inline and its * result is discarded, so a failed send never aborted the order, the document @@ -25,18 +25,7 @@ import { envOr } from '../../common/env'; * never throws — it logs and reports failure in its return value. */ -/** Reference endpoint (`Sms.php:69`). Overridable for staging. */ -const DEFAULT_TREZ_URL = 'https://smspanel.trez.ir/SendMessageWithCode.ashx'; - -/** `Http::timeout(20)` in the reference (`Sms.php:72`). */ -const REQUEST_TIMEOUT_MS = 20_000; - -export interface SmsSendResult { - ok: boolean; - /** Provider response body, when one was received. */ - response?: string; - error?: string; -} +export type { SmsSendResult } from './drivers'; export interface SmsSendOptions { /** @@ -47,15 +36,14 @@ export interface SmsSendOptions { audience?: MessageAudience; } -/** Reads the provider config. Exported so main.ts can validate it at boot. */ -export function smsConfig() { - return { - provider: envOr('SMS_PROVIDER', 'trez').toLowerCase(), - url: envOr('SMS_TREZ_URL', DEFAULT_TREZ_URL), - username: process.env.SMS_TREZ_USERNAME ?? '', - password: process.env.SMS_TREZ_PASSWORD ?? '', - senderLine: process.env.SMS_TREZ_SENDER_LINE ?? '', - }; +/** The selected `SMS_PROVIDER`, lower-cased. */ +export function smsProvider(): string { + return envOr('SMS_PROVIDER', DEFAULT_SMS_PROVIDER).toLowerCase(); +} + +/** The selected driver, or null for `none` and unknown names. */ +export function smsDriver(): SmsDriver | null { + return SMS_DRIVERS[smsProvider()] ?? null; } /** @@ -63,9 +51,8 @@ export function smsConfig() { * development mode: nothing is sent, and OTP codes are logged locally. */ export function smsConfigured(): boolean { - const c = smsConfig(); - if (c.provider === 'none') return false; - return Boolean(c.username && c.password && c.senderLine); + const driver = smsDriver(); + return driver !== null && driver.missingConfig().length === 0; } /** @@ -80,35 +67,30 @@ export function smsConfigured(): boolean { * login code, which is why `OTP_MASTER_CODE` exists for the delivery. */ export function assertSmsConfigured(logger: Logger = new Logger('SmsConfig')): void { - const c = smsConfig(); + const provider = smsProvider(); - if (c.provider === 'none') { + if (provider === 'none') { logger.warn('SMS_PROVIDER=none — no SMS will be sent.'); return; } - if (c.provider !== 'trez') { + const driver = smsDriver(); + if (!driver) { + const supported = [...Object.keys(SMS_DRIVERS), 'none'].map((n) => `"${n}"`).join(', '); logger.warn( - `Unknown SMS_PROVIDER "${c.provider}" (supported: "trez", "none"). ` + - 'No SMS will be sent.', + `Unknown SMS_PROVIDER "${provider}" (supported: ${supported}). No SMS will be sent.`, ); return; } - const missing = ( - [ - ['SMS_TREZ_USERNAME', c.username], - ['SMS_TREZ_PASSWORD', c.password], - ['SMS_TREZ_SENDER_LINE', c.senderLine], - ] as const - ) - .filter(([, v]) => !v) - .map(([name]) => name); - - if (missing.length === 0) return; + const missing = driver.missingConfig(); + if (missing.length === 0) { + logger.log(`SMS provider: ${driver.name}`); + return; + } logger.warn( - `SMS provider "trez" is selected but these are not set: ${missing.join(', ')}. ` + + `SMS provider "${driver.name}" is selected but these are not set: ${missing.join(', ')}. ` + 'Messages are logged, not sent. Customers cannot receive a login code.', ); } @@ -128,14 +110,8 @@ export class SmsService { // The reference trims before sending (`Sms.php:77`). const text = body.trim(); - let result: SmsSendResult; - - if (!smsConfigured()) { - this.logger.warn(`[dev] SMS not configured; not sending to ${mobile}`); - result = { ok: false, error: 'sms-not-configured' }; - } else { - result = await this.deliverViaTrez(mobile, text); - } + console.log("mobile ==>" ,mobile) + const result = await this.deliver(mobile, text); if (persist) { // `Sms::set()` records every message, delivered or not. @@ -145,42 +121,26 @@ export class SmsService { return result; } - /** POST to the Trez panel, shaped exactly as the reference's form post. */ - private async deliverViaTrez(mobile: string, text: string): Promise { - const c = smsConfig(); - const controller = new AbortController(); - const timer = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS); - - try { - const response = await fetch(c.url, { - method: 'POST', - headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - body: new URLSearchParams({ - PhoneNumber: c.senderLine, - Username: c.username, - Password: c.password, - Mobile: mobile, - Message: text, - }).toString(), - signal: controller.signal, - }); - - const responseBody = await response.text(); - - if (!response.ok) { - // Logged, not thrown — see the class comment. - this.logger.error(`SMS to ${mobile} failed: HTTP ${response.status} ${responseBody}`); - return { ok: false, response: responseBody, error: `http-${response.status}` }; - } - - return { ok: true, response: responseBody }; - } catch (e) { - const error = e instanceof Error ? e.message : String(e); - this.logger.error(`SMS to ${mobile} failed: ${error}`); - return { ok: false, error }; - } finally { - clearTimeout(timer); + private async deliver(mobile: string, text: string): Promise { + const driver = smsDriver(); + if (!driver || driver.missingConfig().length > 0) { + this.logger.warn(`[dev] SMS not configured; not sending to ${mobile}`); + return { ok: false, error: 'sms-not-configured' }; } + + let result: SmsSendResult; + try { + result = await driver.deliver(mobile, text); + } catch (e) { + result = { ok: false, error: e instanceof Error ? e.message : String(e) }; + } + + if (!result.ok) { + // Logged, not thrown — see the class comment. + const detail = result.response ? ` ${result.response}` : ''; + this.logger.error(`SMS to ${mobile} via ${driver.name} failed: ${result.error}${detail}`); + } + return result; } /** The `messages` row the reference writes for every send (`Sms.php:120-129`). */ diff --git a/apps/user-app-v2/dist/assets/AppearanceView-ckFSThyi.js b/apps/user-app-v2/dist/assets/AppearanceView-B0bKuyHr.js similarity index 98% rename from apps/user-app-v2/dist/assets/AppearanceView-ckFSThyi.js rename to apps/user-app-v2/dist/assets/AppearanceView-B0bKuyHr.js index ad441c4..e46f0e1 100644 --- a/apps/user-app-v2/dist/assets/AppearanceView-ckFSThyi.js +++ b/apps/user-app-v2/dist/assets/AppearanceView-B0bKuyHr.js @@ -1 +1 @@ -import{d,f as i,c as _,i as r,b as e,_ as h,u as v,p as o,z as b,B as k,F as f,r as w,m as n,t as u,e as x,I as c,N as g}from"./index-BWyw3RAx.js";import{P as y}from"./PageBar-D5DXU6sO.js";const C=d({__name:"ToggleSwitch",props:{on:{type:Boolean}},setup(p){return(a,l)=>(i(),_("span",{class:r(["tsw",{"is-on":p.on}]),"aria-hidden":"true"},[...l[0]||(l[0]=[e("span",{class:"tsw__knob"},null,-1)])],2))}}),B=h(C,[["__scopeId","data-v-3f7a6b1f"]]),T={class:"ap"},S={class:"ap__section"},V={class:"ap__themes",role:"radiogroup","aria-labelledby":"ap-theme"},z=["aria-checked","onClick"],I={class:"ap__themeLabel"},L={class:"ap__check","aria-hidden":"true"},M={key:0,class:"ap__note"},N={class:"ap__section"},$=["aria-checked"],A={class:"ap__rowIcon","aria-hidden":"true"},E=d({__name:"AppearanceView",setup(p){const a=v(),l=[{value:"light",label:"روشن",icon:"vuesax-linear:sun-1"},{value:"dark",label:"تیره",icon:"vuesax-linear:moon"},{value:"system",label:"مطابق سیستم",icon:"vuesax-linear:monitor-mobbile"}];return(P,s)=>{const m=k("container");return i(),_("div",T,[o(y,{title:"تنظیمات ظاهری","back-to":"userPage::hasSubRoute"}),o(m,{class:"ap__body"},{default:b(()=>[e("section",S,[s[2]||(s[2]=e("header",{class:"ap__head"},[e("h2",{id:"ap-theme",class:"ap__title"},"پوسته برنامه"),e("p",{class:"ap__sub"},"ظاهر روشن یا تیره، یا هماهنگ با تنظیمات گوشی شما")],-1)),e("div",V,[(i(),_(f,null,w(l,t=>e("button",{key:t.value,type:"button",role:"radio",class:r(["ap__theme",{"is-on":n(a).theme===t.value}]),"aria-checked":n(a).theme===t.value,onClick:F=>n(a).setTheme(t.value)},[e("span",{class:r(["ap__preview",`ap__preview--${t.value}`]),"aria-hidden":"true"},[...s[1]||(s[1]=[e("span",{class:"ap__pvBar"},null,-1),e("span",{class:"ap__pvCard"},null,-1),e("span",{class:"ap__pvLine"},null,-1),e("span",{class:"ap__pvLine ap__pvLine--short"},null,-1),e("span",{class:"ap__pvBtn"},null,-1)])],2),e("span",I,[o(c,{icon:t.icon,size:"15"},null,8,["icon"]),g(" "+u(t.label),1)]),e("span",L,[o(c,{icon:"vuesax-linear:tick-circle",size:"18"})])],10,z)),64))]),n(a).theme==="system"?(i(),_("p",M," الان "+u(n(a).resolvedTheme==="dark"?"تیره":"روشن")+" است، مطابق تنظیمات گوشی. ",1)):x("",!0)]),e("section",N,[s[4]||(s[4]=e("header",{class:"ap__head"},[e("h2",{class:"ap__title"},"انیمیشن‌ها"),e("p",{class:"ap__sub"},"برای سرعت بیشتر روی گوشی‌های ضعیف‌تر")],-1)),e("button",{type:"button",role:"switch",class:"ap__row","aria-checked":n(a).reduceMotion,onClick:s[0]||(s[0]=t=>n(a).setReduceMotion(!n(a).reduceMotion))},[e("span",A,[o(c,{icon:"vuesax-linear:flash",size:"18"})]),s[3]||(s[3]=e("span",{class:"ap__rowText"},[e("b",null,"حالت سبک و سریع"),e("small",null," حرکت‌های سنگین، افکت‌های شیشه‌ای و اسلاید خودکار خاموش می‌شوند؛ بازخورد کوتاه لمس‌ها و جابه‌جایی‌های سریع باقی می‌مانند تا برنامه خشک و بی‌روح نشود. ")],-1)),o(B,{on:n(a).reduceMotion},null,8,["on"])],8,$)])]),_:1})])}}}),H=h(E,[["__scopeId","data-v-d05eb581"]]);export{H as default}; +import{d,f as i,c as _,i as r,b as e,_ as h,u as v,p as o,z as b,B as k,F as f,r as w,m as n,t as u,e as x,I as c,N as g}from"./index-Dp9sxvBv.js";import{P as y}from"./PageBar-El-laHqK.js";const C=d({__name:"ToggleSwitch",props:{on:{type:Boolean}},setup(p){return(a,l)=>(i(),_("span",{class:r(["tsw",{"is-on":p.on}]),"aria-hidden":"true"},[...l[0]||(l[0]=[e("span",{class:"tsw__knob"},null,-1)])],2))}}),B=h(C,[["__scopeId","data-v-3f7a6b1f"]]),T={class:"ap"},S={class:"ap__section"},V={class:"ap__themes",role:"radiogroup","aria-labelledby":"ap-theme"},z=["aria-checked","onClick"],I={class:"ap__themeLabel"},L={class:"ap__check","aria-hidden":"true"},M={key:0,class:"ap__note"},N={class:"ap__section"},$=["aria-checked"],A={class:"ap__rowIcon","aria-hidden":"true"},E=d({__name:"AppearanceView",setup(p){const a=v(),l=[{value:"light",label:"روشن",icon:"vuesax-linear:sun-1"},{value:"dark",label:"تیره",icon:"vuesax-linear:moon"},{value:"system",label:"مطابق سیستم",icon:"vuesax-linear:monitor-mobbile"}];return(P,s)=>{const m=k("container");return i(),_("div",T,[o(y,{title:"تنظیمات ظاهری","back-to":"userPage::hasSubRoute"}),o(m,{class:"ap__body"},{default:b(()=>[e("section",S,[s[2]||(s[2]=e("header",{class:"ap__head"},[e("h2",{id:"ap-theme",class:"ap__title"},"پوسته برنامه"),e("p",{class:"ap__sub"},"ظاهر روشن یا تیره، یا هماهنگ با تنظیمات گوشی شما")],-1)),e("div",V,[(i(),_(f,null,w(l,t=>e("button",{key:t.value,type:"button",role:"radio",class:r(["ap__theme",{"is-on":n(a).theme===t.value}]),"aria-checked":n(a).theme===t.value,onClick:F=>n(a).setTheme(t.value)},[e("span",{class:r(["ap__preview",`ap__preview--${t.value}`]),"aria-hidden":"true"},[...s[1]||(s[1]=[e("span",{class:"ap__pvBar"},null,-1),e("span",{class:"ap__pvCard"},null,-1),e("span",{class:"ap__pvLine"},null,-1),e("span",{class:"ap__pvLine ap__pvLine--short"},null,-1),e("span",{class:"ap__pvBtn"},null,-1)])],2),e("span",I,[o(c,{icon:t.icon,size:"15"},null,8,["icon"]),g(" "+u(t.label),1)]),e("span",L,[o(c,{icon:"vuesax-linear:tick-circle",size:"18"})])],10,z)),64))]),n(a).theme==="system"?(i(),_("p",M," الان "+u(n(a).resolvedTheme==="dark"?"تیره":"روشن")+" است، مطابق تنظیمات گوشی. ",1)):x("",!0)]),e("section",N,[s[4]||(s[4]=e("header",{class:"ap__head"},[e("h2",{class:"ap__title"},"انیمیشن‌ها"),e("p",{class:"ap__sub"},"برای سرعت بیشتر روی گوشی‌های ضعیف‌تر")],-1)),e("button",{type:"button",role:"switch",class:"ap__row","aria-checked":n(a).reduceMotion,onClick:s[0]||(s[0]=t=>n(a).setReduceMotion(!n(a).reduceMotion))},[e("span",A,[o(c,{icon:"vuesax-linear:flash",size:"18"})]),s[3]||(s[3]=e("span",{class:"ap__rowText"},[e("b",null,"حالت سبک و سریع"),e("small",null," حرکت‌های سنگین، افکت‌های شیشه‌ای و اسلاید خودکار خاموش می‌شوند؛ بازخورد کوتاه لمس‌ها و جابه‌جایی‌های سریع باقی می‌مانند تا برنامه خشک و بی‌روح نشود. ")],-1)),o(B,{on:n(a).reduceMotion},null,8,["on"])],8,$)])]),_:1})])}}}),H=h(E,[["__scopeId","data-v-d05eb581"]]);export{H as default}; diff --git a/apps/user-app-v2/dist/assets/CartView-IeY-S-nZ.css b/apps/user-app-v2/dist/assets/CartView-IeY-S-nZ.css deleted file mode 100644 index 9f74c82..0000000 --- a/apps/user-app-v2/dist/assets/CartView-IeY-S-nZ.css +++ /dev/null @@ -1 +0,0 @@ -.ci[data-v-b125dde9]{display:flex;gap:14px;padding:16px 2px;background:transparent}.ci__art[data-v-b125dde9]{flex:0 0 84px;width:84px;height:84px;display:flex;align-items:center;justify-content:center;border-radius:13px;overflow:hidden;background:#f4f5f6}.ci__art img[data-v-b125dde9]{width:90px;height:90px;-o-object-fit:contain;object-fit:contain;-o-object-position:center;object-position:center;display:block}.ci__artEmpty[data-v-b125dde9]{width:100%;height:100%;display:grid;place-items:center;color:#8a909c}.ci__main[data-v-b125dde9]{flex:1;min-width:0}.ci__title[data-v-b125dde9]{margin:0;font-size:13px;font-weight:700;color:#14161a;line-height:1.6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ci__meta[data-v-b125dde9]{display:flex;align-items:center;gap:7px;padding-top:5px}.ci__weight[data-v-b125dde9]{font-size:11.5px;font-weight:700;color:#22262e}.ci__wage[data-v-b125dde9]{font-size:10.5px;color:#8a909c;padding-inline-start:7px;border-inline-start:1px solid #ECEDEF}.ci__row[data-v-b125dde9]{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:10px}.ci__qty[data-v-b125dde9]{display:inline-flex;align-items:center;gap:4px;padding:3px;border-radius:999px;background:#f4f5f6;border:1px solid #ECEDEF}.ci__qtyBtn[data-v-b125dde9]{width:27px;height:27px;border:0;cursor:pointer;border-radius:50%;display:grid;place-items:center;color:#22262e;background:#fff;transition:transform .15s ease,color .15s ease}.ci__qtyBtn--danger[data-v-b125dde9]{color:#7a1b33}.ci__qtyBtn[data-v-b125dde9]:active{transform:scale(.9)}.ci__qtyValue[data-v-b125dde9]{min-width:22px;text-align:center;font-size:12.5px;font-weight:700;color:#14161a}.ci__note[data-v-b125dde9]{display:inline-flex;align-items:center;gap:5px;border:0;background:none;cursor:pointer;padding:0;font-family:inherit;font-size:11.5px;font-weight:700;color:#7a1b33;white-space:nowrap}.ci__noteText[data-v-b125dde9]{margin:8px 0 0;padding:8px 10px;border-radius:11px;background:#f4f5f6;font-size:11.5px;line-height:1.7;color:#5b616e}.cart[data-v-38f17b56]{background:#fff;min-height:100vh}.cart__body[data-v-38f17b56]{padding-top:76px;padding-bottom:150px}.cart__items[data-v-38f17b56]{display:flex;flex-direction:column;padding-top:8px}.cart__row+.cart__row[data-v-38f17b56]{border-top:1px solid #ECEDEF}.cart__row[data-v-38f17b56]{opacity:0;transform:translate3d(0,12px,0) scale(.98);will-change:transform,opacity}.is-revealed .cart__row[data-v-38f17b56]{opacity:1;transform:translateZ(0) scale(1);transition:opacity .62s cubic-bezier(.32,.72,0,1) var(--reveal-delay, 0ms),transform .62s cubic-bezier(.32,.72,0,1) var(--reveal-delay, 0ms)}@media (prefers-reduced-motion: reduce){.cart__row[data-v-38f17b56]{opacity:1;transform:none}.is-revealed .cart__row[data-v-38f17b56]{transition:none}}.cart__empty[data-v-38f17b56]{margin-top:8px;padding:38px 20px;border:1px dashed #ECEDEF;border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:#8a909c}.cart__empty p[data-v-38f17b56]{margin:0;font-size:12.5px}.cart__emptyCta[data-v-38f17b56]{margin-top:4px;padding:9px 18px;border:0;cursor:pointer;border-radius:999px;font-family:inherit;font-size:12.5px;font-weight:700;color:#fff;background:#14161a}.cart__done[data-v-38f17b56]{margin-top:20px;padding:34px 22px;border:1px solid #ECEDEF;border-radius:20px;display:flex;flex-direction:column;align-items:center;text-align:center}.cart__doneIcon[data-v-38f17b56]{width:56px;height:56px;border-radius:50%;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.cart__doneTitle[data-v-38f17b56]{margin:14px 0 0;font-size:15px;font-weight:800;color:#14161a}.cart__doneSub[data-v-38f17b56]{margin:8px 0 0;font-size:12.5px;color:#5b616e}.cart__doneSub b[data-v-38f17b56]{color:#14161a}.cart__doneHint[data-v-38f17b56]{margin:5px 0 0;font-size:11.5px;color:#8a909c}.cart__doneCta[data-v-38f17b56]{margin-top:18px;padding:11px 22px;border:0;cursor:pointer;border-radius:999px;font-family:inherit;font-size:12.5px;font-weight:700;color:#fff;background:#14161a}.cart__bar[data-v-38f17b56]{position:fixed;bottom:0;left:0;right:0;z-index:5;background:#ffffffeb;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-top:1px solid #ECEDEF;padding-bottom:66px}.cart__barInner[data-v-38f17b56]{max-width:768px;margin:0 auto;padding:12px 16px;display:flex;align-items:center;justify-content:space-between;gap:14px}.cart__total[data-v-38f17b56]{display:flex;flex-direction:column;gap:3px}.cart__totalLabel[data-v-38f17b56]{font-size:11px;color:#8a909c}.cart__totalValue[data-v-38f17b56]{font-size:16px;font-weight:800;color:#14161a}.cart__totalValue i[data-v-38f17b56]{font-style:normal;font-size:11px;font-weight:600;color:#8a909c;padding-inline-start:3px}.cart__submit[data-v-38f17b56]{flex:1;max-width:200px;padding:13px 18px;border:0;cursor:pointer;border-radius:14px;font-family:inherit;font-size:13px;font-weight:700;color:#fff;background:#14161a;transition:transform .15s ease}.cart__submit[data-v-38f17b56]:active{transform:scale(.98)}.sheet[data-v-38f17b56]{padding:18px 16px 22px}.sheet__title[data-v-38f17b56]{margin:0 0 14px;font-size:13.5px;font-weight:800;color:#14161a}.sheet__cta[data-v-38f17b56]{width:100%;padding:12px 18px;border:0;cursor:pointer;border-radius:14px;font-family:inherit;font-size:13px;font-weight:700;color:#fff;background:#14161a} diff --git a/apps/user-app-v2/dist/assets/CartView-DyEDwwD2.js b/apps/user-app-v2/dist/assets/CartView-MDu3XibQ.js similarity index 94% rename from apps/user-app-v2/dist/assets/CartView-DyEDwwD2.js rename to apps/user-app-v2/dist/assets/CartView-MDu3XibQ.js index 6381955..92a4713 100644 --- a/apps/user-app-v2/dist/assets/CartView-DyEDwwD2.js +++ b/apps/user-app-v2/dist/assets/CartView-MDu3XibQ.js @@ -1 +1 @@ -import{d as S,M as U,k as M,l as O,f as i,c as r,b as e,m as a,w as A,p as n,I as f,t as v,e as I,N as B,h as z,_ as L,O as Q,o as W,x as j,z as u,J as G,j as R,P as D,C as H,g as V,K as N,i as J,F as K,r as X,B as Y,n as Z,s as tt}from"./index-BWyw3RAx.js";import{P as et}from"./PageBar-D5DXU6sO.js";import{D as st}from"./index-sLHXZqt3.js";import{L as F,P as at}from"./index-ecOSUWQv.js";import{F as ot,T as nt,a as it}from"./index-7kdFQ8tV.js";import"./KeyCode-CA5MXqE7.js";import"./classCallCheck-Ou87VTNv.js";import"./raf-nDFcuFT6.js";import"./FormItemContext-Bxnh5gKQ.js";const lt={class:"ci"},rt={class:"ci__art"},ct=["alt"],dt={key:1,class:"ci__artEmpty","aria-hidden":"true"},ut={class:"ci__main"},_t={class:"ci__title"},mt={class:"ci__meta"},pt={class:"ci__weight"},vt={key:0,class:"ci__wage"},yt={class:"ci__row"},ft={class:"ci__qty"},bt=["disabled"],gt={class:"ci__qtyValue"},wt={key:0,class:"ci__noteText"},ht=S({__name:"CartItem",props:{value:{}},emits:["note"],setup(_,{emit:x}){const l=_,c=x,m=U(),y=m.find_index(l.value),b=z(()=>m.maxQty(l.value)),g=z(()=>b.value===null||l.value.qty{g.value&&m.updateFeild(l.value.qty+1,y,l.value,"qty")},s=()=>{m.updateFeild(l.value.qty-1,y,l.value,"qty")},{image:p,title:k,selectedVariant:P,wage:C}=M(l.value.product,m.variant(l.value)),q=z(()=>{const d=C.value;return d==null?"":d%1===0?String(d):d.toFixed(2)});return(d,t)=>{var h;const w=O("lazy");return i(),r("article",lt,[e("div",rt,[a(p)?A((i(),r("img",{key:0,alt:a(k)},null,8,ct)),[[w,a(p)]]):(i(),r("div",dt,[n(f,{icon:"vuesax-linear:diamonds",size:"20"})]))]),e("div",ut,[e("h3",_t,v(a(k)),1),e("div",mt,[e("span",pt,v((h=a(P))==null?void 0:h.rashWeightGrams)+" گرم",1),a(C)!=null?(i(),r("span",vt,"اجرت "+v(q.value)+"٪",1)):I("",!0)]),e("div",yt,[e("div",ft,[e("button",{type:"button",class:"ci__qtyBtn","aria-label":"افزودن",disabled:!g.value,onClick:$},[n(f,{icon:"vuesax-linear:add",size:"16"})],8,bt),e("span",gt,v(_.value.qty),1),_.value.qty===1?(i(),r("button",{key:0,type:"button",class:"ci__qtyBtn ci__qtyBtn--danger","aria-label":"حذف",onClick:t[0]||(t[0]=o=>a(m).remove(_.value))},[n(f,{icon:"vuesax-linear:trash",size:"16"})])):(i(),r("button",{key:1,type:"button",class:"ci__qtyBtn","aria-label":"کاهش",onClick:s},[n(f,{icon:"vuesax-linear:minus",size:"16"})]))]),e("button",{type:"button",class:"ci__note",onClick:t[1]||(t[1]=o=>c("note",a(y)))},[n(f,{icon:"vuesax-linear:note-text",size:"15"}),B(" "+v(!_.value.note||_.value.note===""?"توضیحات":"ویرایش توضیحات"),1)])]),_.value.note?(i(),r("p",wt,v(_.value.note),1)):I("",!0)])])}}}),xt=L(ht,[["__scopeId","data-v-d4b1ffdf"]]),kt={class:"cart"},Ct={key:1,class:"cart__empty"},It={key:1,class:"cart__done"},$t={class:"cart__doneIcon","aria-hidden":"true"},Pt={class:"cart__doneSub"},qt={key:0,class:"cart__bar"},zt={class:"cart__barInner"},Rt={class:"cart__total"},Vt={class:"cart__totalValue"},Ft={class:"sheet"},Bt={class:"sheet__title"},Dt=60,Nt=S({__name:"CartView",setup(_){let x=!1;const l=H(),c=U(),m=Q(),y=V(!1),b=V(!1),g=V(x);function $(d){return{"--reveal-delay":`${d*Dt}ms`}}const s=N({loadingPage:!1,showPopUp:!1,step:1,notify:!1,orderID:"",tempRowIndex:-1,tempRow:{product:void 0}}),p=N({note:void 0}),k=()=>{c.updateFeild(p.note,s.tempRowIndex,s.tempRow,"note"),s.showPopUp=!1,p.note=void 0,s.tempRow={product:void 0}},P=async()=>{await l.push({name:"ordersList"}),s.step=1},C=async()=>{if(s.notify=!1,!m.isLoggedIn){y.value=!0;return}try{s.loadingPage=!0;const d=await tt.createOrder({customerId:m.customerId??void 0,items:c.items.map(t=>{const w=c.variant(t);return{productVariantId:t.vid,quantity:t.qty,wagePercent:w?parseFloat(w.defaultWagePercent):0}})});s.orderID=d.orderNumber,s.step=2,c.clear()}catch(d){console.log(d)}finally{s.loadingPage=!1}};async function q(){await c.init(),b.value=!1}return W(async()=>{await c.init(),!g.value&&(await j(),requestAnimationFrame(()=>{g.value=!0,x=!0}))}),(d,t)=>{var h;const w=Y("container");return i(),r("div",kt,[n(et,{title:"سبد خرید","back-to":"home"}),n(G,{spinning:s.loadingPage,tip:"درحال دریافت اطلاعات"},{default:u(()=>[n(w,{class:"cart__body"},{default:u(()=>[s.step===1?(i(),R(a(at),{key:0,modelValue:b.value,"onUpdate:modelValue":t[1]||(t[1]=o=>b.value=o),onRefresh:q},{pulling:u(()=>[n(a(F),{size:"18"})]),loosing:u(()=>[n(a(F),{size:"18"})]),loading:u(()=>[n(a(F),{size:"18"})]),success:u(()=>[...t[8]||(t[8]=[e("span",null,null,-1)])]),default:u(()=>[a(c).items.length?(i(),r("div",{key:0,class:J(["cart__items",{"is-revealed":g.value}])},[(i(!0),r(K,null,X(a(c).items,(o,T)=>(i(),R(xt,{key:o.pid+o.vid,value:o,class:"cart__row",style:Z($(T)),onNote:E=>{s.tempRow=o,s.showPopUp=!0,s.tempRowIndex=E,p.note=o.note??void 0}},null,8,["value","style","onNote"]))),128))],2)):(i(),r("section",Ct,[n(f,{icon:"vuesax-linear:bag-2",size:"26"}),t[9]||(t[9]=e("p",null,"سبد خرید شما خالی است.",-1)),e("button",{type:"button",class:"cart__emptyCta",onClick:t[0]||(t[0]=o=>a(l).push({name:"home"}))}," دیدن محصولات ")]))]),_:1},8,["modelValue"])):(i(),r("section",It,[e("div",$t,[n(f,{icon:"vuesax-linear:tick-circle",size:"30"})]),t[11]||(t[11]=e("h2",{class:"cart__doneTitle"},"سفارش شما ثبت شد",-1)),e("p",Pt,[t[10]||(t[10]=B(" شماره سفارش ",-1)),e("b",null,v(s.orderID),1)]),t[12]||(t[12]=e("p",{class:"cart__doneHint"},"برای پیگیری وضعیت، به فهرست سفارش‌ها مراجعه کنید.",-1)),e("button",{type:"button",class:"cart__doneCta",onClick:P},"فهرست سفارش‌ها")]))]),_:1})]),_:1},8,["spinning"]),a(c).items.length>0&&s.step===1?(i(),r("div",qt,[e("div",zt,[e("div",Rt,[t[14]||(t[14]=e("span",{class:"cart__totalLabel"},"جمع وزن",-1)),e("span",Vt,[B(v(a(c).total())+" ",1),t[13]||(t[13]=e("i",null,"گرم",-1))])]),e("button",{type:"button",class:"cart__submit",onClick:t[2]||(t[2]=o=>s.notify=!0)},"ثبت نهایی سفارش")])])):I("",!0),(h=s.tempRow)!=null&&h.product?(i(),R(a(st),{key:1,visible:s.showPopUp,"onUpdate:visible":t[4]||(t[4]=o=>s.showPopUp=o),placement:"bottom",closable:!1,height:"300px",class:"rtl island-sheet",bodyStyle:{padding:0}},{default:u(()=>[e("div",Ft,[e("h3",Bt,"توضیح برای "+v(s.tempRow.product.title),1),n(a(it),{model:p,name:"noteForm",layout:"vertical",autocomplete:"off",onFinish:k},{default:u(()=>[n(a(ot),{"has-feedback":"",name:"note"},{default:u(()=>[n(a(nt),{value:p.note,"onUpdate:value":t[3]||(t[3]=o=>p.note=o),rows:4,placeholder:"مثلاً سایز یا جزئیات سفارش"},null,8,["value"])]),_:1}),t[15]||(t[15]=e("button",{type:"submit",class:"sheet__cta"},"ثبت توضیحات",-1))]),_:1},8,["model"])])]),_:1},8,["visible"])):I("",!0),n(D,{show:s.notify,"onUpdate:show":t[5]||(t[5]=o=>s.notify=o),art:"order",title:"آیا مطمئن به ثبت سفارش هستید؟",description:"پس از ثبت، وضعیت سفارش را می توانید از بخش سفارش ها پیگیری کنید.","confirm-text":"بله","cancel-text":"بی خیال",onConfirm:C},null,8,["show"]),n(D,{show:y.value,"onUpdate:show":t[6]||(t[6]=o=>y.value=o),art:"login",title:"برای ثبت سفارش وارد شوید",description:"برای ثبت سفارش ابتدا باید وارد حساب کاربری خود شوید. سبد خرید شما حفظ می شود.","confirm-text":"ورود/ثبت نام","cancel-text":"بیخیال",onConfirm:t[7]||(t[7]=o=>a(l).push({name:"login"}))},null,8,["show"])])}}}),Wt=L(Nt,[["__scopeId","data-v-03c515c5"]]);export{Wt as default}; +import{d as S,M as U,k as M,l as O,f as i,c as r,b as e,m as a,w as A,p as n,I as f,t as v,e as I,N as B,h as z,_ as L,O as Q,o as W,x as j,z as u,J as G,j as R,P as D,C as H,g as V,K as N,i as J,F as K,r as X,B as Y,n as Z,s as tt}from"./index-Dp9sxvBv.js";import{P as et}from"./PageBar-El-laHqK.js";import{D as st}from"./index-UuozCFb-.js";import{L as F,P as at}from"./index-B0RgkHMm.js";import{F as ot,T as nt,a as it}from"./index-UkXhTnpw.js";import"./KeyCode-DAs3W-5E.js";import"./classCallCheck-BTVV3tFI.js";import"./raf-nDFcuFT6.js";import"./FormItemContext-C33n6IMx.js";const lt={class:"ci"},rt={class:"ci__art"},ct=["alt"],dt={key:1,class:"ci__artEmpty","aria-hidden":"true"},ut={class:"ci__main"},_t={class:"ci__title"},mt={class:"ci__meta"},pt={class:"ci__weight"},vt={key:0,class:"ci__wage"},yt={class:"ci__row"},ft={class:"ci__qty"},bt=["disabled"],gt={class:"ci__qtyValue"},wt={key:0,class:"ci__noteText"},ht=S({__name:"CartItem",props:{value:{}},emits:["note"],setup(_,{emit:x}){const l=_,c=x,m=U(),y=m.find_index(l.value),b=z(()=>m.maxQty(l.value)),g=z(()=>b.value===null||l.value.qty{g.value&&m.updateFeild(l.value.qty+1,y,l.value,"qty")},s=()=>{m.updateFeild(l.value.qty-1,y,l.value,"qty")},{image:p,title:k,selectedVariant:P,wage:C}=M(l.value.product,m.variant(l.value)),q=z(()=>{const d=C.value;return d==null?"":d%1===0?String(d):d.toFixed(2)});return(d,t)=>{var h;const w=O("lazy");return i(),r("article",lt,[e("div",rt,[a(p)?A((i(),r("img",{key:0,alt:a(k)},null,8,ct)),[[w,a(p)]]):(i(),r("div",dt,[n(f,{icon:"vuesax-linear:diamonds",size:"20"})]))]),e("div",ut,[e("h3",_t,v(a(k)),1),e("div",mt,[e("span",pt,v((h=a(P))==null?void 0:h.rashWeightGrams)+" گرم",1),a(C)!=null?(i(),r("span",vt,"اجرت "+v(q.value)+"٪",1)):I("",!0)]),e("div",yt,[e("div",ft,[e("button",{type:"button",class:"ci__qtyBtn","aria-label":"افزودن",disabled:!g.value,onClick:$},[n(f,{icon:"vuesax-linear:add",size:"16"})],8,bt),e("span",gt,v(_.value.qty),1),_.value.qty===1?(i(),r("button",{key:0,type:"button",class:"ci__qtyBtn ci__qtyBtn--danger","aria-label":"حذف",onClick:t[0]||(t[0]=o=>a(m).remove(_.value))},[n(f,{icon:"vuesax-linear:trash",size:"16"})])):(i(),r("button",{key:1,type:"button",class:"ci__qtyBtn","aria-label":"کاهش",onClick:s},[n(f,{icon:"vuesax-linear:minus",size:"16"})]))]),e("button",{type:"button",class:"ci__note",onClick:t[1]||(t[1]=o=>c("note",a(y)))},[n(f,{icon:"vuesax-linear:note-text",size:"15"}),B(" "+v(!_.value.note||_.value.note===""?"توضیحات":"ویرایش توضیحات"),1)])]),_.value.note?(i(),r("p",wt,v(_.value.note),1)):I("",!0)])])}}}),xt=L(ht,[["__scopeId","data-v-d4b1ffdf"]]),kt={class:"cart"},Ct={key:1,class:"cart__empty"},It={key:1,class:"cart__done"},$t={class:"cart__doneIcon","aria-hidden":"true"},Pt={class:"cart__doneSub"},qt={key:0,class:"cart__bar"},zt={class:"cart__barInner"},Rt={class:"cart__total"},Vt={class:"cart__totalValue"},Ft={class:"sheet"},Bt={class:"sheet__title"},Dt=60,Nt=S({__name:"CartView",setup(_){let x=!1;const l=H(),c=U(),m=Q(),y=V(!1),b=V(!1),g=V(x);function $(d){return{"--reveal-delay":`${d*Dt}ms`}}const s=N({loadingPage:!1,showPopUp:!1,step:1,notify:!1,orderID:"",tempRowIndex:-1,tempRow:{product:void 0}}),p=N({note:void 0}),k=()=>{c.updateFeild(p.note,s.tempRowIndex,s.tempRow,"note"),s.showPopUp=!1,p.note=void 0,s.tempRow={product:void 0}},P=async()=>{await l.push({name:"ordersList"}),s.step=1},C=async()=>{if(s.notify=!1,!m.isLoggedIn){y.value=!0;return}try{s.loadingPage=!0;const d=await tt.createOrder({customerId:m.customerId??void 0,items:c.items.map(t=>{const w=c.variant(t);return{productVariantId:t.vid,quantity:t.qty,wagePercent:w?parseFloat(w.defaultWagePercent):0}})});s.orderID=d.orderNumber,s.step=2,c.clear()}catch(d){console.log(d)}finally{s.loadingPage=!1}};async function q(){await c.init(),b.value=!1}return W(async()=>{await c.init(),!g.value&&(await j(),requestAnimationFrame(()=>{g.value=!0,x=!0}))}),(d,t)=>{var h;const w=Y("container");return i(),r("div",kt,[n(et,{title:"سبد خرید","back-to":"home"}),n(G,{spinning:s.loadingPage,tip:"درحال دریافت اطلاعات"},{default:u(()=>[n(w,{class:"cart__body"},{default:u(()=>[s.step===1?(i(),R(a(at),{key:0,modelValue:b.value,"onUpdate:modelValue":t[1]||(t[1]=o=>b.value=o),onRefresh:q},{pulling:u(()=>[n(a(F),{size:"18"})]),loosing:u(()=>[n(a(F),{size:"18"})]),loading:u(()=>[n(a(F),{size:"18"})]),success:u(()=>[...t[8]||(t[8]=[e("span",null,null,-1)])]),default:u(()=>[a(c).items.length?(i(),r("div",{key:0,class:J(["cart__items",{"is-revealed":g.value}])},[(i(!0),r(K,null,X(a(c).items,(o,T)=>(i(),R(xt,{key:o.pid+o.vid,value:o,class:"cart__row",style:Z($(T)),onNote:E=>{s.tempRow=o,s.showPopUp=!0,s.tempRowIndex=E,p.note=o.note??void 0}},null,8,["value","style","onNote"]))),128))],2)):(i(),r("section",Ct,[n(f,{icon:"vuesax-linear:bag-2",size:"26"}),t[9]||(t[9]=e("p",null,"سبد خرید شما خالی است.",-1)),e("button",{type:"button",class:"cart__emptyCta",onClick:t[0]||(t[0]=o=>a(l).push({name:"home"}))}," دیدن محصولات ")]))]),_:1},8,["modelValue"])):(i(),r("section",It,[e("div",$t,[n(f,{icon:"vuesax-linear:tick-circle",size:"30"})]),t[11]||(t[11]=e("h2",{class:"cart__doneTitle"},"سفارش شما ثبت شد",-1)),e("p",Pt,[t[10]||(t[10]=B(" شماره سفارش ",-1)),e("b",null,v(s.orderID),1)]),t[12]||(t[12]=e("p",{class:"cart__doneHint"},"برای پیگیری وضعیت، به فهرست سفارش‌ها مراجعه کنید.",-1)),e("button",{type:"button",class:"cart__doneCta",onClick:P},"فهرست سفارش‌ها")]))]),_:1})]),_:1},8,["spinning"]),a(c).items.length>0&&s.step===1?(i(),r("div",qt,[e("div",zt,[e("div",Rt,[t[14]||(t[14]=e("span",{class:"cart__totalLabel"},"جمع وزن",-1)),e("span",Vt,[B(v(a(c).total())+" ",1),t[13]||(t[13]=e("i",null,"گرم",-1))])]),e("button",{type:"button",class:"cart__submit",onClick:t[2]||(t[2]=o=>s.notify=!0)},"ثبت نهایی سفارش")])])):I("",!0),(h=s.tempRow)!=null&&h.product?(i(),R(a(st),{key:1,visible:s.showPopUp,"onUpdate:visible":t[4]||(t[4]=o=>s.showPopUp=o),placement:"bottom",closable:!1,height:"300px",class:"rtl island-sheet",bodyStyle:{padding:0}},{default:u(()=>[e("div",Ft,[e("h3",Bt,"توضیح برای "+v(s.tempRow.product.title),1),n(a(it),{model:p,name:"noteForm",layout:"vertical",autocomplete:"off",onFinish:k},{default:u(()=>[n(a(ot),{"has-feedback":"",name:"note"},{default:u(()=>[n(a(nt),{value:p.note,"onUpdate:value":t[3]||(t[3]=o=>p.note=o),rows:4,placeholder:"مثلاً سایز یا جزئیات سفارش"},null,8,["value"])]),_:1}),t[15]||(t[15]=e("button",{type:"submit",class:"sheet__cta"},"ثبت توضیحات",-1))]),_:1},8,["model"])])]),_:1},8,["visible"])):I("",!0),n(D,{show:s.notify,"onUpdate:show":t[5]||(t[5]=o=>s.notify=o),art:"order",title:"آیا مطمئن به ثبت سفارش هستید؟",description:"پس از ثبت، وضعیت سفارش را می توانید از بخش سفارش ها پیگیری کنید.","confirm-text":"بله","cancel-text":"بی خیال",onConfirm:C},null,8,["show"]),n(D,{show:y.value,"onUpdate:show":t[6]||(t[6]=o=>y.value=o),art:"login",title:"برای ثبت سفارش وارد شوید",description:"برای ثبت سفارش ابتدا باید وارد حساب کاربری خود شوید. سبد خرید شما حفظ می شود.","confirm-text":"ورود/ثبت نام","cancel-text":"بیخیال",onConfirm:t[7]||(t[7]=o=>a(l).push({name:"login"}))},null,8,["show"])])}}}),Wt=L(Nt,[["__scopeId","data-v-03c515c5"]]);export{Wt as default}; diff --git a/apps/user-app-v2/dist/assets/ChildOrdersView-BSUeH1Jr.css b/apps/user-app-v2/dist/assets/ChildOrdersView-BSUeH1Jr.css new file mode 100644 index 0000000..1ae7473 --- /dev/null +++ b/apps/user-app-v2/dist/assets/ChildOrdersView-BSUeH1Jr.css @@ -0,0 +1 @@ +.cho__barExtra[data-v-24fb71cb]{padding:0 16px 12px}.cho__body[data-v-24fb71cb]{padding-top:132px;padding-bottom:90px}.cho__list[data-v-24fb71cb]{display:flex;flex-direction:column;padding-top:8px}.cho__card[data-v-24fb71cb]{padding:18px 2px;background:transparent;border:none;border-bottom:1px solid var(--c-hairline);cursor:pointer}.cho__card[data-v-24fb71cb]:last-child{border-bottom:none}.cho__card[data-v-24fb71cb]:active{opacity:.75}.cho__top[data-v-24fb71cb]{display:flex;justify-content:space-between;gap:12px}.cho__right[data-v-24fb71cb]{display:flex;flex-direction:column;align-items:flex-end;gap:8px}.cho__num[data-v-24fb71cb]{font-size:15px;font-weight:700;margin-bottom:10px}.cho__muted[data-v-24fb71cb]{color:var(--c-inkFaint);font-weight:500;margin-left:4px}.cho__meta[data-v-24fb71cb]{display:flex;align-items:baseline;gap:4px}.cho__strong[data-v-24fb71cb]{font-size:15px;font-weight:700}.cho__unit[data-v-24fb71cb]{font-size:12px;color:var(--c-inkFaint)}.cho__status[data-v-24fb71cb]{padding:5px 14px;border-radius:999px;font-size:11.5px;font-weight:600;color:#06b6d4;background:#06b6d41f;white-space:nowrap}.cho__divider[data-v-24fb71cb]{height:10px}.cho__bottom[data-v-24fb71cb]{display:flex;justify-content:space-between;align-items:center}.cho__customer[data-v-24fb71cb]{font-size:13.5px;font-weight:600;color:var(--c-inkMuted)}.cho__more[data-v-24fb71cb],.cho__sentinel[data-v-24fb71cb]{padding:12px 0;text-align:center;font-size:12px;color:var(--c-inkFaint)}.cho__empty[data-v-24fb71cb]{margin-top:8px;padding:34px 20px;border:1px dashed var(--c-hairline);border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--c-inkFaint)}.cho__empty p[data-v-24fb71cb]{margin:0;font-size:12.5px}.cho__retry[data-v-24fb71cb]{padding:8px 18px;border-radius:999px;border:1px solid var(--c-hairline);background:var(--c-canvas);font-family:inherit;font-size:12px;font-weight:600;cursor:pointer}.cho__detail[data-v-24fb71cb]{padding:20px 16px 24px}.cho__detailTitle[data-v-24fb71cb]{margin:0 0 16px;font-size:17px;font-weight:700}.cho__rows[data-v-24fb71cb]{margin:0;display:flex;flex-direction:column}.cho__row[data-v-24fb71cb]{display:flex;justify-content:space-between;align-items:center;padding:13px 2px;border-bottom:1px solid var(--c-hairline)}.cho__row[data-v-24fb71cb]:last-child{border-bottom:none}.cho__row dt[data-v-24fb71cb]{font-size:13px;color:var(--c-inkFaint)}.cho__row dd[data-v-24fb71cb]{margin:0;font-size:14px;font-weight:600}.cho__close[data-v-24fb71cb]{margin-top:18px;width:100%;padding:13px;border:none;border-radius:14px;background:var(--c-ink);color:var(--c-onInk);font-family:inherit;font-size:14px;font-weight:700;cursor:pointer} diff --git a/apps/user-app-v2/dist/assets/ChildOrdersView-CTHMBAuv.js b/apps/user-app-v2/dist/assets/ChildOrdersView-CTHMBAuv.js new file mode 100644 index 0000000..6e73fb8 --- /dev/null +++ b/apps/user-app-v2/dist/assets/ChildOrdersView-CTHMBAuv.js @@ -0,0 +1 @@ +import{d as R,o as U,a as $,c as d,p as n,z as i,J as j,m as v,g as a,s as M,f as u,b as s,F as O,r as T,e as y,I as z,t as l,B as A,N as J,_ as q}from"./index-Dp9sxvBv.js";import{P as G}from"./PageBar-El-laHqK.js";import{S as H}from"./SearchInput-OrOd8Tqr.js";import{j as K}from"./filters-CUgGgSea.js";import{D as Q}from"./index-UuozCFb-.js";import{P as W,L as I}from"./index-B0RgkHMm.js";import"./KeyCode-DAs3W-5E.js";import"./classCallCheck-BTVV3tFI.js";import"./raf-nDFcuFT6.js";const X={class:"cho"},Y={class:"cho__barExtra"},Z={class:"cho__list"},ss=["onClick"],es={class:"cho__top"},ts={class:"cho__left"},os={class:"cho__num"},ns={class:"cho__meta"},ls={class:"cho__strong"},as={class:"cho__right"},is={class:"cho__meta"},rs={class:"cho__strong"},ds={class:"cho__bottom"},us={class:"cho__customer"},cs={key:0,class:"cho__more"},_s={key:1,class:"cho__empty"},vs={key:2,class:"cho__empty"},fs={key:0,class:"cho__detail"},hs={class:"cho__detailTitle"},ms={class:"cho__rows"},ps={class:"cho__row"},gs={class:"cho__row"},bs={dir:"ltr"},ys={class:"cho__row"},ws={dir:"ltr"},ks={class:"cho__row"},xs={class:"cho__row"},Cs=R({__name:"ChildOrdersView",setup(Ns){const c=a([]),_=a(!1),w=a(!1),p=a(!1),k=a(null),x=a(1),g=a(!0),b=a(!1),r=a(null);function B(t){const e=Number(t??0);return Number.isFinite(e)?e.toFixed(3):"0.000"}async function C(){if(!(_.value||!g.value)){_.value=!0,p.value=!1;try{const t=await M.getExpertChildOrders(x.value,k.value),e=t.rows??[];c.value=[...c.value,...e],e.length<(t.limit??20)?g.value=!1:x.value+=1}catch{p.value=!0,g.value=!1}finally{_.value=!1}}}function P(){c.value=[],x.value=1,g.value=!0,p.value=!1}async function N(){P(),await C()}async function S(t){k.value=t!=null&&t.trim()?t.trim():null,await N()}async function D(){await N(),w.value=!1}function F(t){r.value=t,b.value=!0}const V=a(null);let f=null;return U(async()=>{await C(),typeof IntersectionObserver<"u"&&(f=new IntersectionObserver(t=>{t.some(e=>e.isIntersecting)&&C()}),V.value&&f.observe(V.value))}),$(()=>f==null?void 0:f.disconnect()),(t,e)=>{const E=A("container");return u(),d("div",X,[n(G,{title:"سفارشات مشتریان","back-to":"userPage::hasSubRoute"},{below:i(()=>[s("div",Y,[n(H,{onSearch:S,"place-holder":"جستجو"})])]),_:1}),n(j,{spinning:_.value&&!c.value.length,tip:"درحال دریافت اطلاعات"},{default:i(()=>[n(v(W),{modelValue:w.value,"onUpdate:modelValue":e[0]||(e[0]=o=>w.value=o),onRefresh:D},{pulling:i(()=>[n(v(I),{size:"18"})]),loosing:i(()=>[n(v(I),{size:"18"})]),loading:i(()=>[n(v(I),{size:"18"})]),success:i(()=>[...e[3]||(e[3]=[s("span",null,null,-1)])]),default:i(()=>[n(E,{class:"cho__body"},{default:i(()=>[c.value.length?(u(),d(O,{key:0},[s("div",Z,[(u(!0),d(O,null,T(c.value,o=>{var h,m;return u(),d("article",{key:o.id,class:"cho__card",onClick:L=>F(o)},[s("div",es,[s("div",ts,[s("div",os,[e[4]||(e[4]=s("span",{class:"cho__muted"},"سفارش :",-1)),J(" "+l(o.orderNumber),1)]),s("div",ns,[s("span",ls,l(((h=o.items)==null?void 0:h.length)??0),1),e[5]||(e[5]=s("span",{class:"cho__unit"},"آیتم",-1))])]),s("div",as,[e[7]||(e[7]=s("span",{class:"cho__status"},"تحویل مسئول فروش",-1)),s("div",is,[s("span",rs,l(B(o.w)),1),e[6]||(e[6]=s("span",{class:"cho__unit"},"گرم",-1))])])]),e[8]||(e[8]=s("div",{class:"cho__divider"},null,-1)),s("div",ds,[s("div",us," نام مشتری : "+l(((m=o.customer)==null?void 0:m.name)??"—"),1),n(z,{icon:"vuesax-linear:arrow-left-1",size:"20"})])],8,ss)}),128))]),_.value?(u(),d("div",cs,"در حال دریافت…")):y("",!0)],64)):_.value?y("",!0):(u(),d("section",_s,[n(z,{icon:"vuesax-linear:box",size:"26"}),s("p",null,l(k.value?"سفارشی با این مشخصات پیدا نشد.":"هنوز سفارشی ثبت نشده است."),1)])),p.value?(u(),d("section",vs,[n(z,{icon:"vuesax-linear:danger",size:"26"}),e[9]||(e[9]=s("p",null,"دریافت اطلاعات با خطا روبه‌رو شد.",-1)),s("button",{type:"button",class:"cho__retry",onClick:N},"تلاش دوباره")])):y("",!0),s("div",{ref_key:"sentinel",ref:V,class:"cho__sentinel"},null,512)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["spinning"]),n(v(Q),{open:b.value,"onUpdate:open":e[2]||(e[2]=o=>b.value=o),placement:"bottom",height:"auto",closable:!1,"body-style":{padding:"0"}},{default:i(()=>{var o,h,m;return[r.value?(u(),d("div",fs,[s("h2",hs,l(r.value.orderNumber),1),s("dl",ms,[s("div",ps,[e[10]||(e[10]=s("dt",null,"نام مشتری",-1)),s("dd",null,l(((o=r.value.customer)==null?void 0:o.name)??"—"),1)]),s("div",gs,[e[11]||(e[11]=s("dt",null,"شماره تماس",-1)),s("dd",bs,l(((h=r.value.customer)==null?void 0:h.mobile)??"—"),1)]),s("div",ys,[e[12]||(e[12]=s("dt",null,"وزن کل",-1)),s("dd",ws,l(B(r.value.w))+" گرم",1)]),s("div",ks,[e[13]||(e[13]=s("dt",null,"تعداد آیتم‌ها",-1)),s("dd",null,l(((m=r.value.items)==null?void 0:m.length)??0),1)]),s("div",xs,[e[14]||(e[14]=s("dt",null,"تاریخ ثبت",-1)),s("dd",null,l(v(K)(r.value.createdAt)),1)]),e[15]||(e[15]=s("div",{class:"cho__row"},[s("dt",null,"وضعیت"),s("dd",null,"تحویل مسئول فروش")],-1))]),s("button",{type:"button",class:"cho__close",onClick:e[1]||(e[1]=L=>b.value=!1)},"بستن")])):y("",!0)]}),_:1},8,["open"])])}}}),Es=q(Cs,[["__scopeId","data-v-24fb71cb"]]);export{Es as default}; diff --git a/apps/user-app-v2/dist/assets/ChildOrdersView-DS4jSTHf.css b/apps/user-app-v2/dist/assets/ChildOrdersView-DS4jSTHf.css deleted file mode 100644 index 1bb402c..0000000 --- a/apps/user-app-v2/dist/assets/ChildOrdersView-DS4jSTHf.css +++ /dev/null @@ -1 +0,0 @@ -.cho__barExtra[data-v-83f2fdbb]{padding:0 16px 12px}.cho__body[data-v-83f2fdbb]{padding-top:132px;padding-bottom:90px}.cho__list[data-v-83f2fdbb]{display:flex;flex-direction:column;padding-top:8px}.cho__card[data-v-83f2fdbb]{padding:18px 2px;background:transparent;border:none;border-bottom:1px solid var(--c-hairline);cursor:pointer}.cho__card[data-v-83f2fdbb]:last-child{border-bottom:none}.cho__card[data-v-83f2fdbb]:active{opacity:.75}.cho__top[data-v-83f2fdbb]{display:flex;justify-content:space-between;gap:12px}.cho__right[data-v-83f2fdbb]{display:flex;flex-direction:column;align-items:flex-end;gap:8px}.cho__num[data-v-83f2fdbb]{font-size:15px;font-weight:700;margin-bottom:10px}.cho__muted[data-v-83f2fdbb]{color:var(--c-inkFaint);font-weight:500;margin-left:4px}.cho__meta[data-v-83f2fdbb]{display:flex;align-items:baseline;gap:4px}.cho__strong[data-v-83f2fdbb]{font-size:15px;font-weight:700}.cho__unit[data-v-83f2fdbb]{font-size:12px;color:var(--c-inkFaint)}.cho__status[data-v-83f2fdbb]{padding:5px 14px;border-radius:999px;font-size:11.5px;font-weight:600;color:#06b6d4;background:#06b6d41f;white-space:nowrap}.cho__divider[data-v-83f2fdbb]{height:10px}.cho__bottom[data-v-83f2fdbb]{display:flex;justify-content:space-between;align-items:center}.cho__customer[data-v-83f2fdbb]{font-size:13.5px;font-weight:600;color:var(--c-inkMuted)}.cho__more[data-v-83f2fdbb],.cho__sentinel[data-v-83f2fdbb]{padding:12px 0;text-align:center;font-size:12px;color:var(--c-inkFaint)}.cho__empty[data-v-83f2fdbb]{margin-top:8px;padding:34px 20px;border:1px dashed var(--c-hairline);border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--c-inkFaint)}.cho__empty p[data-v-83f2fdbb]{margin:0;font-size:12.5px}.cho__retry[data-v-83f2fdbb]{padding:8px 18px;border-radius:999px;border:1px solid var(--c-hairline);background:var(--c-canvas);font-family:inherit;font-size:12px;font-weight:600;cursor:pointer}.cho__detail[data-v-83f2fdbb]{padding:20px 16px 24px}.cho__detailTitle[data-v-83f2fdbb]{margin:0 0 16px;font-size:17px;font-weight:700}.cho__rows[data-v-83f2fdbb]{margin:0;display:flex;flex-direction:column}.cho__row[data-v-83f2fdbb]{display:flex;justify-content:space-between;align-items:center;padding:13px 2px;border-bottom:1px solid var(--c-hairline)}.cho__row[data-v-83f2fdbb]:last-child{border-bottom:none}.cho__row dt[data-v-83f2fdbb]{font-size:13px;color:var(--c-inkFaint)}.cho__row dd[data-v-83f2fdbb]{margin:0;font-size:14px;font-weight:600}.cho__close[data-v-83f2fdbb]{margin-top:18px;width:100%;padding:13px;border:none;border-radius:14px;background:var(--c-ink);color:var(--c-onInk);font-family:inherit;font-size:14px;font-weight:700;cursor:pointer} diff --git a/apps/user-app-v2/dist/assets/ChildOrdersView-qV6oiil_.js b/apps/user-app-v2/dist/assets/ChildOrdersView-qV6oiil_.js deleted file mode 100644 index 9b78ee5..0000000 --- a/apps/user-app-v2/dist/assets/ChildOrdersView-qV6oiil_.js +++ /dev/null @@ -1 +0,0 @@ -import{d as R,o as U,a as $,c as r,p as a,z as f,J as j,m as V,g as l,s as M,f as d,b as e,F as O,r as T,e as b,I,t as n,B as A,N as J,_ as L}from"./index-BWyw3RAx.js";import{P as q}from"./PageBar-D5DXU6sO.js";import{S as G}from"./SearchInput-BZCG2e_m.js";import{j as H}from"./filters-DVocLz3o.js";import{D as K}from"./index-sLHXZqt3.js";import{P as Q}from"./index-ecOSUWQv.js";import"./KeyCode-CA5MXqE7.js";import"./classCallCheck-Ou87VTNv.js";import"./raf-nDFcuFT6.js";const W={class:"cho"},X={class:"cho__barExtra"},Y={class:"cho__list"},Z=["onClick"],ee={class:"cho__top"},se={class:"cho__left"},te={class:"cho__num"},oe={class:"cho__meta"},ne={class:"cho__strong"},le={class:"cho__right"},ae={class:"cho__meta"},ie={class:"cho__strong"},re={class:"cho__bottom"},de={class:"cho__customer"},ce={key:0,class:"cho__more"},ue={key:1,class:"cho__empty"},_e={key:2,class:"cho__empty"},ve={key:0,class:"cho__detail"},he={class:"cho__detailTitle"},fe={class:"cho__rows"},me={class:"cho__row"},pe={class:"cho__row"},ge={dir:"ltr"},be={class:"cho__row"},ye={dir:"ltr"},we={class:"cho__row"},ke={class:"cho__row"},xe=R({__name:"ChildOrdersView",setup(Ce){const c=l([]),u=l(!1),y=l(!1),m=l(!1),w=l(null),k=l(1),p=l(!0),g=l(!1),i=l(null);function B(t){const s=Number(t??0);return Number.isFinite(s)?s.toFixed(3):"0.000"}async function x(){if(!(u.value||!p.value)){u.value=!0,m.value=!1;try{const t=await M.getExpertChildOrders(k.value,w.value),s=t.rows??[];c.value=[...c.value,...s],s.length<(t.limit??20)?p.value=!1:k.value+=1}catch{m.value=!0,p.value=!1}finally{u.value=!1}}}function P(){c.value=[],k.value=1,p.value=!0,m.value=!1}async function C(){P(),await x()}async function S(t){w.value=t!=null&&t.trim()?t.trim():null,await C()}async function z(){await C(),y.value=!1}function D(t){i.value=t,g.value=!0}const N=l(null);let _=null;return U(async()=>{await x(),typeof IntersectionObserver<"u"&&(_=new IntersectionObserver(t=>{t.some(s=>s.isIntersecting)&&x()}),N.value&&_.observe(N.value))}),$(()=>_==null?void 0:_.disconnect()),(t,s)=>{const F=A("container");return d(),r("div",W,[a(q,{title:"سفارشات مشتریان","back-to":"userPage::hasSubRoute"},{below:f(()=>[e("div",X,[a(G,{onSearch:S,"place-holder":"جستجو"})])]),_:1}),a(j,{spinning:u.value&&!c.value.length,tip:"درحال دریافت اطلاعات"},{default:f(()=>[a(V(Q),{modelValue:y.value,"onUpdate:modelValue":s[0]||(s[0]=o=>y.value=o),onRefresh:z},{default:f(()=>[a(F,{class:"cho__body"},{default:f(()=>[c.value.length?(d(),r(O,{key:0},[e("div",Y,[(d(!0),r(O,null,T(c.value,o=>{var v,h;return d(),r("article",{key:o.id,class:"cho__card",onClick:E=>D(o)},[e("div",ee,[e("div",se,[e("div",te,[s[3]||(s[3]=e("span",{class:"cho__muted"},"سفارش :",-1)),J(" "+n(o.orderNumber),1)]),e("div",oe,[e("span",ne,n(((v=o.items)==null?void 0:v.length)??0),1),s[4]||(s[4]=e("span",{class:"cho__unit"},"آیتم",-1))])]),e("div",le,[s[6]||(s[6]=e("span",{class:"cho__status"},"تحویل مسئول فروش",-1)),e("div",ae,[e("span",ie,n(B(o.w)),1),s[5]||(s[5]=e("span",{class:"cho__unit"},"گرم",-1))])])]),s[7]||(s[7]=e("div",{class:"cho__divider"},null,-1)),e("div",re,[e("div",de," نام مشتری : "+n(((h=o.customer)==null?void 0:h.name)??"—"),1),a(I,{icon:"vuesax-linear:arrow-left-1",size:"20"})])],8,Z)}),128))]),u.value?(d(),r("div",ce,"در حال دریافت…")):b("",!0)],64)):u.value?b("",!0):(d(),r("section",ue,[a(I,{icon:"vuesax-linear:box",size:"26"}),e("p",null,n(w.value?"سفارشی با این مشخصات پیدا نشد.":"هنوز سفارشی ثبت نشده است."),1)])),m.value?(d(),r("section",_e,[a(I,{icon:"vuesax-linear:danger",size:"26"}),s[8]||(s[8]=e("p",null,"دریافت اطلاعات با خطا روبه‌رو شد.",-1)),e("button",{type:"button",class:"cho__retry",onClick:C},"تلاش دوباره")])):b("",!0),e("div",{ref_key:"sentinel",ref:N,class:"cho__sentinel"},null,512)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["spinning"]),a(V(K),{open:g.value,"onUpdate:open":s[2]||(s[2]=o=>g.value=o),placement:"bottom",height:"auto",closable:!1,"body-style":{padding:"0"}},{default:f(()=>{var o,v,h;return[i.value?(d(),r("div",ve,[e("h2",he,n(i.value.orderNumber),1),e("dl",fe,[e("div",me,[s[9]||(s[9]=e("dt",null,"نام مشتری",-1)),e("dd",null,n(((o=i.value.customer)==null?void 0:o.name)??"—"),1)]),e("div",pe,[s[10]||(s[10]=e("dt",null,"شماره تماس",-1)),e("dd",ge,n(((v=i.value.customer)==null?void 0:v.mobile)??"—"),1)]),e("div",be,[s[11]||(s[11]=e("dt",null,"وزن کل",-1)),e("dd",ye,n(B(i.value.w))+" گرم",1)]),e("div",we,[s[12]||(s[12]=e("dt",null,"تعداد آیتم‌ها",-1)),e("dd",null,n(((h=i.value.items)==null?void 0:h.length)??0),1)]),e("div",ke,[s[13]||(s[13]=e("dt",null,"تاریخ ثبت",-1)),e("dd",null,n(V(H)(i.value.createdAt)),1)]),s[14]||(s[14]=e("div",{class:"cho__row"},[e("dt",null,"وضعیت"),e("dd",null,"تحویل مسئول فروش")],-1))]),e("button",{type:"button",class:"cho__close",onClick:s[1]||(s[1]=E=>g.value=!1)},"بستن")])):b("",!0)]}),_:1},8,["open"])])}}}),Fe=L(xe,[["__scopeId","data-v-83f2fdbb"]]);export{Fe as default}; diff --git a/apps/user-app-v2/dist/assets/CollectionView-C1GrIPCU.js b/apps/user-app-v2/dist/assets/CollectionView-CjJy961h.js similarity index 86% rename from apps/user-app-v2/dist/assets/CollectionView-C1GrIPCU.js rename to apps/user-app-v2/dist/assets/CollectionView-CjJy961h.js index 2e6d04f..8c7fa56 100644 --- a/apps/user-app-v2/dist/assets/CollectionView-C1GrIPCU.js +++ b/apps/user-app-v2/dist/assets/CollectionView-CjJy961h.js @@ -1 +1 @@ -import{d as f,o as v,s as g,c as s,p as e,z as u,J as y,g as d,h as _,f as t,F as P,r as k,I as C,b as h,e as x,B,S as b,j as V,_ as w}from"./index-BWyw3RAx.js";import{P as I}from"./PageBar-D5DXU6sO.js";import{S as N}from"./SectionHead-BiCEpXAe.js";import{P as S}from"./ProductCard-nL92ZIkB.js";const z={class:"coll"},F={key:0,class:"coll__grid"},j={key:1,class:"coll__empty"},q=f({__name:"CollectionView",setup(E){const l=b(),o=d(!1),n=d([]),p=_(()=>l.query.page||"مجموعه"),c=_(()=>n.value.filter(i=>i.collections.some(a=>a.collectionId===l.params.id)));return v(async()=>{o.value=!0;try{n.value=await g.listProducts()}finally{o.value=!1}}),(i,a)=>{const m=B("container");return t(),s("div",z,[e(I,{title:p.value,"back-to":"search"},null,8,["title"]),e(y,{spinning:o.value,tip:"درحال دریافت اطلاعات"},{default:u(()=>[e(m,{class:"coll__body"},{default:u(()=>[e(N,{title:"محصولات این مجموعه",subtitle:"برای دیدن جزئیات، روی محصول ضربه بزنید"}),c.value.length?(t(),s("div",F,[(t(!0),s(P,null,k(c.value,r=>(t(),V(S,{key:r.id,value:r},null,8,["value"]))),128))])):o.value?x("",!0):(t(),s("section",j,[e(C,{icon:"vuesax-linear:box",size:"26"}),a[0]||(a[0]=h("p",null,"در این مجموعه محصولی ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"])])}}}),R=w(q,[["__scopeId","data-v-7e172d86"]]);export{R as default}; +import{d as f,o as v,s as g,c as s,p as e,z as u,J as y,g as d,h as _,f as t,F as P,r as k,I as C,b as h,e as x,B,S as b,j as V,_ as w}from"./index-Dp9sxvBv.js";import{P as I}from"./PageBar-El-laHqK.js";import{S as N}from"./SectionHead-DNG9ywW4.js";import{P as S}from"./ProductCard-CvKEozHI.js";const z={class:"coll"},F={key:0,class:"coll__grid"},j={key:1,class:"coll__empty"},q=f({__name:"CollectionView",setup(E){const l=b(),o=d(!1),n=d([]),p=_(()=>l.query.page||"مجموعه"),c=_(()=>n.value.filter(i=>i.collections.some(a=>a.collectionId===l.params.id)));return v(async()=>{o.value=!0;try{n.value=await g.listProducts()}finally{o.value=!1}}),(i,a)=>{const m=B("container");return t(),s("div",z,[e(I,{title:p.value,"back-to":"search"},null,8,["title"]),e(y,{spinning:o.value,tip:"درحال دریافت اطلاعات"},{default:u(()=>[e(m,{class:"coll__body"},{default:u(()=>[e(N,{title:"محصولات این مجموعه",subtitle:"برای دیدن جزئیات، روی محصول ضربه بزنید"}),c.value.length?(t(),s("div",F,[(t(!0),s(P,null,k(c.value,r=>(t(),V(S,{key:r.id,value:r},null,8,["value"]))),128))])):o.value?x("",!0):(t(),s("section",j,[e(C,{icon:"vuesax-linear:box",size:"26"}),a[0]||(a[0]=h("p",null,"در این مجموعه محصولی ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"])])}}}),R=w(q,[["__scopeId","data-v-7e172d86"]]);export{R as default}; diff --git a/apps/user-app-v2/dist/assets/CompleteProfileView-h4pf7JXN.js b/apps/user-app-v2/dist/assets/CompleteProfileView-CxdqhMlz.js similarity index 96% rename from apps/user-app-v2/dist/assets/CompleteProfileView-h4pf7JXN.js rename to apps/user-app-v2/dist/assets/CompleteProfileView-CxdqhMlz.js index 4fa9ede..3328cbf 100644 --- a/apps/user-app-v2/dist/assets/CompleteProfileView-h4pf7JXN.js +++ b/apps/user-app-v2/dist/assets/CompleteProfileView-CxdqhMlz.js @@ -1 +1 @@ -import{d as B,f as r,c,i as $,b as d,p as n,I as w,t as h,e as x,g as o,s as P,_ as I,z as C,J as S,P as U,aN as z,K as D,B as V,C as N,U as R}from"./index-BWyw3RAx.js";import{P as T}from"./PageBar-D5DXU6sO.js";const j=["disabled"],E=["src"],L={key:1,class:"siu__icon"},M={class:"siu__text"},A={key:2,class:"siu__badge"},J={key:0,class:"siu__error"},K=8*1024*1024,O=B({__name:"SingleImageUploader",props:{uploadText:{},purpose:{}},emits:["done"],setup(g,{emit:b}){const a=g,_=b,l=o(null),i=o(!1),t=o(null),u=o(null),m=o(null);async function s(v){var f;const e=v.target,p=(f=e.files)==null?void 0:f[0];if(e.value="",!!p){if(t.value=null,p.size>K){t.value="حجم فایل بیش از حد مجاز است (۸ مگابایت)";return}i.value=!0;try{const k=await P.uploadDocument(p,a.purpose);u.value=k.id,m.value=p.type.startsWith("image/")?URL.createObjectURL(p):null,_("done",k.id)}catch{t.value="بارگذاری انجام نشد. دوباره تلاش کنید.",u.value=null,m.value=null}finally{i.value=!1}}}return(v,e)=>(r(),c("div",{class:$(["siu",{"is-done":!!u.value,"is-error":!!t.value}])},[d("input",{ref_key:"input",ref:l,type:"file",accept:"image/jpeg,image/png,image/webp,application/pdf",class:"siu__input",onChange:s},null,544),d("button",{type:"button",class:"siu__box",disabled:i.value,onClick:e[0]||(e[0]=p=>{var f;return(f=l.value)==null?void 0:f.click()})},[m.value?(r(),c("img",{key:0,src:m.value,class:"siu__preview",alt:""},null,8,E)):(r(),c("span",L,[n(w,{icon:i.value?"vuesax-linear:refresh":"vuesax-linear:gallery-add",size:"26"},null,8,["icon"])])),d("span",M,h(i.value?"در حال بارگذاری…":u.value?"تغییر تصویر":g.uploadText),1),u.value&&!i.value?(r(),c("span",A,[n(w,{icon:"vuesax-linear:tick-circle",size:"16"})])):x("",!0)],8,j),t.value?(r(),c("p",J,h(t.value),1)):x("",!0)],2))}}),y=I(O,[["__scopeId","data-v-3a42e270"]]),W={class:"cpf"},X={key:0,class:"cpf__error"},Y=["disabled"],q=B({__name:"CompleteProfileView",setup(g){const b=N(),a=D({business_license_image_id:null,shop_image_id:null,ncode_image_id:null}),_=o(!1),l=o(!1),i=o(null);async function t(){if(i.value=null,!a.business_license_image_id||!a.shop_image_id||!a.ncode_image_id){R.warning("لطفا تمامی عکس های خواسته شده را آپلود کنید");return}_.value=!0;try{await P.completeProfile({business_license_image_id:a.business_license_image_id,shop_image_id:a.shop_image_id,ncode_image_id:a.ncode_image_id}),l.value=!0}catch{i.value="ثبت اطلاعات انجام نشد. دوباره تلاش کنید."}finally{_.value=!1}}function u(){l.value=!1,b.push({name:"home"})}return(m,s)=>{const v=V("container");return r(),c("div",W,[n(T,{title:"تکمیل پروفایل","back-to":"userPage::hasSubRoute"}),n(S,{spinning:_.value,tip:"در حال ثبت اطلاعات"},{default:C(()=>[n(v,{class:"cpf__body"},{default:C(()=>[s[4]||(s[4]=d("p",{class:"cpf__lead"}," برای تکمیل پروفایل، سه مدرک زیر را بارگذاری کنید. ",-1)),d("form",{class:"cpf__form",onSubmit:z(t,["prevent"])},[n(y,{"upload-text":"بارگذاری عکس جواز کسب",purpose:"business-license",onDone:s[0]||(s[0]=e=>a.business_license_image_id=e)}),n(y,{"upload-text":"بارگذاری عکس سردر مغازه",purpose:"shop-image",onDone:s[1]||(s[1]=e=>a.shop_image_id=e)}),n(y,{"upload-text":"بارگذاری عکس کارت ملی",purpose:"national-card",onDone:s[2]||(s[2]=e=>a.ncode_image_id=e)}),i.value?(r(),c("p",X,h(i.value),1)):x("",!0),d("button",{type:"submit",class:"cpf__submit",disabled:_.value}," بارگذاری اطلاعات ",8,Y)],32)]),_:1})]),_:1},8,["spinning"]),n(U,{show:l.value,"onUpdate:show":s[3]||(s[3]=e=>l.value=e),art:"success",title:"تکمیل اطلاعات شما با موفقیت انجام شد.",description:"مدارک شما با موفقیت بارگذاری شد.","confirm-text":"متوجه شدم","close-on-click-overlay":!1,onConfirm:u},null,8,["show"])])}}}),H=I(q,[["__scopeId","data-v-630e0720"]]);export{H as default}; +import{d as B,f as r,c,i as $,b as d,p as n,I as w,t as h,e as x,g as o,s as P,_ as I,z as C,J as S,P as U,aN as z,K as D,B as V,C as N,U as R}from"./index-Dp9sxvBv.js";import{P as T}from"./PageBar-El-laHqK.js";const j=["disabled"],E=["src"],L={key:1,class:"siu__icon"},M={class:"siu__text"},A={key:2,class:"siu__badge"},J={key:0,class:"siu__error"},K=8*1024*1024,O=B({__name:"SingleImageUploader",props:{uploadText:{},purpose:{}},emits:["done"],setup(g,{emit:b}){const a=g,_=b,l=o(null),i=o(!1),t=o(null),u=o(null),m=o(null);async function s(v){var f;const e=v.target,p=(f=e.files)==null?void 0:f[0];if(e.value="",!!p){if(t.value=null,p.size>K){t.value="حجم فایل بیش از حد مجاز است (۸ مگابایت)";return}i.value=!0;try{const k=await P.uploadDocument(p,a.purpose);u.value=k.id,m.value=p.type.startsWith("image/")?URL.createObjectURL(p):null,_("done",k.id)}catch{t.value="بارگذاری انجام نشد. دوباره تلاش کنید.",u.value=null,m.value=null}finally{i.value=!1}}}return(v,e)=>(r(),c("div",{class:$(["siu",{"is-done":!!u.value,"is-error":!!t.value}])},[d("input",{ref_key:"input",ref:l,type:"file",accept:"image/jpeg,image/png,image/webp,application/pdf",class:"siu__input",onChange:s},null,544),d("button",{type:"button",class:"siu__box",disabled:i.value,onClick:e[0]||(e[0]=p=>{var f;return(f=l.value)==null?void 0:f.click()})},[m.value?(r(),c("img",{key:0,src:m.value,class:"siu__preview",alt:""},null,8,E)):(r(),c("span",L,[n(w,{icon:i.value?"vuesax-linear:refresh":"vuesax-linear:gallery-add",size:"26"},null,8,["icon"])])),d("span",M,h(i.value?"در حال بارگذاری…":u.value?"تغییر تصویر":g.uploadText),1),u.value&&!i.value?(r(),c("span",A,[n(w,{icon:"vuesax-linear:tick-circle",size:"16"})])):x("",!0)],8,j),t.value?(r(),c("p",J,h(t.value),1)):x("",!0)],2))}}),y=I(O,[["__scopeId","data-v-3a42e270"]]),W={class:"cpf"},X={key:0,class:"cpf__error"},Y=["disabled"],q=B({__name:"CompleteProfileView",setup(g){const b=N(),a=D({business_license_image_id:null,shop_image_id:null,ncode_image_id:null}),_=o(!1),l=o(!1),i=o(null);async function t(){if(i.value=null,!a.business_license_image_id||!a.shop_image_id||!a.ncode_image_id){R.warning("لطفا تمامی عکس های خواسته شده را آپلود کنید");return}_.value=!0;try{await P.completeProfile({business_license_image_id:a.business_license_image_id,shop_image_id:a.shop_image_id,ncode_image_id:a.ncode_image_id}),l.value=!0}catch{i.value="ثبت اطلاعات انجام نشد. دوباره تلاش کنید."}finally{_.value=!1}}function u(){l.value=!1,b.push({name:"home"})}return(m,s)=>{const v=V("container");return r(),c("div",W,[n(T,{title:"تکمیل پروفایل","back-to":"userPage::hasSubRoute"}),n(S,{spinning:_.value,tip:"در حال ثبت اطلاعات"},{default:C(()=>[n(v,{class:"cpf__body"},{default:C(()=>[s[4]||(s[4]=d("p",{class:"cpf__lead"}," برای تکمیل پروفایل، سه مدرک زیر را بارگذاری کنید. ",-1)),d("form",{class:"cpf__form",onSubmit:z(t,["prevent"])},[n(y,{"upload-text":"بارگذاری عکس جواز کسب",purpose:"business-license",onDone:s[0]||(s[0]=e=>a.business_license_image_id=e)}),n(y,{"upload-text":"بارگذاری عکس سردر مغازه",purpose:"shop-image",onDone:s[1]||(s[1]=e=>a.shop_image_id=e)}),n(y,{"upload-text":"بارگذاری عکس کارت ملی",purpose:"national-card",onDone:s[2]||(s[2]=e=>a.ncode_image_id=e)}),i.value?(r(),c("p",X,h(i.value),1)):x("",!0),d("button",{type:"submit",class:"cpf__submit",disabled:_.value}," بارگذاری اطلاعات ",8,Y)],32)]),_:1})]),_:1},8,["spinning"]),n(U,{show:l.value,"onUpdate:show":s[3]||(s[3]=e=>l.value=e),art:"success",title:"تکمیل اطلاعات شما با موفقیت انجام شد.",description:"مدارک شما با موفقیت بارگذاری شد.","confirm-text":"متوجه شدم","close-on-click-overlay":!1,onConfirm:u},null,8,["show"])])}}}),H=I(q,[["__scopeId","data-v-630e0720"]]);export{H as default}; diff --git a/apps/user-app-v2/dist/assets/CustomerChoiceView-B2Wj4PsY.css b/apps/user-app-v2/dist/assets/CustomerChoiceView-B2Wj4PsY.css deleted file mode 100644 index ece1073..0000000 --- a/apps/user-app-v2/dist/assets/CustomerChoiceView-B2Wj4PsY.css +++ /dev/null @@ -1 +0,0 @@ -.cch__barExtra[data-v-e8f131ad]{padding:0 16px 12px}.cch__body[data-v-e8f131ad]{padding-top:132px;padding-bottom:90px}.cch__list[data-v-e8f131ad]{display:flex;flex-direction:column;padding-top:8px}.cch__card[data-v-e8f131ad]{padding:18px 2px;background:transparent;border:none;border-bottom:1px solid var(--c-hairline);cursor:pointer}.cch__card[data-v-e8f131ad]:last-child{border-bottom:none}.cch__card[data-v-e8f131ad]:active{opacity:.75}.cch__head[data-v-e8f131ad]{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}.cch__name[data-v-e8f131ad]{margin:0;font-size:15.5px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cch__state[data-v-e8f131ad]{flex:0 0 auto;padding:4px 12px;border-radius:999px;font-size:11.5px;font-weight:600}.cch__state.is-on[data-v-e8f131ad]{color:var(--c-green);background:rgb(var(--c-green-rgb) / 14%)}.cch__state.is-off[data-v-e8f131ad]{color:var(--c-red);background:rgb(var(--c-red-rgb) / 12%)}.cch__facts[data-v-e8f131ad]{display:flex;flex-direction:column;gap:7px}.cch__fact[data-v-e8f131ad]{display:flex;align-items:center;gap:7px;font-size:13px;font-weight:600;color:var(--c-inkFaint)}.cch__empty[data-v-e8f131ad]{margin-top:8px;padding:34px 20px;border:1px dashed var(--c-hairline);border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--c-inkFaint)}.cch__empty p[data-v-e8f131ad]{margin:0;font-size:12.5px}.cch__retry[data-v-e8f131ad]{padding:8px 18px;border-radius:999px;border:1px solid var(--c-hairline);background:var(--c-canvas);font-family:inherit;font-size:12px;font-weight:600;cursor:pointer}.cch__detail[data-v-e8f131ad]{padding:20px 16px 24px}.cch__detailTitle[data-v-e8f131ad]{margin:0 0 16px;font-size:17px;font-weight:700}.cch__rows[data-v-e8f131ad]{margin:0;display:flex;flex-direction:column}.cch__row[data-v-e8f131ad]{display:flex;justify-content:space-between;align-items:center;padding:13px 2px;border-bottom:1px solid var(--c-hairline)}.cch__row[data-v-e8f131ad]:last-child{border-bottom:none}.cch__row dt[data-v-e8f131ad]{font-size:13px;color:var(--c-inkFaint)}.cch__row dd[data-v-e8f131ad]{margin:0;font-size:14px;font-weight:600}.cch__close[data-v-e8f131ad]{margin-top:18px;width:100%;padding:13px;border:none;border-radius:14px;background:var(--c-ink);color:var(--c-onInk);font-family:inherit;font-size:14px;font-weight:700;cursor:pointer} diff --git a/apps/user-app-v2/dist/assets/CustomerChoiceView-D-JqOITb.js b/apps/user-app-v2/dist/assets/CustomerChoiceView-D-JqOITb.js new file mode 100644 index 0000000..7684eb7 --- /dev/null +++ b/apps/user-app-v2/dist/assets/CustomerChoiceView-D-JqOITb.js @@ -0,0 +1 @@ +import{d as S,o as B,c,p as o,z as i,J as N,m as u,g as d,s as P,f as r,b as s,F as D,r as F,I as v,t as l,e as g,B as I,i as E,_ as L}from"./index-Dp9sxvBv.js";import{P as R}from"./PageBar-El-laHqK.js";import{S as $}from"./SearchInput-OrOd8Tqr.js";import{D as U}from"./index-UuozCFb-.js";import{P as J,L as w}from"./index-B0RgkHMm.js";import"./KeyCode-DAs3W-5E.js";import"./classCallCheck-BTVV3tFI.js";import"./raf-nDFcuFT6.js";const M={class:"cch"},O={class:"cch__barExtra"},T={key:0,class:"cch__list"},j=["onClick"],q={class:"cch__head"},A={class:"cch__name"},G={class:"cch__facts"},H={class:"cch__fact"},K={dir:"ltr"},Q={class:"cch__fact"},W={dir:"ltr"},X={key:0,class:"cch__fact"},Y={key:1,class:"cch__empty"},Z={key:2,class:"cch__empty"},ss={key:0,class:"cch__detail"},es={class:"cch__detailTitle"},ts={class:"cch__rows"},os={class:"cch__row"},ls={dir:"ltr"},as={class:"cch__row"},ns={dir:"ltr"},is={class:"cch__row"},cs={class:"cch__row"},rs={class:"cch__row"},ds={dir:"ltr"},_s={class:"cch__row"},us={dir:"ltr"},vs={class:"cch__row"},hs=S({__name:"CustomerChoiceView",setup(ps){const _=d([]),h=d(!1),b=d(!1),p=d(!1),y=d(null),f=d(!1),a=d(null);function C(n){const e=Number(n??0);return Number.isFinite(e)?e.toFixed(3):"0.000"}async function m(){h.value=!0,p.value=!1;try{_.value=await P.getExpertCustomers(y.value)}catch{p.value=!0,_.value=[]}finally{h.value=!1}}async function k(n){y.value=n!=null&&n.trim()?n.trim():null,await m()}async function x(){await m(),b.value=!1}function z(n){a.value=n,f.value=!0}return B(m),(n,e)=>{const V=I("container");return r(),c("div",M,[o(R,{title:"لیست مشتریان","back-to":"userPage::hasSubRoute"},{below:i(()=>[s("div",O,[o($,{onSearch:k,"place-holder":"جستجو"})])]),_:1}),o(N,{spinning:h.value&&!_.value.length,tip:"درحال دریافت اطلاعات"},{default:i(()=>[o(u(J),{modelValue:b.value,"onUpdate:modelValue":e[0]||(e[0]=t=>b.value=t),onRefresh:x},{pulling:i(()=>[o(u(w),{size:"18"})]),loosing:i(()=>[o(u(w),{size:"18"})]),loading:i(()=>[o(u(w),{size:"18"})]),success:i(()=>[...e[3]||(e[3]=[s("span",null,null,-1)])]),default:i(()=>[o(V,{class:"cch__body"},{default:i(()=>[_.value.length?(r(),c("div",T,[(r(!0),c(D,null,F(_.value,t=>(r(),c("article",{key:t.id,class:"cch__card",onClick:fs=>z(t)},[s("div",q,[s("h3",A,l(t.name),1),s("span",{class:E(["cch__state",t.active===1?"is-on":"is-off"])},l(t.active===1?"فعال":"غیرفعال"),3)]),s("div",G,[s("div",H,[o(v,{icon:"vuesax-linear:mobile",size:"15"}),s("span",K,l(t.mobile||"—"),1)]),s("div",Q,[o(v,{icon:"vuesax-linear:call",size:"15"}),s("span",W,l(t.phone||"—"),1)]),t.store_name?(r(),c("div",X,[o(v,{icon:"vuesax-linear:shop",size:"15"}),s("span",null,l(t.store_name),1)])):g("",!0)])],8,j))),128))])):!h.value&&!p.value?(r(),c("section",Y,[o(v,{icon:"vuesax-linear:profile-2user",size:"26"}),s("p",null,l(y.value?"مشتری با این مشخصات پیدا نشد.":"هنوز مشتری‌ای به شما معرفی نشده است."),1)])):g("",!0),p.value?(r(),c("section",Z,[o(v,{icon:"vuesax-linear:danger",size:"26"}),e[4]||(e[4]=s("p",null,"دریافت اطلاعات با خطا روبه‌رو شد.",-1)),s("button",{type:"button",class:"cch__retry",onClick:m},"تلاش دوباره")])):g("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["spinning"]),o(u(U),{open:f.value,"onUpdate:open":e[2]||(e[2]=t=>f.value=t),placement:"bottom",height:"auto",closable:!1,"body-style":{padding:"0"}},{default:i(()=>[a.value?(r(),c("div",ss,[s("h2",es,l(a.value.name),1),s("dl",ts,[s("div",os,[e[5]||(e[5]=s("dt",null,"موبایل",-1)),s("dd",ls,l(a.value.mobile||"—"),1)]),s("div",as,[e[6]||(e[6]=s("dt",null,"تلفن",-1)),s("dd",ns,l(a.value.phone||"—"),1)]),s("div",is,[e[7]||(e[7]=s("dt",null,"نام مغازه",-1)),s("dd",null,l(a.value.store_name||"—"),1)]),s("div",cs,[e[8]||(e[8]=s("dt",null,"نام پاساژ",-1)),s("dd",null,l(a.value.pasazh_name||"—"),1)]),s("div",rs,[e[9]||(e[9]=s("dt",null,"سقف اعتبار",-1)),s("dd",ds,l(C(a.value.gram_level))+" گرم",1)]),s("div",_s,[e[10]||(e[10]=s("dt",null,"بدهی گرمی",-1)),s("dd",us,l(C(a.value.remain))+" گرم",1)]),s("div",vs,[e[11]||(e[11]=s("dt",null,"وضعیت",-1)),s("dd",null,l(a.value.active===1?"فعال":"غیرفعال"),1)])]),s("button",{type:"button",class:"cch__close",onClick:e[1]||(e[1]=t=>f.value=!1)},"بستن")])):g("",!0)]),_:1},8,["open"])])}}}),zs=L(hs,[["__scopeId","data-v-b1fb7f3c"]]);export{zs as default}; diff --git a/apps/user-app-v2/dist/assets/CustomerChoiceView-H1FeybTn.css b/apps/user-app-v2/dist/assets/CustomerChoiceView-H1FeybTn.css new file mode 100644 index 0000000..72c479b --- /dev/null +++ b/apps/user-app-v2/dist/assets/CustomerChoiceView-H1FeybTn.css @@ -0,0 +1 @@ +.cch__barExtra[data-v-b1fb7f3c]{padding:0 16px 12px}.cch__body[data-v-b1fb7f3c]{padding-top:132px;padding-bottom:90px}.cch__list[data-v-b1fb7f3c]{display:flex;flex-direction:column;padding-top:8px}.cch__card[data-v-b1fb7f3c]{padding:18px 2px;background:transparent;border:none;border-bottom:1px solid var(--c-hairline);cursor:pointer}.cch__card[data-v-b1fb7f3c]:last-child{border-bottom:none}.cch__card[data-v-b1fb7f3c]:active{opacity:.75}.cch__head[data-v-b1fb7f3c]{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}.cch__name[data-v-b1fb7f3c]{margin:0;font-size:15.5px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cch__state[data-v-b1fb7f3c]{flex:0 0 auto;padding:4px 12px;border-radius:999px;font-size:11.5px;font-weight:600}.cch__state.is-on[data-v-b1fb7f3c]{color:var(--c-green);background:rgb(var(--c-green-rgb) / 14%)}.cch__state.is-off[data-v-b1fb7f3c]{color:var(--c-red);background:rgb(var(--c-red-rgb) / 12%)}.cch__facts[data-v-b1fb7f3c]{display:flex;flex-direction:column;gap:7px}.cch__fact[data-v-b1fb7f3c]{display:flex;align-items:center;gap:7px;font-size:13px;font-weight:600;color:var(--c-inkFaint)}.cch__empty[data-v-b1fb7f3c]{margin-top:8px;padding:34px 20px;border:1px dashed var(--c-hairline);border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--c-inkFaint)}.cch__empty p[data-v-b1fb7f3c]{margin:0;font-size:12.5px}.cch__retry[data-v-b1fb7f3c]{padding:8px 18px;border-radius:999px;border:1px solid var(--c-hairline);background:var(--c-canvas);font-family:inherit;font-size:12px;font-weight:600;cursor:pointer}.cch__detail[data-v-b1fb7f3c]{padding:20px 16px 24px}.cch__detailTitle[data-v-b1fb7f3c]{margin:0 0 16px;font-size:17px;font-weight:700}.cch__rows[data-v-b1fb7f3c]{margin:0;display:flex;flex-direction:column}.cch__row[data-v-b1fb7f3c]{display:flex;justify-content:space-between;align-items:center;padding:13px 2px;border-bottom:1px solid var(--c-hairline)}.cch__row[data-v-b1fb7f3c]:last-child{border-bottom:none}.cch__row dt[data-v-b1fb7f3c]{font-size:13px;color:var(--c-inkFaint)}.cch__row dd[data-v-b1fb7f3c]{margin:0;font-size:14px;font-weight:600}.cch__close[data-v-b1fb7f3c]{margin-top:18px;width:100%;padding:13px;border:none;border-radius:14px;background:var(--c-ink);color:var(--c-onInk);font-family:inherit;font-size:14px;font-weight:700;cursor:pointer} diff --git a/apps/user-app-v2/dist/assets/CustomerChoiceView-Yt6glUHR.js b/apps/user-app-v2/dist/assets/CustomerChoiceView-Yt6glUHR.js deleted file mode 100644 index 9692219..0000000 --- a/apps/user-app-v2/dist/assets/CustomerChoiceView-Yt6glUHR.js +++ /dev/null @@ -1 +0,0 @@ -import{d as V,o as S,c,p as a,z as d,J as B,m as w,g as r,s as N,f as i,b as s,F as P,r as D,I as u,t as o,e as m,B as F,i as I,_ as E}from"./index-BWyw3RAx.js";import{P as R}from"./PageBar-D5DXU6sO.js";import{S as $}from"./SearchInput-BZCG2e_m.js";import{D as U}from"./index-sLHXZqt3.js";import{P as J}from"./index-ecOSUWQv.js";import"./KeyCode-CA5MXqE7.js";import"./classCallCheck-Ou87VTNv.js";import"./raf-nDFcuFT6.js";const L={class:"cch"},M={class:"cch__barExtra"},O={key:0,class:"cch__list"},T=["onClick"],j={class:"cch__head"},q={class:"cch__name"},A={class:"cch__facts"},G={class:"cch__fact"},H={dir:"ltr"},K={class:"cch__fact"},Q={dir:"ltr"},W={key:0,class:"cch__fact"},X={key:1,class:"cch__empty"},Y={key:2,class:"cch__empty"},Z={key:0,class:"cch__detail"},ss={class:"cch__detailTitle"},es={class:"cch__rows"},ts={class:"cch__row"},os={dir:"ltr"},as={class:"cch__row"},ls={dir:"ltr"},ns={class:"cch__row"},cs={class:"cch__row"},is={class:"cch__row"},rs={dir:"ltr"},_s={class:"cch__row"},ds={dir:"ltr"},us={class:"cch__row"},vs=V({__name:"CustomerChoiceView",setup(hs){const _=r([]),v=r(!1),y=r(!1),h=r(!1),b=r(null),p=r(!1),l=r(null);function g(n){const e=Number(n??0);return Number.isFinite(e)?e.toFixed(3):"0.000"}async function f(){v.value=!0,h.value=!1;try{_.value=await N.getExpertCustomers(b.value)}catch{h.value=!0,_.value=[]}finally{v.value=!1}}async function C(n){b.value=n!=null&&n.trim()?n.trim():null,await f()}async function k(){await f(),y.value=!1}function x(n){l.value=n,p.value=!0}return S(f),(n,e)=>{const z=F("container");return i(),c("div",L,[a(R,{title:"لیست مشتریان","back-to":"userPage::hasSubRoute"},{below:d(()=>[s("div",M,[a($,{onSearch:C,"place-holder":"جستجو"})])]),_:1}),a(B,{spinning:v.value&&!_.value.length,tip:"درحال دریافت اطلاعات"},{default:d(()=>[a(w(J),{modelValue:y.value,"onUpdate:modelValue":e[0]||(e[0]=t=>y.value=t),onRefresh:k},{default:d(()=>[a(z,{class:"cch__body"},{default:d(()=>[_.value.length?(i(),c("div",O,[(i(!0),c(P,null,D(_.value,t=>(i(),c("article",{key:t.id,class:"cch__card",onClick:ps=>x(t)},[s("div",j,[s("h3",q,o(t.name),1),s("span",{class:I(["cch__state",t.active===1?"is-on":"is-off"])},o(t.active===1?"فعال":"غیرفعال"),3)]),s("div",A,[s("div",G,[a(u,{icon:"vuesax-linear:mobile",size:"15"}),s("span",H,o(t.mobile||"—"),1)]),s("div",K,[a(u,{icon:"vuesax-linear:call",size:"15"}),s("span",Q,o(t.phone||"—"),1)]),t.store_name?(i(),c("div",W,[a(u,{icon:"vuesax-linear:shop",size:"15"}),s("span",null,o(t.store_name),1)])):m("",!0)])],8,T))),128))])):!v.value&&!h.value?(i(),c("section",X,[a(u,{icon:"vuesax-linear:profile-2user",size:"26"}),s("p",null,o(b.value?"مشتری با این مشخصات پیدا نشد.":"هنوز مشتری‌ای به شما معرفی نشده است."),1)])):m("",!0),h.value?(i(),c("section",Y,[a(u,{icon:"vuesax-linear:danger",size:"26"}),e[3]||(e[3]=s("p",null,"دریافت اطلاعات با خطا روبه‌رو شد.",-1)),s("button",{type:"button",class:"cch__retry",onClick:f},"تلاش دوباره")])):m("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["spinning"]),a(w(U),{open:p.value,"onUpdate:open":e[2]||(e[2]=t=>p.value=t),placement:"bottom",height:"auto",closable:!1,"body-style":{padding:"0"}},{default:d(()=>[l.value?(i(),c("div",Z,[s("h2",ss,o(l.value.name),1),s("dl",es,[s("div",ts,[e[4]||(e[4]=s("dt",null,"موبایل",-1)),s("dd",os,o(l.value.mobile||"—"),1)]),s("div",as,[e[5]||(e[5]=s("dt",null,"تلفن",-1)),s("dd",ls,o(l.value.phone||"—"),1)]),s("div",ns,[e[6]||(e[6]=s("dt",null,"نام مغازه",-1)),s("dd",null,o(l.value.store_name||"—"),1)]),s("div",cs,[e[7]||(e[7]=s("dt",null,"نام پاساژ",-1)),s("dd",null,o(l.value.pasazh_name||"—"),1)]),s("div",is,[e[8]||(e[8]=s("dt",null,"سقف اعتبار",-1)),s("dd",rs,o(g(l.value.gram_level))+" گرم",1)]),s("div",_s,[e[9]||(e[9]=s("dt",null,"بدهی گرمی",-1)),s("dd",ds,o(g(l.value.remain))+" گرم",1)]),s("div",us,[e[10]||(e[10]=s("dt",null,"وضعیت",-1)),s("dd",null,o(l.value.active===1?"فعال":"غیرفعال"),1)])]),s("button",{type:"button",class:"cch__close",onClick:e[1]||(e[1]=t=>p.value=!1)},"بستن")])):m("",!0)]),_:1},8,["open"])])}}}),xs=E(vs,[["__scopeId","data-v-e8f131ad"]]);export{xs as default}; diff --git a/apps/user-app-v2/dist/assets/DashboardView-B0WNzWOb.js b/apps/user-app-v2/dist/assets/DashboardView-B0WNzWOb.js deleted file mode 100644 index 96544b2..0000000 --- a/apps/user-app-v2/dist/assets/DashboardView-B0WNzWOb.js +++ /dev/null @@ -1 +0,0 @@ -import{d as P,O as E,o as M,x as B,c,b as s,m as l,p as a,e as F,z as p,P as T,C as U,g as m,K as q,s as $,f as h,i as D,n as b,t as v,N as G,I as n,F as O,h as k,B as A,_ as K}from"./index-BWyw3RAx.js";import{R as j}from"./RateStrip-0Viss8IX.js";import{p as H}from"./filters-DVocLz3o.js";import{P as J,L as z}from"./index-ecOSUWQv.js";const Q={class:"dash"},W={class:"dash__bar"},X={class:"dash__barInner"},Y={class:"dash__heroTop"},Z={class:"dash__heroIdentity"},ss={class:"dash__heroName"},es={class:"dash__heroMobile"},as={class:"dash__heroFigure"},ns={class:"dash__heroNum"},os={class:"dash__heroUnit"},ts={class:"dash__heroDebt"},ls={class:"dash__inviteIcon","aria-hidden":"true"},is={class:"dash__rowIcon","aria-hidden":"true"},rs={class:"dash__rowIcon","aria-hidden":"true"},us={class:"dash__rowIcon","aria-hidden":"true"},ds={class:"dash__rowIcon","aria-hidden":"true"},_s={class:"dash__rowIcon","aria-hidden":"true"},ps={class:"dash__rowIcon","aria-hidden":"true"},vs={class:"dash__rowIcon","aria-hidden":"true"},cs={class:"dash__rowIcon","aria-hidden":"true"},hs=70,fs=P({__name:"DashboardView",setup(ms){const t=U(),_=E(),r=m(null),w=m(null),x=m(!1),y=k(()=>r.value?parseFloat(r.value.goldDebtGrams)>0:!1),N=k(()=>y.value?"بدهکار":"بستانکار"),L=k(()=>r.value?Math.abs(parseFloat(r.value.goldDebtGrams)):0),u=q({notify:!1,loginNotify:!1});function d(i){if(!_.isLoggedIn){u.loginNotify=!0;return}i===0&&t.push({name:"ordersList"}),i===1&&t.push({name:"transactionsList"}),i===2&&t.push({name:"profileData"}),i===3&&t.push({name:"favoritesList"}),i===4&&t.push({name:"ChildOrder"}),i===5&&t.push({name:"customerChoice"}),i===6&&t.push({name:"report"})}function S(){_.logout(),u.notify=!1,t.push({name:"home"})}async function C(){_.isLoggedIn&&(r.value=await $.getMe());try{w.value=await $.getLatestGoldPrice()}catch{w.value=null}}async function V(){await C(),x.value=!1}let I=!1;const g=m(I);function f(i){return{"--reveal-delay":`${i*hs}ms`}}return M(async()=>{await C(),!g.value&&(await B(),requestAnimationFrame(()=>{g.value=!0,I=!0}))}),(i,e)=>{const R=A("container");return h(),c("div",Q,[s("header",W,[s("div",X,[e[14]||(e[14]=s("span",{class:"dash__brand"},"میز کار",-1)),l(_).isLoggedIn?(h(),c("button",{key:0,type:"button",class:"dash__exit","aria-label":"خروج",onClick:e[0]||(e[0]=o=>u.notify=!0)},[a(n,{icon:"vuesax-linear:logout",size:"18"})])):F("",!0)])]),a(l(J),{modelValue:x.value,"onUpdate:modelValue":e[10]||(e[10]=o=>x.value=o),onRefresh:V},{pulling:p(()=>[a(l(z),{size:"18"})]),loosing:p(()=>[a(l(z),{size:"18"})]),loading:p(()=>[a(l(z),{size:"18"})]),success:p(()=>[...e[15]||(e[15]=[s("span",null,null,-1)])]),default:p(()=>[a(R,{class:D(["dash__body",{"is-revealed":g.value}])},{default:p(()=>[r.value?(h(),c("section",{key:0,class:"dash__hero dash__reveal",style:b(f(0))},[s("div",Y,[s("div",Z,[s("span",ss,v(r.value.fullName),1),s("span",es,v(l(_).mobile),1)]),s("span",{class:D(["dash__heroSeal",y.value?"is-debtor":"is-creditor"])},v(y.value?"بدهکار":"بستانکار"),3)]),s("div",as,[s("span",ns,v(L.value),1),s("span",os,"گرم "+v(N.value),1)]),s("div",ts,[e[17]||(e[17]=s("span",null,"بدهی ریالی",-1)),s("b",null,[G(v(l(H)(r.value.fiatDebtRial))+" ",1),e[16]||(e[16]=s("i",null,"ریال",-1))])])],4)):(h(),c("section",{key:1,class:"dash__invite dash__reveal",style:b(f(0))},[s("div",ls,[a(n,{icon:"vuesax-linear:security-user",size:"22",color:"#fff"})]),e[18]||(e[18]=s("h3",null,"حساب گرمی شما",-1)),e[19]||(e[19]=s("p",null,"برای دیدن موجودی، سفارش‌ها و اسناد خود وارد شوید.",-1)),s("button",{type:"button",class:"dash__inviteCta",onClick:e[1]||(e[1]=o=>l(t).push({name:"login"}))}," ورود / ثبت‌نام ")],4)),s("section",{class:"dash__rows dash__reveal",style:b(f(1))},[s("button",{type:"button",class:"dash__row",onClick:e[2]||(e[2]=o=>d(0))},[s("span",is,[a(n,{icon:"vuesax-linear:box",size:"18"})]),e[20]||(e[20]=s("span",{class:"dash__rowText"},[s("b",null,"سفارشات"),s("small",null,"پیگیری سفارش‌های شما")],-1)),a(n,{icon:"vuesax-linear:arrow-left-2",size:"16",color:"var(--c-inkFaint)"})]),s("button",{type:"button",class:"dash__row",onClick:e[3]||(e[3]=o=>d(1))},[s("span",rs,[a(n,{icon:"vuesax-linear:receipt-text",size:"18"})]),e[21]||(e[21]=s("span",{class:"dash__rowText"},[s("b",null,"اسناد"),s("small",null,"تراکنش‌ها و رسیدهای حساب")],-1)),a(n,{icon:"vuesax-linear:arrow-left-2",size:"16",color:"var(--c-inkFaint)"})]),s("button",{type:"button",class:"dash__row",onClick:e[4]||(e[4]=o=>d(2))},[s("span",us,[a(n,{icon:"vuesax-linear:user",size:"18"})]),e[22]||(e[22]=s("span",{class:"dash__rowText"},[s("b",null,"پروفایل"),s("small",null,"اطلاعات و تنظیمات حساب")],-1)),a(n,{icon:"vuesax-linear:arrow-left-2",size:"16",color:"var(--c-inkFaint)"})]),s("button",{type:"button",class:"dash__row",onClick:e[5]||(e[5]=o=>d(3))},[s("span",ds,[a(n,{icon:"vuesax-linear:heart",size:"18"})]),e[23]||(e[23]=s("span",{class:"dash__rowText"},[s("b",null,"علاقمندی"),s("small",null,"محصولات ذخیره‌شده شما")],-1)),a(n,{icon:"vuesax-linear:arrow-left-2",size:"16",color:"var(--c-inkFaint)"})]),s("button",{type:"button",class:"dash__row",onClick:e[6]||(e[6]=o=>d(6))},[s("span",_s,[a(n,{icon:"vuesax-linear:chart-2",size:"18"})]),e[24]||(e[24]=s("span",{class:"dash__rowText"},[s("b",null,"گزارش"),s("small",null,"گردش حساب طلایی و ریالی شما")],-1)),a(n,{icon:"vuesax-linear:arrow-left-2",size:"16",color:"var(--c-inkFaint)"})]),s("button",{type:"button",class:"dash__row",onClick:e[7]||(e[7]=o=>l(t).push({name:"appearanceSettings"}))},[s("span",ps,[a(n,{icon:"vuesax-linear:brush",size:"18"})]),e[25]||(e[25]=s("span",{class:"dash__rowText"},[s("b",null,"تنظیمات ظاهری"),s("small",null,"پوسته روشن و تیره، انیمیشن‌ها")],-1)),a(n,{icon:"vuesax-linear:arrow-left-2",size:"16",color:"var(--c-inkFaint)"})]),l(_).isSalesExpert?(h(),c(O,{key:0},[s("button",{type:"button",class:"dash__row",onClick:e[8]||(e[8]=o=>d(4))},[s("span",vs,[a(n,{icon:"vuesax-linear:box-tick",size:"18"})]),e[26]||(e[26]=s("span",{class:"dash__rowText"},[s("b",null,"سفارش مشتریان"),s("small",null,"سفارش‌های مشتریان معرفی‌شده شما")],-1)),a(n,{icon:"vuesax-linear:arrow-left-2",size:"16",color:"var(--c-inkFaint)"})]),s("button",{type:"button",class:"dash__row",onClick:e[9]||(e[9]=o=>d(5))},[s("span",cs,[a(n,{icon:"vuesax-linear:profile-2user",size:"18"})]),e[27]||(e[27]=s("span",{class:"dash__rowText"},[s("b",null,"مشتریان من"),s("small",null,"فهرست مشتریان معرفی‌شده شما")],-1)),a(n,{icon:"vuesax-linear:arrow-left-2",size:"16",color:"var(--c-inkFaint)"})])],64)):F("",!0)],4),a(j,{quote:w.value,class:"dash__rate dash__reveal",style:b(f(2))},null,8,["quote","style"])]),_:1},8,["class"])]),_:1},8,["modelValue"]),a(T,{show:u.notify,"onUpdate:show":e[11]||(e[11]=o=>u.notify=o),art:"logout",title:"آیا می خواهید از برنامه خارج شوید؟",description:"برای استفاده دوباره از امکانات منتزر، باید دوباره وارد حساب کاربری خود شوید.","confirm-text":"بله","cancel-text":"بی خیال",onConfirm:S},null,8,["show"]),a(T,{show:u.loginNotify,"onUpdate:show":e[12]||(e[12]=o=>u.loginNotify=o),art:"login",title:"ابتدا وارد حساب کاربری شوید",description:"برای دسترسی به تمامی امکانات نرم افزار منتزر، گزینه ورود/ثبت نام را لمس کنید و در صورت نداشتن حساب کاربری، ثبت نام نمایید.","confirm-text":"ورود/ثبت نام","cancel-text":"بیخیال",onConfirm:e[13]||(e[13]=o=>l(t).push({name:"login"}))},null,8,["show"])])}}}),gs=K(fs,[["__scopeId","data-v-244443b2"]]);export{gs as default}; diff --git a/apps/user-app-v2/dist/assets/DashboardView-BRB4XUhz.js b/apps/user-app-v2/dist/assets/DashboardView-BRB4XUhz.js new file mode 100644 index 0000000..e061817 --- /dev/null +++ b/apps/user-app-v2/dist/assets/DashboardView-BRB4XUhz.js @@ -0,0 +1 @@ +import{d as P,O as E,o as M,x as B,c as v,b as s,m as i,p as a,e as F,z as c,P as T,C as U,g as m,K as q,s as $,f as h,i as D,n as b,t as p,N as G,I as o,F as O,h as k,B as A,_ as K}from"./index-Dp9sxvBv.js";import{R as j}from"./RateStrip-Cjr1qlEL.js";import{p as H}from"./filters-CUgGgSea.js";import{P as J,L as z}from"./index-B0RgkHMm.js";const Q={class:"dash"},W={class:"dash__bar"},X={class:"dash__barInner"},Y={class:"dash__heroTop"},Z={class:"dash__heroIdentity"},ss={class:"dash__heroName"},es={class:"dash__heroMobile"},as={class:"dash__heroFigure"},os={class:"dash__heroNum"},ns={class:"dash__heroUnit"},ts={class:"dash__heroDebt"},ls={class:"dash__inviteIcon","aria-hidden":"true"},is={class:"dash__rowIcon","aria-hidden":"true"},rs={class:"dash__rowIcon","aria-hidden":"true"},us={class:"dash__rowIcon","aria-hidden":"true"},ds={class:"dash__rowIcon","aria-hidden":"true"},_s={class:"dash__rowIcon","aria-hidden":"true"},cs={class:"dash__rowIcon","aria-hidden":"true"},ps={class:"dash__rowIcon","aria-hidden":"true"},vs={class:"dash__rowIcon","aria-hidden":"true"},hs=70,fs=P({__name:"DashboardView",setup(ms){const l=U(),_=E(),r=m(null),w=m(null),x=m(!1),y=k(()=>r.value?parseFloat(r.value.goldDebtGrams)>0:!1),N=k(()=>y.value?"بدهکار":"بستانکار"),L=k(()=>r.value?Math.abs(parseFloat(r.value.goldDebtGrams)):0),u=q({notify:!1,loginNotify:!1});function d(t){if(!_.isLoggedIn){u.loginNotify=!0;return}t===0&&l.push({name:"ordersList"}),t===1&&l.push({name:"transactionsList"}),t===2&&l.push({name:"profileData"}),t===3&&l.push({name:"favoritesList"}),t===4&&l.push({name:"ChildOrder"}),t===5&&l.push({name:"customerChoice"}),t===6&&l.push({name:"report"})}function S(){_.logout(),u.notify=!1,l.push({name:"home"})}async function C(){if(_.isLoggedIn)try{r.value=await $.getMe()}catch(t){console.log(t)}try{w.value=await $.getLatestGoldPrice()}catch{w.value=null}}async function V(){await C(),x.value=!1}let I=!1;const g=m(I);function f(t){return{"--reveal-delay":`${t*hs}ms`}}return M(async()=>{await C(),!g.value&&(await B(),requestAnimationFrame(()=>{g.value=!0,I=!0}))}),(t,e)=>{const R=A("container");return h(),v("div",Q,[s("header",W,[s("div",X,[e[14]||(e[14]=s("span",{class:"dash__brand"},"میز کار",-1)),i(_).isLoggedIn?(h(),v("button",{key:0,type:"button",class:"dash__exit","aria-label":"خروج",onClick:e[0]||(e[0]=n=>u.notify=!0)},[a(o,{icon:"vuesax-linear:logout",size:"18"})])):F("",!0)])]),a(i(J),{modelValue:x.value,"onUpdate:modelValue":e[10]||(e[10]=n=>x.value=n),onRefresh:V},{pulling:c(()=>[a(i(z),{size:"18"})]),loosing:c(()=>[a(i(z),{size:"18"})]),loading:c(()=>[a(i(z),{size:"18"})]),success:c(()=>[...e[15]||(e[15]=[s("span",null,null,-1)])]),default:c(()=>[a(R,{class:D(["dash__body",{"is-revealed":g.value}])},{default:c(()=>[r.value?(h(),v("section",{key:0,class:"dash__hero dash__reveal",style:b(f(0))},[s("div",Y,[s("div",Z,[s("span",ss,p(r.value.fullName),1),s("span",es,p(i(_).mobile),1)]),s("span",{class:D(["dash__heroSeal",y.value?"is-debtor":"is-creditor"])},p(y.value?"بدهکار":"بستانکار"),3)]),s("div",as,[s("span",os,p(L.value),1),s("span",ns,"گرم "+p(N.value),1)]),s("div",ts,[e[17]||(e[17]=s("span",null,"بدهی ریالی",-1)),s("b",null,[G(p(i(H)(r.value.fiatDebtRial))+" ",1),e[16]||(e[16]=s("i",null,"ریال",-1))])])],4)):(h(),v("section",{key:1,class:"dash__invite dash__reveal",style:b(f(0))},[s("div",ls,[a(o,{icon:"vuesax-linear:security-user",size:"22",color:"#fff"})]),e[18]||(e[18]=s("h3",null,"حساب گرمی شما",-1)),e[19]||(e[19]=s("p",null,"برای دیدن موجودی، سفارش‌ها و اسناد خود وارد شوید.",-1)),s("button",{type:"button",class:"dash__inviteCta",onClick:e[1]||(e[1]=n=>i(l).push({name:"login"}))}," ورود / ثبت‌نام ")],4)),s("section",{class:"dash__rows dash__reveal",style:b(f(1))},[s("button",{type:"button",class:"dash__row",onClick:e[2]||(e[2]=n=>d(0))},[s("span",is,[a(o,{icon:"vuesax-linear:box",size:"18"})]),e[20]||(e[20]=s("span",{class:"dash__rowText"},[s("b",null,"سفارشات"),s("small",null,"پیگیری سفارش‌های شما")],-1)),a(o,{icon:"vuesax-linear:arrow-left-2",size:"16",color:"var(--c-inkFaint)"})]),s("button",{type:"button",class:"dash__row",onClick:e[3]||(e[3]=n=>d(1))},[s("span",rs,[a(o,{icon:"vuesax-linear:receipt-text",size:"18"})]),e[21]||(e[21]=s("span",{class:"dash__rowText"},[s("b",null,"اسناد"),s("small",null,"تراکنش‌ها و رسیدهای حساب")],-1)),a(o,{icon:"vuesax-linear:arrow-left-2",size:"16",color:"var(--c-inkFaint)"})]),s("button",{type:"button",class:"dash__row",onClick:e[4]||(e[4]=n=>d(2))},[s("span",us,[a(o,{icon:"vuesax-linear:user",size:"18"})]),e[22]||(e[22]=s("span",{class:"dash__rowText"},[s("b",null,"پروفایل"),s("small",null,"اطلاعات و تنظیمات حساب")],-1)),a(o,{icon:"vuesax-linear:arrow-left-2",size:"16",color:"var(--c-inkFaint)"})]),s("button",{type:"button",class:"dash__row",onClick:e[5]||(e[5]=n=>d(3))},[s("span",ds,[a(o,{icon:"vuesax-linear:heart",size:"18"})]),e[23]||(e[23]=s("span",{class:"dash__rowText"},[s("b",null,"علاقمندی"),s("small",null,"محصولات ذخیره‌شده شما")],-1)),a(o,{icon:"vuesax-linear:arrow-left-2",size:"16",color:"var(--c-inkFaint)"})]),s("button",{type:"button",class:"dash__row",onClick:e[6]||(e[6]=n=>d(6))},[s("span",_s,[a(o,{icon:"vuesax-linear:chart-2",size:"18"})]),e[24]||(e[24]=s("span",{class:"dash__rowText"},[s("b",null,"گزارش"),s("small",null,"گردش حساب طلایی و ریالی شما")],-1)),a(o,{icon:"vuesax-linear:arrow-left-2",size:"16",color:"var(--c-inkFaint)"})]),s("button",{type:"button",class:"dash__row",onClick:e[7]||(e[7]=n=>i(l).push({name:"appearanceSettings"}))},[s("span",cs,[a(o,{icon:"vuesax-linear:brush",size:"18"})]),e[25]||(e[25]=s("span",{class:"dash__rowText"},[s("b",null,"تنظیمات ظاهری"),s("small",null,"پوسته روشن و تیره، انیمیشن‌ها")],-1)),a(o,{icon:"vuesax-linear:arrow-left-2",size:"16",color:"var(--c-inkFaint)"})]),i(_).isSalesExpert?(h(),v(O,{key:0},[s("button",{type:"button",class:"dash__row",onClick:e[8]||(e[8]=n=>d(4))},[s("span",ps,[a(o,{icon:"vuesax-linear:box-tick",size:"18"})]),e[26]||(e[26]=s("span",{class:"dash__rowText"},[s("b",null,"سفارش مشتریان"),s("small",null,"سفارش‌های مشتریان معرفی‌شده شما")],-1)),a(o,{icon:"vuesax-linear:arrow-left-2",size:"16",color:"var(--c-inkFaint)"})]),s("button",{type:"button",class:"dash__row",onClick:e[9]||(e[9]=n=>d(5))},[s("span",vs,[a(o,{icon:"vuesax-linear:profile-2user",size:"18"})]),e[27]||(e[27]=s("span",{class:"dash__rowText"},[s("b",null,"مشتریان من"),s("small",null,"فهرست مشتریان معرفی‌شده شما")],-1)),a(o,{icon:"vuesax-linear:arrow-left-2",size:"16",color:"var(--c-inkFaint)"})])],64)):F("",!0)],4),a(j,{quote:w.value,class:"dash__rate dash__reveal",style:b(f(2))},null,8,["quote","style"])]),_:1},8,["class"])]),_:1},8,["modelValue"]),a(T,{show:u.notify,"onUpdate:show":e[11]||(e[11]=n=>u.notify=n),art:"logout",title:"آیا می خواهید از برنامه خارج شوید؟",description:"برای استفاده دوباره از امکانات منتزر، باید دوباره وارد حساب کاربری خود شوید.","confirm-text":"بله","cancel-text":"بی خیال",onConfirm:S},null,8,["show"]),a(T,{show:u.loginNotify,"onUpdate:show":e[12]||(e[12]=n=>u.loginNotify=n),art:"login",title:"ابتدا وارد حساب کاربری شوید",description:"برای دسترسی به تمامی امکانات نرم افزار منتزر، گزینه ورود/ثبت نام را لمس کنید و در صورت نداشتن حساب کاربری، ثبت نام نمایید.","confirm-text":"ورود/ثبت نام","cancel-text":"بیخیال",onConfirm:e[13]||(e[13]=n=>i(l).push({name:"login"}))},null,8,["show"])])}}}),gs=K(fs,[["__scopeId","data-v-d6c76569"]]);export{gs as default}; diff --git a/apps/user-app-v2/dist/assets/DashboardView-D5cEPlGT.css b/apps/user-app-v2/dist/assets/DashboardView-D5cEPlGT.css deleted file mode 100644 index 8a89714..0000000 --- a/apps/user-app-v2/dist/assets/DashboardView-D5cEPlGT.css +++ /dev/null @@ -1 +0,0 @@ -.dash[data-v-244443b2]{background:var(--c-page);min-height:100vh}.dash__bar[data-v-244443b2]{position:fixed;top:0;left:0;right:0;z-index:20;background:rgb(var(--c-canvas-rgb) / 82%);-webkit-backdrop-filter:blur(18px) saturate(140%);backdrop-filter:blur(18px) saturate(140%);border-bottom:1px solid rgb(var(--c-primary-rgb) / 5%);box-shadow:0 8px 20px -18px rgb(var(--c-primary-rgb) / 55%)}.dash__barInner[data-v-244443b2]{max-width:768px;margin:0 auto;padding:10px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px}.dash__brand[data-v-244443b2]{font-size:14.5px;font-weight:800;color:var(--c-ink)}.dash__exit[data-v-244443b2]{flex:0 0 auto;width:34px;height:34px;border:0;cursor:pointer;border-radius:11px;display:grid;place-items:center;color:var(--c-wine);background:var(--c-wineWash);transition:transform .18s ease}.dash__exit[data-v-244443b2]:active{transform:scale(.92)}.dash__body[data-v-244443b2]{padding-top:58px;padding-bottom:90px}.dash__reveal[data-v-244443b2]{opacity:0;transform:translate3d(0,14px,0) scale(.98);will-change:transform,opacity}.is-revealed .dash__reveal[data-v-244443b2]{opacity:1;transform:translateZ(0) scale(1);transition:opacity .62s cubic-bezier(.32,.72,0,1) var(--reveal-delay, 0ms),transform .62s cubic-bezier(.32,.72,0,1) var(--reveal-delay, 0ms)}@media (prefers-reduced-motion: reduce){.dash__reveal[data-v-244443b2]{opacity:1;transform:none}.is-revealed .dash__reveal[data-v-244443b2]{transition:none}}.dash__hero[data-v-244443b2]{margin-top:16px;margin-bottom:28px;padding:20px 18px 16px;border-radius:26px;background:linear-gradient(155deg,var(--c-heroSurface) 0%,var(--c-heroSurface) 55%,#5E1427 130%);color:#fff;box-shadow:0 22px 40px -26px #14161a52}.dash__heroTop[data-v-244443b2]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.dash__heroIdentity[data-v-244443b2]{display:flex;flex-direction:column;gap:3px;min-width:0}.dash__heroName[data-v-244443b2]{font-size:13.5px;font-weight:800}.dash__heroMobile[data-v-244443b2]{font-size:11px;color:#ffffff8c;direction:ltr;text-align:right}.dash__heroSeal[data-v-244443b2]{flex:0 0 auto;padding:5px 12px;border-radius:999px;font-size:10.5px;font-weight:700}.dash__heroSeal.is-debtor[data-v-244443b2]{color:#fff;background:var(--c-wineSoft)}.dash__heroSeal.is-creditor[data-v-244443b2]{color:#14161a;background:#ffffffe6}.dash__heroFigure[data-v-244443b2]{margin-top:20px;display:flex;align-items:baseline;gap:8px}.dash__heroNum[data-v-244443b2]{font-size:34px;font-weight:800;letter-spacing:-.5px}.dash__heroUnit[data-v-244443b2]{font-size:12px;font-weight:600;color:#ffffff9e}.dash__heroDebt[data-v-244443b2]{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding-top:13px;border-top:1px solid rgba(255,255,255,.14);font-size:11.5px;color:#ffffff9e}.dash__heroDebt b[data-v-244443b2]{font-size:13px;font-weight:700;color:#fff}.dash__heroDebt i[data-v-244443b2]{font-style:normal;font-size:10.5px;font-weight:600;color:#ffffff9e;padding-inline-start:3px}.dash__invite[data-v-244443b2]{margin-top:16px;padding:26px 20px;border-radius:26px;background:var(--c-heroSurface);color:#fff;display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px}.dash__inviteIcon[data-v-244443b2]{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:#ffffff1a;margin-bottom:2px}.dash__invite h3[data-v-244443b2]{margin:0;font-size:14px;font-weight:800}.dash__invite p[data-v-244443b2]{margin:0;font-size:11.5px;color:#fff9;max-width:240px}.dash__inviteCta[data-v-244443b2]{margin-top:6px;padding:10px 22px;border:0;cursor:pointer;border-radius:999px;font-family:inherit;font-size:12px;font-weight:700;color:#14161a;background:#fff;transition:transform .18s ease}.dash__inviteCta[data-v-244443b2]:active{transform:scale(.96)}.dash__rows[data-v-244443b2]{margin-top:0;display:flex;flex-direction:column;gap:9px}.dash__row[data-v-244443b2]{display:flex;align-items:center;gap:12px;padding:13px 14px;border:1px solid var(--c-hairline);border-radius:17px;cursor:pointer;background:var(--c-canvas);font-family:inherit;text-align:right;transition:transform .18s ease,border-color .18s ease}.dash__row[data-v-244443b2]:active{transform:scale(.985);border-color:rgb(var(--c-wine-rgb) / 20%)}.dash__rowIcon[data-v-244443b2]{flex:0 0 auto;width:38px;height:38px;border-radius:12px;display:grid;place-items:center;color:var(--c-wine);background:var(--c-wineWash)}.dash__rowText[data-v-244443b2]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.dash__rowText b[data-v-244443b2]{font-size:12.5px;font-weight:700;color:var(--c-ink)}.dash__rowText small[data-v-244443b2]{font-size:10.5px;color:var(--c-inkFaint)}.dash__rate[data-v-244443b2]{margin-top:14px} diff --git a/apps/user-app-v2/dist/assets/DashboardView-Dd-mLt1P.css b/apps/user-app-v2/dist/assets/DashboardView-Dd-mLt1P.css new file mode 100644 index 0000000..98cb52d --- /dev/null +++ b/apps/user-app-v2/dist/assets/DashboardView-Dd-mLt1P.css @@ -0,0 +1 @@ +.dash[data-v-d6c76569]{background:var(--c-page);min-height:100vh}.dash__bar[data-v-d6c76569]{position:fixed;top:0;left:0;right:0;z-index:20;background:rgb(var(--c-canvas-rgb) / 82%);-webkit-backdrop-filter:blur(18px) saturate(140%);backdrop-filter:blur(18px) saturate(140%);border-bottom:1px solid rgb(var(--c-primary-rgb) / 5%);box-shadow:0 8px 20px -18px rgb(var(--c-primary-rgb) / 55%)}.dash__barInner[data-v-d6c76569]{max-width:768px;margin:0 auto;padding:10px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px}.dash__brand[data-v-d6c76569]{font-size:14.5px;font-weight:800;color:var(--c-ink)}.dash__exit[data-v-d6c76569]{flex:0 0 auto;width:34px;height:34px;border:0;cursor:pointer;border-radius:11px;display:grid;place-items:center;color:var(--c-wine);background:var(--c-wineWash);transition:transform .18s ease}.dash__exit[data-v-d6c76569]:active{transform:scale(.92)}.dash__body[data-v-d6c76569]{padding-top:58px;padding-bottom:90px}.dash__reveal[data-v-d6c76569]{opacity:0;transform:translate3d(0,14px,0) scale(.98);will-change:transform,opacity}.is-revealed .dash__reveal[data-v-d6c76569]{opacity:1;transform:translateZ(0) scale(1);transition:opacity .62s cubic-bezier(.32,.72,0,1) var(--reveal-delay, 0ms),transform .62s cubic-bezier(.32,.72,0,1) var(--reveal-delay, 0ms)}@media (prefers-reduced-motion: reduce){.dash__reveal[data-v-d6c76569]{opacity:1;transform:none}.is-revealed .dash__reveal[data-v-d6c76569]{transition:none}}.dash__hero[data-v-d6c76569]{margin-top:16px;margin-bottom:28px;padding:20px 18px 16px;border-radius:26px;background:linear-gradient(155deg,var(--c-heroSurface) 0%,var(--c-heroSurface) 55%,#5E1427 130%);color:#fff;box-shadow:0 22px 40px -26px #14161a52}.dash__heroTop[data-v-d6c76569]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.dash__heroIdentity[data-v-d6c76569]{display:flex;flex-direction:column;gap:3px;min-width:0}.dash__heroName[data-v-d6c76569]{font-size:13.5px;font-weight:800}.dash__heroMobile[data-v-d6c76569]{font-size:11px;color:#ffffff8c;direction:ltr;text-align:right}.dash__heroSeal[data-v-d6c76569]{flex:0 0 auto;padding:5px 12px;border-radius:999px;font-size:10.5px;font-weight:700}.dash__heroSeal.is-debtor[data-v-d6c76569]{color:#fff;background:var(--c-wineSoft)}.dash__heroSeal.is-creditor[data-v-d6c76569]{color:#14161a;background:#ffffffe6}.dash__heroFigure[data-v-d6c76569]{margin-top:20px;display:flex;align-items:baseline;gap:8px}.dash__heroNum[data-v-d6c76569]{font-size:34px;font-weight:800;letter-spacing:-.5px}.dash__heroUnit[data-v-d6c76569]{font-size:12px;font-weight:600;color:#ffffff9e}.dash__heroDebt[data-v-d6c76569]{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding-top:13px;border-top:1px solid rgba(255,255,255,.14);font-size:11.5px;color:#ffffff9e}.dash__heroDebt b[data-v-d6c76569]{font-size:13px;font-weight:700;color:#fff}.dash__heroDebt i[data-v-d6c76569]{font-style:normal;font-size:10.5px;font-weight:600;color:#ffffff9e;padding-inline-start:3px}.dash__invite[data-v-d6c76569]{margin-top:16px;padding:26px 20px;border-radius:26px;background:var(--c-heroSurface);color:#fff;display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px}.dash__inviteIcon[data-v-d6c76569]{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:#ffffff1a;margin-bottom:2px}.dash__invite h3[data-v-d6c76569]{margin:0;font-size:14px;font-weight:800}.dash__invite p[data-v-d6c76569]{margin:0;font-size:11.5px;color:#fff9;max-width:240px}.dash__inviteCta[data-v-d6c76569]{margin-top:6px;padding:10px 22px;border:0;cursor:pointer;border-radius:999px;font-family:inherit;font-size:12px;font-weight:700;color:#14161a;background:#fff;transition:transform .18s ease}.dash__inviteCta[data-v-d6c76569]:active{transform:scale(.96)}.dash__rows[data-v-d6c76569]{margin-top:0;display:flex;flex-direction:column;gap:9px}.dash__row[data-v-d6c76569]{display:flex;align-items:center;gap:12px;padding:13px 14px;border:1px solid var(--c-hairline);border-radius:17px;cursor:pointer;background:var(--c-canvas);font-family:inherit;text-align:right;transition:transform .18s ease,border-color .18s ease}.dash__row[data-v-d6c76569]:active{transform:scale(.985);border-color:rgb(var(--c-wine-rgb) / 20%)}.dash__rowIcon[data-v-d6c76569]{flex:0 0 auto;width:38px;height:38px;border-radius:12px;display:grid;place-items:center;color:var(--c-wine);background:var(--c-wineWash)}.dash__rowText[data-v-d6c76569]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.dash__rowText b[data-v-d6c76569]{font-size:12.5px;font-weight:700;color:var(--c-ink)}.dash__rowText small[data-v-d6c76569]{font-size:10.5px;color:var(--c-inkFaint)}.dash__rate[data-v-d6c76569]{margin-top:14px} diff --git a/apps/user-app-v2/dist/assets/FavoritesView-CiVaZUZb.js b/apps/user-app-v2/dist/assets/FavoritesView-DxHQrp9E.js similarity index 87% rename from apps/user-app-v2/dist/assets/FavoritesView-CiVaZUZb.js rename to apps/user-app-v2/dist/assets/FavoritesView-DxHQrp9E.js index 16f72a3..0725f47 100644 --- a/apps/user-app-v2/dist/assets/FavoritesView-CiVaZUZb.js +++ b/apps/user-app-v2/dist/assets/FavoritesView-DxHQrp9E.js @@ -1 +1 @@ -import{d as m,aM as g,o as y,s as b,c as o,p as e,z as c,J as h,g as d,f as t,F as _,b as l,r as k,I as C,m as P,e as B,C as F,h as x,B as V,j as w,_ as S}from"./index-BWyw3RAx.js";import{P as I}from"./PageBar-D5DXU6sO.js";import{S as N}from"./SectionHead-BiCEpXAe.js";import{P as $}from"./ProductCard-nL92ZIkB.js";const z={class:"favs"},M={class:"favs__grid"},R={key:1,class:"favs__empty"},j=m({__name:"FavoritesView",setup(E){const v=F(),f=g(),a=d(!1),i=d([]),n=x(()=>i.value.filter(u=>f.isFavorite(u.id)));return y(async()=>{a.value=!0;try{i.value=await b.listProducts()}finally{a.value=!1}}),(u,s)=>{const p=V("container");return t(),o("div",z,[e(I,{title:"علاقه‌مندی","back-to":"userPage::hasSubRoute"}),e(h,{spinning:a.value,tip:"در حال دریافت اطلاعات"},{default:c(()=>[e(p,{class:"favs__body"},{default:c(()=>[n.value.length?(t(),o(_,{key:0},[e(N,{title:"ذخیره‌شده‌ها",subtitle:`${n.value.length} محصول`},null,8,["subtitle"]),l("div",M,[(t(!0),o(_,null,k(n.value,r=>(t(),w($,{key:r.id,value:r},null,8,["value"]))),128))])],64)):a.value?B("",!0):(t(),o("section",R,[e(C,{icon:"vuesax-linear:heart",size:"26"}),s[1]||(s[1]=l("p",null,"هنوز محصولی را به علاقه‌مندی‌ها اضافه نکرده‌اید.",-1)),l("button",{type:"button",class:"favs__emptyCta",onClick:s[0]||(s[0]=r=>P(v).push({name:"home"}))}," دیدن محصولات ")]))]),_:1})]),_:1},8,["spinning"])])}}}),A=S(j,[["__scopeId","data-v-d58ee1f5"]]);export{A as default}; +import{d as m,aM as g,o as y,s as b,c as o,p as e,z as c,J as h,g as d,f as t,F as _,b as l,r as k,I as C,m as P,e as B,C as F,h as x,B as V,j as w,_ as S}from"./index-Dp9sxvBv.js";import{P as I}from"./PageBar-El-laHqK.js";import{S as N}from"./SectionHead-DNG9ywW4.js";import{P as $}from"./ProductCard-CvKEozHI.js";const z={class:"favs"},M={class:"favs__grid"},R={key:1,class:"favs__empty"},j=m({__name:"FavoritesView",setup(E){const v=F(),f=g(),a=d(!1),i=d([]),n=x(()=>i.value.filter(u=>f.isFavorite(u.id)));return y(async()=>{a.value=!0;try{i.value=await b.listProducts()}finally{a.value=!1}}),(u,s)=>{const p=V("container");return t(),o("div",z,[e(I,{title:"علاقه‌مندی","back-to":"userPage::hasSubRoute"}),e(h,{spinning:a.value,tip:"در حال دریافت اطلاعات"},{default:c(()=>[e(p,{class:"favs__body"},{default:c(()=>[n.value.length?(t(),o(_,{key:0},[e(N,{title:"ذخیره‌شده‌ها",subtitle:`${n.value.length} محصول`},null,8,["subtitle"]),l("div",M,[(t(!0),o(_,null,k(n.value,r=>(t(),w($,{key:r.id,value:r},null,8,["value"]))),128))])],64)):a.value?B("",!0):(t(),o("section",R,[e(C,{icon:"vuesax-linear:heart",size:"26"}),s[1]||(s[1]=l("p",null,"هنوز محصولی را به علاقه‌مندی‌ها اضافه نکرده‌اید.",-1)),l("button",{type:"button",class:"favs__emptyCta",onClick:s[0]||(s[0]=r=>P(v).push({name:"home"}))}," دیدن محصولات ")]))]),_:1})]),_:1},8,["spinning"])])}}}),A=S(j,[["__scopeId","data-v-d58ee1f5"]]);export{A as default}; diff --git a/apps/user-app-v2/dist/assets/FormItemContext-Bxnh5gKQ.js b/apps/user-app-v2/dist/assets/FormItemContext-C33n6IMx.js similarity index 99% rename from apps/user-app-v2/dist/assets/FormItemContext-Bxnh5gKQ.js rename to apps/user-app-v2/dist/assets/FormItemContext-C33n6IMx.js index c1e1c26..9657138 100644 --- a/apps/user-app-v2/dist/assets/FormItemContext-Bxnh5gKQ.js +++ b/apps/user-app-v2/dist/assets/FormItemContext-C33n6IMx.js @@ -1 +1 @@ -import{aG as Ke,av as qe,a1 as ie,aK as We,ah as Ve,aq as Ie,X as j,ar as w,ak as oe,W as F,b2 as Xe,Q as Ye,a9 as se,a as Je,a2 as Qe,h as Ce,g as Ze,d as ke,an as P}from"./index-BWyw3RAx.js";var Se=function(){if(typeof Map<"u")return Map;function e(t,r){var n=-1;return t.some(function(a,i){return a[0]===r?(n=i,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(r){var n=e(this.__entries__,r),a=this.__entries__[n];return a&&a[1]},t.prototype.set=function(r,n){var a=e(this.__entries__,r);~a?this.__entries__[a][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,a=e(n,r);~a&&n.splice(a,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var a=0,i=this.__entries__;a0},e.prototype.connect_=function(){!J||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),it?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!J||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,a=at.some(function(i){return!!~n.indexOf(i)});a&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Fe=function(e,t){for(var r=0,n=Object.keys(t);r"u"||!(Element instanceof Object))){if(!(t instanceof I(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)||(r.set(t,new pt(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof I(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)&&(r.delete(t),r.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&t.activeObservations_.push(r)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new vt(n.target,n.broadcastRect())});this.callback_.call(t,r,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Re=typeof WeakMap<"u"?new WeakMap:new Se,je=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=ot.getInstance(),n=new _t(t,r,this);Re.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){je.prototype[e]=function(){var t;return(t=Re.get(this))[e].apply(t,arguments)}});var Qn=function(){return typeof L.ResizeObserver<"u"?L.ResizeObserver:je}();function gt(e,t){return function(r){return e(t(r))}}function fe(e,t,r,n,a,i,o){try{var s=e[i](o),u=s.value}catch(f){return void r(f)}s.done?t(u):Promise.resolve(u).then(n,a)}function Zn(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function o(u){fe(i,n,a,o,s,"next",u)}function s(u){fe(i,n,a,o,s,"throw",u)}o(void 0)})}}function kn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,a=e;if(Array.isArray(e)&&(a=Ke(e)[0]),!a)return null;var i=qe(a,t,n);return i.props=r?ie(ie({},i.props),t):i.props,We(Ve(i.props.class)!=="object","class must be string"),i}function yt(){this.__data__=[],this.size=0}function Me(e,t){return e===t||e!==e&&t!==t}function q(e,t){for(var r=e.length;r--;)if(Me(e[r][0],t))return r;return-1}var mt=Array.prototype,bt=mt.splice;function wt(e){var t=this.__data__,r=q(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():bt.call(t,r,1),--this.size,!0}function Ot(e){var t=this.__data__,r=q(t,e);return r<0?void 0:t[r][1]}function At(e){return q(this.__data__,e)>-1}function Tt(e,t){var r=this.__data__,n=q(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function g(e){var t=-1,r=e==null?0:e.length;for(this.clear();++ts))return!1;var f=i.get(e),d=i.get(t);if(f&&d)return f==t&&d==e;var h=-1,l=!0,_=r&_r?new B:void 0;for(i.set(e,t),i.set(t,e);++h-1&&e%1==0&&e-1&&e%1==0&&e<=Qr}var Zr="[object Arguments]",kr="[object Array]",en="[object Boolean]",tn="[object Date]",rn="[object Error]",nn="[object Function]",an="[object Map]",on="[object Number]",sn="[object Object]",un="[object RegExp]",fn="[object Set]",cn="[object String]",ln="[object WeakMap]",dn="[object ArrayBuffer]",hn="[object DataView]",pn="[object Float32Array]",vn="[object Float64Array]",_n="[object Int8Array]",gn="[object Int16Array]",yn="[object Int32Array]",mn="[object Uint8Array]",bn="[object Uint8ClampedArray]",wn="[object Uint16Array]",On="[object Uint32Array]",c={};c[pn]=c[vn]=c[_n]=c[gn]=c[yn]=c[mn]=c[bn]=c[wn]=c[On]=!0;c[Zr]=c[kr]=c[dn]=c[en]=c[hn]=c[tn]=c[rn]=c[nn]=c[an]=c[on]=c[sn]=c[un]=c[fn]=c[cn]=c[ln]=!1;function An(e){return F(e)&&Be(e.length)&&!!c[j(e)]}function Tn(e){return function(t){return e(t)}}var He=typeof exports=="object"&&exports&&!exports.nodeType&&exports,S=He&&typeof module=="object"&&module&&!module.nodeType&&module,En=S&&S.exports===He,Y=En&&Xe.process,ge=function(){try{var e=S&&S.require&&S.require("util").types;return e||Y&&Y.binding&&Y.binding("util")}catch{}}(),ye=ge&&ge.isTypedArray,Ne=ye?Tn(ye):An,xn=Object.prototype,Pn=xn.hasOwnProperty;function In(e,t){var r=H(e),n=!r&&Kr(e),a=!r&&!n&&Q(e),i=!r&&!n&&!a&&Ne(e),o=r||n||a||i,s=o?Br(e.length,String):[],u=s.length;for(var f in e)(t||Pn.call(e,f))&&!(o&&(f=="length"||a&&(f=="offset"||f=="parent")||i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Jr(f,u)))&&s.push(f);return s}var Cn=Object.prototype;function Sn(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Cn;return e===r}var Fn=gt(Object.keys,Object),$n=Object.prototype,Rn=$n.hasOwnProperty;function jn(e){if(!Sn(e))return Fn(e);var t=[];for(var r in Object(e))Rn.call(e,r)&&r!="constructor"&&t.push(r);return t}function Mn(e){return e!=null&&Be(e.length)&&!De(e)}function Dn(e){return Mn(e)?In(e):jn(e)}function me(e){return jr(e,Dn,Gr)}var zn=1,Ln=Object.prototype,Gn=Ln.hasOwnProperty;function Bn(e,t,r,n,a,i){var o=r&zn,s=me(e),u=s.length,f=me(t),d=f.length;if(u!=d&&!o)return!1;for(var h=u;h--;){var l=s[h];if(!(o?l in t:Gn.call(t,l)))return!1}var _=i.get(e),p=i.get(t);if(_&&p)return _==t&&p==e;var v=!0;i.set(e,t),i.set(t,e);for(var y=o;++h1&&arguments[1]!==void 0?arguments[1]:Ce(function(){return!0}),n=Ze(new Map),a=function(s,u){n.value.set(s,u),n.value=new Map(n.value)},i=function(s){n.value.delete(s),n.value=new Map(n.value)};Ye([r,n],function(){}),P(N,t),P(U,{addFormItemField:a,removeFormItemField:i})},re={id:Ce(function(){}),onFieldBlur:function(){},onFieldChange:function(){},clearValidate:function(){}},ne={addFormItemField:function(){},removeFormItemField:function(){}},ra=function(){var t=se(U,ne),r=Symbol("FormItemFieldKey"),n=Qe();return t.addFormItemField(r,n.type),Je(function(){t.removeFormItemField(r)}),P(U,ne),P(N,re),se(N,re)};const na=ke({compatConfig:{MODE:3},name:"AFormItemRest",setup:function(t,r){var n=r.slots;return P(U,ne),P(N,re),function(){var a;return(a=n.default)===null||a===void 0?void 0:a.call(n)}}});export{ra as A,kn as B,na as F,x as M,b as S,le as U,Zn as _,H as a,Be as b,Jr as c,Kr as d,Me as e,Rr as f,C as g,Sn as h,Qn as i,Mn as j,Dn as k,In as l,Gr as m,jr as n,gt as o,m as p,Tn as q,ge as r,Dr as s,Q as t,me as u,Ue as v,ta as w,B as x,pr as y,ea as z}; +import{aG as Ke,av as qe,a1 as ie,aK as We,ah as Ve,aq as Ie,X as j,ar as w,ak as oe,W as F,b2 as Xe,Q as Ye,a9 as se,a as Je,a2 as Qe,h as Ce,g as Ze,d as ke,an as P}from"./index-Dp9sxvBv.js";var Se=function(){if(typeof Map<"u")return Map;function e(t,r){var n=-1;return t.some(function(a,i){return a[0]===r?(n=i,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(r){var n=e(this.__entries__,r),a=this.__entries__[n];return a&&a[1]},t.prototype.set=function(r,n){var a=e(this.__entries__,r);~a?this.__entries__[a][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,a=e(n,r);~a&&n.splice(a,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var a=0,i=this.__entries__;a0},e.prototype.connect_=function(){!J||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),it?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!J||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,a=at.some(function(i){return!!~n.indexOf(i)});a&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Fe=function(e,t){for(var r=0,n=Object.keys(t);r"u"||!(Element instanceof Object))){if(!(t instanceof I(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)||(r.set(t,new pt(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof I(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)&&(r.delete(t),r.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&t.activeObservations_.push(r)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new vt(n.target,n.broadcastRect())});this.callback_.call(t,r,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Re=typeof WeakMap<"u"?new WeakMap:new Se,je=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=ot.getInstance(),n=new _t(t,r,this);Re.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){je.prototype[e]=function(){var t;return(t=Re.get(this))[e].apply(t,arguments)}});var Qn=function(){return typeof L.ResizeObserver<"u"?L.ResizeObserver:je}();function gt(e,t){return function(r){return e(t(r))}}function fe(e,t,r,n,a,i,o){try{var s=e[i](o),u=s.value}catch(f){return void r(f)}s.done?t(u):Promise.resolve(u).then(n,a)}function Zn(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function o(u){fe(i,n,a,o,s,"next",u)}function s(u){fe(i,n,a,o,s,"throw",u)}o(void 0)})}}function kn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,a=e;if(Array.isArray(e)&&(a=Ke(e)[0]),!a)return null;var i=qe(a,t,n);return i.props=r?ie(ie({},i.props),t):i.props,We(Ve(i.props.class)!=="object","class must be string"),i}function yt(){this.__data__=[],this.size=0}function Me(e,t){return e===t||e!==e&&t!==t}function q(e,t){for(var r=e.length;r--;)if(Me(e[r][0],t))return r;return-1}var mt=Array.prototype,bt=mt.splice;function wt(e){var t=this.__data__,r=q(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():bt.call(t,r,1),--this.size,!0}function Ot(e){var t=this.__data__,r=q(t,e);return r<0?void 0:t[r][1]}function At(e){return q(this.__data__,e)>-1}function Tt(e,t){var r=this.__data__,n=q(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function g(e){var t=-1,r=e==null?0:e.length;for(this.clear();++ts))return!1;var f=i.get(e),d=i.get(t);if(f&&d)return f==t&&d==e;var h=-1,l=!0,_=r&_r?new B:void 0;for(i.set(e,t),i.set(t,e);++h-1&&e%1==0&&e-1&&e%1==0&&e<=Qr}var Zr="[object Arguments]",kr="[object Array]",en="[object Boolean]",tn="[object Date]",rn="[object Error]",nn="[object Function]",an="[object Map]",on="[object Number]",sn="[object Object]",un="[object RegExp]",fn="[object Set]",cn="[object String]",ln="[object WeakMap]",dn="[object ArrayBuffer]",hn="[object DataView]",pn="[object Float32Array]",vn="[object Float64Array]",_n="[object Int8Array]",gn="[object Int16Array]",yn="[object Int32Array]",mn="[object Uint8Array]",bn="[object Uint8ClampedArray]",wn="[object Uint16Array]",On="[object Uint32Array]",c={};c[pn]=c[vn]=c[_n]=c[gn]=c[yn]=c[mn]=c[bn]=c[wn]=c[On]=!0;c[Zr]=c[kr]=c[dn]=c[en]=c[hn]=c[tn]=c[rn]=c[nn]=c[an]=c[on]=c[sn]=c[un]=c[fn]=c[cn]=c[ln]=!1;function An(e){return F(e)&&Be(e.length)&&!!c[j(e)]}function Tn(e){return function(t){return e(t)}}var He=typeof exports=="object"&&exports&&!exports.nodeType&&exports,S=He&&typeof module=="object"&&module&&!module.nodeType&&module,En=S&&S.exports===He,Y=En&&Xe.process,ge=function(){try{var e=S&&S.require&&S.require("util").types;return e||Y&&Y.binding&&Y.binding("util")}catch{}}(),ye=ge&&ge.isTypedArray,Ne=ye?Tn(ye):An,xn=Object.prototype,Pn=xn.hasOwnProperty;function In(e,t){var r=H(e),n=!r&&Kr(e),a=!r&&!n&&Q(e),i=!r&&!n&&!a&&Ne(e),o=r||n||a||i,s=o?Br(e.length,String):[],u=s.length;for(var f in e)(t||Pn.call(e,f))&&!(o&&(f=="length"||a&&(f=="offset"||f=="parent")||i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Jr(f,u)))&&s.push(f);return s}var Cn=Object.prototype;function Sn(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Cn;return e===r}var Fn=gt(Object.keys,Object),$n=Object.prototype,Rn=$n.hasOwnProperty;function jn(e){if(!Sn(e))return Fn(e);var t=[];for(var r in Object(e))Rn.call(e,r)&&r!="constructor"&&t.push(r);return t}function Mn(e){return e!=null&&Be(e.length)&&!De(e)}function Dn(e){return Mn(e)?In(e):jn(e)}function me(e){return jr(e,Dn,Gr)}var zn=1,Ln=Object.prototype,Gn=Ln.hasOwnProperty;function Bn(e,t,r,n,a,i){var o=r&zn,s=me(e),u=s.length,f=me(t),d=f.length;if(u!=d&&!o)return!1;for(var h=u;h--;){var l=s[h];if(!(o?l in t:Gn.call(t,l)))return!1}var _=i.get(e),p=i.get(t);if(_&&p)return _==t&&p==e;var v=!0;i.set(e,t),i.set(t,e);for(var y=o;++h1&&arguments[1]!==void 0?arguments[1]:Ce(function(){return!0}),n=Ze(new Map),a=function(s,u){n.value.set(s,u),n.value=new Map(n.value)},i=function(s){n.value.delete(s),n.value=new Map(n.value)};Ye([r,n],function(){}),P(N,t),P(U,{addFormItemField:a,removeFormItemField:i})},re={id:Ce(function(){}),onFieldBlur:function(){},onFieldChange:function(){},clearValidate:function(){}},ne={addFormItemField:function(){},removeFormItemField:function(){}},ra=function(){var t=se(U,ne),r=Symbol("FormItemFieldKey"),n=Qe();return t.addFormItemField(r,n.type),Je(function(){t.removeFormItemField(r)}),P(U,ne),P(N,re),se(N,re)};const na=ke({compatConfig:{MODE:3},name:"AFormItemRest",setup:function(t,r){var n=r.slots;return P(U,ne),P(N,re),function(){var a;return(a=n.default)===null||a===void 0?void 0:a.call(n)}}});export{ra as A,kn as B,na as F,x as M,b as S,le as U,Zn as _,H as a,Be as b,Jr as c,Kr as d,Me as e,Rr as f,C as g,Sn as h,Qn as i,Mn as j,Dn as k,In as l,Gr as m,jr as n,gt as o,m as p,Tn as q,ge as r,Dr as s,Q as t,me as u,Ue as v,ta as w,B as x,pr as y,ea as z}; diff --git a/apps/user-app-v2/dist/assets/HomeView-BLj03XEk.js b/apps/user-app-v2/dist/assets/HomeView-C0cpdx4l.js similarity index 98% rename from apps/user-app-v2/dist/assets/HomeView-BLj03XEk.js rename to apps/user-app-v2/dist/assets/HomeView-C0cpdx4l.js index 1205237..0b308fb 100644 --- a/apps/user-app-v2/dist/assets/HomeView-BLj03XEk.js +++ b/apps/user-app-v2/dist/assets/HomeView-C0cpdx4l.js @@ -1 +1 @@ -import{d as F,u as ne,o as Z,a as se,c as l,b as _,F as A,r as G,e as x,f as a,g as I,h as R,n as B,i as N,_ as V,j as q,t as U,I as j,k as ae,l as oe,w as le,m as $,p as P,q as ie,s as X,v as re,x as ce,y as ue,z,A as de,B as _e,C as ve}from"./index-BWyw3RAx.js";import{R as pe}from"./RateStrip-0Viss8IX.js";import{P as fe,L as Y}from"./index-ecOSUWQv.js";import"./filters-DVocLz3o.js";const me={key:0,class:"hero"},ge=["onClick"],he=["src","alt"],ye={key:1,class:"hero__artFallback","aria-hidden":"true"},ke={key:0,class:"hero__dots"},Ie=["aria-label","onClick"],J=46,be=.76,$e=36.6,Pe=.75,Ce=F({__name:"HeroCarousel",props:{slides:{},autoplay:{type:Boolean,default:!0}},emits:["select"],setup(r,{emit:y}){const v=r,b=y,u=I(0),p=I(null),c=I(!1),i=I(0);let k=0,m=null,g;const f=ne(),h=R(()=>v.slides.length);function S(e){let t=e-u.value;h.value>2&&(t>h.value/2&&(t-=h.value),t<-h.value/2&&(t+=h.value));const s=c.value?i.value:0,d=Math.abs(t),C=t*$e+s,H=t===0?1:be,W=d>1?0:d===0?1:Pe;return{transform:`translate3d(${C}%, 0, 0) scale(${H})`,opacity:String(W),zIndex:String(10-d),pointerEvents:d>1?"none":"auto",transition:c.value?"none":"transform .42s cubic-bezier(.22,.61,.36,1), opacity .42s ease"}}function w(e){u.value=(e%h.value+h.value)%h.value,o()}function E(){w(u.value+1)}function T(){w(u.value-1)}function L(e){var t,s;h.value<2||(c.value=!0,k=e.clientX,i.value=0,m=e.pointerId,(s=(t=e.currentTarget).setPointerCapture)==null||s.call(t,e.pointerId),n())}function M(e){var s;if(!c.value||e.pointerId!==m)return;const t=((s=p.value)==null?void 0:s.clientWidth)||1;i.value=(e.clientX-k)/t*100}function O(e){if(!c.value)return;const t=e.clientX-k;c.value=!1,i.value=0,m=null,t>J?T():t<-J?E():o()}function D(e,t){if(!(Math.abs(i.value)>1)){if(e!==u.value){w(e);return}b("select",t)}}function n(){g&&clearInterval(g),g=void 0}function o(){n(),v.autoplay&&!f.isReducedMotion&&h.value>1&&(g=setInterval(E,6e3))}return Z(o),se(n),(e,t)=>r.slides.length?(a(),l("section",me,[_("div",{class:"hero__stage",ref_key:"stage",ref:p,onPointerdown:L,onPointermove:M,onPointerup:O,onPointercancel:O},[(a(!0),l(A,null,G(r.slides,(s,d)=>(a(),l("article",{key:s.key,class:N(["hero__card",{"is-active":d===u.value}]),style:B(S(d)),onClick:C=>D(d,s)},[s.image?(a(),l("img",{key:0,src:s.image,alt:s.title,class:"hero__art",draggable:"false"},null,8,he)):(a(),l("div",ye))],14,ge))),128))],544),r.slides.length>1?(a(),l("div",ke,[(a(!0),l(A,null,G(r.slides,(s,d)=>(a(),l("button",{key:s.key,type:"button",class:N(["hero__dot",{"is-active":d===u.value}]),"aria-label":s.title,onClick:C=>w(d)},null,10,Ie))),128))])):x("",!0)])):x("",!0)}}),Se=V(Ce,[["__scopeId","data-v-d3ac0cc7"]]),we={class:"cats no-scrollbar"},xe=["onClick"],Ee={class:"cats__mark","aria-hidden":"true"},He=["src"],Re={class:"cats__title"},Le=F({__name:"CategoryGrid",props:{categories:{},activeId:{}},emits:["select"],setup(r,{emit:y}){const v=y;return(b,u)=>(a(),l("div",we,[(a(!0),l(A,null,G(r.categories,p=>{var c;return a(),l("button",{key:p.id,type:"button",class:N(["cats__tile",{"is-active":p.id===r.activeId}]),onClick:i=>v("select",p)},[_("span",Ee,[(c=p.icon)!=null&&c.image?(a(),l("img",{key:0,src:p.icon.image,alt:""},null,8,He)):(a(),q(j,{key:1,icon:"vuesax-linear:3d-cube-scan",size:"27"}))]),_("span",Re,U(p.title),1)],10,xe)}),128))]))}}),Me=V(Le,[["__scopeId","data-v-155beefb"]]),Oe={class:"panel__art"},ze=["alt"],Be={class:"panel__title"},Ae={class:"panel__meta"},Te={class:"panel__weight"},De={key:0,class:"panel__wageOld"},Ue={class:"panel__wage"},Ge=F({__name:"ProductPanel",props:{value:{},wageBefore:{}},emits:["open"],setup(r,{emit:y}){const v=r,b=y,{image:u,title:p,min_gram:c,wage:i}=ae(v.value);function k(m){return m%1===0?String(m):m.toFixed(2)}return(m,g)=>{const f=oe("lazy");return a(),l("article",{class:"panel","data-product-origin":"",onClick:g[0]||(g[0]=h=>b("open",r.value))},[_("div",Oe,[le(_("img",{alt:$(p)},null,8,ze),[[f,$(u)]])]),_("h3",Be,U($(p)),1),_("div",Ae,[_("span",Te,U($(c))+" گرم",1),$(i)!=null?(a(),l(A,{key:0},[g[1]||(g[1]=_("span",{class:"panel__sep","aria-hidden":"true"},null,-1)),r.wageBefore!=null?(a(),l("span",De,"اجرت "+U(k(r.wageBefore))+"٪",1)):x("",!0),_("span",Ue,U(k($(i)))+"٪ اجرت",1)],64)):x("",!0)])])}}}),ee=V(Ge,[["__scopeId","data-v-ccafc905"]]),Ne={class:"reel"},Fe=["onClick"],Ve={class:"reel__allMark","aria-hidden":"true"},K=46,Xe=.78,Q=92.5,qe=.62,We=F({__name:"ProductCarousel",props:{products:{}},emits:["open","all"],setup(r,{emit:y}){const v=r,b=y,u=I(0),p=I(null),c=I(!1),i=I(0);let k=0,m=null;const g=R(()=>[...v.products.map(n=>({key:n.id,kind:"product",product:n})),{key:"__all__",kind:"all"}]),f=R(()=>g.value.length);function h(n){let o=n-u.value;f.value>2&&(o>f.value/2&&(o-=f.value),o<-f.value/2&&(o+=f.value));const e=c.value?i.value:0,t=o*Q+e,s=Math.min(Math.abs(o+e/Q),1),d=1-(1-Xe)*s,C=1-(1-qe)*s,H=Math.abs(o)<=1,W=H?C:0;return{transform:`translate3d(${t}%, 0, 0) scale(${d})`,opacity:String(W),zIndex:String(10-Math.abs(o)),pointerEvents:H?"auto":"none",transition:c.value?"none":"transform .55s cubic-bezier(.21,1.02,.36,1), opacity .45s ease"}}function S(n){u.value=(n%f.value+f.value)%f.value}function w(){S(u.value+1)}function E(){S(u.value-1)}function T(n){var o,e;f.value<2||(c.value=!0,k=n.clientX,i.value=0,m=n.pointerId,(e=(o=n.currentTarget).setPointerCapture)==null||e.call(o,n.pointerId))}function L(n){var e;if(!c.value||n.pointerId!==m)return;const o=((e=p.value)==null?void 0:e.clientWidth)||1;i.value=(n.clientX-k)/o*100}function M(n){if(!c.value)return;const o=n.clientX-k;c.value=!1,i.value=0,m=null,o>K?E():o<-K&&w()}function O(n,o){if(!(Math.abs(i.value)>1)){if(n!==u.value){S(n);return}b("open",o)}}function D(n){if(!(Math.abs(i.value)>1)){if(n!==u.value){S(n);return}b("all")}}return(n,o)=>(a(),l("section",Ne,[_("div",{class:"reel__stage",ref_key:"stage",ref:p,onPointerdown:T,onPointermove:L,onPointerup:M,onPointercancel:M},[(a(!0),l(A,null,G(g.value,(e,t)=>(a(),l("div",{key:e.key,class:N(["reel__cell",{"is-active":t===u.value}]),style:B(h(t))},[e.kind==="product"?(a(),q(ee,{key:0,value:e.product,onOpen:s=>O(t,s)},null,8,["value","onOpen"])):(a(),l("button",{key:1,type:"button",class:"reel__all",onClick:s=>D(t)},[_("span",Ve,[P(j,{icon:"vuesax-linear:arrow-left-2",size:"26"})]),o[0]||(o[0]=_("span",{class:"reel__allText"},"مشاهده همه محصولات جدید",-1))],8,Fe))],6))),128))],544)]))}}),Ye=V(We,[["__scopeId","data-v-9bb6595e"]]),je="/assets/shipping-and-delivery-CyUGL93q.png",Je="/assets/sports-and-competition-ao926_SX.png",te="/assets/montzar-logo-05_bmbid.png",Ke=[{type:"popup",src:je,text:"ارسال سریع و مطمئن سفارش‌های شما به سراسر کشور.",link:void 0},{type:"popup",src:Je,text:"جدیدترین محصولات منتزر را در بخش محصولات جدید ببینید.",link:void 0},{type:"popup",src:te,text:"منتزر، همراه شما در خرید و فروش طلا.",link:void 0}],Qe=ie("config",{state:()=>({config:{main_slider:Ke},cats:[],loaded:!1}),actions:{setCats(r){this.cats=r},async init(){try{const r=await X.listProducts(),y=new Map;for(const v of r)v.category&&!y.has(v.category.id)&&y.set(v.category.id,{id:v.category.id,title:v.category.title,icon:{image:te}});this.cats=[...y.values()],this.loaded=!0}catch(r){console.log(r)}}}}),Ze={class:"home"},et={class:"home__bar"},tt={class:"home__barInner"},nt={class:"home__list"},st={key:3,class:"home__empty"},at=70,ot=6,lt=4,it=F({__name:"HomeView",setup(r){let y=!1;const v=ve(),b=Qe(),u=re(),p=I(!0),c=I(!1),i=I([]),k=I(null),m=I(null),g=I(y);function f(e){return{"--reveal-delay":`${e*at}ms`}}const h=R(()=>i.value),S=R(()=>i.value.slice(0,ot)),w=R(()=>i.value.slice(0,lt)),E=R(()=>{var e;return(e=m.value)!=null&&e.length?m.value.filter(t=>t.image).map((t,s)=>({key:`${s}-${t.image}`,title:"",image:t.image,link:t.link||void 0})):b.cats.slice(0,5).map(t=>({key:t.id,title:t.title,image:T(t.id),categoryId:t.id}))});function T(e){var s,d;const t=i.value.find(C=>{var H;return((H=C.category)==null?void 0:H.id)===e});return(d=(s=t==null?void 0:t.images)==null?void 0:s[0])==null?void 0:d.url}function L(e){de(e)}function M(e){u.query.cats=[e.id],v.push({name:"search"})}function O(e){if(e.link){/^https?:\/\//i.test(e.link)?window.open(e.link,"_blank","noopener"):v.push(e.link);return}e.categoryId&&(u.query.cats=[e.categoryId]),v.push({name:"search"})}function D(){v.push({name:"newestProduct"})}async function n(){try{const[e]=await Promise.all([X.listProducts(),b.init()]);i.value=e}catch(e){console.log(e)}try{k.value=await X.getLatestGoldPrice()}catch{k.value=null}try{m.value=await X.getHomeSlider()}catch{m.value=null}}async function o(){await n(),c.value=!1}return Z(async()=>{await n(),p.value=!1,!g.value&&(await ce(),requestAnimationFrame(()=>{g.value=!0,y=!0}))}),(e,t)=>{const s=_e("container");return a(),l("div",Ze,[_("header",et,[_("div",tt,[t[1]||(t[1]=_("img",{src:ue,alt:"منتزر",class:"home__logo"},null,-1)),P(pe,{quote:k.value,compact:"",class:"home__rate"},null,8,["quote"])])]),P($(fe),{modelValue:c.value,"onUpdate:modelValue":t[0]||(t[0]=d=>c.value=d),onRefresh:o},{pulling:z(()=>[P($(Y),{size:"18"})]),loosing:z(()=>[P($(Y),{size:"18"})]),loading:z(()=>[P($(Y),{size:"18"})]),success:z(()=>[...t[2]||(t[2]=[_("span",null,null,-1)])]),default:z(()=>[P(s,{class:N(["home__body",{"is-revealed":g.value}])},{default:z(()=>[E.value.length?(a(),q(Se,{key:0,slides:E.value,class:"home__hero home__reveal",style:B(f(0)),onSelect:O},null,8,["slides","style"])):x("",!0),$(b).cats.length?(a(),l("section",{key:1,class:"home__section home__reveal",style:B(f(1))},[t[3]||(t[3]=_("h2",{class:"home__heading"},"دسته بندی ها",-1)),P(Me,{categories:$(b).cats,"active-id":null,onSelect:M},null,8,["categories"])],4)):x("",!0),h.value.length?(a(),l("section",{key:2,class:"home__section home__reveal",style:B(f(2))},[t[4]||(t[4]=_("h2",{class:"home__heading"},"محصولات جدید",-1)),P(Ye,{products:S.value,onOpen:L,onAll:D},null,8,["products"]),_("div",nt,[(a(!0),l(A,null,G(w.value,(d,C)=>(a(),q(ee,{key:d.id,value:d,class:"home__reveal",style:B(f(3+C)),onOpen:L},null,8,["value","style"]))),128))])],4)):x("",!0),!p.value&&!i.value.length?(a(),l("section",st,[P(j,{icon:"vuesax-linear:box",size:"26"}),t[5]||(t[5]=_("p",null,"هنوز محصولی در مجموعه ثبت نشده است.",-1))])):x("",!0)]),_:1},8,["class"])]),_:1},8,["modelValue"])])}}}),_t=V(it,[["__scopeId","data-v-3a35bb09"]]);export{_t as default}; +import{d as F,u as ne,o as Z,a as se,c as l,b as _,F as A,r as G,e as x,f as a,g as I,h as R,n as B,i as N,_ as V,j as q,t as U,I as j,k as ae,l as oe,w as le,m as $,p as P,q as ie,s as X,v as re,x as ce,y as ue,z,A as de,B as _e,C as ve}from"./index-Dp9sxvBv.js";import{R as pe}from"./RateStrip-Cjr1qlEL.js";import{P as fe,L as Y}from"./index-B0RgkHMm.js";import"./filters-CUgGgSea.js";const me={key:0,class:"hero"},ge=["onClick"],he=["src","alt"],ye={key:1,class:"hero__artFallback","aria-hidden":"true"},ke={key:0,class:"hero__dots"},Ie=["aria-label","onClick"],J=46,be=.76,$e=36.6,Pe=.75,Ce=F({__name:"HeroCarousel",props:{slides:{},autoplay:{type:Boolean,default:!0}},emits:["select"],setup(r,{emit:y}){const v=r,b=y,u=I(0),p=I(null),c=I(!1),i=I(0);let k=0,m=null,g;const f=ne(),h=R(()=>v.slides.length);function S(e){let t=e-u.value;h.value>2&&(t>h.value/2&&(t-=h.value),t<-h.value/2&&(t+=h.value));const s=c.value?i.value:0,d=Math.abs(t),C=t*$e+s,H=t===0?1:be,W=d>1?0:d===0?1:Pe;return{transform:`translate3d(${C}%, 0, 0) scale(${H})`,opacity:String(W),zIndex:String(10-d),pointerEvents:d>1?"none":"auto",transition:c.value?"none":"transform .42s cubic-bezier(.22,.61,.36,1), opacity .42s ease"}}function w(e){u.value=(e%h.value+h.value)%h.value,o()}function E(){w(u.value+1)}function T(){w(u.value-1)}function L(e){var t,s;h.value<2||(c.value=!0,k=e.clientX,i.value=0,m=e.pointerId,(s=(t=e.currentTarget).setPointerCapture)==null||s.call(t,e.pointerId),n())}function M(e){var s;if(!c.value||e.pointerId!==m)return;const t=((s=p.value)==null?void 0:s.clientWidth)||1;i.value=(e.clientX-k)/t*100}function O(e){if(!c.value)return;const t=e.clientX-k;c.value=!1,i.value=0,m=null,t>J?T():t<-J?E():o()}function D(e,t){if(!(Math.abs(i.value)>1)){if(e!==u.value){w(e);return}b("select",t)}}function n(){g&&clearInterval(g),g=void 0}function o(){n(),v.autoplay&&!f.isReducedMotion&&h.value>1&&(g=setInterval(E,6e3))}return Z(o),se(n),(e,t)=>r.slides.length?(a(),l("section",me,[_("div",{class:"hero__stage",ref_key:"stage",ref:p,onPointerdown:L,onPointermove:M,onPointerup:O,onPointercancel:O},[(a(!0),l(A,null,G(r.slides,(s,d)=>(a(),l("article",{key:s.key,class:N(["hero__card",{"is-active":d===u.value}]),style:B(S(d)),onClick:C=>D(d,s)},[s.image?(a(),l("img",{key:0,src:s.image,alt:s.title,class:"hero__art",draggable:"false"},null,8,he)):(a(),l("div",ye))],14,ge))),128))],544),r.slides.length>1?(a(),l("div",ke,[(a(!0),l(A,null,G(r.slides,(s,d)=>(a(),l("button",{key:s.key,type:"button",class:N(["hero__dot",{"is-active":d===u.value}]),"aria-label":s.title,onClick:C=>w(d)},null,10,Ie))),128))])):x("",!0)])):x("",!0)}}),Se=V(Ce,[["__scopeId","data-v-d3ac0cc7"]]),we={class:"cats no-scrollbar"},xe=["onClick"],Ee={class:"cats__mark","aria-hidden":"true"},He=["src"],Re={class:"cats__title"},Le=F({__name:"CategoryGrid",props:{categories:{},activeId:{}},emits:["select"],setup(r,{emit:y}){const v=y;return(b,u)=>(a(),l("div",we,[(a(!0),l(A,null,G(r.categories,p=>{var c;return a(),l("button",{key:p.id,type:"button",class:N(["cats__tile",{"is-active":p.id===r.activeId}]),onClick:i=>v("select",p)},[_("span",Ee,[(c=p.icon)!=null&&c.image?(a(),l("img",{key:0,src:p.icon.image,alt:""},null,8,He)):(a(),q(j,{key:1,icon:"vuesax-linear:3d-cube-scan",size:"27"}))]),_("span",Re,U(p.title),1)],10,xe)}),128))]))}}),Me=V(Le,[["__scopeId","data-v-155beefb"]]),Oe={class:"panel__art"},ze=["alt"],Be={class:"panel__title"},Ae={class:"panel__meta"},Te={class:"panel__weight"},De={key:0,class:"panel__wageOld"},Ue={class:"panel__wage"},Ge=F({__name:"ProductPanel",props:{value:{},wageBefore:{}},emits:["open"],setup(r,{emit:y}){const v=r,b=y,{image:u,title:p,min_gram:c,wage:i}=ae(v.value);function k(m){return m%1===0?String(m):m.toFixed(2)}return(m,g)=>{const f=oe("lazy");return a(),l("article",{class:"panel","data-product-origin":"",onClick:g[0]||(g[0]=h=>b("open",r.value))},[_("div",Oe,[le(_("img",{alt:$(p)},null,8,ze),[[f,$(u)]])]),_("h3",Be,U($(p)),1),_("div",Ae,[_("span",Te,U($(c))+" گرم",1),$(i)!=null?(a(),l(A,{key:0},[g[1]||(g[1]=_("span",{class:"panel__sep","aria-hidden":"true"},null,-1)),r.wageBefore!=null?(a(),l("span",De,"اجرت "+U(k(r.wageBefore))+"٪",1)):x("",!0),_("span",Ue,U(k($(i)))+"٪ اجرت",1)],64)):x("",!0)])])}}}),ee=V(Ge,[["__scopeId","data-v-ccafc905"]]),Ne={class:"reel"},Fe=["onClick"],Ve={class:"reel__allMark","aria-hidden":"true"},K=46,Xe=.78,Q=92.5,qe=.62,We=F({__name:"ProductCarousel",props:{products:{}},emits:["open","all"],setup(r,{emit:y}){const v=r,b=y,u=I(0),p=I(null),c=I(!1),i=I(0);let k=0,m=null;const g=R(()=>[...v.products.map(n=>({key:n.id,kind:"product",product:n})),{key:"__all__",kind:"all"}]),f=R(()=>g.value.length);function h(n){let o=n-u.value;f.value>2&&(o>f.value/2&&(o-=f.value),o<-f.value/2&&(o+=f.value));const e=c.value?i.value:0,t=o*Q+e,s=Math.min(Math.abs(o+e/Q),1),d=1-(1-Xe)*s,C=1-(1-qe)*s,H=Math.abs(o)<=1,W=H?C:0;return{transform:`translate3d(${t}%, 0, 0) scale(${d})`,opacity:String(W),zIndex:String(10-Math.abs(o)),pointerEvents:H?"auto":"none",transition:c.value?"none":"transform .55s cubic-bezier(.21,1.02,.36,1), opacity .45s ease"}}function S(n){u.value=(n%f.value+f.value)%f.value}function w(){S(u.value+1)}function E(){S(u.value-1)}function T(n){var o,e;f.value<2||(c.value=!0,k=n.clientX,i.value=0,m=n.pointerId,(e=(o=n.currentTarget).setPointerCapture)==null||e.call(o,n.pointerId))}function L(n){var e;if(!c.value||n.pointerId!==m)return;const o=((e=p.value)==null?void 0:e.clientWidth)||1;i.value=(n.clientX-k)/o*100}function M(n){if(!c.value)return;const o=n.clientX-k;c.value=!1,i.value=0,m=null,o>K?E():o<-K&&w()}function O(n,o){if(!(Math.abs(i.value)>1)){if(n!==u.value){S(n);return}b("open",o)}}function D(n){if(!(Math.abs(i.value)>1)){if(n!==u.value){S(n);return}b("all")}}return(n,o)=>(a(),l("section",Ne,[_("div",{class:"reel__stage",ref_key:"stage",ref:p,onPointerdown:T,onPointermove:L,onPointerup:M,onPointercancel:M},[(a(!0),l(A,null,G(g.value,(e,t)=>(a(),l("div",{key:e.key,class:N(["reel__cell",{"is-active":t===u.value}]),style:B(h(t))},[e.kind==="product"?(a(),q(ee,{key:0,value:e.product,onOpen:s=>O(t,s)},null,8,["value","onOpen"])):(a(),l("button",{key:1,type:"button",class:"reel__all",onClick:s=>D(t)},[_("span",Ve,[P(j,{icon:"vuesax-linear:arrow-left-2",size:"26"})]),o[0]||(o[0]=_("span",{class:"reel__allText"},"مشاهده همه محصولات جدید",-1))],8,Fe))],6))),128))],544)]))}}),Ye=V(We,[["__scopeId","data-v-9bb6595e"]]),je="/assets/shipping-and-delivery-CyUGL93q.png",Je="/assets/sports-and-competition-ao926_SX.png",te="/assets/montzar-logo-05_bmbid.png",Ke=[{type:"popup",src:je,text:"ارسال سریع و مطمئن سفارش‌های شما به سراسر کشور.",link:void 0},{type:"popup",src:Je,text:"جدیدترین محصولات منتزر را در بخش محصولات جدید ببینید.",link:void 0},{type:"popup",src:te,text:"منتزر، همراه شما در خرید و فروش طلا.",link:void 0}],Qe=ie("config",{state:()=>({config:{main_slider:Ke},cats:[],loaded:!1}),actions:{setCats(r){this.cats=r},async init(){try{const r=await X.listProducts(),y=new Map;for(const v of r)v.category&&!y.has(v.category.id)&&y.set(v.category.id,{id:v.category.id,title:v.category.title,icon:{image:te}});this.cats=[...y.values()],this.loaded=!0}catch(r){console.log(r)}}}}),Ze={class:"home"},et={class:"home__bar"},tt={class:"home__barInner"},nt={class:"home__list"},st={key:3,class:"home__empty"},at=70,ot=6,lt=4,it=F({__name:"HomeView",setup(r){let y=!1;const v=ve(),b=Qe(),u=re(),p=I(!0),c=I(!1),i=I([]),k=I(null),m=I(null),g=I(y);function f(e){return{"--reveal-delay":`${e*at}ms`}}const h=R(()=>i.value),S=R(()=>i.value.slice(0,ot)),w=R(()=>i.value.slice(0,lt)),E=R(()=>{var e;return(e=m.value)!=null&&e.length?m.value.filter(t=>t.image).map((t,s)=>({key:`${s}-${t.image}`,title:"",image:t.image,link:t.link||void 0})):b.cats.slice(0,5).map(t=>({key:t.id,title:t.title,image:T(t.id),categoryId:t.id}))});function T(e){var s,d;const t=i.value.find(C=>{var H;return((H=C.category)==null?void 0:H.id)===e});return(d=(s=t==null?void 0:t.images)==null?void 0:s[0])==null?void 0:d.url}function L(e){de(e)}function M(e){u.query.cats=[e.id],v.push({name:"search"})}function O(e){if(e.link){/^https?:\/\//i.test(e.link)?window.open(e.link,"_blank","noopener"):v.push(e.link);return}e.categoryId&&(u.query.cats=[e.categoryId]),v.push({name:"search"})}function D(){v.push({name:"newestProduct"})}async function n(){try{const[e]=await Promise.all([X.listProducts(),b.init()]);i.value=e}catch(e){console.log(e)}try{k.value=await X.getLatestGoldPrice()}catch{k.value=null}try{m.value=await X.getHomeSlider()}catch{m.value=null}}async function o(){await n(),c.value=!1}return Z(async()=>{await n(),p.value=!1,!g.value&&(await ce(),requestAnimationFrame(()=>{g.value=!0,y=!0}))}),(e,t)=>{const s=_e("container");return a(),l("div",Ze,[_("header",et,[_("div",tt,[t[1]||(t[1]=_("img",{src:ue,alt:"منتزر",class:"home__logo"},null,-1)),P(pe,{quote:k.value,compact:"",class:"home__rate"},null,8,["quote"])])]),P($(fe),{modelValue:c.value,"onUpdate:modelValue":t[0]||(t[0]=d=>c.value=d),onRefresh:o},{pulling:z(()=>[P($(Y),{size:"18"})]),loosing:z(()=>[P($(Y),{size:"18"})]),loading:z(()=>[P($(Y),{size:"18"})]),success:z(()=>[...t[2]||(t[2]=[_("span",null,null,-1)])]),default:z(()=>[P(s,{class:N(["home__body",{"is-revealed":g.value}])},{default:z(()=>[E.value.length?(a(),q(Se,{key:0,slides:E.value,class:"home__hero home__reveal",style:B(f(0)),onSelect:O},null,8,["slides","style"])):x("",!0),$(b).cats.length?(a(),l("section",{key:1,class:"home__section home__reveal",style:B(f(1))},[t[3]||(t[3]=_("h2",{class:"home__heading"},"دسته بندی ها",-1)),P(Me,{categories:$(b).cats,"active-id":null,onSelect:M},null,8,["categories"])],4)):x("",!0),h.value.length?(a(),l("section",{key:2,class:"home__section home__reveal",style:B(f(2))},[t[4]||(t[4]=_("h2",{class:"home__heading"},"محصولات جدید",-1)),P(Ye,{products:S.value,onOpen:L,onAll:D},null,8,["products"]),_("div",nt,[(a(!0),l(A,null,G(w.value,(d,C)=>(a(),q(ee,{key:d.id,value:d,class:"home__reveal",style:B(f(3+C)),onOpen:L},null,8,["value","style"]))),128))])],4)):x("",!0),!p.value&&!i.value.length?(a(),l("section",st,[P(j,{icon:"vuesax-linear:box",size:"26"}),t[5]||(t[5]=_("p",null,"هنوز محصولی در مجموعه ثبت نشده است.",-1))])):x("",!0)]),_:1},8,["class"])]),_:1},8,["modelValue"])])}}}),_t=V(it,[["__scopeId","data-v-3a35bb09"]]);export{_t as default}; diff --git a/apps/user-app-v2/dist/assets/KeyCode-CA5MXqE7.js b/apps/user-app-v2/dist/assets/KeyCode-DAs3W-5E.js similarity index 96% rename from apps/user-app-v2/dist/assets/KeyCode-CA5MXqE7.js rename to apps/user-app-v2/dist/assets/KeyCode-DAs3W-5E.js index e02c824..570abe5 100644 --- a/apps/user-app-v2/dist/assets/KeyCode-CA5MXqE7.js +++ b/apps/user-app-v2/dist/assets/KeyCode-DAs3W-5E.js @@ -1 +1 @@ -import{a9 as d,h as f,an as g,d as P,ab as p,L as C,Q as T,Y as h,x as m,a as x,p as R,bj as y}from"./index-BWyw3RAx.js";var E=!1;try{var c=Object.defineProperty({},"passive",{get:function(){E=!0}});window.addEventListener("testPassive",null,c),window.removeEventListener("testPassive",null,c)}catch{}var j=Symbol("TriggerContextKey"),K=function(e){return e?d(j,{setPortal:function(){},popPortal:!1}):{setPortal:function(){},popPortal:!1}},v=Symbol("PortalContextKey"),b=function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inTriggerContext:!0};g(v,{inTriggerContext:i.inTriggerContext,shouldRender:f(function(){var n=e||{},u=n.sPopupVisible,t=n.popupRef,l=n.forceRender,r=n.autoDestroy,s=!1;return(u||t||l)&&(s=!0),!u&&r&&(s=!1),s})})},D=function(){b({},{inTriggerContext:!1});var e=d(v,{shouldRender:f(function(){return!1}),inTriggerContext:!1});return{shouldRender:f(function(){return e.shouldRender.value||e.inTriggerContext===!1})}};const N=P({compatConfig:{MODE:3},name:"Portal",inheritAttrs:!1,props:{getContainer:p.func.isRequired,didUpdate:Function},setup:function(e,i){var n=i.slots,u=!0,t,l=D(),r=l.shouldRender;C(function(){u=!1,r.value&&(t=e.getContainer())});var s=T(r,function(){r.value&&!t&&(t=e.getContainer()),t&&s()});return h(function(){m(function(){if(r.value){var o;(o=e.didUpdate)===null||o===void 0||o.call(e,e)}})}),x(function(){t&&t.parentNode&&t.parentNode.removeChild(t)}),function(){if(!r.value)return null;if(u){var o;return(o=n.default)===null||o===void 0?void 0:o.call(n)}return t?R(y,{to:t},n):null}}});var w={ESC:27,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};export{w as K,N as P,K as a,E as s,b as u}; +import{a9 as d,h as f,an as g,d as P,ab as p,L as C,Q as T,Y as h,x as m,a as x,p as R,bj as y}from"./index-Dp9sxvBv.js";var E=!1;try{var c=Object.defineProperty({},"passive",{get:function(){E=!0}});window.addEventListener("testPassive",null,c),window.removeEventListener("testPassive",null,c)}catch{}var j=Symbol("TriggerContextKey"),K=function(e){return e?d(j,{setPortal:function(){},popPortal:!1}):{setPortal:function(){},popPortal:!1}},v=Symbol("PortalContextKey"),b=function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inTriggerContext:!0};g(v,{inTriggerContext:i.inTriggerContext,shouldRender:f(function(){var n=e||{},u=n.sPopupVisible,t=n.popupRef,l=n.forceRender,r=n.autoDestroy,s=!1;return(u||t||l)&&(s=!0),!u&&r&&(s=!1),s})})},D=function(){b({},{inTriggerContext:!1});var e=d(v,{shouldRender:f(function(){return!1}),inTriggerContext:!1});return{shouldRender:f(function(){return e.shouldRender.value||e.inTriggerContext===!1})}};const N=P({compatConfig:{MODE:3},name:"Portal",inheritAttrs:!1,props:{getContainer:p.func.isRequired,didUpdate:Function},setup:function(e,i){var n=i.slots,u=!0,t,l=D(),r=l.shouldRender;C(function(){u=!1,r.value&&(t=e.getContainer())});var s=T(r,function(){r.value&&!t&&(t=e.getContainer()),t&&s()});return h(function(){m(function(){if(r.value){var o;(o=e.didUpdate)===null||o===void 0||o.call(e,e)}})}),x(function(){t&&t.parentNode&&t.parentNode.removeChild(t)}),function(){if(!r.value)return null;if(u){var o;return(o=n.default)===null||o===void 0?void 0:o.call(n)}return t?R(y,{to:t},n):null}}});var w={ESC:27,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};export{w as K,N as P,K as a,E as s,b as u}; diff --git a/apps/user-app-v2/dist/assets/LoginRegisterView-CFYOzXdH.js b/apps/user-app-v2/dist/assets/LoginRegisterView-GyFoinkN.js similarity index 98% rename from apps/user-app-v2/dist/assets/LoginRegisterView-CFYOzXdH.js rename to apps/user-app-v2/dist/assets/LoginRegisterView-GyFoinkN.js index 5d35572..cf3aa32 100644 --- a/apps/user-app-v2/dist/assets/LoginRegisterView-CFYOzXdH.js +++ b/apps/user-app-v2/dist/assets/LoginRegisterView-GyFoinkN.js @@ -1 +1 @@ -import{d as E,g as x,Q as N,L as Y,f as v,c as b,w as K,R as ee,b as a,i as L,e as T,F as V,r as te,j as S,C as W,S as se,O as ae,B as H,p as n,z as _,I as O,t as I,m,T as ne,N as A,K as U,s as P,x as oe,U as M,h as le,_ as G,V as q}from"./index-BWyw3RAx.js";import{P as J}from"./PageBar-D5DXU6sO.js";import{a as Q,F as C,I as F,T as ue}from"./index-7kdFQ8tV.js";import"./FormItemContext-Bxnh5gKQ.js";import"./classCallCheck-Ou87VTNv.js";import"./raf-nDFcuFT6.js";const re={class:"otp-single-input"},ie=["type","placeholder","disabled"],ce={key:0},de=["innerHTML"],pe=E({__name:"SingleOtpInput",props:{inputType:{default:"tel"},value:{},separator:{},focus:{type:Boolean},inputClasses:{},shouldAutoFocus:{type:Boolean},isLastChild:{type:Boolean},placeholder:{},disabled:{type:Boolean}},emits:["on-change","on-keydown","on-paste","on-focus","on-blur"],setup(u,{emit:k}){const i=u,g=k,r=x(i.value||""),t=x(null),f=()=>(r.value=r.value.toString(),r.value.length>1&&(r.value=r.value.slice(0,1)),g("on-change",r.value)),p=c=>c>=48&&c<=57||c>=96&&c<=105,o=c=>{i.disabled&&c.preventDefault();const d=c||window.event,e=d.which?d.which:d.keyCode;p(e)||[8,9,13,37,39,46,86].includes(e)?g("on-keydown",c):d.preventDefault()},y=c=>g("on-paste",c),w=()=>(t.value.select(),g("on-focus")),$=()=>g("on-blur");return N(()=>i.value,(c,d)=>{c!==d&&(r.value=c??"")}),N(()=>i.focus,(c,d)=>{d!==c&&t.value&&i.focus&&(t.value.focus(),t.value.select())}),Y(()=>{t.value&&i.focus&&i.shouldAutoFocus&&(t.value.focus(),t.value.select())}),(c,d)=>(v(),b("div",re,[K(a("input",{type:u.inputType,placeholder:u.placeholder,disabled:u.disabled,ref_key:"input",ref:t,min:"0",max:"9",maxlength:"1",pattern:"[0-9]","onUpdate:modelValue":d[0]||(d[0]=e=>r.value=e),class:L(u.inputClasses),onInput:f,onKeydown:o,onPaste:y,onFocus:w,onBlur:$},null,42,ie),[[ee,r.value]]),!u.isLastChild&&u.separator?(v(),b("span",ce,[a("span",{innerHTML:u.separator},null,8,de)])):T("",!0)]))}}),me={class:"flex ltr justify-around w-full"},ve=8,_e=37,fe=39,he=46,ge=E({__name:"OtpInput",props:{defaultFocus:{type:Boolean},numInputs:{default:4},separator:{},inputClasses:{},inputType:{},shouldAutoFocus:{type:Boolean,default:!1},placeholder:{},disabled:{type:Boolean,default:!1}},emits:["on-change","on-complete"],setup(u,{emit:k}){const i=u,g=k,r=x(0),t=x([]),f=x([]),p=l=>{i.defaultFocus&&l{r.value=-1},y=()=>t.value.join("").length===i.numInputs?g("on-complete",t.value.join("")):"Wait until the user enters the required number of characters",w=l=>{r.value=Math.max(Math.min(i.numInputs-1,l),0)},$=()=>w(r.value+1),c=()=>w(r.value-1),d=l=>{f.value=Object.assign([],t.value),typeof l=="string"&&l===""?t.value.splice(r.value,1):t.value[r.value]=l,f.value.join("")!==t.value.join("")&&(g("on-change",t.value.join("")),y())},e=l=>{var j;l.preventDefault();const R=(((j=l.clipboardData)==null?void 0:j.getData("text/plain"))??"").slice(0,i.numInputs-r.value).split("");if(i.inputType==="number"&&!R.join("").match(/^\d+$/))return"Invalid pasted data";const z=t.value.slice(0,r.value).concat(R);return z.slice(0,i.numInputs).forEach((Z,X)=>{t.value[X]=Z}),w(z.slice(0,i.numInputs).length),y()},h=l=>{d(l),$()},s=l=>{switch(l.keyCode){case ve:l.preventDefault(),d(""),c();break;case he:l.preventDefault(),d("");break;case _e:l.preventDefault(),c();break;case fe:l.preventDefault(),$();break}};return(l,B)=>(v(),b("div",null,[a("div",me,[(v(!0),b(V,null,te(u.numInputs,(R,D)=>(v(),S(pe,{key:D,focus:r.value===D,value:t.value[D],separator:u.separator,"input-type":u.inputType,"input-classes":u.inputClasses,"is-last-child":D===u.numInputs-1,"should-auto-focus":u.shouldAutoFocus,placeholder:u.placeholder,disabled:u.disabled,onOnChange:h,onOnKeydown:s,onOnPaste:e,onOnFocus:z=>p(D),onOnBlur:o},null,8,["focus","value","separator","input-type","input-classes","is-last-child","should-auto-focus","placeholder","disabled","onOnFocus"]))),128))])]))}}),ye=u=>` مقدار ${u} نا معتبر است `,be=u=>({pattern:/^(\+98|0098|98|0)?9\d{9}$/g,message:ye(u)}),ke=u=>({required:!0,message:` لطفا ${u} را وارد کنید `}),xe={class:"auth"},we={class:"auth__intro"},Ie={class:"auth__mark","aria-hidden":"true"},$e={class:"auth__sub"},Oe={class:"auth__card"},Ce={key:0,class:"auth__timer"},Fe={key:1,class:"auth__timer"},Te=["disabled"],Be={class:"auth__switch"},De=E({__name:"LoginView",emits:["register"],setup(u,{emit:k}){const i=k,g=W(),r=se(),t=ae(),f=U({username:void 0}),p=U({step:1,loading:!1,defaultFocus:!1}),o=x(0),y=()=>{o.value>0&&setTimeout(()=>{o.value>0&&(o.value-=1,y())},1e3)},w=async()=>{try{p.loading=!0,await P.requestOtp(String(f.username??"")),p.step=2,o.value=120,y(),await oe(()=>{p.defaultFocus=!0})}catch(h){const s=h instanceof Error&&/\(429\)/.test(h.message)?c(h):null;M.error(s??"خطا در ارسال کد. لطفاً دوباره تلاش کنید.")}finally{p.loading=!1}},$=async h=>{try{p.loading=!0;const{token:s,customer:l}=await P.verifyOtp(String(f.username??""),h);t.login(s,l.id,l.mobile);try{const R=await P.getExpertIdentity();t.setSalesExpert(R.isSalesExpert)}catch{t.setSalesExpert(!1)}const B=typeof r.query.redirect=="string"?r.query.redirect:void 0;await g.push(B??{name:"home"}),M.success("با موفقیت وارد شدید")}catch(s){M.error(s instanceof Error&&/\(429\)/.test(s.message)?c(s)??"تعداد تلاش‌ها بیش از حد مجاز است.":"کد وارد شده صحیح نیست")}finally{p.loading=!1}};function c(h){const s=h.message.match(/\{.*\}/);if(!s)return null;try{const l=JSON.parse(s[0]);return typeof l.message=="string"?l.message:null}catch{return null}}const d=h=>h<10?"0"+h:h,e=le(()=>p.step===1?"دریافت رمز عبور":"دریافت مجدد رمز عبور");return(h,s)=>{const l=H("container");return v(),b("div",xe,[n(J,{title:"ورود","back-to":"home"}),n(l,{class:"auth__body"},{default:_(()=>[a("section",we,[a("div",Ie,[n(O,{icon:"vuesax-linear:security-user",size:"28"})]),s[2]||(s[2]=a("h2",{class:"auth__title"},"ورود به منتزر",-1)),a("p",$e,I(p.step===1?"شماره موبایل خود را وارد کنید":"رمز یکبارمصرف را وارد کنید"),1)]),a("section",Oe,[p.step===2?(v(),b(V,{key:0},[n(ge,{class:"auth__otp","input-classes":"otp-input",inputType:"tel","num-inputs":4,"should-auto-focus":!0,defaultFocus:p.defaultFocus,onOnComplete:$},null,8,["defaultFocus"]),o.value>0?(v(),b("p",Ce," امکان دریافت مجدد رمز در "+I(d(o.value))+" ثانیه دیگر ",1)):(v(),b("p",Fe,"برای دریافت رمز عبور مجدد تلاش کنید"))],64)):T("",!0),n(m(Q),{model:f,layout:"vertical",onFinish:w,class:"auth__form"},{default:_(()=>[K(n(m(C),{name:"username",label:"تلفن همراه",rules:[m(ke)("تلفن همراه"),m(be)("تلفن همراه")]},{default:_(()=>[n(m(F),{type:"number",value:f.username,"onUpdate:value":s[0]||(s[0]=B=>f.username=B)},null,8,["value"])]),_:1},8,["rules"]),[[ne,p.step===1]]),a("button",{type:"submit",class:L(["auth__cta",{"is-loading":p.loading}]),disabled:p.loading||o.value>0&&p.step===2},I(e.value),11,Te)]),_:1},8,["model"])]),a("p",Be,[s[3]||(s[3]=A(" اگر ثبت نام نکرده‌اید ",-1)),a("button",{type:"button",onClick:s[1]||(s[1]=B=>i("register",!0))},"ثبت نام کنید")])]),_:1})])}}}),Se=G(De,[["__scopeId","data-v-5676980f"]]),Re={class:"reg"},Ee={class:"reg__doneMark","aria-hidden":"true"},Ae={class:"reg__doneText"},Le={class:"reg__ltr"},ze={class:"reg__doneActions"},Pe={class:"reg__head"},Me=["aria-valuenow"],Ue={class:"reg__stepLabel"},Ve={class:"reg__title"},je={class:"reg__sub"},Ne={key:"s1",class:"reg__fields"},qe={class:"reg__row"},Ke={key:"s2",class:"reg__fields"},We={class:"reg__note"},He={class:"reg__footer"},Ge={class:"reg__footerInner"},Je=["disabled"],Qe={key:0,class:"reg__spinner keep-motion","aria-hidden":"true"},Ze={key:0,class:"reg__switch"},Xe=E({__name:"RegisterView",emits:["register"],setup(u,{emit:k}){const i=k,g=W(),r=x(),t=x(1),f=x(!1),p=x(!1),o=U({fname:void 0,lname:void 0,mobile:void 0,store_name:void 0,phone:void 0,city:void 0,address:void 0}),y=d=>({required:!0,whitespace:!0,message:`لطفاً ${d} را وارد کنید`});function w(d){return(d??"").replace(/[۰-۹]/g,e=>String(e.charCodeAt(0)-1776)).replace(/[٠-٩]/g,e=>String(e.charCodeAt(0)-1632)).replace(/\D/g,"")}function $(){p.value?g.push({name:"home"}):t.value===2?t.value=1:i("register",!1)}async function c(){if(t.value===1){t.value=2,window.scrollTo({top:0,behavior:"smooth"});return}try{f.value=!0,await new Promise(d=>setTimeout(d,600)),p.value=!0,window.scrollTo({top:0})}finally{f.value=!1}}return(d,e)=>{const h=H("container");return v(),b("div",Re,[n(J,{title:"ثبت نام","back-action":$}),n(q,{name:"reg-fade",mode:"out-in"},{default:_(()=>[p.value?(v(),S(h,{key:"done",class:"reg__body reg__done"},{default:_(()=>[a("div",Ee,[e[10]||(e[10]=a("span",{class:"reg__doneRing"},null,-1)),n(O,{icon:"vuesax-linear:tick-circle",size:"40"})]),e[12]||(e[12]=a("h2",{class:"reg__doneTitle"},"درخواست شما ثبت شد",-1)),a("p",Ae,[A(" اطلاعات فروشگاه "+I(o.store_name)+" برای کارشناسان ما ارسال شد. پس از بررسی و تایید، می‌توانید با شماره ",1),a("span",Le,I(o.mobile),1),e[11]||(e[11]=A(" وارد شوید. ",-1))]),a("div",ze,[a("button",{type:"button",class:"reg__cta",onClick:e[0]||(e[0]=s=>m(g).push({name:"home"}))},"بازگشت به صفحه اصلی"),a("button",{type:"button",class:"reg__ghost",onClick:e[1]||(e[1]=s=>i("register",!1))},"رفتن به صفحه ورود")])]),_:1})):(v(),S(h,{key:"form",class:"reg__body"},{default:_(()=>[a("header",Pe,[a("div",{class:"reg__steps",role:"progressbar","aria-valuenow":t.value,"aria-valuemin":"1","aria-valuemax":"2"},[e[13]||(e[13]=a("span",{class:"reg__seg is-on"},null,-1)),a("span",{class:L(["reg__seg",{"is-on":t.value===2}])},null,2)],8,Me),a("p",Ue,"مرحله "+I(t.value===1?"۱":"۲")+" از ۲",1),a("h2",Ve,I(t.value===1?"اطلاعات شما":"اطلاعات فروشگاه"),1),a("p",je,I(t.value===1?"برای ساخت حساب فروشگاه، ابتدا خودتان را معرفی کنید.":"این اطلاعات برای ارسال سفارش و تایید حساب استفاده می‌شود."),1)]),n(m(Q),{ref_key:"formRef",ref:r,model:o,layout:"vertical",class:"reg__form",onFinish:c},{default:_(()=>[n(q,{name:t.value===2?"reg-next":"reg-prev",mode:"out-in"},{default:_(()=>[t.value===1?(v(),b("div",Ne,[a("div",qe,[n(m(C),{name:"fname",label:"نام",rules:[y("نام خود")]},{default:_(()=>[n(m(F),{value:o.fname,"onUpdate:value":e[2]||(e[2]=s=>o.fname=s),placeholder:"مثلاً علی",autocomplete:"given-name",enterkeyhint:"next"},null,8,["value"])]),_:1},8,["rules"]),n(m(C),{name:"lname",label:"نام خانوادگی",rules:[y("نام خانوادگی")]},{default:_(()=>[n(m(F),{value:o.lname,"onUpdate:value":e[3]||(e[3]=s=>o.lname=s),placeholder:"مثلاً محمدی",autocomplete:"family-name",enterkeyhint:"next"},null,8,["value"])]),_:1},8,["rules"])]),n(m(C),{name:"mobile",label:"شماره موبایل",rules:[y("شماره موبایل"),{pattern:/^09\d{9}$/,message:"شماره موبایل باید ۱۱ رقم و با ۰۹ شروع شود"}],extra:"کد ورود به این شماره پیامک می‌شود."},{default:_(()=>[n(m(F),{value:o.mobile,class:"reg__num",type:"tel",inputmode:"numeric",maxlength:11,placeholder:"09123456789",autocomplete:"tel",enterkeyhint:"next","onUpdate:value":e[4]||(e[4]=s=>o.mobile=w(s))},{prefix:_(()=>[n(O,{icon:"vuesax-linear:mobile",size:"18"})]),_:1},8,["value"])]),_:1},8,["rules"])])):(v(),b("div",Ke,[n(m(C),{name:"store_name",label:"نام فروشگاه",rules:[y("نام فروشگاه")]},{default:_(()=>[n(m(F),{value:o.store_name,"onUpdate:value":e[5]||(e[5]=s=>o.store_name=s),placeholder:"مثلاً گالری طلای آفتاب",autocomplete:"organization",enterkeyhint:"next"},{prefix:_(()=>[n(O,{icon:"vuesax-linear:shop",size:"18"})]),_:1},8,["value"])]),_:1},8,["rules"]),n(m(C),{name:"phone",label:"تلفن فروشگاه",rules:[y("تلفن فروشگاه"),{pattern:/^(0\d{10}|\d{8})$/,message:"تلفن را با کد شهر وارد کنید، مثلاً 02112345678"}]},{default:_(()=>[n(m(F),{value:o.phone,class:"reg__num",type:"tel",inputmode:"numeric",maxlength:11,placeholder:"02112345678",autocomplete:"tel-national",enterkeyhint:"next","onUpdate:value":e[6]||(e[6]=s=>o.phone=w(s))},{prefix:_(()=>[n(O,{icon:"vuesax-linear:call",size:"18"})]),_:1},8,["value"])]),_:1},8,["rules"]),n(m(C),{name:"city",label:"شهر",rules:[y("شهر")]},{default:_(()=>[n(m(F),{value:o.city,"onUpdate:value":e[7]||(e[7]=s=>o.city=s),placeholder:"مثلاً تهران",autocomplete:"address-level2",enterkeyhint:"next"},{prefix:_(()=>[n(O,{icon:"vuesax-linear:buildings",size:"18"})]),_:1},8,["value"])]),_:1},8,["rules"]),n(m(C),{name:"address",label:"آدرس پستی",rules:[y("آدرس فروشگاه")]},{default:_(()=>[n(m(ue),{value:o.address,"onUpdate:value":e[8]||(e[8]=s=>o.address=s),rows:3,placeholder:"خیابان، کوچه، پلاک، واحد",autocomplete:"street-address"},null,8,["value"])]),_:1},8,["rules"]),a("div",We,[n(O,{icon:"vuesax-linear:shield-tick",size:"18"}),e[14]||(e[14]=a("span",null,"حساب شما پس از بررسی اطلاعات توسط کارشناسان فعال می‌شود.",-1))])]))]),_:1},8,["name"]),a("footer",He,[a("div",Ge,[a("button",{type:"submit",class:L(["reg__cta",{"is-loading":f.value}]),disabled:f.value},[f.value?(v(),b("span",Qe)):T("",!0),a("span",null,I(t.value===1?"ادامه":f.value?"در حال ثبت…":"ثبت درخواست"),1),t.value===1?(v(),S(O,{key:1,icon:"vuesax-linear:arrow-left",size:"18"})):T("",!0)],10,Je),t.value===1?(v(),b("p",Ze,[e[15]||(e[15]=A(" حساب دارید؟ ",-1)),a("button",{type:"button",onClick:e[9]||(e[9]=s=>i("register",!1))},"وارد شوید")])):T("",!0)])])]),_:1},8,["model"])]),_:1}))]),_:1})])}}}),Ye=G(Xe,[["__scopeId","data-v-84dbe021"]]),lt=E({__name:"LoginRegisterView",setup(u){const k=x(!1),i=g=>k.value=g;return(g,r)=>(v(),b(V,null,[k.value?T("",!0):(v(),S(Se,{key:0,onRegister:i})),k.value?(v(),S(Ye,{key:1,onRegister:i})):T("",!0)],64))}});export{lt as default}; +import{d as E,g as x,Q as N,L as Y,f as v,c as b,w as K,R as ee,b as a,i as L,e as T,F as V,r as te,j as S,C as W,S as se,O as ae,B as H,p as n,z as _,I as O,t as I,m,T as ne,N as A,K as U,s as P,x as oe,U as M,h as le,_ as G,V as q}from"./index-Dp9sxvBv.js";import{P as J}from"./PageBar-El-laHqK.js";import{a as Q,F as C,I as F,T as ue}from"./index-UkXhTnpw.js";import"./FormItemContext-C33n6IMx.js";import"./classCallCheck-BTVV3tFI.js";import"./raf-nDFcuFT6.js";const re={class:"otp-single-input"},ie=["type","placeholder","disabled"],ce={key:0},de=["innerHTML"],pe=E({__name:"SingleOtpInput",props:{inputType:{default:"tel"},value:{},separator:{},focus:{type:Boolean},inputClasses:{},shouldAutoFocus:{type:Boolean},isLastChild:{type:Boolean},placeholder:{},disabled:{type:Boolean}},emits:["on-change","on-keydown","on-paste","on-focus","on-blur"],setup(u,{emit:k}){const i=u,g=k,r=x(i.value||""),t=x(null),f=()=>(r.value=r.value.toString(),r.value.length>1&&(r.value=r.value.slice(0,1)),g("on-change",r.value)),p=c=>c>=48&&c<=57||c>=96&&c<=105,o=c=>{i.disabled&&c.preventDefault();const d=c||window.event,e=d.which?d.which:d.keyCode;p(e)||[8,9,13,37,39,46,86].includes(e)?g("on-keydown",c):d.preventDefault()},y=c=>g("on-paste",c),w=()=>(t.value.select(),g("on-focus")),$=()=>g("on-blur");return N(()=>i.value,(c,d)=>{c!==d&&(r.value=c??"")}),N(()=>i.focus,(c,d)=>{d!==c&&t.value&&i.focus&&(t.value.focus(),t.value.select())}),Y(()=>{t.value&&i.focus&&i.shouldAutoFocus&&(t.value.focus(),t.value.select())}),(c,d)=>(v(),b("div",re,[K(a("input",{type:u.inputType,placeholder:u.placeholder,disabled:u.disabled,ref_key:"input",ref:t,min:"0",max:"9",maxlength:"1",pattern:"[0-9]","onUpdate:modelValue":d[0]||(d[0]=e=>r.value=e),class:L(u.inputClasses),onInput:f,onKeydown:o,onPaste:y,onFocus:w,onBlur:$},null,42,ie),[[ee,r.value]]),!u.isLastChild&&u.separator?(v(),b("span",ce,[a("span",{innerHTML:u.separator},null,8,de)])):T("",!0)]))}}),me={class:"flex ltr justify-around w-full"},ve=8,_e=37,fe=39,he=46,ge=E({__name:"OtpInput",props:{defaultFocus:{type:Boolean},numInputs:{default:4},separator:{},inputClasses:{},inputType:{},shouldAutoFocus:{type:Boolean,default:!1},placeholder:{},disabled:{type:Boolean,default:!1}},emits:["on-change","on-complete"],setup(u,{emit:k}){const i=u,g=k,r=x(0),t=x([]),f=x([]),p=l=>{i.defaultFocus&&l{r.value=-1},y=()=>t.value.join("").length===i.numInputs?g("on-complete",t.value.join("")):"Wait until the user enters the required number of characters",w=l=>{r.value=Math.max(Math.min(i.numInputs-1,l),0)},$=()=>w(r.value+1),c=()=>w(r.value-1),d=l=>{f.value=Object.assign([],t.value),typeof l=="string"&&l===""?t.value.splice(r.value,1):t.value[r.value]=l,f.value.join("")!==t.value.join("")&&(g("on-change",t.value.join("")),y())},e=l=>{var j;l.preventDefault();const R=(((j=l.clipboardData)==null?void 0:j.getData("text/plain"))??"").slice(0,i.numInputs-r.value).split("");if(i.inputType==="number"&&!R.join("").match(/^\d+$/))return"Invalid pasted data";const z=t.value.slice(0,r.value).concat(R);return z.slice(0,i.numInputs).forEach((Z,X)=>{t.value[X]=Z}),w(z.slice(0,i.numInputs).length),y()},h=l=>{d(l),$()},s=l=>{switch(l.keyCode){case ve:l.preventDefault(),d(""),c();break;case he:l.preventDefault(),d("");break;case _e:l.preventDefault(),c();break;case fe:l.preventDefault(),$();break}};return(l,B)=>(v(),b("div",null,[a("div",me,[(v(!0),b(V,null,te(u.numInputs,(R,D)=>(v(),S(pe,{key:D,focus:r.value===D,value:t.value[D],separator:u.separator,"input-type":u.inputType,"input-classes":u.inputClasses,"is-last-child":D===u.numInputs-1,"should-auto-focus":u.shouldAutoFocus,placeholder:u.placeholder,disabled:u.disabled,onOnChange:h,onOnKeydown:s,onOnPaste:e,onOnFocus:z=>p(D),onOnBlur:o},null,8,["focus","value","separator","input-type","input-classes","is-last-child","should-auto-focus","placeholder","disabled","onOnFocus"]))),128))])]))}}),ye=u=>` مقدار ${u} نا معتبر است `,be=u=>({pattern:/^(\+98|0098|98|0)?9\d{9}$/g,message:ye(u)}),ke=u=>({required:!0,message:` لطفا ${u} را وارد کنید `}),xe={class:"auth"},we={class:"auth__intro"},Ie={class:"auth__mark","aria-hidden":"true"},$e={class:"auth__sub"},Oe={class:"auth__card"},Ce={key:0,class:"auth__timer"},Fe={key:1,class:"auth__timer"},Te=["disabled"],Be={class:"auth__switch"},De=E({__name:"LoginView",emits:["register"],setup(u,{emit:k}){const i=k,g=W(),r=se(),t=ae(),f=U({username:void 0}),p=U({step:1,loading:!1,defaultFocus:!1}),o=x(0),y=()=>{o.value>0&&setTimeout(()=>{o.value>0&&(o.value-=1,y())},1e3)},w=async()=>{try{p.loading=!0,await P.requestOtp(String(f.username??"")),p.step=2,o.value=120,y(),await oe(()=>{p.defaultFocus=!0})}catch(h){const s=h instanceof Error&&/\(429\)/.test(h.message)?c(h):null;M.error(s??"خطا در ارسال کد. لطفاً دوباره تلاش کنید.")}finally{p.loading=!1}},$=async h=>{try{p.loading=!0;const{token:s,customer:l}=await P.verifyOtp(String(f.username??""),h);t.login(s,l.id,l.mobile);try{const R=await P.getExpertIdentity();t.setSalesExpert(R.isSalesExpert)}catch{t.setSalesExpert(!1)}const B=typeof r.query.redirect=="string"?r.query.redirect:void 0;await g.push(B??{name:"home"}),M.success("با موفقیت وارد شدید")}catch(s){M.error(s instanceof Error&&/\(429\)/.test(s.message)?c(s)??"تعداد تلاش‌ها بیش از حد مجاز است.":"کد وارد شده صحیح نیست")}finally{p.loading=!1}};function c(h){const s=h.message.match(/\{.*\}/);if(!s)return null;try{const l=JSON.parse(s[0]);return typeof l.message=="string"?l.message:null}catch{return null}}const d=h=>h<10?"0"+h:h,e=le(()=>p.step===1?"دریافت رمز عبور":"دریافت مجدد رمز عبور");return(h,s)=>{const l=H("container");return v(),b("div",xe,[n(J,{title:"ورود","back-to":"home"}),n(l,{class:"auth__body"},{default:_(()=>[a("section",we,[a("div",Ie,[n(O,{icon:"vuesax-linear:security-user",size:"28"})]),s[2]||(s[2]=a("h2",{class:"auth__title"},"ورود به منتزر",-1)),a("p",$e,I(p.step===1?"شماره موبایل خود را وارد کنید":"رمز یکبارمصرف را وارد کنید"),1)]),a("section",Oe,[p.step===2?(v(),b(V,{key:0},[n(ge,{class:"auth__otp","input-classes":"otp-input",inputType:"tel","num-inputs":4,"should-auto-focus":!0,defaultFocus:p.defaultFocus,onOnComplete:$},null,8,["defaultFocus"]),o.value>0?(v(),b("p",Ce," امکان دریافت مجدد رمز در "+I(d(o.value))+" ثانیه دیگر ",1)):(v(),b("p",Fe,"برای دریافت رمز عبور مجدد تلاش کنید"))],64)):T("",!0),n(m(Q),{model:f,layout:"vertical",onFinish:w,class:"auth__form"},{default:_(()=>[K(n(m(C),{name:"username",label:"تلفن همراه",rules:[m(ke)("تلفن همراه"),m(be)("تلفن همراه")]},{default:_(()=>[n(m(F),{type:"number",value:f.username,"onUpdate:value":s[0]||(s[0]=B=>f.username=B)},null,8,["value"])]),_:1},8,["rules"]),[[ne,p.step===1]]),a("button",{type:"submit",class:L(["auth__cta",{"is-loading":p.loading}]),disabled:p.loading||o.value>0&&p.step===2},I(e.value),11,Te)]),_:1},8,["model"])]),a("p",Be,[s[3]||(s[3]=A(" اگر ثبت نام نکرده‌اید ",-1)),a("button",{type:"button",onClick:s[1]||(s[1]=B=>i("register",!0))},"ثبت نام کنید")])]),_:1})])}}}),Se=G(De,[["__scopeId","data-v-5676980f"]]),Re={class:"reg"},Ee={class:"reg__doneMark","aria-hidden":"true"},Ae={class:"reg__doneText"},Le={class:"reg__ltr"},ze={class:"reg__doneActions"},Pe={class:"reg__head"},Me=["aria-valuenow"],Ue={class:"reg__stepLabel"},Ve={class:"reg__title"},je={class:"reg__sub"},Ne={key:"s1",class:"reg__fields"},qe={class:"reg__row"},Ke={key:"s2",class:"reg__fields"},We={class:"reg__note"},He={class:"reg__footer"},Ge={class:"reg__footerInner"},Je=["disabled"],Qe={key:0,class:"reg__spinner keep-motion","aria-hidden":"true"},Ze={key:0,class:"reg__switch"},Xe=E({__name:"RegisterView",emits:["register"],setup(u,{emit:k}){const i=k,g=W(),r=x(),t=x(1),f=x(!1),p=x(!1),o=U({fname:void 0,lname:void 0,mobile:void 0,store_name:void 0,phone:void 0,city:void 0,address:void 0}),y=d=>({required:!0,whitespace:!0,message:`لطفاً ${d} را وارد کنید`});function w(d){return(d??"").replace(/[۰-۹]/g,e=>String(e.charCodeAt(0)-1776)).replace(/[٠-٩]/g,e=>String(e.charCodeAt(0)-1632)).replace(/\D/g,"")}function $(){p.value?g.push({name:"home"}):t.value===2?t.value=1:i("register",!1)}async function c(){if(t.value===1){t.value=2,window.scrollTo({top:0,behavior:"smooth"});return}try{f.value=!0,await new Promise(d=>setTimeout(d,600)),p.value=!0,window.scrollTo({top:0})}finally{f.value=!1}}return(d,e)=>{const h=H("container");return v(),b("div",Re,[n(J,{title:"ثبت نام","back-action":$}),n(q,{name:"reg-fade",mode:"out-in"},{default:_(()=>[p.value?(v(),S(h,{key:"done",class:"reg__body reg__done"},{default:_(()=>[a("div",Ee,[e[10]||(e[10]=a("span",{class:"reg__doneRing"},null,-1)),n(O,{icon:"vuesax-linear:tick-circle",size:"40"})]),e[12]||(e[12]=a("h2",{class:"reg__doneTitle"},"درخواست شما ثبت شد",-1)),a("p",Ae,[A(" اطلاعات فروشگاه "+I(o.store_name)+" برای کارشناسان ما ارسال شد. پس از بررسی و تایید، می‌توانید با شماره ",1),a("span",Le,I(o.mobile),1),e[11]||(e[11]=A(" وارد شوید. ",-1))]),a("div",ze,[a("button",{type:"button",class:"reg__cta",onClick:e[0]||(e[0]=s=>m(g).push({name:"home"}))},"بازگشت به صفحه اصلی"),a("button",{type:"button",class:"reg__ghost",onClick:e[1]||(e[1]=s=>i("register",!1))},"رفتن به صفحه ورود")])]),_:1})):(v(),S(h,{key:"form",class:"reg__body"},{default:_(()=>[a("header",Pe,[a("div",{class:"reg__steps",role:"progressbar","aria-valuenow":t.value,"aria-valuemin":"1","aria-valuemax":"2"},[e[13]||(e[13]=a("span",{class:"reg__seg is-on"},null,-1)),a("span",{class:L(["reg__seg",{"is-on":t.value===2}])},null,2)],8,Me),a("p",Ue,"مرحله "+I(t.value===1?"۱":"۲")+" از ۲",1),a("h2",Ve,I(t.value===1?"اطلاعات شما":"اطلاعات فروشگاه"),1),a("p",je,I(t.value===1?"برای ساخت حساب فروشگاه، ابتدا خودتان را معرفی کنید.":"این اطلاعات برای ارسال سفارش و تایید حساب استفاده می‌شود."),1)]),n(m(Q),{ref_key:"formRef",ref:r,model:o,layout:"vertical",class:"reg__form",onFinish:c},{default:_(()=>[n(q,{name:t.value===2?"reg-next":"reg-prev",mode:"out-in"},{default:_(()=>[t.value===1?(v(),b("div",Ne,[a("div",qe,[n(m(C),{name:"fname",label:"نام",rules:[y("نام خود")]},{default:_(()=>[n(m(F),{value:o.fname,"onUpdate:value":e[2]||(e[2]=s=>o.fname=s),placeholder:"مثلاً علی",autocomplete:"given-name",enterkeyhint:"next"},null,8,["value"])]),_:1},8,["rules"]),n(m(C),{name:"lname",label:"نام خانوادگی",rules:[y("نام خانوادگی")]},{default:_(()=>[n(m(F),{value:o.lname,"onUpdate:value":e[3]||(e[3]=s=>o.lname=s),placeholder:"مثلاً محمدی",autocomplete:"family-name",enterkeyhint:"next"},null,8,["value"])]),_:1},8,["rules"])]),n(m(C),{name:"mobile",label:"شماره موبایل",rules:[y("شماره موبایل"),{pattern:/^09\d{9}$/,message:"شماره موبایل باید ۱۱ رقم و با ۰۹ شروع شود"}],extra:"کد ورود به این شماره پیامک می‌شود."},{default:_(()=>[n(m(F),{value:o.mobile,class:"reg__num",type:"tel",inputmode:"numeric",maxlength:11,placeholder:"09123456789",autocomplete:"tel",enterkeyhint:"next","onUpdate:value":e[4]||(e[4]=s=>o.mobile=w(s))},{prefix:_(()=>[n(O,{icon:"vuesax-linear:mobile",size:"18"})]),_:1},8,["value"])]),_:1},8,["rules"])])):(v(),b("div",Ke,[n(m(C),{name:"store_name",label:"نام فروشگاه",rules:[y("نام فروشگاه")]},{default:_(()=>[n(m(F),{value:o.store_name,"onUpdate:value":e[5]||(e[5]=s=>o.store_name=s),placeholder:"مثلاً گالری طلای آفتاب",autocomplete:"organization",enterkeyhint:"next"},{prefix:_(()=>[n(O,{icon:"vuesax-linear:shop",size:"18"})]),_:1},8,["value"])]),_:1},8,["rules"]),n(m(C),{name:"phone",label:"تلفن فروشگاه",rules:[y("تلفن فروشگاه"),{pattern:/^(0\d{10}|\d{8})$/,message:"تلفن را با کد شهر وارد کنید، مثلاً 02112345678"}]},{default:_(()=>[n(m(F),{value:o.phone,class:"reg__num",type:"tel",inputmode:"numeric",maxlength:11,placeholder:"02112345678",autocomplete:"tel-national",enterkeyhint:"next","onUpdate:value":e[6]||(e[6]=s=>o.phone=w(s))},{prefix:_(()=>[n(O,{icon:"vuesax-linear:call",size:"18"})]),_:1},8,["value"])]),_:1},8,["rules"]),n(m(C),{name:"city",label:"شهر",rules:[y("شهر")]},{default:_(()=>[n(m(F),{value:o.city,"onUpdate:value":e[7]||(e[7]=s=>o.city=s),placeholder:"مثلاً تهران",autocomplete:"address-level2",enterkeyhint:"next"},{prefix:_(()=>[n(O,{icon:"vuesax-linear:buildings",size:"18"})]),_:1},8,["value"])]),_:1},8,["rules"]),n(m(C),{name:"address",label:"آدرس پستی",rules:[y("آدرس فروشگاه")]},{default:_(()=>[n(m(ue),{value:o.address,"onUpdate:value":e[8]||(e[8]=s=>o.address=s),rows:3,placeholder:"خیابان، کوچه، پلاک، واحد",autocomplete:"street-address"},null,8,["value"])]),_:1},8,["rules"]),a("div",We,[n(O,{icon:"vuesax-linear:shield-tick",size:"18"}),e[14]||(e[14]=a("span",null,"حساب شما پس از بررسی اطلاعات توسط کارشناسان فعال می‌شود.",-1))])]))]),_:1},8,["name"]),a("footer",He,[a("div",Ge,[a("button",{type:"submit",class:L(["reg__cta",{"is-loading":f.value}]),disabled:f.value},[f.value?(v(),b("span",Qe)):T("",!0),a("span",null,I(t.value===1?"ادامه":f.value?"در حال ثبت…":"ثبت درخواست"),1),t.value===1?(v(),S(O,{key:1,icon:"vuesax-linear:arrow-left",size:"18"})):T("",!0)],10,Je),t.value===1?(v(),b("p",Ze,[e[15]||(e[15]=A(" حساب دارید؟ ",-1)),a("button",{type:"button",onClick:e[9]||(e[9]=s=>i("register",!1))},"وارد شوید")])):T("",!0)])])]),_:1},8,["model"])]),_:1}))]),_:1})])}}}),Ye=G(Xe,[["__scopeId","data-v-84dbe021"]]),lt=E({__name:"LoginRegisterView",setup(u){const k=x(!1),i=g=>k.value=g;return(g,r)=>(v(),b(V,null,[k.value?T("",!0):(v(),S(Se,{key:0,onRegister:i})),k.value?(v(),S(Ye,{key:1,onRegister:i})):T("",!0)],64))}});export{lt as default}; diff --git a/apps/user-app-v2/dist/assets/NewestView--pb6tWn4.js b/apps/user-app-v2/dist/assets/NewestView-BG4MNUeW.js similarity index 90% rename from apps/user-app-v2/dist/assets/NewestView--pb6tWn4.js rename to apps/user-app-v2/dist/assets/NewestView-BG4MNUeW.js index 866ad0f..1100e06 100644 --- a/apps/user-app-v2/dist/assets/NewestView--pb6tWn4.js +++ b/apps/user-app-v2/dist/assets/NewestView-BG4MNUeW.js @@ -1 +1 @@ -import{d as p,f as n,c,p as a,m as r,E as P,D as b,G as k,n as S,H as B,J as v,j as y,e as h,g as u,s as E,K as L,L as C,z as d,F as I,r as N,I as V,b as $,h as A,B as F,_ as z}from"./index-BWyw3RAx.js";import{P as D}from"./PageBar-D5DXU6sO.js";import{S as H}from"./SectionHead-BiCEpXAe.js";import{P as j}from"./ProductCard-nL92ZIkB.js";const G={class:"flex justify-center items-center empty"},T=p({__name:"EmptyState",props:{description:{},image:{}},setup(e){return(t,s)=>(n(),c("div",G,[a(r(P),{description:"موردی یافت نشد",image:e.image,class:"h-[200px] w-[200px] opacity-70"},null,8,["image"])]))}}),J="/assets/favoritEmpty-kbtPAdi5.svg",K=p({__name:"ScrollFetchSearch",props:{loading:{type:Boolean},flag:{type:Boolean},padding:{}},emits:["fetch"],setup(e,{emit:t}){const s=t,o=b(),l=u(null);return k(l,()=>{s("fetch")},{distance:50}),(i,f)=>(n(),c("main",{class:"flex flex-col flex-1 overflow-auto no-scrollbar w-[100vw] max-w-screen-md m-auto",style:S({paddingTop:e.padding||r(o).headerHeight+"px"}),ref_key:"scrollArea",ref:l},[B(i.$slots,"default"),a(v,{cls:"my-[10px]",spinning:e.loading,indicator:!0,tip:"درحال دریافت اطلاعات"},null,8,["spinning"]),e.flag?(n(),y(T,{key:0,image:r(J)},null,8,["image"])):h("",!0)],4))}});function M(){const e=L({totalPages:0,productList:[],flag:!1});return{productsData:e,getProducts:async(s,o=!1)=>{if(!o){s.value=!0;try{e.productList=await E.listProducts(),e.flag=e.productList.length<1}catch(l){console.log(l)}finally{s.value=!1}}}}}const Z={class:"newest"},q={key:0,class:"newest__grid"},O={key:1,class:"newest__empty"},g=20,Q=p({__name:"NewestView",setup(e){const{productsData:t,getProducts:s}=M(),o=u(!1),l=u(!1),i=u(g),f=A(()=>t.productList.slice(0,i.value));C(async()=>{await s(o,!1)});const w=async()=>{if(i.value{const x=F("container");return n(),c("div",Z,[a(D,{title:"جدیدترین محصولات","back-to":"home"}),a(v,{spinning:o.value,tip:"درحال دریافت اطلاعات"},{default:d(()=>[a(K,{class:"newest__scroll",loading:l.value,flag:r(t).flag,padding:"0px",onFetch:w},{default:d(()=>[a(x,{class:"newest__body"},{default:d(()=>[a(H,{title:"تازه‌ها",subtitle:"آخرین افزوده‌های مجموعه"}),r(t).productList.length?(n(),c("div",q,[(n(!0),c(I,null,N(f.value,_=>(n(),y(j,{key:_.id,value:_},null,8,["value"]))),128))])):o.value?h("",!0):(n(),c("section",O,[a(V,{icon:"vuesax-linear:box",size:"26"}),m[0]||(m[0]=$("p",null,"هنوز محصولی در مجموعه ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["loading","flag"])]),_:1},8,["spinning"])])}}}),ee=z(Q,[["__scopeId","data-v-4551f84b"]]);export{ee as default}; +import{d as p,f as n,c,p as a,m as r,E as P,D as b,G as k,n as S,H as B,J as v,j as y,e as h,g as u,s as E,K as L,L as C,z as d,F as I,r as N,I as V,b as $,h as A,B as F,_ as z}from"./index-Dp9sxvBv.js";import{P as D}from"./PageBar-El-laHqK.js";import{S as H}from"./SectionHead-DNG9ywW4.js";import{P as j}from"./ProductCard-CvKEozHI.js";const G={class:"flex justify-center items-center empty"},T=p({__name:"EmptyState",props:{description:{},image:{}},setup(e){return(t,s)=>(n(),c("div",G,[a(r(P),{description:"موردی یافت نشد",image:e.image,class:"h-[200px] w-[200px] opacity-70"},null,8,["image"])]))}}),J="/assets/favoritEmpty-kbtPAdi5.svg",K=p({__name:"ScrollFetchSearch",props:{loading:{type:Boolean},flag:{type:Boolean},padding:{}},emits:["fetch"],setup(e,{emit:t}){const s=t,o=b(),l=u(null);return k(l,()=>{s("fetch")},{distance:50}),(i,f)=>(n(),c("main",{class:"flex flex-col flex-1 overflow-auto no-scrollbar w-[100vw] max-w-screen-md m-auto",style:S({paddingTop:e.padding||r(o).headerHeight+"px"}),ref_key:"scrollArea",ref:l},[B(i.$slots,"default"),a(v,{cls:"my-[10px]",spinning:e.loading,indicator:!0,tip:"درحال دریافت اطلاعات"},null,8,["spinning"]),e.flag?(n(),y(T,{key:0,image:r(J)},null,8,["image"])):h("",!0)],4))}});function M(){const e=L({totalPages:0,productList:[],flag:!1});return{productsData:e,getProducts:async(s,o=!1)=>{if(!o){s.value=!0;try{e.productList=await E.listProducts(),e.flag=e.productList.length<1}catch(l){console.log(l)}finally{s.value=!1}}}}}const Z={class:"newest"},q={key:0,class:"newest__grid"},O={key:1,class:"newest__empty"},g=20,Q=p({__name:"NewestView",setup(e){const{productsData:t,getProducts:s}=M(),o=u(!1),l=u(!1),i=u(g),f=A(()=>t.productList.slice(0,i.value));C(async()=>{await s(o,!1)});const w=async()=>{if(i.value{const x=F("container");return n(),c("div",Z,[a(D,{title:"جدیدترین محصولات","back-to":"home"}),a(v,{spinning:o.value,tip:"درحال دریافت اطلاعات"},{default:d(()=>[a(K,{class:"newest__scroll",loading:l.value,flag:r(t).flag,padding:"0px",onFetch:w},{default:d(()=>[a(x,{class:"newest__body"},{default:d(()=>[a(H,{title:"تازه‌ها",subtitle:"آخرین افزوده‌های مجموعه"}),r(t).productList.length?(n(),c("div",q,[(n(!0),c(I,null,N(f.value,_=>(n(),y(j,{key:_.id,value:_},null,8,["value"]))),128))])):o.value?h("",!0):(n(),c("section",O,[a(V,{icon:"vuesax-linear:box",size:"26"}),m[0]||(m[0]=$("p",null,"هنوز محصولی در مجموعه ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["loading","flag"])]),_:1},8,["spinning"])])}}}),ee=z(Q,[["__scopeId","data-v-4551f84b"]]);export{ee as default}; diff --git a/apps/user-app-v2/dist/assets/NotificationsView-QOE6v-gp.js b/apps/user-app-v2/dist/assets/NotificationsView-BuhDQ6dh.js similarity index 78% rename from apps/user-app-v2/dist/assets/NotificationsView-QOE6v-gp.js rename to apps/user-app-v2/dist/assets/NotificationsView-BuhDQ6dh.js index 74c968e..98d33c6 100644 --- a/apps/user-app-v2/dist/assets/NotificationsView-QOE6v-gp.js +++ b/apps/user-app-v2/dist/assets/NotificationsView-BuhDQ6dh.js @@ -1 +1 @@ -import{d as n,c as a,p as o,z as i,B as c,f as _,b as e,I as r,_ as f}from"./index-BWyw3RAx.js";import{P as p}from"./PageBar-D5DXU6sO.js";const l={class:"notif"},d={class:"notif__empty"},m=n({__name:"NotificationsView",setup(u){return(x,t)=>{const s=c("container");return _(),a("div",l,[o(p,{title:"اعلان‌ها","back-to":"home"}),o(s,{class:"notif__body"},{default:i(()=>[e("section",d,[o(r,{icon:"vuesax-linear:notification",size:"26"}),t[0]||(t[0]=e("p",null,"اعلانی برای نمایش وجود ندارد.",-1))])]),_:1})])}}}),v=f(m,[["__scopeId","data-v-6887fb26"]]);export{v as default}; +import{d as n,c as a,p as o,z as i,B as c,f as _,b as e,I as r,_ as f}from"./index-Dp9sxvBv.js";import{P as p}from"./PageBar-El-laHqK.js";const l={class:"notif"},d={class:"notif__empty"},m=n({__name:"NotificationsView",setup(u){return(x,t)=>{const s=c("container");return _(),a("div",l,[o(p,{title:"اعلان‌ها","back-to":"home"}),o(s,{class:"notif__body"},{default:i(()=>[e("section",d,[o(r,{icon:"vuesax-linear:notification",size:"26"}),t[0]||(t[0]=e("p",null,"اعلانی برای نمایش وجود ندارد.",-1))])]),_:1})])}}}),v=f(m,[["__scopeId","data-v-6887fb26"]]);export{v as default}; diff --git a/apps/user-app-v2/dist/assets/OrdersView-B7LDWHTY.css b/apps/user-app-v2/dist/assets/OrdersView-BULq1WHJ.css similarity index 64% rename from apps/user-app-v2/dist/assets/OrdersView-B7LDWHTY.css rename to apps/user-app-v2/dist/assets/OrdersView-BULq1WHJ.css index fe22a07..44d582e 100644 --- a/apps/user-app-v2/dist/assets/OrdersView-B7LDWHTY.css +++ b/apps/user-app-v2/dist/assets/OrdersView-BULq1WHJ.css @@ -1 +1 @@ -.oc[data-v-ef740bbe]{display:flex;gap:11px;cursor:pointer;padding:12px;background:var(--c-canvas);border:1px solid var(--c-hairline);border-radius:18px;transition:transform .18s ease}.oc[data-v-ef740bbe]:active{transform:scale(.99)}.oc__mark[data-v-ef740bbe]{flex:0 0 36px;width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:var(--c-hairlineSoft);color:var(--c-inkFaint)}.oc__main[data-v-ef740bbe]{flex:1;min-width:0}.oc__head[data-v-ef740bbe]{display:flex;align-items:center;justify-content:space-between;gap:10px}.oc__id[data-v-ef740bbe]{margin:0;font-size:13.5px;font-weight:800;color:var(--c-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.oc__status[data-v-ef740bbe]{flex:0 0 auto;padding:4px 11px;border-radius:999px;font-size:10.5px;font-weight:700;white-space:nowrap}.oc__figures[data-v-ef740bbe]{display:flex;gap:14px;padding-top:6px}.oc__figure[data-v-ef740bbe]{font-size:12px;font-weight:700;color:var(--c-inkSoft)}.oc__figure i[data-v-ef740bbe]{font-style:normal;font-size:10px;font-weight:600;color:var(--c-inkFaint);padding-inline-start:2px}.oc__foot[data-v-ef740bbe]{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:8px}.oc__date[data-v-ef740bbe]{font-size:11px;color:var(--c-inkFaint)}.oc__more[data-v-ef740bbe]{display:inline-flex;align-items:center;gap:4px;font-size:11.5px;font-weight:700;color:var(--c-wine)}.oi[data-v-dfbe6e64]{display:flex;gap:11px;padding:11px;background:var(--c-canvas);border:1px solid var(--c-hairline);border-radius:16px}.oi__art[data-v-dfbe6e64]{flex:0 0 62px;width:62px;height:62px;border-radius:12px;overflow:hidden;background:var(--c-hairlineSoft)}.oi__art img[data-v-dfbe6e64]{width:100%;height:100%;-o-object-fit:cover;object-fit:cover;display:block}html.theme-dark .oi__art img[data-v-dfbe6e64]{background:var(--c-photoMat);border-radius:12px}.oi__artEmpty[data-v-dfbe6e64]{width:100%;height:100%;display:grid;place-items:center;color:var(--c-inkFaint)}.oi__main[data-v-dfbe6e64]{flex:1;min-width:0}.oi__head[data-v-dfbe6e64]{display:flex;align-items:baseline;gap:7px;min-width:0}.oi__title[data-v-dfbe6e64]{margin:0;font-size:12.5px;font-weight:700;color:var(--c-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.oi__variant[data-v-dfbe6e64]{flex:0 0 auto;font-size:10.5px;color:var(--c-inkFaint)}.oi__figures[data-v-dfbe6e64]{display:flex;flex-wrap:wrap;gap:14px;padding-top:9px}.oi__figure[data-v-dfbe6e64]{font-size:12px;font-weight:700;color:var(--c-inkSoft)}.oi__figure i[data-v-dfbe6e64]{font-style:normal;font-size:10px;font-weight:600;color:var(--c-inkFaint);padding-inline-start:2px}.ord[data-v-818bd333]{background:var(--c-page);min-height:100vh}.ord__barExtra[data-v-818bd333]{max-width:768px;margin:0 auto;padding:0 16px}.ord__chips[data-v-818bd333]{display:flex;gap:8px;overflow-x:auto;margin:8px 0 8px -16px;scroll-snap-type:x proximity}.ord__chip[data-v-818bd333]{scroll-snap-align:start;flex:0 0 auto;padding:7px 14px;border-radius:999px;cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;white-space:nowrap;color:var(--c-inkSoft);background:var(--c-canvas);border:1px solid var(--c-hairline);transition:all .2s ease}.ord__chip.is-on[data-v-818bd333]{color:var(--c-onInk);background:var(--c-ink);border-color:var(--c-ink)}.ord__chip[data-v-818bd333]:active{transform:scale(.97)}.ord__body[data-v-818bd333]{padding-top:160px;padding-bottom:90px}.ord__list[data-v-818bd333]{display:flex;flex-direction:column;padding-top:16px;gap:11px}.ord__empty[data-v-818bd333]{margin-top:8px;padding:34px 20px;border:1px dashed var(--c-hairline);border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--c-inkFaint)}.ord__empty p[data-v-818bd333]{margin:0;font-size:12.5px}.detail[data-v-818bd333]{height:100vh;display:flex;flex-direction:column;background:var(--c-canvas)}.detail__bar[data-v-818bd333]{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 16px;border-bottom:1px solid var(--c-hairline);background:rgb(var(--c-canvas-rgb) / 92%);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}.detail__title[data-v-818bd333]{margin:0;font-size:14px;font-weight:800;color:var(--c-ink)}.detail__close[data-v-818bd333]{width:38px;height:38px;border:0;cursor:pointer;border-radius:12px;display:grid;place-items:center;color:var(--c-ink);background:var(--c-hairlineSoft)}.detail__spacer[data-v-818bd333]{display:block;width:38px;height:38px}.detail__scroll[data-v-818bd333]{flex:1;overflow-y:auto;padding:16px 16px 40px}.detail__block[data-v-818bd333]{margin-bottom:22px}.detail__blockTitle[data-v-818bd333]{margin:0 0 11px;font-size:13px;font-weight:800;color:var(--c-ink)}.detail__steps[data-v-818bd333]{display:flex;gap:4px;overflow-x:auto;padding-bottom:4px}.detail__step[data-v-818bd333]{flex:1 0 74px;display:flex;flex-direction:column;align-items:center;gap:7px;text-align:center;position:relative}.detail__stepDot[data-v-818bd333]{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;font-size:11.5px;font-weight:700;color:var(--c-inkFaint);background:var(--c-hairlineSoft);border:1px solid var(--c-hairline);z-index:1}.detail__step.is-done .detail__stepDot[data-v-818bd333]{color:var(--c-onInk);background:var(--c-ink);border-color:var(--c-ink)}.detail__step.is-active .detail__stepDot[data-v-818bd333]{color:#fff;background:var(--c-wine);border-color:var(--c-wine)}.detail__stepTitle[data-v-818bd333]{font-size:10px;line-height:1.5;color:var(--c-inkFaint)}.detail__step.is-done .detail__stepTitle[data-v-818bd333]{color:var(--c-inkSoft);font-weight:600}.detail__headline[data-v-818bd333]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding-bottom:14px}.detail__eyebrow[data-v-818bd333]{font-size:11px;color:var(--c-inkFaint)}.detail__number[data-v-818bd333]{padding-top:4px;font-size:18px;font-weight:800;color:var(--c-ink)}.detail__status[data-v-818bd333]{flex:0 0 auto;padding:5px 12px;border-radius:999px;font-size:10.5px;font-weight:700;white-space:nowrap}.detail__specs[data-v-818bd333]{margin:0;border:1px solid var(--c-hairline);border-radius:16px;overflow:hidden}.detail__spec[data-v-818bd333]{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 14px;border-bottom:1px solid var(--c-hairlineSoft)}.detail__spec[data-v-818bd333]:last-child{border-bottom:0}.detail__spec dt[data-v-818bd333]{margin:0;font-size:12px;color:var(--c-inkFaint)}.detail__spec dd[data-v-818bd333]{margin:0;font-size:12.5px;font-weight:700;color:var(--c-ink)}.detail__items[data-v-818bd333]{display:flex;flex-direction:column;gap:10px} +.oc[data-v-ef740bbe]{display:flex;gap:11px;cursor:pointer;padding:12px;background:var(--c-canvas);border:1px solid var(--c-hairline);border-radius:18px;transition:transform .18s ease}.oc[data-v-ef740bbe]:active{transform:scale(.99)}.oc__mark[data-v-ef740bbe]{flex:0 0 36px;width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:var(--c-hairlineSoft);color:var(--c-inkFaint)}.oc__main[data-v-ef740bbe]{flex:1;min-width:0}.oc__head[data-v-ef740bbe]{display:flex;align-items:center;justify-content:space-between;gap:10px}.oc__id[data-v-ef740bbe]{margin:0;font-size:13.5px;font-weight:800;color:var(--c-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.oc__status[data-v-ef740bbe]{flex:0 0 auto;padding:4px 11px;border-radius:999px;font-size:10.5px;font-weight:700;white-space:nowrap}.oc__figures[data-v-ef740bbe]{display:flex;gap:14px;padding-top:6px}.oc__figure[data-v-ef740bbe]{font-size:12px;font-weight:700;color:var(--c-inkSoft)}.oc__figure i[data-v-ef740bbe]{font-style:normal;font-size:10px;font-weight:600;color:var(--c-inkFaint);padding-inline-start:2px}.oc__foot[data-v-ef740bbe]{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:8px}.oc__date[data-v-ef740bbe]{font-size:11px;color:var(--c-inkFaint)}.oc__more[data-v-ef740bbe]{display:inline-flex;align-items:center;gap:4px;font-size:11.5px;font-weight:700;color:var(--c-wine)}.oi[data-v-dfbe6e64]{display:flex;gap:11px;padding:11px;background:var(--c-canvas);border:1px solid var(--c-hairline);border-radius:16px}.oi__art[data-v-dfbe6e64]{flex:0 0 62px;width:62px;height:62px;border-radius:12px;overflow:hidden;background:var(--c-hairlineSoft)}.oi__art img[data-v-dfbe6e64]{width:100%;height:100%;-o-object-fit:cover;object-fit:cover;display:block}html.theme-dark .oi__art img[data-v-dfbe6e64]{background:var(--c-photoMat);border-radius:12px}.oi__artEmpty[data-v-dfbe6e64]{width:100%;height:100%;display:grid;place-items:center;color:var(--c-inkFaint)}.oi__main[data-v-dfbe6e64]{flex:1;min-width:0}.oi__head[data-v-dfbe6e64]{display:flex;align-items:baseline;gap:7px;min-width:0}.oi__title[data-v-dfbe6e64]{margin:0;font-size:12.5px;font-weight:700;color:var(--c-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.oi__variant[data-v-dfbe6e64]{flex:0 0 auto;font-size:10.5px;color:var(--c-inkFaint)}.oi__figures[data-v-dfbe6e64]{display:flex;flex-wrap:wrap;gap:14px;padding-top:9px}.oi__figure[data-v-dfbe6e64]{font-size:12px;font-weight:700;color:var(--c-inkSoft)}.oi__figure i[data-v-dfbe6e64]{font-style:normal;font-size:10px;font-weight:600;color:var(--c-inkFaint);padding-inline-start:2px}.ord[data-v-660b7444]{background:var(--c-page);min-height:100vh}.ord__barExtra[data-v-660b7444]{max-width:768px;margin:0 auto;padding:0 16px}.ord__chips[data-v-660b7444]{display:flex;gap:8px;overflow-x:auto;margin:8px 0 8px -16px;scroll-snap-type:x proximity}.ord__chip[data-v-660b7444]{scroll-snap-align:start;flex:0 0 auto;padding:7px 14px;border-radius:999px;cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;white-space:nowrap;color:var(--c-inkSoft);background:var(--c-canvas);border:1px solid var(--c-hairline);transition:all .2s ease}.ord__chip.is-on[data-v-660b7444]{color:var(--c-onInk);background:var(--c-ink);border-color:var(--c-ink)}.ord__chip[data-v-660b7444]:active{transform:scale(.97)}.ord__body[data-v-660b7444]{padding-top:160px;padding-bottom:90px}.ord__list[data-v-660b7444]{display:flex;flex-direction:column;padding-top:16px;gap:11px}.ord__empty[data-v-660b7444]{margin-top:8px;padding:34px 20px;border:1px dashed var(--c-hairline);border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--c-inkFaint)}.ord__empty p[data-v-660b7444]{margin:0;font-size:12.5px}.detail[data-v-660b7444]{height:100vh;display:flex;flex-direction:column;background:var(--c-canvas)}.detail__bar[data-v-660b7444]{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 16px;border-bottom:1px solid var(--c-hairline);background:rgb(var(--c-canvas-rgb) / 92%);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}.detail__title[data-v-660b7444]{margin:0;font-size:14px;font-weight:800;color:var(--c-ink)}.detail__close[data-v-660b7444]{width:38px;height:38px;border:0;cursor:pointer;border-radius:12px;display:grid;place-items:center;color:var(--c-ink);background:var(--c-hairlineSoft)}.detail__spacer[data-v-660b7444]{display:block;width:38px;height:38px}.detail__scroll[data-v-660b7444]{flex:1;overflow-y:auto;padding:16px 16px 40px}.detail__block[data-v-660b7444]{margin-bottom:22px}.detail__blockTitle[data-v-660b7444]{margin:0 0 11px;font-size:13px;font-weight:800;color:var(--c-ink)}.detail__steps[data-v-660b7444]{display:flex;gap:4px;overflow-x:auto;padding-bottom:4px}.detail__step[data-v-660b7444]{flex:1 0 74px;display:flex;flex-direction:column;align-items:center;gap:7px;text-align:center;position:relative}.detail__stepDot[data-v-660b7444]{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;font-size:11.5px;font-weight:700;color:var(--c-inkFaint);background:var(--c-hairlineSoft);border:1px solid var(--c-hairline);z-index:1}.detail__step.is-done .detail__stepDot[data-v-660b7444]{color:var(--c-onInk);background:var(--c-ink);border-color:var(--c-ink)}.detail__step.is-active .detail__stepDot[data-v-660b7444]{color:#fff;background:var(--c-wine);border-color:var(--c-wine)}.detail__stepTitle[data-v-660b7444]{font-size:10px;line-height:1.5;color:var(--c-inkFaint)}.detail__step.is-done .detail__stepTitle[data-v-660b7444]{color:var(--c-inkSoft);font-weight:600}.detail__headline[data-v-660b7444]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding-bottom:14px}.detail__eyebrow[data-v-660b7444]{font-size:11px;color:var(--c-inkFaint)}.detail__number[data-v-660b7444]{padding-top:4px;font-size:18px;font-weight:800;color:var(--c-ink)}.detail__status[data-v-660b7444]{flex:0 0 auto;padding:5px 12px;border-radius:999px;font-size:10.5px;font-weight:700;white-space:nowrap}.detail__specs[data-v-660b7444]{margin:0;border:1px solid var(--c-hairline);border-radius:16px;overflow:hidden}.detail__spec[data-v-660b7444]{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 14px;border-bottom:1px solid var(--c-hairlineSoft)}.detail__spec[data-v-660b7444]:last-child{border-bottom:0}.detail__spec dt[data-v-660b7444]{margin:0;font-size:12px;color:var(--c-inkFaint)}.detail__spec dd[data-v-660b7444]{margin:0;font-size:12.5px;font-weight:700;color:var(--c-ink)}.detail__items[data-v-660b7444]{display:flex;flex-direction:column;gap:10px} diff --git a/apps/user-app-v2/dist/assets/OrdersView-BcT-EgU-.js b/apps/user-app-v2/dist/assets/OrdersView-BcT-EgU-.js deleted file mode 100644 index 6507b55..0000000 --- a/apps/user-app-v2/dist/assets/OrdersView-BcT-EgU-.js +++ /dev/null @@ -1 +0,0 @@ -import{d as w,f as i,c,b as e,p,I as S,n as $,t as o,N as g,m as C,h as y,_ as U,s as M,g as h,o as z,l as H,w as Q,e as V,O as X,z as O,J as Y,j as N,K as Z,F as A,r as L,B as ee,i as B}from"./index-BWyw3RAx.js";import{P as te}from"./PageBar-D5DXU6sO.js";import{S as se}from"./SearchInput-BZCG2e_m.js";import{j}from"./filters-DVocLz3o.js";import{D as ae}from"./index-sLHXZqt3.js";import{P as oe}from"./index-ecOSUWQv.js";import"./KeyCode-CA5MXqE7.js";import"./classCallCheck-Ou87VTNv.js";import"./raf-nDFcuFT6.js";const E={SUSPENDED:"معلق",PLACED:"ثبت سفارش",ADMIN_APPROVED:"تایید مدیر سیستم",SOURCING:"درحال تامین",PREPARING:"درحال آماده سازی",DELIVERED_TO_AGENT:"تحویل مسئول فروش",DELIVERED_TO_CUSTOMER:"تحویل مشتری",CANCELLED:"لغو شده"},W={PLACED:{font:"#3B82F6",background:"#3B82F61F"},SOURCING:{font:"#EAB308",background:"#EAB3081F"},PREPARING:{font:"#F97316",background:"#F973161F"},DELIVERED_TO_AGENT:{font:"#06B6D4",background:"#06B6D41F"},DELIVERED_TO_CUSTOMER:{font:"#22C55E",background:"#22C55E1F"}},le=["ثبت سفارش","آماده سازی","تحویل مشتری","لغو شده"];function ie(l){switch(l){case"PLACED":case"ADMIN_APPROVED":case"SUSPENDED":return 0;case"SOURCING":case"PREPARING":return 1;case"DELIVERED_TO_AGENT":case"DELIVERED_TO_CUSTOMER":return 2;case"CANCELLED":return 3;default:return 0}}const ne={class:"oc__main"},re={class:"oc__head"},de={class:"oc__id"},ce={class:"oc__figures"},_e={class:"oc__figure"},ue={class:"oc__figure"},ve={class:"oc__foot"},me={class:"oc__date"},Ee={class:"oc__more"},pe=w({__name:"OrderCard",props:{value:{}},emits:["view"],setup(l,{emit:_}){const u=l,a=_,v=y(()=>E[u.value.status]??u.value.status),n=y(()=>W[u.value.status]);return(R,r)=>{var f,k,D,s;return i(),c("article",{class:"oc",onClick:r[0]||(r[0]=G=>a("view",l.value))},[e("span",{class:"oc__mark",style:$({background:(f=n.value)==null?void 0:f.background,color:(k=n.value)==null?void 0:k.font}),"aria-hidden":"true"},[p(S,{icon:"vuesax-linear:receipt-text",size:"16"})],4),e("div",ne,[e("div",re,[e("h3",de,o(l.value.orderNumber),1),e("span",{class:"oc__status",style:$({background:(D=n.value)==null?void 0:D.background,color:(s=n.value)==null?void 0:s.font})},o(v.value),5)]),e("div",ce,[e("span",_e,[g(o(l.value.items.length)+" ",1),r[1]||(r[1]=e("i",null,"آیتم",-1))]),e("span",ue,[g(o(parseFloat(l.value.totalGoldWeightGrams).toFixed(2))+" ",1),r[2]||(r[2]=e("i",null,"گرم",-1))])]),e("div",ve,[e("span",me,o(C(j)(l.value.createdAt)),1),e("span",Ee,[r[3]||(r[3]=g(" جزئیات ",-1)),p(S,{icon:"vuesax-linear:arrow-left-2",size:"14"})])])])])}}}),fe=U(pe,[["__scopeId","data-v-ef740bbe"]]),P=h(null);async function De(){var u;if(P.value)return P.value;const l=await M.listProducts(),_=new Map;for(const a of l)for(const v of a.variants)_.set(v.id,{productTitle:a.title,variantTitle:v.title,imageUrl:(u=a.images[0])==null?void 0:u.url});return P.value=_,_}function ke(){return{lookup:async _=>(await De()).get(_)}}const he={class:"oi"},be={class:"oi__art"},ye=["alt"],ge={key:1,class:"oi__artEmpty","aria-hidden":"true"},Re={class:"oi__main"},Oe={class:"oi__head"},Ce={class:"oi__title"},Se={key:0,class:"oi__variant"},Ae={class:"oi__figures"},Le={class:"oi__figure"},Ie={class:"oi__figure"},Te={class:"oi__figure"},Ne=w({__name:"OrderItemCard",props:{value:{}},setup(l){const _=l,{lookup:u}=ke(),a=h();return z(async()=>{a.value=await u(_.value.productVariantId)}),(v,n)=>{var r,f,k,D;const R=H("lazy");return i(),c("article",he,[e("div",be,[(r=a.value)!=null&&r.imageUrl?Q((i(),c("img",{key:0,alt:((f=a.value)==null?void 0:f.productTitle)??""},null,8,ye)),[[R,a.value.imageUrl]]):(i(),c("div",ge,[p(S,{icon:"vuesax-linear:diamonds",size:"18"})]))]),e("div",Re,[e("div",Oe,[e("h4",Ce,o(((k=a.value)==null?void 0:k.productTitle)??"—"),1),(D=a.value)!=null&&D.variantTitle?(i(),c("span",Se,o(a.value.variantTitle),1)):V("",!0)]),e("div",Ae,[e("span",Le,[g(o(l.value.quantity)+" ",1),n[0]||(n[0]=e("i",null,"عدد",-1))]),e("span",Ie,[g(o(l.value.computedWeightGrams)+" ",1),n[1]||(n[1]=e("i",null,"گرم",-1))]),e("span",Te,[g(o(l.value.wagePercentSnapshot)+" ",1),n[2]||(n[2]=e("i",null,"٪ اجرت",-1))])])])])}}}),Pe=U(Ne,[["__scopeId","data-v-dfbe6e64"]]),$e={class:"ord"},Ve={class:"ord__barExtra"},we={class:"ord__chips no-scrollbar"},Ue=["onClick"],Ge={key:0,class:"ord__list"},xe={key:1,class:"ord__empty"},Fe={class:"detail"},Be={class:"detail__bar"},Me={class:"detail__scroll"},ze={class:"detail__block"},je={class:"detail__steps"},We={class:"detail__stepDot"},qe={class:"detail__stepTitle"},Je={class:"detail__block"},Ke={class:"detail__headline"},He={class:"detail__number"},Qe={class:"detail__specs"},Xe={class:"detail__spec"},Ye={class:"detail__spec"},Ze={class:"detail__spec"},et={class:"detail__block"},tt={class:"detail__items"},st=w({__name:"OrdersView",setup(l){const _=X(),u=[{title:"همه",key:"ALL"},{title:E.SUSPENDED,key:"SUSPENDED"},{title:E.PLACED,key:"PLACED"},{title:E.ADMIN_APPROVED,key:"ADMIN_APPROVED"},{title:E.SOURCING,key:"SOURCING"},{title:E.PREPARING,key:"PREPARING"},{title:E.DELIVERED_TO_AGENT,key:"DELIVERED_TO_AGENT"},{title:E.DELIVERED_TO_CUSTOMER,key:"DELIVERED_TO_CUSTOMER"},{title:E.CANCELLED,key:"CANCELLED"}],a=h("ALL"),v=h(!1),n=h(!1),R=h([]),r=h(void 0),f=y(()=>{let m=R.value;return a.value!=="ALL"&&(m=m.filter(t=>t.status===a.value)),r.value&&(m=m.filter(t=>t.orderNumber.includes(r.value))),m});function k(m){r.value=m}async function D(){if(_.isLoggedIn){v.value=!0;try{R.value=await M.getMyOrders()}finally{v.value=!1}}}const s=Z({model:!1,item:null}),G=y(()=>s.item?E[s.item.status]??s.item.status:""),x=y(()=>s.item?W[s.item.status]:void 0),F=y(()=>s.item?ie(s.item.status):0);function q(m){s.item=m,s.model=!0}async function J(){await D(),n.value=!1}return z(D),(m,t)=>{const K=ee("container");return i(),c("div",$e,[p(te,{title:"سفارشات","back-to":"home"},{below:O(()=>[e("div",Ve,[p(se,{onSearch:k,"place-holder":"جستجوی شماره سفارش"}),e("div",we,[(i(),c(A,null,L(u,d=>e("button",{key:d.key,type:"button",class:B(["ord__chip",{"is-on":a.value===d.key}]),onClick:I=>a.value=d.key},o(d.title),11,Ue)),64))])])]),_:1}),p(Y,{spinning:v.value,tip:"درحال دریافت اطلاعات"},{default:O(()=>[p(C(oe),{modelValue:n.value,"onUpdate:modelValue":t[0]||(t[0]=d=>n.value=d),onRefresh:J},{default:O(()=>[p(K,{class:"ord__body"},{default:O(()=>[f.value.length?(i(),c("div",Ge,[(i(!0),c(A,null,L(f.value,d=>(i(),N(fe,{key:d.id,value:d,onView:q},null,8,["value"]))),128))])):v.value?V("",!0):(i(),c("section",xe,[p(S,{icon:"vuesax-linear:box",size:"26"}),t[3]||(t[3]=e("p",null,"سفارشی با این مشخصات پیدا نشد.",-1))]))]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["spinning"]),s.item?(i(),N(C(ae),{key:0,visible:s.model,"onUpdate:visible":t[2]||(t[2]=d=>s.model=d),placement:"bottom",closable:!1,height:"100vh",class:"rtl",bodyStyle:{padding:0,position:"relative"}},{default:O(()=>{var d,I;return[e("div",Fe,[e("header",Be,[e("button",{type:"button",class:"detail__close","aria-label":"بستن",onClick:t[1]||(t[1]=b=>s.model=!1)},[p(S,{icon:"vuesax-linear:arrow-right-1",size:"20"})]),t[4]||(t[4]=e("h2",{class:"detail__title"},"جزئیات سفارش",-1)),t[5]||(t[5]=e("span",{class:"detail__spacer","aria-hidden":"true"},null,-1))]),e("div",Me,[e("section",ze,[e("div",je,[(i(!0),c(A,null,L(C(le),(b,T)=>(i(),c("div",{key:b,class:B(["detail__step",{"is-done":T<=F.value,"is-active":T===F.value}])},[e("span",We,o(T+1),1),e("span",qe,o(b),1)],2))),128))])]),e("section",Je,[e("div",Ke,[e("div",null,[t[6]||(t[6]=e("div",{class:"detail__eyebrow"},"شماره سفارش",-1)),e("div",He,o(s.item.orderNumber),1)]),e("span",{class:"detail__status",style:$({background:(d=x.value)==null?void 0:d.background,color:(I=x.value)==null?void 0:I.font})},o(G.value),5)]),e("dl",Qe,[e("div",Xe,[t[7]||(t[7]=e("dt",null,"تعداد کالاها",-1)),e("dd",null,o(s.item.items.length)+" آیتم",1)]),e("div",Ye,[t[8]||(t[8]=e("dt",null,"وزن سفارش",-1)),e("dd",null,o(parseFloat(s.item.totalGoldWeightGrams).toFixed(2))+" گرم",1)]),e("div",Ze,[t[9]||(t[9]=e("dt",null,"تاریخ سفارش",-1)),e("dd",null,o(C(j)(s.item.createdAt)),1)])])]),e("section",et,[t[10]||(t[10]=e("h3",{class:"detail__blockTitle"},"آیتم‌های سفارش",-1)),e("div",tt,[(i(!0),c(A,null,L(s.item.items,b=>(i(),N(Pe,{key:b.id,value:b},null,8,["value"]))),128))])])])])]}),_:1},8,["visible"])):V("",!0)])}}}),ut=U(st,[["__scopeId","data-v-818bd333"]]);export{ut as default}; diff --git a/apps/user-app-v2/dist/assets/OrdersView-C8fvzMFb.js b/apps/user-app-v2/dist/assets/OrdersView-C8fvzMFb.js new file mode 100644 index 0000000..bedde1e --- /dev/null +++ b/apps/user-app-v2/dist/assets/OrdersView-C8fvzMFb.js @@ -0,0 +1 @@ +import{d as U,f as i,c,b as e,p as u,I as L,n as V,t as o,N as O,m as g,h as R,_ as G,s as M,g as h,o as j,l as Q,w as X,e as w,O as Y,z as f,J as Z,j as N,K as ee,F as S,r as A,B as te,i as B}from"./index-Dp9sxvBv.js";import{P as se}from"./PageBar-El-laHqK.js";import{S as ae}from"./SearchInput-OrOd8Tqr.js";import{j as W}from"./filters-CUgGgSea.js";import{D as oe}from"./index-UuozCFb-.js";import{P as le,L as P}from"./index-B0RgkHMm.js";import"./KeyCode-DAs3W-5E.js";import"./classCallCheck-BTVV3tFI.js";import"./raf-nDFcuFT6.js";const E={SUSPENDED:"معلق",PLACED:"ثبت سفارش",ADMIN_APPROVED:"تایید مدیر سیستم",SOURCING:"درحال تامین",PREPARING:"درحال آماده سازی",DELIVERED_TO_AGENT:"تحویل مسئول فروش",DELIVERED_TO_CUSTOMER:"تحویل مشتری",CANCELLED:"لغو شده"},q={PLACED:{font:"#3B82F6",background:"#3B82F61F"},SOURCING:{font:"#EAB308",background:"#EAB3081F"},PREPARING:{font:"#F97316",background:"#F973161F"},DELIVERED_TO_AGENT:{font:"#06B6D4",background:"#06B6D41F"},DELIVERED_TO_CUSTOMER:{font:"#22C55E",background:"#22C55E1F"}},ie=["ثبت سفارش","آماده سازی","تحویل مشتری","لغو شده"];function ne(l){switch(l){case"PLACED":case"ADMIN_APPROVED":case"SUSPENDED":return 0;case"SOURCING":case"PREPARING":return 1;case"DELIVERED_TO_AGENT":case"DELIVERED_TO_CUSTOMER":return 2;case"CANCELLED":return 3;default:return 0}}const re={class:"oc__main"},de={class:"oc__head"},ue={class:"oc__id"},ce={class:"oc__figures"},_e={class:"oc__figure"},ve={class:"oc__figure"},me={class:"oc__foot"},pe={class:"oc__date"},Ee={class:"oc__more"},fe=U({__name:"OrderCard",props:{value:{}},emits:["view"],setup(l,{emit:_}){const v=l,a=_,m=R(()=>E[v.value.status]??v.value.status),n=R(()=>q[v.value.status]);return(C,r)=>{var D,b,k,s;return i(),c("article",{class:"oc",onClick:r[0]||(r[0]=x=>a("view",l.value))},[e("span",{class:"oc__mark",style:V({background:(D=n.value)==null?void 0:D.background,color:(b=n.value)==null?void 0:b.font}),"aria-hidden":"true"},[u(L,{icon:"vuesax-linear:receipt-text",size:"16"})],4),e("div",re,[e("div",de,[e("h3",ue,o(l.value.orderNumber),1),e("span",{class:"oc__status",style:V({background:(k=n.value)==null?void 0:k.background,color:(s=n.value)==null?void 0:s.font})},o(m.value),5)]),e("div",ce,[e("span",_e,[O(o(l.value.items.length)+" ",1),r[1]||(r[1]=e("i",null,"آیتم",-1))]),e("span",ve,[O(o(parseFloat(l.value.totalGoldWeightGrams).toFixed(2))+" ",1),r[2]||(r[2]=e("i",null,"گرم",-1))])]),e("div",me,[e("span",pe,o(g(W)(l.value.createdAt)),1),e("span",Ee,[r[3]||(r[3]=O(" جزئیات ",-1)),u(L,{icon:"vuesax-linear:arrow-left-2",size:"14"})])])])])}}}),De=G(fe,[["__scopeId","data-v-ef740bbe"]]),$=h(null);async function ke(){var v;if($.value)return $.value;const l=await M.listProducts(),_=new Map;for(const a of l)for(const m of a.variants)_.set(m.id,{productTitle:a.title,variantTitle:m.title,imageUrl:(v=a.images[0])==null?void 0:v.url});return $.value=_,_}function ge(){return{lookup:async _=>(await ke()).get(_)}}const be={class:"oi"},he={class:"oi__art"},ye=["alt"],Re={key:1,class:"oi__artEmpty","aria-hidden":"true"},Oe={class:"oi__main"},Ce={class:"oi__head"},Le={class:"oi__title"},Se={key:0,class:"oi__variant"},Ae={class:"oi__figures"},Ie={class:"oi__figure"},Te={class:"oi__figure"},Ne={class:"oi__figure"},Pe=U({__name:"OrderItemCard",props:{value:{}},setup(l){const _=l,{lookup:v}=ge(),a=h();return j(async()=>{a.value=await v(_.value.productVariantId)}),(m,n)=>{var r,D,b,k;const C=Q("lazy");return i(),c("article",be,[e("div",he,[(r=a.value)!=null&&r.imageUrl?X((i(),c("img",{key:0,alt:((D=a.value)==null?void 0:D.productTitle)??""},null,8,ye)),[[C,a.value.imageUrl]]):(i(),c("div",Re,[u(L,{icon:"vuesax-linear:diamonds",size:"18"})]))]),e("div",Oe,[e("div",Ce,[e("h4",Le,o(((b=a.value)==null?void 0:b.productTitle)??"—"),1),(k=a.value)!=null&&k.variantTitle?(i(),c("span",Se,o(a.value.variantTitle),1)):w("",!0)]),e("div",Ae,[e("span",Ie,[O(o(l.value.quantity)+" ",1),n[0]||(n[0]=e("i",null,"عدد",-1))]),e("span",Te,[O(o(l.value.computedWeightGrams)+" ",1),n[1]||(n[1]=e("i",null,"گرم",-1))]),e("span",Ne,[O(o(l.value.wagePercentSnapshot)+" ",1),n[2]||(n[2]=e("i",null,"٪ اجرت",-1))])])])])}}}),$e=G(Pe,[["__scopeId","data-v-dfbe6e64"]]),Ve={class:"ord"},we={class:"ord__barExtra"},Ue={class:"ord__chips no-scrollbar"},Ge=["onClick"],xe={key:0,class:"ord__list"},Fe={key:1,class:"ord__empty"},ze={class:"detail"},Be={class:"detail__bar"},Me={class:"detail__scroll"},je={class:"detail__block"},We={class:"detail__steps"},qe={class:"detail__stepDot"},Je={class:"detail__stepTitle"},Ke={class:"detail__block"},He={class:"detail__headline"},Qe={class:"detail__number"},Xe={class:"detail__specs"},Ye={class:"detail__spec"},Ze={class:"detail__spec"},et={class:"detail__spec"},tt={class:"detail__block"},st={class:"detail__items"},at=U({__name:"OrdersView",setup(l){const _=Y(),v=[{title:"همه",key:"ALL"},{title:E.SUSPENDED,key:"SUSPENDED"},{title:E.PLACED,key:"PLACED"},{title:E.ADMIN_APPROVED,key:"ADMIN_APPROVED"},{title:E.SOURCING,key:"SOURCING"},{title:E.PREPARING,key:"PREPARING"},{title:E.DELIVERED_TO_AGENT,key:"DELIVERED_TO_AGENT"},{title:E.DELIVERED_TO_CUSTOMER,key:"DELIVERED_TO_CUSTOMER"},{title:E.CANCELLED,key:"CANCELLED"}],a=h("ALL"),m=h(!1),n=h(!1),C=h([]),r=h(void 0),D=R(()=>{let p=C.value;return a.value!=="ALL"&&(p=p.filter(t=>t.status===a.value)),r.value&&(p=p.filter(t=>t.orderNumber.includes(r.value))),p});function b(p){r.value=p}async function k(){if(_.isLoggedIn){m.value=!0;try{C.value=await M.getMyOrders()}finally{m.value=!1}}}const s=ee({model:!1,item:null}),x=R(()=>s.item?E[s.item.status]??s.item.status:""),F=R(()=>s.item?q[s.item.status]:void 0),z=R(()=>s.item?ne(s.item.status):0);function J(p){s.item=p,s.model=!0}async function K(){await k(),n.value=!1}return j(k),(p,t)=>{const H=te("container");return i(),c("div",Ve,[u(se,{title:"سفارشات","back-to":"home"},{below:f(()=>[e("div",we,[u(ae,{onSearch:b,"place-holder":"جستجوی شماره سفارش"}),e("div",Ue,[(i(),c(S,null,A(v,d=>e("button",{key:d.key,type:"button",class:B(["ord__chip",{"is-on":a.value===d.key}]),onClick:I=>a.value=d.key},o(d.title),11,Ge)),64))])])]),_:1}),u(Z,{spinning:m.value,tip:"درحال دریافت اطلاعات"},{default:f(()=>[u(g(le),{modelValue:n.value,"onUpdate:modelValue":t[0]||(t[0]=d=>n.value=d),onRefresh:K},{pulling:f(()=>[u(g(P),{size:"18"})]),loosing:f(()=>[u(g(P),{size:"18"})]),loading:f(()=>[u(g(P),{size:"18"})]),success:f(()=>[...t[3]||(t[3]=[e("span",null,null,-1)])]),default:f(()=>[u(H,{class:"ord__body"},{default:f(()=>[D.value.length?(i(),c("div",xe,[(i(!0),c(S,null,A(D.value,d=>(i(),N(De,{key:d.id,value:d,onView:J},null,8,["value"]))),128))])):m.value?w("",!0):(i(),c("section",Fe,[u(L,{icon:"vuesax-linear:box",size:"26"}),t[4]||(t[4]=e("p",null,"سفارشی با این مشخصات پیدا نشد.",-1))]))]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["spinning"]),s.item?(i(),N(g(oe),{key:0,visible:s.model,"onUpdate:visible":t[2]||(t[2]=d=>s.model=d),placement:"bottom",closable:!1,height:"100vh",class:"rtl",bodyStyle:{padding:0,position:"relative"}},{default:f(()=>{var d,I;return[e("div",ze,[e("header",Be,[e("button",{type:"button",class:"detail__close","aria-label":"بستن",onClick:t[1]||(t[1]=y=>s.model=!1)},[u(L,{icon:"vuesax-linear:arrow-right-1",size:"20"})]),t[5]||(t[5]=e("h2",{class:"detail__title"},"جزئیات سفارش",-1)),t[6]||(t[6]=e("span",{class:"detail__spacer","aria-hidden":"true"},null,-1))]),e("div",Me,[e("section",je,[e("div",We,[(i(!0),c(S,null,A(g(ie),(y,T)=>(i(),c("div",{key:y,class:B(["detail__step",{"is-done":T<=z.value,"is-active":T===z.value}])},[e("span",qe,o(T+1),1),e("span",Je,o(y),1)],2))),128))])]),e("section",Ke,[e("div",He,[e("div",null,[t[7]||(t[7]=e("div",{class:"detail__eyebrow"},"شماره سفارش",-1)),e("div",Qe,o(s.item.orderNumber),1)]),e("span",{class:"detail__status",style:V({background:(d=F.value)==null?void 0:d.background,color:(I=F.value)==null?void 0:I.font})},o(x.value),5)]),e("dl",Xe,[e("div",Ye,[t[8]||(t[8]=e("dt",null,"تعداد کالاها",-1)),e("dd",null,o(s.item.items.length)+" آیتم",1)]),e("div",Ze,[t[9]||(t[9]=e("dt",null,"وزن سفارش",-1)),e("dd",null,o(parseFloat(s.item.totalGoldWeightGrams).toFixed(2))+" گرم",1)]),e("div",et,[t[10]||(t[10]=e("dt",null,"تاریخ سفارش",-1)),e("dd",null,o(g(W)(s.item.createdAt)),1)])])]),e("section",tt,[t[11]||(t[11]=e("h3",{class:"detail__blockTitle"},"آیتم‌های سفارش",-1)),e("div",st,[(i(!0),c(S,null,A(s.item.items,y=>(i(),N($e,{key:y.id,value:y},null,8,["value"]))),128))])])])])]}),_:1},8,["visible"])):w("",!0)])}}}),vt=G(at,[["__scopeId","data-v-660b7444"]]);export{vt as default}; diff --git a/apps/user-app-v2/dist/assets/PageBar-D5DXU6sO.js b/apps/user-app-v2/dist/assets/PageBar-El-laHqK.js similarity index 92% rename from apps/user-app-v2/dist/assets/PageBar-D5DXU6sO.js rename to apps/user-app-v2/dist/assets/PageBar-El-laHqK.js index 25757d8..ef7d417 100644 --- a/apps/user-app-v2/dist/assets/PageBar-D5DXU6sO.js +++ b/apps/user-app-v2/dist/assets/PageBar-El-laHqK.js @@ -1 +1 @@ -import{d as _,c as t,b as e,p as b,I as d,t as u,H as i,f as o,C as p,_ as k}from"./index-BWyw3RAx.js";const f={class:"bar"},h={class:"bar__inner"},m={key:1,class:"bar__spacer","aria-hidden":"true"},B={class:"bar__title"},g={class:"bar__trailing"},v=_({__name:"PageBar",props:{title:{},back:{type:Boolean,default:!0},backTo:{},backAction:{}},setup(s){const a=s,n=p();function l(){a.backAction?a.backAction():a.backTo?n.push({name:a.backTo}):n.back()}return(r,c)=>(o(),t("header",f,[e("div",h,[s.back?(o(),t("button",{key:0,type:"button",class:"bar__btn","aria-label":"بازگشت",onClick:l},[b(d,{icon:"vuesax-linear:arrow-right-1",size:"20"})])):(o(),t("span",m)),e("h1",B,u(s.title),1),e("div",g,[i(r.$slots,"trailing",{},()=>[c[0]||(c[0]=e("span",{class:"bar__spacer","aria-hidden":"true"},null,-1))],!0)])]),i(r.$slots,"below",{},void 0,!0)]))}}),A=k(v,[["__scopeId","data-v-dc516f82"]]);export{A as P}; +import{d as _,c as t,b as e,p as b,I as d,t as u,H as i,f as o,C as p,_ as k}from"./index-Dp9sxvBv.js";const f={class:"bar"},h={class:"bar__inner"},m={key:1,class:"bar__spacer","aria-hidden":"true"},B={class:"bar__title"},g={class:"bar__trailing"},v=_({__name:"PageBar",props:{title:{},back:{type:Boolean,default:!0},backTo:{},backAction:{}},setup(s){const a=s,n=p();function l(){a.backAction?a.backAction():a.backTo?n.push({name:a.backTo}):n.back()}return(r,c)=>(o(),t("header",f,[e("div",h,[s.back?(o(),t("button",{key:0,type:"button",class:"bar__btn","aria-label":"بازگشت",onClick:l},[b(d,{icon:"vuesax-linear:arrow-right-1",size:"20"})])):(o(),t("span",m)),e("h1",B,u(s.title),1),e("div",g,[i(r.$slots,"trailing",{},()=>[c[0]||(c[0]=e("span",{class:"bar__spacer","aria-hidden":"true"},null,-1))],!0)])]),i(r.$slots,"below",{},void 0,!0)]))}}),A=k(v,[["__scopeId","data-v-dc516f82"]]);export{A as P}; diff --git a/apps/user-app-v2/dist/assets/ProductCard-nL92ZIkB.js b/apps/user-app-v2/dist/assets/ProductCard-CvKEozHI.js similarity index 96% rename from apps/user-app-v2/dist/assets/ProductCard-nL92ZIkB.js rename to apps/user-app-v2/dist/assets/ProductCard-CvKEozHI.js index a8cad9e..237dfe3 100644 --- a/apps/user-app-v2/dist/assets/ProductCard-nL92ZIkB.js +++ b/apps/user-app-v2/dist/assets/ProductCard-CvKEozHI.js @@ -1 +1 @@ -import{d as B,aM as N,k as P,l as z,f as s,c as t,b as a,m as e,w as F,p as m,I as h,aN as V,i as D,e as _,t as r,N as I,g as S,A as E,_ as M}from"./index-BWyw3RAx.js";const O={class:"pc__art"},q=["alt"],A={key:1,class:"pc__artEmpty","aria-hidden":"true"},L=["aria-label"],T={key:2,class:"pc__flag"},U={key:3,class:"pc__flag pc__flag--soft"},$={class:"pc__title"},j={class:"pc__weight"},G={key:0,class:"pc__meta"},H={key:0,class:"pc__wageOld"},J={class:"pc__wage"},K=B({__name:"ProductCard",props:{value:{},wageBefore:{}},setup(l){const d=l,o=N(),{image:p,id:i,title:u,min_gram:y,wage:f,is_exist:k,qty:w,isPreOrder:x}=P(d.value),g=S(null);function b(){E(d.value,g.value)}function v(n){return n%1===0?String(n):n.toFixed(2)}return(n,c)=>{const C=z("lazy");return s(),t("article",{ref_key:"root",ref:g,class:"pc","data-product-origin":"",onClick:b},[a("div",O,[e(p)?F((s(),t("img",{key:0,alt:e(u)},null,8,q)),[[C,e(p)]]):(s(),t("div",A,[m(h,{icon:"vuesax-linear:diamonds",size:"26"})])),a("button",{type:"button",class:D(["pc__fav",{"is-on":e(o).isFavorite(e(i))}]),"aria-label":e(o).isFavorite(e(i))?"حذف از علاقه‌مندی":"افزودن به علاقه‌مندی",onClick:c[0]||(c[0]=V(Q=>e(o).toggle(e(i)),["stop"]))},[m(h,{icon:e(o).isFavorite(e(i))?"vuesax-linear:heart-fill":"vuesax-linear:heart",size:"16"},null,8,["icon"])],10,L),e(k)?e(x)&&e(w)===0?(s(),t("span",U,"پیش‌سفارش")):_("",!0):(s(),t("span",T,"ناموجود"))]),a("h3",$,r(e(u)),1),a("p",j,[I(r(e(y))+" ",1),c[1]||(c[1]=a("span",{class:"pc__weightUnit"},"گرم",-1))]),e(f)!=null?(s(),t("div",G,[l.wageBefore!=null?(s(),t("span",H,"اجرت "+r(v(l.wageBefore))+"٪",1)):_("",!0),a("span",J,r(v(e(f)))+"٪ اجرت",1)])):_("",!0)],512)}}}),W=M(K,[["__scopeId","data-v-63b56860"]]);export{W as P}; +import{d as B,aM as N,k as P,l as z,f as s,c as t,b as a,m as e,w as F,p as m,I as h,aN as V,i as D,e as _,t as r,N as I,g as S,A as E,_ as M}from"./index-Dp9sxvBv.js";const O={class:"pc__art"},q=["alt"],A={key:1,class:"pc__artEmpty","aria-hidden":"true"},L=["aria-label"],T={key:2,class:"pc__flag"},U={key:3,class:"pc__flag pc__flag--soft"},$={class:"pc__title"},j={class:"pc__weight"},G={key:0,class:"pc__meta"},H={key:0,class:"pc__wageOld"},J={class:"pc__wage"},K=B({__name:"ProductCard",props:{value:{},wageBefore:{}},setup(l){const d=l,o=N(),{image:p,id:i,title:u,min_gram:y,wage:f,is_exist:k,qty:w,isPreOrder:x}=P(d.value),g=S(null);function b(){E(d.value,g.value)}function v(n){return n%1===0?String(n):n.toFixed(2)}return(n,c)=>{const C=z("lazy");return s(),t("article",{ref_key:"root",ref:g,class:"pc","data-product-origin":"",onClick:b},[a("div",O,[e(p)?F((s(),t("img",{key:0,alt:e(u)},null,8,q)),[[C,e(p)]]):(s(),t("div",A,[m(h,{icon:"vuesax-linear:diamonds",size:"26"})])),a("button",{type:"button",class:D(["pc__fav",{"is-on":e(o).isFavorite(e(i))}]),"aria-label":e(o).isFavorite(e(i))?"حذف از علاقه‌مندی":"افزودن به علاقه‌مندی",onClick:c[0]||(c[0]=V(Q=>e(o).toggle(e(i)),["stop"]))},[m(h,{icon:e(o).isFavorite(e(i))?"vuesax-linear:heart-fill":"vuesax-linear:heart",size:"16"},null,8,["icon"])],10,L),e(k)?e(x)&&e(w)===0?(s(),t("span",U,"پیش‌سفارش")):_("",!0):(s(),t("span",T,"ناموجود"))]),a("h3",$,r(e(u)),1),a("p",j,[I(r(e(y))+" ",1),c[1]||(c[1]=a("span",{class:"pc__weightUnit"},"گرم",-1))]),e(f)!=null?(s(),t("div",G,[l.wageBefore!=null?(s(),t("span",H,"اجرت "+r(v(l.wageBefore))+"٪",1)):_("",!0),a("span",J,r(v(e(f)))+"٪ اجرت",1)])):_("",!0)],512)}}}),W=M(K,[["__scopeId","data-v-63b56860"]]);export{W as P}; diff --git a/apps/user-app-v2/dist/assets/ProfileView-Bcb3A35W.js b/apps/user-app-v2/dist/assets/ProfileView-qElFZKrE.js similarity index 95% rename from apps/user-app-v2/dist/assets/ProfileView-Bcb3A35W.js rename to apps/user-app-v2/dist/assets/ProfileView-qElFZKrE.js index 0ba3e4c..d1e9b47 100644 --- a/apps/user-app-v2/dist/assets/ProfileView-Bcb3A35W.js +++ b/apps/user-app-v2/dist/assets/ProfileView-qElFZKrE.js @@ -1 +1 @@ -import{d as y,O as b,o as T,s as k,c as l,p as i,z as V,g as p,B,f as n,b as e,I as d,t as a,e as r,i as C,m as P,h as f,C as g,_ as D}from"./index-BWyw3RAx.js";import{P as N}from"./PageBar-D5DXU6sO.js";import{S as h}from"./SectionHead-BiCEpXAe.js";const R={class:"prof"},x={class:"prof__identity"},F={class:"prof__avatar","aria-hidden":"true"},M={class:"prof__name"},O={key:0,class:"prof__mobile"},w={key:0,class:"prof__block"},z={class:"prof__specs"},U={class:"prof__spec"},L={class:"prof__spec"},A={class:"prof__spec"},W={class:"prof__spec"},H={key:1,class:"prof__empty"},$=y({__name:"ProfileView",setup(j){const _={UNVERIFIED:"احراز نشده",STEP_ONE_SUBMITTED:"مرحله اول ثبت شده",STEP_TWO_SUBMITTED:"مرحله دوم ثبت شده",VERIFIED:"تایید شده"},v=b(),s=p(null),u=p(!1),m=f(()=>{var t;return((t=s.value)==null?void 0:t.verificationStep)==="VERIFIED"}),S=f(()=>{var o;const t=(o=s.value)==null?void 0:o.verificationStep;return!!t&&t!=="VERIFIED"&&t!=="STEP_TWO_SUBMITTED"}),E=g();return T(async()=>{if(v.isLoggedIn){u.value=!0;try{s.value=await k.getMe()}finally{u.value=!1}}}),(t,o)=>{const I=B("container");return n(),l("div",R,[i(N,{title:"اطلاعات کاربری","back-to":"userPage::hasSubRoute"}),i(I,{class:"prof__body"},{default:V(()=>{var c;return[e("section",x,[e("div",F,[i(d,{icon:"vuesax-linear:user",size:"30"})]),e("h2",M,a(((c=s.value)==null?void 0:c.fullName)??"—"),1),s.value?(n(),l("p",O,a(s.value.mobile),1)):r("",!0),s.value?(n(),l("span",{key:1,class:C(["prof__seal",m.value?"is-ok":"is-pending"])},a(_[s.value.verificationStep]??s.value.verificationStep),3)):r("",!0)]),s.value?(n(),l("section",w,[i(h,{title:"مشخصات",subtitle:"اطلاعات ثبت‌شده حساب شما"}),e("dl",z,[e("div",U,[o[1]||(o[1]=e("dt",null,"نام و نام خانوادگی",-1)),e("dd",null,a(s.value.fullName),1)]),e("div",L,[o[2]||(o[2]=e("dt",null,"تلفن همراه",-1)),e("dd",null,a(s.value.mobile),1)]),e("div",A,[o[3]||(o[3]=e("dt",null,"کد ملی",-1)),e("dd",null,a(s.value.nationalCode),1)]),e("div",W,[o[4]||(o[4]=e("dt",null,"وضعیت احراز هویت",-1)),e("dd",null,a(_[s.value.verificationStep]??s.value.verificationStep),1)])])])):u.value?r("",!0):(n(),l("section",H,[i(d,{icon:"vuesax-linear:user",size:"26"}),o[5]||(o[5]=e("p",null,"اطلاعات حساب در دسترس نیست.",-1))])),S.value?(n(),l("button",{key:2,type:"button",class:"prof__complete",onClick:o[0]||(o[0]=q=>P(E).push({name:"completeProfile"}))}," تکمیل پروفایل ")):r("",!0)]}),_:1})])}}}),Q=D($,[["__scopeId","data-v-a13f377b"]]);export{Q as default}; +import{d as y,O as b,o as T,s as k,c as l,p as i,z as V,g as p,B,f as n,b as e,I as d,t as a,e as r,i as C,m as P,h as f,C as g,_ as D}from"./index-Dp9sxvBv.js";import{P as N}from"./PageBar-El-laHqK.js";import{S as h}from"./SectionHead-DNG9ywW4.js";const R={class:"prof"},x={class:"prof__identity"},F={class:"prof__avatar","aria-hidden":"true"},M={class:"prof__name"},O={key:0,class:"prof__mobile"},w={key:0,class:"prof__block"},z={class:"prof__specs"},U={class:"prof__spec"},L={class:"prof__spec"},A={class:"prof__spec"},W={class:"prof__spec"},H={key:1,class:"prof__empty"},$=y({__name:"ProfileView",setup(j){const _={UNVERIFIED:"احراز نشده",STEP_ONE_SUBMITTED:"مرحله اول ثبت شده",STEP_TWO_SUBMITTED:"مرحله دوم ثبت شده",VERIFIED:"تایید شده"},v=b(),s=p(null),u=p(!1),m=f(()=>{var t;return((t=s.value)==null?void 0:t.verificationStep)==="VERIFIED"}),S=f(()=>{var o;const t=(o=s.value)==null?void 0:o.verificationStep;return!!t&&t!=="VERIFIED"&&t!=="STEP_TWO_SUBMITTED"}),E=g();return T(async()=>{if(v.isLoggedIn){u.value=!0;try{s.value=await k.getMe()}finally{u.value=!1}}}),(t,o)=>{const I=B("container");return n(),l("div",R,[i(N,{title:"اطلاعات کاربری","back-to":"userPage::hasSubRoute"}),i(I,{class:"prof__body"},{default:V(()=>{var c;return[e("section",x,[e("div",F,[i(d,{icon:"vuesax-linear:user",size:"30"})]),e("h2",M,a(((c=s.value)==null?void 0:c.fullName)??"—"),1),s.value?(n(),l("p",O,a(s.value.mobile),1)):r("",!0),s.value?(n(),l("span",{key:1,class:C(["prof__seal",m.value?"is-ok":"is-pending"])},a(_[s.value.verificationStep]??s.value.verificationStep),3)):r("",!0)]),s.value?(n(),l("section",w,[i(h,{title:"مشخصات",subtitle:"اطلاعات ثبت‌شده حساب شما"}),e("dl",z,[e("div",U,[o[1]||(o[1]=e("dt",null,"نام و نام خانوادگی",-1)),e("dd",null,a(s.value.fullName),1)]),e("div",L,[o[2]||(o[2]=e("dt",null,"تلفن همراه",-1)),e("dd",null,a(s.value.mobile),1)]),e("div",A,[o[3]||(o[3]=e("dt",null,"کد ملی",-1)),e("dd",null,a(s.value.nationalCode),1)]),e("div",W,[o[4]||(o[4]=e("dt",null,"وضعیت احراز هویت",-1)),e("dd",null,a(_[s.value.verificationStep]??s.value.verificationStep),1)])])])):u.value?r("",!0):(n(),l("section",H,[i(d,{icon:"vuesax-linear:user",size:"26"}),o[5]||(o[5]=e("p",null,"اطلاعات حساب در دسترس نیست.",-1))])),S.value?(n(),l("button",{key:2,type:"button",class:"prof__complete",onClick:o[0]||(o[0]=q=>P(E).push({name:"completeProfile"}))}," تکمیل پروفایل ")):r("",!0)]}),_:1})])}}}),Q=D($,[["__scopeId","data-v-a13f377b"]]);export{Q as default}; diff --git a/apps/user-app-v2/dist/assets/RateStrip-0Viss8IX.js b/apps/user-app-v2/dist/assets/RateStrip-Cjr1qlEL.js similarity index 87% rename from apps/user-app-v2/dist/assets/RateStrip-0Viss8IX.js rename to apps/user-app-v2/dist/assets/RateStrip-Cjr1qlEL.js index 76da582..bd453af 100644 --- a/apps/user-app-v2/dist/assets/RateStrip-0Viss8IX.js +++ b/apps/user-app-v2/dist/assets/RateStrip-Cjr1qlEL.js @@ -1 +1 @@ -import{p as n,j as d}from"./filters-DVocLz3o.js";import{d as l,c as a,i as m,b as s,N as u,t as i,m as c,e as _,h as v,f as r,_ as q}from"./index-BWyw3RAx.js";const f={key:0,class:"rate-strip__value"},y={class:"rate-strip__num"},k={key:1,class:"rate-strip__value rate-strip__value--muted"},x={key:2,class:"rate-strip__time"},B=l({__name:"RateStrip",props:{quote:{},compact:{type:Boolean}},setup(t){const o=t,p=v(()=>o.quote?o.quote.pricePerGramRial.split(".")[0]:"");return(N,e)=>(r(),a("div",{class:m(["rate-strip",{"is-empty":!t.quote,"rate-strip--compact":t.compact}])},[e[1]||(e[1]=s("div",{class:"rate-strip__label"},[s("span",{class:"rate-strip__dot","aria-hidden":"true"}),u(" نرخ طلای ۱۸ عیار ")],-1)),t.quote?(r(),a("div",f,[s("span",y,i(c(n)(p.value)),1),e[0]||(e[0]=s("span",{class:"rate-strip__unit"},"ریال / گرم",-1))])):(r(),a("div",k,"در انتظار اعلام نرخ")),t.quote?(r(),a("div",x,i(c(d)(t.quote.quotedAt)),1)):_("",!0)],2))}}),h=q(B,[["__scopeId","data-v-563349ab"]]);export{h as R}; +import{p as n,j as d}from"./filters-CUgGgSea.js";import{d as l,c as a,i as m,b as s,N as u,t as i,m as c,e as _,h as v,f as r,_ as q}from"./index-Dp9sxvBv.js";const f={key:0,class:"rate-strip__value"},y={class:"rate-strip__num"},k={key:1,class:"rate-strip__value rate-strip__value--muted"},x={key:2,class:"rate-strip__time"},B=l({__name:"RateStrip",props:{quote:{},compact:{type:Boolean}},setup(t){const o=t,p=v(()=>o.quote?o.quote.pricePerGramRial.split(".")[0]:"");return(N,e)=>(r(),a("div",{class:m(["rate-strip",{"is-empty":!t.quote,"rate-strip--compact":t.compact}])},[e[1]||(e[1]=s("div",{class:"rate-strip__label"},[s("span",{class:"rate-strip__dot","aria-hidden":"true"}),u(" نرخ طلای ۱۸ عیار ")],-1)),t.quote?(r(),a("div",f,[s("span",y,i(c(n)(p.value)),1),e[0]||(e[0]=s("span",{class:"rate-strip__unit"},"ریال / گرم",-1))])):(r(),a("div",k,"در انتظار اعلام نرخ")),t.quote?(r(),a("div",x,i(c(d)(t.quote.quotedAt)),1)):_("",!0)],2))}}),h=q(B,[["__scopeId","data-v-563349ab"]]);export{h as R}; diff --git a/apps/user-app-v2/dist/assets/ReportView-NtWL-hNL.js b/apps/user-app-v2/dist/assets/ReportView-NtWL-hNL.js deleted file mode 100644 index 1ddbf44..0000000 --- a/apps/user-app-v2/dist/assets/ReportView-NtWL-hNL.js +++ /dev/null @@ -1 +0,0 @@ -import{d as E,f as n,c as a,b as t,N,t as i,m as $,e as r,_ as J,g as u,o as Q,a as W,p as m,z as y,J as O,S as X,s as B,i as D,F as w,r as I,I as M,B as Y,j as U}from"./index-BWyw3RAx.js";import{P as Z}from"./PageBar-D5DXU6sO.js";import{j as S,p as K}from"./filters-DVocLz3o.js";import{D as tt}from"./index-sLHXZqt3.js";import{P as et}from"./index-ecOSUWQv.js";import"./KeyCode-CA5MXqE7.js";import"./classCallCheck-Ou87VTNv.js";import"./raf-nDFcuFT6.js";const st={class:"doc"},lt={class:"doc__head"},nt={class:"doc__rows"},at={class:"doc__row"},ot={class:"doc__row"},it={dir:"ltr"},rt={key:0,class:"doc__row"},dt={dir:"ltr"},ut={key:1,class:"doc__row"},ct={dir:"ltr"},_t={key:2,class:"doc__row"},vt={key:3,class:"doc__row"},mt={dir:"ltr"},ft={key:4,class:"doc__row"},pt={dir:"ltr"},yt={key:5,class:"doc__row"},kt={dir:"ltr"},bt={key:6,class:"doc__row"},gt={key:7,class:"doc__row"},ht={key:8,class:"doc__row"},wt={key:9,class:"doc__row"},$t={key:10,class:"doc__row"},Ct={class:"doc__gold"},Rt={class:"doc__stack"},xt={dir:"ltr",class:"is-in"},Dt={dir:"ltr",class:"is-out"},Nt=E({__name:"ReportDocument",props:{item:{}},setup(l){function C(_){const e=parseFloat(_);if(!Number.isFinite(e))return _;const v=Math.trunc(Math.abs(e)).toString();return(e<0?"-":"")+K(v)}return(_,e)=>(n(),a("article",st,[t("header",lt,[t("span",null,[e[0]||(e[0]=t("span",{class:"doc__muted"},"شماره سند:",-1)),N(" "+i(l.item.sh_factor),1)]),t("span",null,[e[1]||(e[1]=t("span",{class:"doc__muted"},"تاریخ:",-1)),N(" "+i($(S)(l.item.tarikh)),1)])]),t("dl",nt,[t("div",at,[e[2]||(e[2]=t("dt",null,"نوع سند",-1)),t("dd",null,i(l.item.no),1)]),t("div",ot,[e[3]||(e[3]=t("dt",null,"وزن خالص",-1)),t("dd",it,i(l.item.vazn),1)]),l.item.ayar!==null?(n(),a("div",rt,[e[4]||(e[4]=t("dt",null,"عیار",-1)),t("dd",dt,i(l.item.ayar),1)])):r("",!0),l.item.sh_sharti?(n(),a("div",ut,[e[5]||(e[5]=t("dt",null,"شماره انگ",-1)),t("dd",ct,i(l.item.sh_sharti),1)])):r("",!0),l.item.name_az?(n(),a("div",_t,[e[6]||(e[6]=t("dt",null,"نام آزمایشگاه",-1)),t("dd",null,i(l.item.name_az),1)])):r("",!0),l.item.Darsad_Talayee?(n(),a("div",vt,[e[7]||(e[7]=t("dt",null,"اجرت (گرم)",-1)),t("dd",mt,i(l.item.Darsad_Talayee),1)])):r("",!0),l.item.fi?(n(),a("div",ft,[e[8]||(e[8]=t("dt",null,"قیمت هر گرم",-1)),t("dd",pt,i(C(l.item.fi)),1)])):r("",!0),l.item.fiF?(n(),a("div",yt,[e[9]||(e[9]=t("dt",null,"مبلغ سند",-1)),t("dd",kt,i(C(l.item.fiF)),1)])):r("",!0),l.item.bankName?(n(),a("div",bt,[e[10]||(e[10]=t("dt",null,"بانک",-1)),t("dd",null,i(l.item.bankName),1)])):r("",!0),l.item.accountName?(n(),a("div",gt,[e[11]||(e[11]=t("dt",null,"نام حساب",-1)),t("dd",null,i(l.item.accountName),1)])):r("",!0),l.item.transferTo?(n(),a("div",ht,[e[12]||(e[12]=t("dt",null,"مقصد حواله",-1)),t("dd",null,i(l.item.transferTo),1)])):r("",!0),l.item.receivedAt?(n(),a("div",wt,[e[13]||(e[13]=t("dt",null,"تاریخ دریافت",-1)),t("dd",null,i($(S)(l.item.receivedAt)),1)])):r("",!0),l.item.note?(n(),a("div",$t,[e[14]||(e[14]=t("dt",null,"توضیحات",-1)),t("dd",null,i(l.item.note),1)])):r("",!0)]),t("div",Ct,[e[15]||(e[15]=t("span",null,"طلا",-1)),t("div",Rt,[t("span",xt,i(l.item.tabdil750_v),1),t("span",Dt,i(l.item.tabdil750_kh),1)])])]))}}),A=J(Nt,[["__scopeId","data-v-21825ac9"]]),Ft={class:"rep"},Vt={class:"rep__tabs"},zt={key:0,class:"rep__list"},Pt={class:"rep__head"},Tt={class:"rep__pair"},Bt={class:"rep__stack"},It={dir:"ltr",class:"is-in"},Mt={dir:"ltr",class:"is-out"},St={class:"rep__pair is-balance"},jt={class:"rep__pair"},Lt={class:"rep__stack"},Ot={dir:"ltr",class:"is-in"},Ut={dir:"ltr",class:"is-out"},At={class:"rep__pair is-balance"},Et=["onClick"],Jt={key:1,class:"rep__empty"},Kt={key:0,class:"rep__list"},qt={key:1,class:"rep__empty"},Gt={key:2,class:"rep__empty"},Ht={key:3,class:"rep__more"},Qt={class:"rep__modal"},Wt={key:0,class:"rep__modalEmpty"},Xt=E({__name:"ReportView",setup(l){const C=X(),_=u(C.name==="reportDetail"?"2":"1"),e=u([]),v=u([]),k=u(1),b=u(!0),f=u(!1),F=u(!1),p=u(!1),R=u(!1),x=u(!1),g=u([]);function V(d){const s=parseFloat(d);if(!Number.isFinite(s))return d;const c=Math.trunc(Math.abs(s)).toString();return(s<0?"-":"")+K(c)}function j(d){return parseFloat(d)<0?"is-out":"is-in"}async function z(){var d,s;if(!(f.value||!b.value)){f.value=!0,p.value=!1;try{if(_.value==="1"){const c=await B.getReport(k.value);e.value=[...e.value,...c.result??[]],(((d=c.result)==null?void 0:d.length)??0)<(c.limit??50)?b.value=!1:k.value+=1}else{const c=await B.getReportDetailList(k.value);v.value=[...v.value,...c.result??[]],(((s=c.result)==null?void 0:s.length)??0)<(c.limit??50)?b.value=!1:k.value+=1}}catch{p.value=!0,b.value=!1}finally{f.value=!1}}}function q(){e.value=[],v.value=[],k.value=1,b.value=!0,p.value=!1}async function P(){q(),await z()}async function L(d){_.value!==d&&(_.value=d,await P())}async function G(){await P(),F.value=!1}async function H(d){R.value=!0,x.value=!0,g.value=[];try{const s=await B.getReportDocument(d.factor_Code);g.value=s.result??[]}catch{g.value=[]}finally{x.value=!1}}const T=u(null);let h=null;return Q(async()=>{await z(),typeof IntersectionObserver<"u"&&(h=new IntersectionObserver(d=>{d.some(s=>s.isIntersecting)&&z()}),T.value&&h.observe(T.value))}),W(()=>h==null?void 0:h.disconnect()),(d,s)=>{const c=Y("container");return n(),a("div",Ft,[m(Z,{title:"گزارش","back-to":"userPage::hasSubRoute"},{below:y(()=>[t("div",Vt,[t("button",{type:"button",class:D(["rep__tab",{"is-on":_.value==="1"}]),onClick:s[0]||(s[0]=o=>L("1"))}," کلیات حساب ",2),t("button",{type:"button",class:D(["rep__tab",{"is-on":_.value==="2"}]),onClick:s[1]||(s[1]=o=>L("2"))}," جزئیات حساب ",2)])]),_:1}),m(O,{spinning:f.value&&!e.value.length&&!v.value.length,tip:"درحال دریافت اطلاعات"},{default:y(()=>[m($(et),{modelValue:F.value,"onUpdate:modelValue":s[2]||(s[2]=o=>F.value=o),onRefresh:G},{default:y(()=>[m(c,{class:"rep__body"},{default:y(()=>[_.value==="1"?(n(),a(w,{key:0},[e.value.length?(n(),a("div",zt,[(n(!0),a(w,null,I(e.value,o=>(n(),a("article",{key:o.factor_Code,class:"rep__card"},[t("header",Pt,[t("span",null,[s[5]||(s[5]=t("span",{class:"rep__muted"},"شماره سند:",-1)),N(" "+i(o.sh_factor),1)]),t("span",null,[s[6]||(s[6]=t("span",{class:"rep__muted"},"تاریخ:",-1)),N(" "+i($(S)(o.tarikh)),1)])]),t("div",Tt,[s[7]||(s[7]=t("span",null,"طلا",-1)),t("div",Bt,[t("span",It,i(o.geram_v),1),t("span",Mt,i(o.geram_kh),1)])]),t("div",St,[s[8]||(s[8]=t("span",null,"مانده طلا:",-1)),t("span",{dir:"ltr",class:D(j(o.tahesab_T))},i(o.tahesab_T),3)]),t("div",jt,[s[9]||(s[9]=t("span",null,"ریال",-1)),t("div",Lt,[t("span",Ot,i(V(o.rial_v)),1),t("span",Ut,i(V(o.rial_kh)),1)])]),t("div",At,[s[10]||(s[10]=t("span",null,"مانده ریال:",-1)),t("span",{dir:"ltr",class:D(j(o.tahesab_P))},i(V(o.tahesab_P)),3)]),t("button",{type:"button",class:"rep__more",onClick:Yt=>H(o)},"جزئیات",8,Et)]))),128))])):!f.value&&!p.value?(n(),a("section",Jt,[m(M,{icon:"vuesax-linear:receipt-text",size:"26"}),s[11]||(s[11]=t("p",null,"هنوز سندی برای حساب شما ثبت نشده است.",-1))])):r("",!0)],64)):(n(),a(w,{key:1},[v.value.length?(n(),a("div",Kt,[(n(!0),a(w,null,I(v.value,o=>(n(),U(A,{key:o.factor_Code,item:o},null,8,["item"]))),128))])):!f.value&&!p.value?(n(),a("section",qt,[m(M,{icon:"vuesax-linear:receipt-text",size:"26"}),s[12]||(s[12]=t("p",null,"هنوز سندی برای حساب شما ثبت نشده است.",-1))])):r("",!0)],64)),p.value?(n(),a("section",Gt,[m(M,{icon:"vuesax-linear:danger",size:"26"}),s[13]||(s[13]=t("p",null,"دریافت اطلاعات با خطا روبه‌رو شد.",-1)),t("button",{type:"button",class:"rep__retry",onClick:P},"تلاش دوباره")])):r("",!0),f.value&&(e.value.length||v.value.length)?(n(),a("div",Ht,"در حال دریافت…")):r("",!0),t("div",{ref_key:"sentinel",ref:T,class:"rep__sentinel"},null,512)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["spinning"]),m($(tt),{open:R.value,"onUpdate:open":s[4]||(s[4]=o=>R.value=o),placement:"bottom",height:"auto",closable:!1,"body-style":{padding:"0"}},{default:y(()=>[t("div",Qt,[m(O,{spinning:x.value,tip:"درحال دریافت اطلاعات"},{default:y(()=>[(n(!0),a(w,null,I(g.value,o=>(n(),U(A,{key:o.factor_Code,item:o},null,8,["item"]))),128)),!x.value&&!g.value.length?(n(),a("p",Wt," جزئیاتی برای این سند ثبت نشده است. ")):r("",!0)]),_:1},8,["spinning"]),t("button",{type:"button",class:"rep__close",onClick:s[3]||(s[3]=o=>R.value=!1)},"بازگشت")])]),_:1},8,["open"])])}}}),ie=J(Xt,[["__scopeId","data-v-a1c9c13f"]]);export{ie as default}; diff --git a/apps/user-app-v2/dist/assets/ReportView-ooq-YW_N.js b/apps/user-app-v2/dist/assets/ReportView-ooq-YW_N.js new file mode 100644 index 0000000..3abf330 --- /dev/null +++ b/apps/user-app-v2/dist/assets/ReportView-ooq-YW_N.js @@ -0,0 +1 @@ +import{d as J,f as n,c as a,b as t,N as D,t as i,m as p,e as r,_ as K,g as u,o as W,a as X,p as c,z as m,J as U,S as Y,s as B,i as z,F as $,r as I,I as M,B as Z,j as A}from"./index-Dp9sxvBv.js";import{P as tt}from"./PageBar-El-laHqK.js";import{j as S,p as q}from"./filters-CUgGgSea.js";import{D as et}from"./index-UuozCFb-.js";import{P as st,L}from"./index-B0RgkHMm.js";import"./KeyCode-DAs3W-5E.js";import"./classCallCheck-BTVV3tFI.js";import"./raf-nDFcuFT6.js";const lt={class:"doc"},nt={class:"doc__head"},at={class:"doc__rows"},ot={class:"doc__row"},it={class:"doc__row"},rt={dir:"ltr"},dt={key:0,class:"doc__row"},ut={dir:"ltr"},ct={key:1,class:"doc__row"},_t={dir:"ltr"},vt={key:2,class:"doc__row"},mt={key:3,class:"doc__row"},ft={dir:"ltr"},pt={key:4,class:"doc__row"},yt={dir:"ltr"},kt={key:5,class:"doc__row"},gt={dir:"ltr"},bt={key:6,class:"doc__row"},ht={key:7,class:"doc__row"},wt={key:8,class:"doc__row"},$t={key:9,class:"doc__row"},Ct={key:10,class:"doc__row"},Rt={class:"doc__gold"},xt={class:"doc__stack"},zt={dir:"ltr",class:"is-in"},Dt={dir:"ltr",class:"is-out"},Nt=J({__name:"ReportDocument",props:{item:{}},setup(l){function C(v){const e=parseFloat(v);if(!Number.isFinite(e))return v;const f=Math.trunc(Math.abs(e)).toString();return(e<0?"-":"")+q(f)}return(v,e)=>(n(),a("article",lt,[t("header",nt,[t("span",null,[e[0]||(e[0]=t("span",{class:"doc__muted"},"شماره سند:",-1)),D(" "+i(l.item.sh_factor),1)]),t("span",null,[e[1]||(e[1]=t("span",{class:"doc__muted"},"تاریخ:",-1)),D(" "+i(p(S)(l.item.tarikh)),1)])]),t("dl",at,[t("div",ot,[e[2]||(e[2]=t("dt",null,"نوع سند",-1)),t("dd",null,i(l.item.no),1)]),t("div",it,[e[3]||(e[3]=t("dt",null,"وزن خالص",-1)),t("dd",rt,i(l.item.vazn),1)]),l.item.ayar!==null?(n(),a("div",dt,[e[4]||(e[4]=t("dt",null,"عیار",-1)),t("dd",ut,i(l.item.ayar),1)])):r("",!0),l.item.sh_sharti?(n(),a("div",ct,[e[5]||(e[5]=t("dt",null,"شماره انگ",-1)),t("dd",_t,i(l.item.sh_sharti),1)])):r("",!0),l.item.name_az?(n(),a("div",vt,[e[6]||(e[6]=t("dt",null,"نام آزمایشگاه",-1)),t("dd",null,i(l.item.name_az),1)])):r("",!0),l.item.Darsad_Talayee?(n(),a("div",mt,[e[7]||(e[7]=t("dt",null,"اجرت (گرم)",-1)),t("dd",ft,i(l.item.Darsad_Talayee),1)])):r("",!0),l.item.fi?(n(),a("div",pt,[e[8]||(e[8]=t("dt",null,"قیمت هر گرم",-1)),t("dd",yt,i(C(l.item.fi)),1)])):r("",!0),l.item.fiF?(n(),a("div",kt,[e[9]||(e[9]=t("dt",null,"مبلغ سند",-1)),t("dd",gt,i(C(l.item.fiF)),1)])):r("",!0),l.item.bankName?(n(),a("div",bt,[e[10]||(e[10]=t("dt",null,"بانک",-1)),t("dd",null,i(l.item.bankName),1)])):r("",!0),l.item.accountName?(n(),a("div",ht,[e[11]||(e[11]=t("dt",null,"نام حساب",-1)),t("dd",null,i(l.item.accountName),1)])):r("",!0),l.item.transferTo?(n(),a("div",wt,[e[12]||(e[12]=t("dt",null,"مقصد حواله",-1)),t("dd",null,i(l.item.transferTo),1)])):r("",!0),l.item.receivedAt?(n(),a("div",$t,[e[13]||(e[13]=t("dt",null,"تاریخ دریافت",-1)),t("dd",null,i(p(S)(l.item.receivedAt)),1)])):r("",!0),l.item.note?(n(),a("div",Ct,[e[14]||(e[14]=t("dt",null,"توضیحات",-1)),t("dd",null,i(l.item.note),1)])):r("",!0)]),t("div",Rt,[e[15]||(e[15]=t("span",null,"طلا",-1)),t("div",xt,[t("span",zt,i(l.item.tabdil750_v),1),t("span",Dt,i(l.item.tabdil750_kh),1)])])]))}}),E=K(Nt,[["__scopeId","data-v-21825ac9"]]),Ft={class:"rep"},Vt={class:"rep__tabs"},Pt={key:0,class:"rep__list"},Tt={class:"rep__head"},Bt={class:"rep__pair"},It={class:"rep__stack"},Mt={dir:"ltr",class:"is-in"},Lt={dir:"ltr",class:"is-out"},St={class:"rep__pair is-balance"},jt={class:"rep__pair"},Ot={class:"rep__stack"},Ut={dir:"ltr",class:"is-in"},At={dir:"ltr",class:"is-out"},Et={class:"rep__pair is-balance"},Jt=["onClick"],Kt={key:1,class:"rep__empty"},qt={key:0,class:"rep__list"},Gt={key:1,class:"rep__empty"},Ht={key:2,class:"rep__empty"},Qt={key:3,class:"rep__more"},Wt={class:"rep__modal"},Xt={key:0,class:"rep__modalEmpty"},Yt=J({__name:"ReportView",setup(l){const C=Y(),v=u(C.name==="reportDetail"?"2":"1"),e=u([]),f=u([]),g=u(1),b=u(!0),y=u(!1),N=u(!1),k=u(!1),R=u(!1),x=u(!1),h=u([]);function F(d){const s=parseFloat(d);if(!Number.isFinite(s))return d;const _=Math.trunc(Math.abs(s)).toString();return(s<0?"-":"")+q(_)}function j(d){return parseFloat(d)<0?"is-out":"is-in"}async function V(){var d,s;if(!(y.value||!b.value)){y.value=!0,k.value=!1;try{if(v.value==="1"){const _=await B.getReport(g.value);e.value=[...e.value,..._.result??[]],(((d=_.result)==null?void 0:d.length)??0)<(_.limit??50)?b.value=!1:g.value+=1}else{const _=await B.getReportDetailList(g.value);f.value=[...f.value,..._.result??[]],(((s=_.result)==null?void 0:s.length)??0)<(_.limit??50)?b.value=!1:g.value+=1}}catch{k.value=!0,b.value=!1}finally{y.value=!1}}}function G(){e.value=[],f.value=[],g.value=1,b.value=!0,k.value=!1}async function P(){G(),await V()}async function O(d){v.value!==d&&(v.value=d,await P())}async function H(){await P(),N.value=!1}async function Q(d){R.value=!0,x.value=!0,h.value=[];try{const s=await B.getReportDocument(d.factor_Code);h.value=s.result??[]}catch{h.value=[]}finally{x.value=!1}}const T=u(null);let w=null;return W(async()=>{await V(),typeof IntersectionObserver<"u"&&(w=new IntersectionObserver(d=>{d.some(s=>s.isIntersecting)&&V()}),T.value&&w.observe(T.value))}),X(()=>w==null?void 0:w.disconnect()),(d,s)=>{const _=Z("container");return n(),a("div",Ft,[c(tt,{title:"گزارش","back-to":"userPage::hasSubRoute"},{below:m(()=>[t("div",Vt,[t("button",{type:"button",class:z(["rep__tab",{"is-on":v.value==="1"}]),onClick:s[0]||(s[0]=o=>O("1"))}," کلیات حساب ",2),t("button",{type:"button",class:z(["rep__tab",{"is-on":v.value==="2"}]),onClick:s[1]||(s[1]=o=>O("2"))}," جزئیات حساب ",2)])]),_:1}),c(U,{spinning:y.value&&!e.value.length&&!f.value.length,tip:"درحال دریافت اطلاعات"},{default:m(()=>[c(p(st),{modelValue:N.value,"onUpdate:modelValue":s[2]||(s[2]=o=>N.value=o),onRefresh:H},{pulling:m(()=>[c(p(L),{size:"18"})]),loosing:m(()=>[c(p(L),{size:"18"})]),loading:m(()=>[c(p(L),{size:"18"})]),success:m(()=>[...s[5]||(s[5]=[t("span",null,null,-1)])]),default:m(()=>[c(_,{class:"rep__body"},{default:m(()=>[v.value==="1"?(n(),a($,{key:0},[e.value.length?(n(),a("div",Pt,[(n(!0),a($,null,I(e.value,o=>(n(),a("article",{key:o.factor_Code,class:"rep__card"},[t("header",Tt,[t("span",null,[s[6]||(s[6]=t("span",{class:"rep__muted"},"شماره سند:",-1)),D(" "+i(o.sh_factor),1)]),t("span",null,[s[7]||(s[7]=t("span",{class:"rep__muted"},"تاریخ:",-1)),D(" "+i(p(S)(o.tarikh)),1)])]),t("div",Bt,[s[8]||(s[8]=t("span",null,"طلا",-1)),t("div",It,[t("span",Mt,i(o.geram_v),1),t("span",Lt,i(o.geram_kh),1)])]),t("div",St,[s[9]||(s[9]=t("span",null,"مانده طلا:",-1)),t("span",{dir:"ltr",class:z(j(o.tahesab_T))},i(o.tahesab_T),3)]),t("div",jt,[s[10]||(s[10]=t("span",null,"ریال",-1)),t("div",Ot,[t("span",Ut,i(F(o.rial_v)),1),t("span",At,i(F(o.rial_kh)),1)])]),t("div",Et,[s[11]||(s[11]=t("span",null,"مانده ریال:",-1)),t("span",{dir:"ltr",class:z(j(o.tahesab_P))},i(F(o.tahesab_P)),3)]),t("button",{type:"button",class:"rep__more",onClick:Zt=>Q(o)},"جزئیات",8,Jt)]))),128))])):!y.value&&!k.value?(n(),a("section",Kt,[c(M,{icon:"vuesax-linear:receipt-text",size:"26"}),s[12]||(s[12]=t("p",null,"هنوز سندی برای حساب شما ثبت نشده است.",-1))])):r("",!0)],64)):(n(),a($,{key:1},[f.value.length?(n(),a("div",qt,[(n(!0),a($,null,I(f.value,o=>(n(),A(E,{key:o.factor_Code,item:o},null,8,["item"]))),128))])):!y.value&&!k.value?(n(),a("section",Gt,[c(M,{icon:"vuesax-linear:receipt-text",size:"26"}),s[13]||(s[13]=t("p",null,"هنوز سندی برای حساب شما ثبت نشده است.",-1))])):r("",!0)],64)),k.value?(n(),a("section",Ht,[c(M,{icon:"vuesax-linear:danger",size:"26"}),s[14]||(s[14]=t("p",null,"دریافت اطلاعات با خطا روبه‌رو شد.",-1)),t("button",{type:"button",class:"rep__retry",onClick:P},"تلاش دوباره")])):r("",!0),y.value&&(e.value.length||f.value.length)?(n(),a("div",Qt,"در حال دریافت…")):r("",!0),t("div",{ref_key:"sentinel",ref:T,class:"rep__sentinel"},null,512)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["spinning"]),c(p(et),{open:R.value,"onUpdate:open":s[4]||(s[4]=o=>R.value=o),placement:"bottom",height:"auto",closable:!1,"body-style":{padding:"0"}},{default:m(()=>[t("div",Wt,[c(U,{spinning:x.value,tip:"درحال دریافت اطلاعات"},{default:m(()=>[(n(!0),a($,null,I(h.value,o=>(n(),A(E,{key:o.factor_Code,item:o},null,8,["item"]))),128)),!x.value&&!h.value.length?(n(),a("p",Xt," جزئیاتی برای این سند ثبت نشده است. ")):r("",!0)]),_:1},8,["spinning"]),t("button",{type:"button",class:"rep__close",onClick:s[3]||(s[3]=o=>R.value=!1)},"بازگشت")])]),_:1},8,["open"])])}}}),re=K(Yt,[["__scopeId","data-v-24011723"]]);export{re as default}; diff --git a/apps/user-app-v2/dist/assets/ReportView-DjU8BNPp.css b/apps/user-app-v2/dist/assets/ReportView-tLoo_9HZ.css similarity index 59% rename from apps/user-app-v2/dist/assets/ReportView-DjU8BNPp.css rename to apps/user-app-v2/dist/assets/ReportView-tLoo_9HZ.css index 0751cc1..36d3c5c 100644 --- a/apps/user-app-v2/dist/assets/ReportView-DjU8BNPp.css +++ b/apps/user-app-v2/dist/assets/ReportView-tLoo_9HZ.css @@ -1 +1 @@ -.doc[data-v-21825ac9]{padding:18px 2px;background:transparent;border:none;border-bottom:1px solid var(--c-hairline)}.doc[data-v-21825ac9]:last-child{border-bottom:none}.doc__head[data-v-21825ac9]{display:flex;justify-content:space-between;gap:10px;margin-bottom:10px;font-size:13px;font-weight:600}.doc__muted[data-v-21825ac9]{color:var(--c-inkMuted);font-weight:500;margin-left:4px}.doc__rows[data-v-21825ac9]{margin:0;display:flex;flex-direction:column}.doc__row[data-v-21825ac9]{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:9px 0;border-bottom:1px dashed var(--c-hairlineSoft)}.doc__row[data-v-21825ac9]:last-child{border-bottom:none}.doc__row dt[data-v-21825ac9]{font-size:12.5px;color:var(--c-inkMuted);white-space:nowrap}.doc__row dd[data-v-21825ac9]{margin:0;font-size:13.5px;font-weight:600;text-align:left}.doc__gold[data-v-21825ac9]{display:flex;justify-content:space-between;align-items:center;margin-top:10px;padding-top:10px;border-top:1px dashed var(--c-hairline);font-size:13px;font-weight:700}.doc__stack[data-v-21825ac9]{display:flex;flex-direction:column;align-items:flex-end;gap:2px}.is-in[data-v-21825ac9]{color:var(--c-green)}.is-out[data-v-21825ac9]{color:var(--c-red)}.rep__tabs[data-v-a1c9c13f]{display:flex;gap:24px;padding:0 16px 10px}.rep__tab[data-v-a1c9c13f]{padding:8px 0;border:none;border-bottom:2px solid transparent;background:transparent;font-family:inherit;font-size:14px;font-weight:600;color:var(--c-inkFaint);cursor:pointer}.rep__tab.is-on[data-v-a1c9c13f]{color:var(--c-ink);border-bottom-color:var(--c-wine)}.rep__body[data-v-a1c9c13f]{padding-top:126px;padding-bottom:90px}.rep__list[data-v-a1c9c13f]{display:flex;flex-direction:column;padding-top:8px}.rep__card[data-v-a1c9c13f]{padding:18px 2px;background:transparent;border:none;border-bottom:1px solid var(--c-hairline)}.rep__card[data-v-a1c9c13f]:last-child{border-bottom:none}.rep__head[data-v-a1c9c13f]{display:flex;justify-content:space-between;gap:10px;margin-bottom:12px;font-size:13px;font-weight:600}.rep__muted[data-v-a1c9c13f]{color:var(--c-inkMuted);font-weight:500;margin-left:4px}.rep__pair[data-v-a1c9c13f]{display:flex;justify-content:space-between;align-items:center;padding:8px 0;font-size:13px;color:var(--c-inkMuted)}.rep__pair.is-balance[data-v-a1c9c13f]{padding-top:10px;border-top:1px dashed var(--c-hairline);color:var(--c-ink);font-weight:700}.rep__stack[data-v-a1c9c13f]{display:flex;flex-direction:column;align-items:flex-end;gap:2px;font-weight:600}.is-in[data-v-a1c9c13f]{color:var(--c-green)}.is-out[data-v-a1c9c13f]{color:var(--c-red)}.rep__more[data-v-a1c9c13f],.rep__sentinel[data-v-a1c9c13f]{padding:12px 0;text-align:center;font-size:12px;color:var(--c-inkMuted)}.rep__more[data-v-a1c9c13f]{width:100%;margin-top:6px;border:none;background:transparent;font-family:inherit;font-weight:700;color:var(--c-wine);cursor:pointer}.rep__empty[data-v-a1c9c13f]{margin-top:40px;padding:34px 20px;display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--c-inkMuted);font-size:13px}.rep__retry[data-v-a1c9c13f]{padding:8px 18px;border-radius:999px;border:1px solid var(--c-hairline);background:var(--c-canvas);font-family:inherit;font-size:12px;font-weight:600;cursor:pointer}.rep__modal[data-v-a1c9c13f]{padding:20px 16px 24px}.rep__modalEmpty[data-v-a1c9c13f]{padding:24px 0;text-align:center;font-size:13px;color:var(--c-inkMuted)}.rep__close[data-v-a1c9c13f]{margin-top:18px;width:100%;padding:14px;border:none;border-radius:999px;background:var(--c-wine);color:#fff;font-family:inherit;font-size:14px;font-weight:700;cursor:pointer} +.doc[data-v-21825ac9]{padding:18px 2px;background:transparent;border:none;border-bottom:1px solid var(--c-hairline)}.doc[data-v-21825ac9]:last-child{border-bottom:none}.doc__head[data-v-21825ac9]{display:flex;justify-content:space-between;gap:10px;margin-bottom:10px;font-size:13px;font-weight:600}.doc__muted[data-v-21825ac9]{color:var(--c-inkMuted);font-weight:500;margin-left:4px}.doc__rows[data-v-21825ac9]{margin:0;display:flex;flex-direction:column}.doc__row[data-v-21825ac9]{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:9px 0;border-bottom:1px dashed var(--c-hairlineSoft)}.doc__row[data-v-21825ac9]:last-child{border-bottom:none}.doc__row dt[data-v-21825ac9]{font-size:12.5px;color:var(--c-inkMuted);white-space:nowrap}.doc__row dd[data-v-21825ac9]{margin:0;font-size:13.5px;font-weight:600;text-align:left}.doc__gold[data-v-21825ac9]{display:flex;justify-content:space-between;align-items:center;margin-top:10px;padding-top:10px;border-top:1px dashed var(--c-hairline);font-size:13px;font-weight:700}.doc__stack[data-v-21825ac9]{display:flex;flex-direction:column;align-items:flex-end;gap:2px}.is-in[data-v-21825ac9]{color:var(--c-green)}.is-out[data-v-21825ac9]{color:var(--c-red)}.rep__tabs[data-v-24011723]{display:flex;gap:24px;padding:0 16px 10px}.rep__tab[data-v-24011723]{padding:8px 0;border:none;border-bottom:2px solid transparent;background:transparent;font-family:inherit;font-size:14px;font-weight:600;color:var(--c-inkFaint);cursor:pointer}.rep__tab.is-on[data-v-24011723]{color:var(--c-ink);border-bottom-color:var(--c-wine)}.rep__body[data-v-24011723]{padding-top:126px;padding-bottom:90px}.rep__list[data-v-24011723]{display:flex;flex-direction:column;padding-top:8px}.rep__card[data-v-24011723]{padding:18px 2px;background:transparent;border:none;border-bottom:1px solid var(--c-hairline)}.rep__card[data-v-24011723]:last-child{border-bottom:none}.rep__head[data-v-24011723]{display:flex;justify-content:space-between;gap:10px;margin-bottom:12px;font-size:13px;font-weight:600}.rep__muted[data-v-24011723]{color:var(--c-inkMuted);font-weight:500;margin-left:4px}.rep__pair[data-v-24011723]{display:flex;justify-content:space-between;align-items:center;padding:8px 0;font-size:13px;color:var(--c-inkMuted)}.rep__pair.is-balance[data-v-24011723]{padding-top:10px;border-top:1px dashed var(--c-hairline);color:var(--c-ink);font-weight:700}.rep__stack[data-v-24011723]{display:flex;flex-direction:column;align-items:flex-end;gap:2px;font-weight:600}.is-in[data-v-24011723]{color:var(--c-green)}.is-out[data-v-24011723]{color:var(--c-red)}.rep__more[data-v-24011723],.rep__sentinel[data-v-24011723]{padding:12px 0;text-align:center;font-size:12px;color:var(--c-inkMuted)}.rep__more[data-v-24011723]{width:100%;margin-top:6px;border:none;background:transparent;font-family:inherit;font-weight:700;color:var(--c-wine);cursor:pointer}.rep__empty[data-v-24011723]{margin-top:40px;padding:34px 20px;display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--c-inkMuted);font-size:13px}.rep__retry[data-v-24011723]{padding:8px 18px;border-radius:999px;border:1px solid var(--c-hairline);background:var(--c-canvas);font-family:inherit;font-size:12px;font-weight:600;cursor:pointer}.rep__modal[data-v-24011723]{padding:20px 16px 24px}.rep__modalEmpty[data-v-24011723]{padding:24px 0;text-align:center;font-size:13px;color:var(--c-inkMuted)}.rep__close[data-v-24011723]{margin-top:18px;width:100%;padding:14px;border:none;border-radius:999px;background:var(--c-wine);color:#fff;font-family:inherit;font-size:14px;font-weight:700;cursor:pointer} diff --git a/apps/user-app-v2/dist/assets/SearchInput-BZCG2e_m.js b/apps/user-app-v2/dist/assets/SearchInput-OrOd8Tqr.js similarity index 93% rename from apps/user-app-v2/dist/assets/SearchInput-BZCG2e_m.js rename to apps/user-app-v2/dist/assets/SearchInput-OrOd8Tqr.js index f257cfc..7d5dc0b 100644 --- a/apps/user-app-v2/dist/assets/SearchInput-BZCG2e_m.js +++ b/apps/user-app-v2/dist/assets/SearchInput-OrOd8Tqr.js @@ -1 +1 @@ -import{d as v,b3 as h,Q as m,f as t,c as l,p as n,I as r,w as f,b4 as b,b as x,b5 as k,e as I,K as w,g as y,_ as C}from"./index-BWyw3RAx.js";const S={class:"si"},V=["placeholder"],B=v({__name:"SearchInput",props:{placeHolder:{}},emits:["search"],setup(i,{emit:d}){const c=d,a=w({clear:!1}),e=y(void 0),s=()=>{c("search",e.value)},u=()=>{e.value=void 0,a.clear=!1,c("search",void 0)},p=h(e,700);return m(p,()=>{e?a.clear=!0:a.clear=!1,s()}),(K,o)=>(t(),l("div",S,[n(r,{icon:"vuesax-linear:search-normal-1",class:"si__icon",size:"18",onClick:s}),f(x("input",{"onUpdate:modelValue":o[0]||(o[0]=_=>e.value=_),class:"si__input",placeholder:i.placeHolder,onKeyup:k(s,["enter"])},null,40,V),[[b,e.value]]),a.clear?(t(),l("button",{key:0,type:"button",class:"si__clear","aria-label":"پاک کردن",onClick:u},[n(r,{icon:"vuesax-linear:add",size:"16"})])):I("",!0)]))}}),z=C(B,[["__scopeId","data-v-8ebd3183"]]);export{z as S}; +import{d as v,b3 as h,Q as m,f as t,c as l,p as n,I as r,w as f,b4 as b,b as x,b5 as k,e as I,K as w,g as y,_ as C}from"./index-Dp9sxvBv.js";const S={class:"si"},V=["placeholder"],B=v({__name:"SearchInput",props:{placeHolder:{}},emits:["search"],setup(i,{emit:d}){const c=d,a=w({clear:!1}),e=y(void 0),s=()=>{c("search",e.value)},u=()=>{e.value=void 0,a.clear=!1,c("search",void 0)},p=h(e,700);return m(p,()=>{e?a.clear=!0:a.clear=!1,s()}),(K,o)=>(t(),l("div",S,[n(r,{icon:"vuesax-linear:search-normal-1",class:"si__icon",size:"18",onClick:s}),f(x("input",{"onUpdate:modelValue":o[0]||(o[0]=_=>e.value=_),class:"si__input",placeholder:i.placeHolder,onKeyup:k(s,["enter"])},null,40,V),[[b,e.value]]),a.clear?(t(),l("button",{key:0,type:"button",class:"si__clear","aria-label":"پاک کردن",onClick:u},[n(r,{icon:"vuesax-linear:add",size:"16"})])):I("",!0)]))}}),z=C(B,[["__scopeId","data-v-8ebd3183"]]);export{z as S}; diff --git a/apps/user-app-v2/dist/assets/SearchView-uJ2hiU7a.js b/apps/user-app-v2/dist/assets/SearchView-DNae1fsD.js similarity index 99% rename from apps/user-app-v2/dist/assets/SearchView-uJ2hiU7a.js rename to apps/user-app-v2/dist/assets/SearchView-DNae1fsD.js index 1ba6a82..84303e2 100644 --- a/apps/user-app-v2/dist/assets/SearchView-uJ2hiU7a.js +++ b/apps/user-app-v2/dist/assets/SearchView-DNae1fsD.js @@ -1 +1 @@ -import{a1 as g,p as k,V as qe,w as Xt,l as kn,d as j,af as Yt,ap as G,g as D,Q as z,o as be,a as Ne,at as lt,h as L,ax as ke,x as ze,Y as Vn,Z as _n,ah as fe,aT as $n,T as An,aN as ut,a8 as B,aU as Dn,as as q,aV as Bn,a0 as Nn,ab as O,aG as Gt,aW as Kt,aX as ct,F as Ve,aY as _e,aZ as En,$ as xe,an as Fn,a9 as Hn,ad as Rn,aL as $e,aR as Ln,ao as qt,aa as Zt,aK as Ze,au as Qt,ag as Qe,a_ as jn,aQ as Jt,a$ as In,b0 as Wn,f as I,c as W,b as E,H as ft,N as ge,t as oe,I as Ae,i as le,_ as en,j as tn,z as K,m as te,b1 as zn,e as Oe,r as Ue,n as Un,v as Xn,J as dt,s as Yn,B as vt}from"./index-BWyw3RAx.js";import{P as Gn}from"./PageBar-D5DXU6sO.js";import{S as Kn}from"./SearchInput-BZCG2e_m.js";import{s as ne,P as pt,u as qn,a as Zn,K as ee}from"./KeyCode-CA5MXqE7.js";import{w as J}from"./raf-nDFcuFT6.js";import{_ as Qn,i as Jn,B as De,z as ei,A as ti}from"./FormItemContext-Bxnh5gKQ.js";import{P as ni}from"./ProductCard-nL92ZIkB.js";import{P as ii}from"./index-ecOSUWQv.js";function Z(i,e,t,n){if(i&&i.addEventListener){var a=n;a===void 0&&ne&&(e==="touchstart"||e==="touchmove"||e==="wheel")&&(a={passive:!1}),i.addEventListener(e,t,a)}return{remove:function(){i&&i.removeEventListener&&i.removeEventListener(e,t)}}}function se(i,e){return i?i.contains(e):!1}var nn=["moz","ms","webkit"];function ai(){var i=0;return function(e){var t=new Date().getTime(),n=Math.max(0,16-(t-i)),a=window.setTimeout(function(){e(t+n)},n);return i=t+n,a}}function oi(){if(typeof window>"u")return function(){};if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);var i=nn.filter(function(e){return"".concat(e,"RequestAnimationFrame")in window})[0];return i?window["".concat(i,"RequestAnimationFrame")]:ai()}function ri(i){if(typeof window>"u")return null;if(window.cancelAnimationFrame)return window.cancelAnimationFrame(i);var e=nn.filter(function(t){return"".concat(t,"CancelAnimationFrame")in window||"".concat(t,"CancelRequestAnimationFrame")in window})[0];return e?(window["".concat(e,"CancelAnimationFrame")]||window["".concat(e,"CancelRequestAnimationFrame")]).call(this,i):clearTimeout(i)}var ht=oi(),si=function(e){return ri(e.id)},li=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=Date.now();function a(){Date.now()-n>=t?e.call():o.id=ht(a)}var o={id:ht(a)};return o},Je={visible:Boolean,prefixCls:String,zIndex:Number,destroyPopupOnHide:Boolean,forceRender:Boolean,animation:[String,Object],transitionName:String,stretch:{type:String},align:{type:Object},point:{type:Object},getRootDomNode:{type:Function},getClassNameFromAlign:{type:Function},onMouseenter:{type:Function},onMouseleave:{type:Function},onMousedown:{type:Function},onTouchstart:{type:Function}},ui=g(g({},Je),{},{mobile:{type:Object}}),ci=g(g({},Je),{},{mask:Boolean,mobile:{type:Object},maskAnimation:String,maskTransitionName:String});function an(i){var e=i.prefixCls,t=i.animation,n=i.transitionName;return t?{name:"".concat(e,"-").concat(t)}:n?{name:n}:{}}function on(i){var e=i.prefixCls,t=i.visible,n=i.zIndex,a=i.mask,o=i.maskAnimation,r=i.maskTransitionName;if(!a)return null;var s={};return(r||o)&&(s=an({prefixCls:e,transitionName:r,animation:o})),k(qe,g({appear:!0},s),{default:function(){return[Xt(k("div",{style:{zIndex:n},class:"".concat(e,"-mask")},null),[[kn("if"),t]])]}})}on.displayName="Mask";const fi=j({compatConfig:{MODE:3},name:"MobilePopupInner",inheritAttrs:!1,props:ui,emits:["mouseenter","mouseleave","mousedown","touchstart","align"],setup:function(e,t){var n=t.expose,a=t.slots,o=D();return n({forceAlign:function(){},getElement:function(){return o.value}}),function(){var r,s=e.zIndex,l=e.visible,u=e.prefixCls,c=e.mobile,h=c===void 0?{}:c,f=h.popupClassName,p=h.popupStyle,w=h.popupMotion,M=w===void 0?{}:w,_=h.popupRender,T=g({zIndex:s},p),y=Yt((r=a.default)===null||r===void 0?void 0:r.call(a));y.length>1&&(y=k("div",{class:"".concat(u,"-content")},[y])),_&&(y=_(y));var S=G(u,f);return k(qe,g({ref:o},M),{default:function(){return[l?k("div",{class:S,style:T},[y]):null]}})}}});var mt=["measure","align",null,"motion"];const di=function(i,e){var t=D(null),n=D(),a=D(!1);function o(l){a.value||(t.value=l)}function r(){J.cancel(n.value)}function s(l){r(),n.value=J(function(){var u=t.value;switch(t.value){case"align":u="motion";break;case"motion":u="stable";break}o(u),l==null||l()})}return z(i,function(){o("measure")},{immediate:!0,flush:"post"}),be(function(){z(t,function(){switch(t.value){case"measure":e();break}t.value&&(n.value=J(Qn(lt.mark(function l(){var u,c;return lt.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:u=mt.indexOf(t.value),c=mt[u+1],c&&u!==-1&&o(c);case 3:case"end":return f.stop()}},l)}))))},{immediate:!0,flush:"post"})}),Ne(function(){a.value=!0,r()}),[t,s]},vi=function(i){var e=D({width:0,height:0});function t(a){e.value={width:a.offsetWidth,height:a.offsetHeight}}var n=L(function(){var a={};if(i.value){var o=e.value,r=o.width,s=o.height;i.value.indexOf("height")!==-1&&s?a.height="".concat(s,"px"):i.value.indexOf("minHeight")!==-1&&s&&(a.minHeight="".concat(s,"px")),i.value.indexOf("width")!==-1&&r?a.width="".concat(r,"px"):i.value.indexOf("minWidth")!==-1&&r&&(a.minWidth="".concat(r,"px"))}return a});return[n,t]};function gt(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(i,a).enumerable})),t.push.apply(t,n)}return t}function yt(i){for(var e=1;e=0&&t.left>=0&&t.bottom>t.top&&t.right>t.left?t:null}function Ei(i,e,t,n){var a=A.clone(i),o={width:e.width,height:e.height};return n.adjustX&&a.left=t.left&&a.left+o.width>t.right&&(o.width-=a.left+o.width-t.right),n.adjustX&&a.left+o.width>t.right&&(a.left=Math.max(t.right-o.width,t.left)),n.adjustY&&a.top=t.top&&a.top+o.height>t.bottom&&(o.height-=a.top+o.height-t.bottom),n.adjustY&&a.top+o.height>t.bottom&&(a.top=Math.max(t.bottom-o.height,t.top)),A.mix(a,o)}function it(i){var e,t,n;if(!A.isWindow(i)&&i.nodeType!==9)e=A.offset(i),t=A.outerWidth(i),n=A.outerHeight(i);else{var a=A.getWindow(i);e={left:A.getWindowScrollLeft(a),top:A.getWindowScrollTop(a)},t=A.viewportWidth(a),n=A.viewportHeight(a)}return e.width=t,e.height=n,e}function Mt(i,e){var t=e.charAt(0),n=e.charAt(1),a=i.width,o=i.height,r=i.left,s=i.top;return t==="c"?s+=o/2:t==="b"&&(s+=o),n==="c"?r+=a/2:n==="r"&&(r+=a),{left:r,top:s}}function Te(i,e,t,n,a){var o=Mt(e,t[1]),r=Mt(i,t[0]),s=[r.left-o.left,r.top-o.top];return{left:Math.round(i.left-s[0]+n[0]-a[0]),top:Math.round(i.top-s[1]+n[1]-a[1])}}function Ot(i,e,t){return i.leftt.right}function kt(i,e,t){return i.topt.bottom}function Fi(i,e,t){return i.left>t.right||i.left+e.widtht.bottom||i.top+e.height=t.right||n.top>=t.bottom}function at(i,e,t){var n=t.target||e,a=it(n),o=!Ri(n,t.overflow&&t.overflow.alwaysByViewport);return vn(i,a,t,o)}at.__getOffsetParent=Ke;at.__getVisibleRectForElement=nt;function Li(i,e,t){var n,a,o=A.getDocument(i),r=o.defaultView||o.parentWindow,s=A.getWindowScrollLeft(r),l=A.getWindowScrollTop(r),u=A.viewportWidth(r),c=A.viewportHeight(r);"pageX"in e?n=e.pageX:n=s+e.clientX,"pageY"in e?a=e.pageY:a=l+e.clientY;var h={left:n,top:a,width:0,height:0},f=n>=0&&n<=s+u&&a>=0&&a<=l+c,p=[t.points[0],"cc"];return vn(i,h,yt(yt({},t),{},{points:p}),f)}const ji=function(i){if(!i)return!1;if(i.offsetParent)return!0;if(i.getBBox){var e=i.getBBox();if(e.width||e.height)return!0}if(i.getBoundingClientRect){var t=i.getBoundingClientRect();if(t.width||t.height)return!0}return!1};function Ii(i,e){return i===e?!0:!i||!e?!1:"pageX"in e&&"pageY"in e?i.pageX===e.pageX&&i.pageY===e.pageY:"clientX"in e&&"clientY"in e?i.clientX===e.clientX&&i.clientY===e.clientY:!1}function Wi(i,e){i!==document.activeElement&&se(e,i)&&typeof i.focus=="function"&&i.focus()}function $t(i,e){var t=null,n=null;function a(r){var s=ke(r,1),l=s[0].target;if(document.documentElement.contains(l)){var u=l.getBoundingClientRect(),c=u.width,h=u.height,f=Math.floor(c),p=Math.floor(h);(t!==f||n!==p)&&Promise.resolve().then(function(){e({width:f,height:p})}),t=f,n=p}}var o=new Jn(a);return i&&o.observe(i),function(){o.disconnect()}}const zi=function(i,e){var t=!1,n=null;function a(){clearTimeout(n)}function o(r){if(!t||r===!0){if(i()===!1)return;t=!0,a(),n=setTimeout(function(){t=!1},e.value)}else a(),n=setTimeout(function(){t=!1,o()},e.value)}return[o,function(){t=!1,a()}]};var Ui={align:Object,target:[Object,Function],onAlign:Function,monitorBufferTime:Number,monitorWindowResize:Boolean,disabled:Boolean};function At(i){return typeof i!="function"?null:i()}function Dt(i){return fe(i)!=="object"||!i?null:i}const Xi=j({compatConfig:{MODE:3},name:"Align",props:Ui,emits:["align"],setup:function(e,t){var n=t.expose,a=t.slots,o=D({}),r=D(),s=zi(function(){var M=e.disabled,_=e.target,T=e.align,y=e.onAlign;if(!M&&_&&r.value){var S=r.value,C,d=At(_),m=Dt(_);o.value.element=d,o.value.point=m,o.value.align=T;var x=document,b=x.activeElement;return d&&ji(d)?C=at(S,d,T):m&&(C=Li(S,m,T)),Wi(b,S),y&&C&&y(S,C),!0}return!1},L(function(){return e.monitorBufferTime})),l=ke(s,2),u=l[0],c=l[1],h=D({cancel:function(){}}),f=D({cancel:function(){}}),p=function(){var _=e.target,T=At(_),y=Dt(_);r.value!==f.value.element&&(f.value.cancel(),f.value.element=r.value,f.value.cancel=$t(r.value,u)),(o.value.element!==T||!Ii(o.value.point,y)||!ei(o.value.align,e.align))&&(u(),h.value.element!==T&&(h.value.cancel(),h.value.element=T,h.value.cancel=$t(T,u)))};be(function(){ze(function(){p()})}),Vn(function(){ze(function(){p()})}),z(function(){return e.disabled},function(M){M?c():u()},{immediate:!0,flush:"post"});var w=D(null);return z(function(){return e.monitorWindowResize},function(M){M?w.value||(w.value=Z(window,"resize",u)):w.value&&(w.value.remove(),w.value=null)},{flush:"post"}),_n(function(){h.value.cancel(),f.value.cancel(),w.value&&w.value.remove(),c()}),n({forceAlign:function(){return u(!0)}}),function(){var M=a==null?void 0:a.default();return M?De(M[0],{ref:r},!0,!0):null}}}),Yi=j({compatConfig:{MODE:3},name:"PopupInner",inheritAttrs:!1,props:Je,emits:["mouseenter","mouseleave","mousedown","touchstart","align"],setup:function(e,t){var n=t.expose,a=t.attrs,o=t.slots,r=D(),s=D(),l=D(),u=vi(Dn(e,"stretch")),c=ke(u,2),h=c[0],f=c[1],p=function(){e.stretch&&f(e.getRootDomNode())},w=D(!1),M;z(function(){return e.visible},function(v){clearTimeout(M),v?M=setTimeout(function(){w.value=e.visible}):w.value=!1},{immediate:!0});var _=di(w,p),T=ke(_,2),y=T[0],S=T[1],C=D(),d=function(){return e.point?e.point:e.getRootDomNode},m=function(){var $;($=r.value)===null||$===void 0||$.forceAlign()},x=function($,N){var H=e.getClassNameFromAlign(N),R=l.value;if(l.value!==H&&(l.value=H),y.value==="align"){var F;R!==H?Promise.resolve().then(function(){m()}):S(function(){var U;(U=C.value)===null||U===void 0||U.call(C)}),(F=e.onAlign)===null||F===void 0||F.call(e,$,N)}},b=L(function(){var v=fe(e.animation)==="object"?e.animation:an(e);return["onAfterEnter","onAfterLeave"].forEach(function($){var N=v[$];v[$]=function(H){S(),y.value="stable",N==null||N(H)}}),v}),V=function(){return new Promise(function($){C.value=$})};z([b,y],function(){!b.value&&y.value==="motion"&&S()},{immediate:!0}),n({forceAlign:m,getElement:function(){return s.value.$el||s.value}});var P=L(function(){var v;return!((v=e.align)!==null&&v!==void 0&&v.points&&(y.value==="align"||y.value==="stable"))});return function(){var v,$=e.zIndex,N=e.align,H=e.prefixCls,R=e.destroyPopupOnHide,F=e.onMouseenter,U=e.onMouseleave,re=e.onTouchstart,de=re===void 0?function(){}:re,st=e.onMousedown,ve=y.value,Tn=[g(g({},h.value),{},{zIndex:$,opacity:ve==="motion"||ve==="stable"||!w.value?null:0,pointerEvents:!w.value&&ve!=="stable"?"none":null}),a.style],Ce=Yt((v=o.default)===null||v===void 0?void 0:v.call(o,{visible:e.visible}));Ce.length>1&&(Ce=k("div",{class:"".concat(H,"-content")},[Ce]));var Sn=G(H,a.class,l.value),Mn=w.value||!e.visible,On=Mn?$n(b.value.name,b.value):{};return k(qe,g(g({ref:s},On),{},{onBeforeEnter:V}),{default:function(){return!R||e.visible?Xt(k(Xi,{target:d(),key:"popup",ref:r,monitorWindowResize:!0,disabled:P.value,align:N,onAlign:x},{default:function(){return k("div",g(g({class:Sn,onMouseenter:F,onMouseleave:U,onMousedown:ut(st,["capture"])},B({},ne?"onTouchstartPassive":"onTouchstart",ut(de,["capture"]))),{},{style:Tn}),[Ce])}}),[[An,w.value]]):null}})}}}),Gi=j({compatConfig:{MODE:3},name:"Popup",inheritAttrs:!1,props:ci,setup:function(e,t){var n=t.attrs,a=t.slots,o=t.expose,r=D(!1),s=D(!1),l=D();return z([function(){return e.visible},function(){return e.mobile}],function(){r.value=e.visible,e.visible&&e.mobile&&(s.value=!0)},{immediate:!0,flush:"post"}),o({forceAlign:function(){var c;(c=l.value)===null||c===void 0||c.forceAlign()},getElement:function(){var c;return(c=l.value)===null||c===void 0?void 0:c.getElement()}}),function(){var u=g(g(g({},e),n),{},{visible:r.value}),c=s.value?k(fi,g(g({},u),{},{mobile:e.mobile,ref:l}),{default:a.default}):k(Yi,g(g({},u),{},{ref:l}),{default:a.default});return k("div",null,[k(on,u,null),c])}}});function Ki(i,e,t){return t?i[0]===e[0]:i[0]===e[0]&&i[1]===e[1]}function Bt(i,e,t){var n=i[e]||{};return g(g({},n),t)}function qi(i,e,t,n){for(var a=t.points,o=Object.keys(i),r=0;r0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=typeof e=="function"?e(this.$data,this.$props):e;if(this.getDerivedStateFromProps){var a=this.getDerivedStateFromProps(Bn(this),g(g({},this.$data),n));if(a===null)return;n=g(g({},n),a||{})}Nn(this.$data,n),this._.isMounted&&this.$forceUpdate(),ze(function(){t&&t()})},__emit:function(){var e=[].slice.call(arguments,0),t=e[0];t="on".concat(t[0].toUpperCase()).concat(t.substring(1));var n=this.$props[t]||this.$attrs[t];if(e.length&&n)if(Array.isArray(n))for(var a=0,o=n.length;a0&&arguments[0]!==void 0?arguments[0]:[],e=0,t=i.length;e=0||V.indexOf("Bottom")>=0?v.top="".concat(P.height-x.offset[1],"px"):(V.indexOf("Top")>=0||V.indexOf("bottom")>=0)&&(v.top="".concat(-x.offset[1],"px")),V.indexOf("left")>=0||V.indexOf("Right")>=0?v.left="".concat(P.width-x.offset[0],"px"):(V.indexOf("right")>=0||V.indexOf("Left")>=0)&&(v.left="".concat(-x.offset[0],"px")),m.style.transformOrigin="".concat(v.left," ").concat(v.top)}};return function(){var d,m,x,b=e.openClassName,V=e.color,P=e.overlayClassName,v=(d=Gt((m=n.default)===null||m===void 0?void 0:m.call(n)))!==null&&d!==void 0?d:null;v=v.length===1?v[0]:v;var $=c.value;if(e.visible===void 0&&p()&&($=!1),!v)return null;var N=y(Qt(v)?v:k("span",null,[v])),H=G((x={},B(x,b||"".concat(l.value,"-open"),!0),B(x,N.props&&N.props.class,N.props&&N.props.class),x)),R=G(P,B({},"".concat(l.value,"-").concat(V),V&&Rt.test(V))),F,U;V&&!Rt.test(V)&&(F={backgroundColor:V},U={backgroundColor:V});var re=g(g(g({},o),e),{},{prefixCls:l.value,getPopupContainer:u.value,builtinPlacements:_.value,visible:$,ref:h,overlayClassName:R,overlayInnerStyle:F,onVisibleChange:w,onPopupAlign:C});return k(aa,re,{default:function(){return[c.value?De(N,{class:H}):N]},arrowContent:function(){return k("span",{class:"".concat(l.value,"-arrow-content"),style:U},null)},overlay:S})}}}),va=Jt(da);var ot=function(e,t){var n,a,o=t.attrs,r=o.included,s=o.vertical,l=o.style,u=o.class,c=o.length,h=o.offset,f=o.reverse;c<0&&(f=!f,c=Math.abs(c),h=100-h);var p=s?(n={},B(n,f?"top":"bottom","".concat(h,"%")),B(n,f?"bottom":"top","auto"),B(n,"height","".concat(c,"%")),n):(a={},B(a,f?"right":"left","".concat(h,"%")),B(a,f?"left":"right","auto"),B(a,"width","".concat(c,"%")),a),w=g(g({},l),p);return r?k("div",{class:u,style:w},null):null};ot.inheritAttrs=!1;var pa=function(e,t,n,a,o,r){Ze(n?a>0:!0,"Slider","`Slider[step]` should be a positive number in order to make Slider[dots] work.");var s=Object.keys(t).map(parseFloat).sort(function(u,c){return u-c});if(n&&a)for(var l=o;l<=r;l+=a)s.indexOf(l)===-1&&s.push(l);return s},mn=function(e,t){var n=t.attrs,a=n.prefixCls,o=n.vertical,r=n.reverse,s=n.marks,l=n.dots,u=n.step,c=n.included,h=n.lowerBound,f=n.upperBound,p=n.max,w=n.min,M=n.dotStyle,_=n.activeDotStyle,T=p-w,y=pa(o,s,l,u,w,p).map(function(S){var C,d="".concat(Math.abs(S-w)/T*100,"%"),m=!c&&S===f||c&&S<=f&&S>=h,x=o?g(g({},M),{},B({},r?"top":"bottom",d)):g(g({},M),{},B({},r?"right":"left",d));m&&(x=g(g({},x),_));var b=G((C={},B(C,"".concat(a,"-dot"),!0),B(C,"".concat(a,"-dot-active"),m),B(C,"".concat(a,"-dot-reverse"),r),C));return k("span",{class:b,style:x,key:S},null)});return k("div",{class:"".concat(a,"-step")},[y])};mn.inheritAttrs=!1;var gn=function(e,t){var n=t.attrs,a=t.slots,o=n.class,r=n.vertical,s=n.reverse,l=n.marks,u=n.included,c=n.upperBound,h=n.lowerBound,f=n.max,p=n.min,w=n.onClickLabel,M=Object.keys(l),_=a.mark,T=f-p,y=M.map(parseFloat).sort(function(S,C){return S-C}).map(function(S){var C,d=typeof l[S]=="function"?l[S]():l[S],m=fe(d)==="object"&&!Qt(d),x=m?d.label:d;if(!x&&x!==0)return null;_&&(x=_({point:S,label:x}));var b=!u&&S===c||u&&S<=c&&S>=h,V=G((C={},B(C,"".concat(o,"-text"),!0),B(C,"".concat(o,"-text-active"),b),C)),P=B({marginBottom:"-50%"},s?"top":"bottom","".concat((S-p)/T*100,"%")),v=B({transform:"translateX(".concat(s?"50%":"-50%",")"),msTransform:"translateX(".concat(s?"50%":"-50%",")")},s?"right":"left","".concat((S-p)/T*100,"%")),$=r?P:v,N=m?g(g({},$),d.style):$,H=B({},ne?"onTouchstartPassive":"onTouchstart",function(R){return w(R,S)});return k("span",g({class:V,style:N,key:S,onMousedown:function(F){return w(F,S)}},H),[x])});return k("div",{class:o},[y])};gn.inheritAttrs=!1;const yn=j({compatConfig:{MODE:3},name:"Handle",inheritAttrs:!1,props:{prefixCls:String,vertical:{type:Boolean,default:void 0},offset:Number,disabled:{type:Boolean,default:void 0},min:Number,max:Number,value:Number,tabindex:O.oneOfType([O.number,O.string]),reverse:{type:Boolean,default:void 0},ariaLabel:String,ariaLabelledBy:String,ariaValueTextFormatter:Function,onMouseenter:{type:Function},onMouseleave:{type:Function},onMousedown:{type:Function}},setup:function(e,t){var n=t.attrs,a=t.emit,o=t.expose,r=D(!1),s=D(),l=function(){document.activeElement===s.value&&(r.value=!0)},u=function(y){r.value=!1,a("blur",y)},c=function(){r.value=!1},h=function(){var y;(y=s.value)===null||y===void 0||y.focus()},f=function(){var y;(y=s.value)===null||y===void 0||y.blur()},p=function(){r.value=!0,h()},w=function(y){y.preventDefault(),h(),a("mousedown",y)};o({focus:h,blur:f,clickFocus:p,ref:s});var M=null;be(function(){M=Z(document,"mouseup",l)}),Ne(function(){var T;(T=M)===null||T===void 0||T.remove()});var _=L(function(){var T,y,S=e.vertical,C=e.offset,d=e.reverse;return S?(T={},B(T,d?"top":"bottom","".concat(C,"%")),B(T,d?"bottom":"top","auto"),B(T,"transform",d?null:"translateY(+50%)"),T):(y={},B(y,d?"right":"left","".concat(C,"%")),B(y,d?"left":"right","auto"),B(y,"transform","translateX(".concat(d?"+":"-","50%)")),y)});return function(){var T=e.prefixCls,y=e.disabled,S=e.min,C=e.max,d=e.value,m=e.tabindex,x=e.ariaLabel,b=e.ariaLabelledBy,V=e.ariaValueTextFormatter,P=e.onMouseenter,v=e.onMouseleave,$=G(n.class,B({},"".concat(T,"-handle-click-focused"),r.value)),N={"aria-valuemin":S,"aria-valuemax":C,"aria-valuenow":d,"aria-disabled":!!y},H=[n.style,_.value],R=m||0;(y||m===null)&&(R=null);var F;V&&(F=V(d));var U=g(g(g({},n),{},{role:"slider",tabindex:R},N),{},{class:$,onBlur:u,onKeydown:c,onMousedown:w,onMouseenter:P,onMouseleave:v,ref:s,style:H});return k("div",g(g({},U),{},{"aria-label":x,"aria-labelledby":b,"aria-valuetext":F}),null)}}});function Ie(i,e){try{return Object.keys(e).some(function(t){return i.target===e[t].ref})}catch{return!1}}function bn(i,e){var t=e.min,n=e.max;return in}function Lt(i){return i.touches.length>1||i.type.toLowerCase()==="touchend"&&i.touches.length>0}function jt(i,e){var t=e.marks,n=e.step,a=e.min,o=e.max,r=Object.keys(t).map(parseFloat);if(n!==null){var s=Math.pow(10,wn(n)),l=Math.floor((o*s-a*s)/(n*s)),u=Math.min((i-a)/n,l),c=Math.round(u)*n+a;r.push(c)}var h=r.map(function(f){return Math.abs(i-f)});return r[h.indexOf(Math.min.apply(Math,q(h)))]}function wn(i){var e=i.toString(),t=0;return e.indexOf(".")>=0&&(t=e.length-e.indexOf(".")-1),t}function It(i,e){var t=1;return window.visualViewport&&(t=+(window.visualViewport.width/document.body.getBoundingClientRect().width).toFixed(2)),(i?e.clientY:e.pageX)/t}function Wt(i,e){var t=1;return window.visualViewport&&(t=+(window.visualViewport.width/document.body.getBoundingClientRect().width).toFixed(2)),(i?e.touches[0].clientY:e.touches[0].pageX)/t}function zt(i,e){var t=e.getBoundingClientRect();return i?t.top+t.height*.5:window.pageXOffset+t.left+t.width*.5}function rt(i,e){var t=e.max,n=e.min;return i<=n?n:i>=t?t:i}function Cn(i,e){var t=e.step,n=isFinite(jt(i,e))?jt(i,e):0;return t===null?n:parseFloat(n.toFixed(wn(t)))}function ce(i){i.stopPropagation(),i.preventDefault()}function ha(i,e,t){var n={increase:function(s,l){return s+l},decrease:function(s,l){return s-l}},a=n[i](Object.keys(t.marks).indexOf(JSON.stringify(e)),1),o=Object.keys(t.marks)[a];return t.step?n[i](e,t.step):Object.keys(t.marks).length&&t.marks[o]?t.marks[o]:e}function xn(i,e,t){var n="increase",a="decrease",o=n;switch(i.keyCode){case ee.UP:o=e&&t?a:n;break;case ee.RIGHT:o=!e&&t?a:n;break;case ee.DOWN:o=e&&t?n:a;break;case ee.LEFT:o=!e&&t?n:a;break;case ee.END:return function(r,s){return s.max};case ee.HOME:return function(r,s){return s.min};case ee.PAGE_UP:return function(r,s){return r+s.step*2};case ee.PAGE_DOWN:return function(r,s){return r-s.step*2};default:return}return function(r,s){return ha(o,r,s)}}var ma=["index","directives","className","style"];function ae(){}function Pn(i){var e={id:String,min:Number,max:Number,step:Number,marks:O.object,included:{type:Boolean,default:void 0},prefixCls:String,disabled:{type:Boolean,default:void 0},handle:Function,dots:{type:Boolean,default:void 0},vertical:{type:Boolean,default:void 0},reverse:{type:Boolean,default:void 0},minimumTrackStyle:O.object,maximumTrackStyle:O.object,handleStyle:O.oneOfType([O.object,O.arrayOf(O.object)]),trackStyle:O.oneOfType([O.object,O.arrayOf(O.object)]),railStyle:O.object,dotStyle:O.object,activeDotStyle:O.object,autofocus:{type:Boolean,default:void 0},draggableTrack:{type:Boolean,default:void 0}};return j({compatConfig:{MODE:3},name:"CreateSlider",mixins:[Fe,i],inheritAttrs:!1,slots:["mark"],props:Qe(e,{prefixCls:"rc-slider",min:0,max:100,step:1,marks:{},included:!0,disabled:!1,dots:!1,vertical:!1,reverse:!1,trackStyle:[{}],handleStyle:[{}],railStyle:{},dotStyle:{},activeDotStyle:{}}),emits:["change","blur","focus"],data:function(){var n=this.step,a=this.max,o=this.min,r=isFinite(a-o)?(a-o)%n===0:!0;return Ze(n&&Math.floor(n)===n?r:!0,"Slider[max] - Slider[min] (".concat(a-o,") should be a multiple of Slider[step] (").concat(n,")")),this.handlesRefs={},{}},mounted:function(){var n=this;this.$nextTick(function(){n.document=n.sliderRef&&n.sliderRef.ownerDocument;var a=n.autofocus,o=n.disabled;a&&!o&&n.focus()})},beforeUnmount:function(){var n=this;this.$nextTick(function(){n.removeDocumentEvents()})},methods:{defaultHandle:function(n){var a=n.index;n.directives;var o=n.className,r=n.style,s=$e(n,ma);if(delete s.dragging,s.value===null)return null;var l=g(g({},s),{},{class:o,style:r,key:a});return k(yn,l,null)},onDown:function(n,a){var o=a,r=this.$props,s=r.draggableTrack,l=r.vertical,u=this.$data.bounds,c=s&&this.positionGetValue?this.positionGetValue(o)||[]:[],h=Ie(n,this.handlesRefs);if(this.dragTrack=s&&u.length>=2&&!h&&!c.map(function(p,w){var M=w?!0:p>=u[w];return w===c.length-1?p<=u[w]:M}).some(function(p){return!p}),this.dragTrack)this.dragOffset=o,this.startBounds=q(u);else{if(!h)this.dragOffset=0;else{var f=zt(l,n.target);this.dragOffset=o-f,o=f}this.onStart(o)}},onMouseDown:function(n){if(n.button===0){this.removeDocumentEvents();var a=this.$props.vertical,o=It(a,n);this.onDown(n,o),this.addDocumentMouseEvents()}},onTouchStart:function(n){if(!Lt(n)){var a=this.vertical,o=Wt(a,n);this.onDown(n,o),this.addDocumentTouchEvents(),ce(n)}},onFocus:function(n){var a=this.vertical;if(Ie(n,this.handlesRefs)&&!this.dragTrack){var o=zt(a,n.target);this.dragOffset=0,this.onStart(o),ce(n),this.$emit("focus",n)}},onBlur:function(n){this.dragTrack||this.onEnd(),this.$emit("blur",n)},onMouseUp:function(){this.handlesRefs[this.prevMovedHandleIndex]&&this.handlesRefs[this.prevMovedHandleIndex].clickFocus()},onMouseMove:function(n){if(!this.sliderRef){this.onEnd();return}var a=It(this.vertical,n);this.onMove(n,a-this.dragOffset,this.dragTrack,this.startBounds)},onTouchMove:function(n){if(Lt(n)||!this.sliderRef){this.onEnd();return}var a=Wt(this.vertical,n);this.onMove(n,a-this.dragOffset,this.dragTrack,this.startBounds)},onKeyDown:function(n){this.sliderRef&&Ie(n,this.handlesRefs)&&this.onKeyboard(n)},onClickMarkLabel:function(n,a){var o=this;n.stopPropagation(),this.onChange({sValue:a}),this.setState({sValue:a},function(){return o.onEnd(!0)})},getSliderStart:function(){var n=this.sliderRef,a=this.vertical,o=this.reverse,r=n.getBoundingClientRect();return a?o?r.bottom:r.top:window.pageXOffset+(o?r.right:r.left)},getSliderLength:function(){var n=this.sliderRef;if(!n)return 0;var a=n.getBoundingClientRect();return this.vertical?a.height:a.width},addDocumentTouchEvents:function(){this.onTouchMoveListener=Z(this.document,"touchmove",this.onTouchMove),this.onTouchUpListener=Z(this.document,"touchend",this.onEnd)},addDocumentMouseEvents:function(){this.onMouseMoveListener=Z(this.document,"mousemove",this.onMouseMove),this.onMouseUpListener=Z(this.document,"mouseup",this.onEnd)},removeDocumentEvents:function(){this.onTouchMoveListener&&this.onTouchMoveListener.remove(),this.onTouchUpListener&&this.onTouchUpListener.remove(),this.onMouseMoveListener&&this.onMouseMoveListener.remove(),this.onMouseUpListener&&this.onMouseUpListener.remove()},focus:function(){var n;this.$props.disabled||(n=this.handlesRefs[0])===null||n===void 0||n.focus()},blur:function(){var n=this;this.$props.disabled||Object.keys(this.handlesRefs).forEach(function(a){var o,r;(o=n.handlesRefs[a])===null||o===void 0||(r=o.blur)===null||r===void 0||r.call(o)})},calcValue:function(n){var a=this.vertical,o=this.min,r=this.max,s=Math.abs(Math.max(n,0)/this.getSliderLength()),l=a?(1-s)*(r-o)+o:s*(r-o)+o;return l},calcValueByPos:function(n){var a=this.reverse?-1:1,o=a*(n-this.getSliderStart()),r=this.trimAlignValue(this.calcValue(o));return r},calcOffset:function(n){var a=this.min,o=this.max,r=(n-a)/(o-a);return Math.max(0,r*100)},saveSlider:function(n){this.sliderRef=n},saveHandle:function(n,a){this.handlesRefs[n]=a}},render:function(){var n,a=this.prefixCls,o=this.marks,r=this.dots,s=this.step,l=this.included,u=this.disabled,c=this.vertical,h=this.reverse,f=this.min,p=this.max,w=this.maximumTrackStyle,M=this.railStyle,_=this.dotStyle,T=this.activeDotStyle,y=this.id,S=this.$attrs,C=S.class,d=S.style,m=this.renderSlider(),x=m.tracks,b=m.handles,V=G(a,C,(n={},B(n,"".concat(a,"-with-marks"),Object.keys(o).length),B(n,"".concat(a,"-disabled"),u),B(n,"".concat(a,"-vertical"),c),n)),P={vertical:c,marks:o,included:l,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:p,min:f,reverse:h,class:"".concat(a,"-mark"),onClickLabel:u?ae:this.onClickMarkLabel},v=B({},ne?"onTouchstartPassive":"onTouchstart",u?ae:this.onTouchStart);return k("div",g(g({id:y,ref:this.saveSlider,tabindex:"-1",class:V},v),{},{onMousedown:u?ae:this.onMouseDown,onMouseup:u?ae:this.onMouseUp,onKeydown:u?ae:this.onKeyDown,onFocus:u?ae:this.onFocus,onBlur:u?ae:this.onBlur,style:d}),[k("div",{class:"".concat(a,"-rail"),style:g(g({},w),M)},null),x,k(mn,{prefixCls:a,vertical:c,reverse:h,marks:o,dots:r,step:s,included:l,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:p,min:f,dotStyle:_,activeDotStyle:T},null),b,k(gn,P,{mark:this.$slots.mark}),Kt(this)])}})}var ga=j({compatConfig:{MODE:3},name:"Slider",mixins:[Fe],inheritAttrs:!1,props:{defaultValue:Number,value:Number,disabled:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},tabindex:O.oneOfType([O.number,O.string]),reverse:{type:Boolean,default:void 0},min:Number,max:Number,ariaLabelForHandle:String,ariaLabelledByForHandle:String,ariaValueTextFormatterForHandle:String,startPoint:Number},emits:["beforeChange","afterChange","change"],data:function(){var e=this.defaultValue!==void 0?this.defaultValue:this.min,t=this.value!==void 0?this.value:e;return{sValue:this.trimAlignValue(t),dragging:!1}},watch:{value:{handler:function(e){this.setChangeValue(e)},deep:!0},min:function(){var e=this.sValue;this.setChangeValue(e)},max:function(){var e=this.sValue;this.setChangeValue(e)}},methods:{setChangeValue:function(e){var t=e!==void 0?e:this.sValue,n=this.trimAlignValue(t,this.$props);n!==this.sValue&&(this.setState({sValue:n}),bn(t,this.$props)&&this.$emit("change",n))},onChange:function(e){var t=!_e(this,"value"),n=e.sValue>this.max?g(g({},e),{},{sValue:this.max}):e;t&&this.setState(n);var a=n.sValue;this.$emit("change",a)},onStart:function(e){this.setState({dragging:!0});var t=this.sValue;this.$emit("beforeChange",t);var n=this.calcValueByPos(e);this.startValue=n,this.startPosition=e,n!==t&&(this.prevMovedHandleIndex=0,this.onChange({sValue:n}))},onEnd:function(e){var t=this.dragging;this.removeDocumentEvents(),(t||e)&&this.$emit("afterChange",this.sValue),this.setState({dragging:!1})},onMove:function(e,t){ce(e);var n=this.sValue,a=this.calcValueByPos(t);a!==n&&this.onChange({sValue:a})},onKeyboard:function(e){var t=this.$props,n=t.reverse,a=t.vertical,o=xn(e,a,n);if(o){ce(e);var r=this.sValue,s=o(r,this.$props),l=this.trimAlignValue(s);if(l===r)return;this.onChange({sValue:l}),this.$emit("afterChange",l),this.onEnd()}},getLowerBound:function(){var e=this.$props.startPoint||this.$props.min;return this.$data.sValue>e?e:this.$data.sValue},getUpperBound:function(){return this.$data.sValue1&&arguments[1]!==void 0?arguments[1]:{};if(e===null)return null;var n=g(g({},this.$props),t),a=rt(e,n);return Cn(a,n)},getTrack:function(e){var t=e.prefixCls,n=e.reverse,a=e.vertical,o=e.included,r=e.minimumTrackStyle,s=e.mergedTrackStyle,l=e.length,u=e.offset;return k(ot,{class:"".concat(t,"-track"),vertical:a,included:o,offset:u,reverse:n,length:l,style:g(g({},r),s)},null)},renderSlider:function(){var e=this,t=this.prefixCls,n=this.vertical,a=this.included,o=this.disabled,r=this.minimumTrackStyle,s=this.trackStyle,l=this.handleStyle,u=this.tabindex,c=this.ariaLabelForHandle,h=this.ariaLabelledByForHandle,f=this.ariaValueTextFormatterForHandle,p=this.min,w=this.max,M=this.startPoint,_=this.reverse,T=this.handle,y=this.defaultHandle,S=T||y,C=this.sValue,d=this.dragging,m=this.calcOffset(C),x=S({class:"".concat(t,"-handle"),prefixCls:t,vertical:n,offset:m,value:C,dragging:d,disabled:o,min:p,max:w,reverse:_,index:0,tabindex:u,ariaLabel:c,ariaLabelledBy:h,ariaValueTextFormatter:f,style:l[0]||l,ref:function(v){return e.saveHandle(0,v)},onFocus:this.onFocus,onBlur:this.onBlur}),b=M!==void 0?this.calcOffset(M):0,V=s[0]||s;return{tracks:this.getTrack({prefixCls:t,reverse:_,vertical:n,included:a,offset:b,minimumTrackStyle:r,mergedTrackStyle:V,length:m-b}),handles:x}}}});const ya=Pn(ga);var he=function(e){var t=e.value,n=e.handle,a=e.bounds,o=e.props,r=o.allowCross,s=o.pushable,l=Number(s),u=rt(t,o),c=u;return!r&&n!=null&&a!==void 0&&(n>0&&u<=a[n-1]+l&&(c=a[n-1]+l),n=a[n+1]-l&&(c=a[n+1]-l)),Cn(c,o)},ba={defaultValue:O.arrayOf(O.number),value:O.arrayOf(O.number),count:Number,pushable:In(O.oneOfType([O.looseBool,O.number])),allowCross:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},reverse:{type:Boolean,default:void 0},tabindex:O.arrayOf(O.number),prefixCls:String,min:Number,max:Number,autofocus:{type:Boolean,default:void 0},ariaLabelGroupForHandles:Array,ariaLabelledByGroupForHandles:Array,ariaValueTextFormatterGroupForHandles:Array,draggableTrack:{type:Boolean,default:void 0}},wa=j({compatConfig:{MODE:3},name:"Range",mixins:[Fe],inheritAttrs:!1,props:Qe(ba,{count:1,allowCross:!0,pushable:!1,tabindex:[],draggableTrack:!1,ariaLabelGroupForHandles:[],ariaLabelledByGroupForHandles:[],ariaValueTextFormatterGroupForHandles:[]}),emits:["beforeChange","afterChange","change"],displayName:"Range",data:function(){var e=this,t=this.count,n=this.min,a=this.max,o=Array.apply(void 0,q(Array(t+1))).map(function(){return n}),r=_e(this,"defaultValue")?this.defaultValue:o,s=this.value;s===void 0&&(s=r);var l=s.map(function(c,h){return he({value:c,handle:h,props:e.$props})}),u=l[0]===a?0:l.length-1;return{sHandle:null,recent:u,bounds:l}},watch:{value:{handler:function(e){var t=this.bounds;this.setChangeValue(e||t)},deep:!0},min:function(){var e=this.value;this.setChangeValue(e||this.bounds)},max:function(){var e=this.value;this.setChangeValue(e||this.bounds)}},methods:{setChangeValue:function(e){var t=this,n=this.bounds,a=e.map(function(r,s){return he({value:r,handle:s,bounds:n,props:t.$props})});if(n.length===a.length){if(a.every(function(r,s){return r===n[s]}))return null}else a=e.map(function(r,s){return he({value:r,handle:s,props:t.$props})});if(this.setState({bounds:a}),e.some(function(r){return bn(r,t.$props)})){var o=e.map(function(r){return rt(r,t.$props)});this.$emit("change",o)}},onChange:function(e){var t=!_e(this,"value");if(t)this.setState(e);else{var n={};["sHandle","recent"].forEach(function(r){e[r]!==void 0&&(n[r]=e[r])}),Object.keys(n).length&&this.setState(n)}var a=g(g({},this.$data),e),o=a.bounds;this.$emit("change",o)},positionGetValue:function(e){var t=this.getValue(),n=this.calcValueByPos(e),a=this.getClosestBound(n),o=this.getBoundNeedMoving(n,a),r=t[o];if(n===r)return null;var s=q(t);return s[o]=n,s},onStart:function(e){var t=this.bounds;this.$emit("beforeChange",t);var n=this.calcValueByPos(e);this.startValue=n,this.startPosition=e;var a=this.getClosestBound(n);this.prevMovedHandleIndex=this.getBoundNeedMoving(n,a),this.setState({sHandle:this.prevMovedHandleIndex,recent:this.prevMovedHandleIndex});var o=t[this.prevMovedHandleIndex];if(n!==o){var r=q(t);r[this.prevMovedHandleIndex]=n,this.onChange({bounds:r})}},onEnd:function(e){var t=this.sHandle;this.removeDocumentEvents(),t||(this.dragTrack=!1),(t!==null||e)&&this.$emit("afterChange",this.bounds),this.setState({sHandle:null})},onMove:function(e,t,n,a){ce(e);var o=this.$data,r=this.$props,s=r.max||100,l=r.min||0;if(n){var u=r.vertical?-t:t;u=r.reverse?-u:u;var c=s-Math.max.apply(Math,q(a)),h=l-Math.min.apply(Math,q(a)),f=Math.min(Math.max(u/(this.getSliderLength()/100),h),c),p=a.map(function(y){return Math.floor(Math.max(Math.min(y+f,s),l))});o.bounds.map(function(y,S){return y===p[S]}).some(function(y){return!y})&&this.onChange({bounds:p});return}var w=this.bounds,M=this.sHandle,_=this.calcValueByPos(t),T=w[M];_!==T&&this.moveTo(_)},onKeyboard:function(e){var t=this.$props,n=t.reverse,a=t.vertical,o=xn(e,a,n);if(o){ce(e);var r=this.bounds,s=this.sHandle,l=r[s===null?this.recent:s],u=o(l,this.$props),c=he({value:u,handle:s,bounds:r,props:this.$props});if(c===l)return;var h=!0;this.moveTo(c,h)}},getClosestBound:function(e){for(var t=this.bounds,n=0,a=1;a=t[a]&&(n=a);return Math.abs(t[n+1]-e)=a.length||r<0)return!1;var s=t+n,l=a[r],u=this.pushable,c=Number(u),h=n*(e[s]-l);return this.pushHandle(e,s,n,c-h)?(e[t]=l,!0):!1},trimAlignValue:function(e){var t=this.sHandle,n=this.bounds;return he({value:e,handle:t,bounds:n,props:this.$props})},ensureValueNotConflict:function(e,t,n){var a=n.allowCross,o=n.pushable,r=this.$data||{},s=r.bounds;if(e=e===void 0?r.sHandle:e,o=Number(o),!a&&e!=null&&s!==void 0){if(e>0&&t<=s[e-1]+o)return s[e-1]+o;if(e=s[e+1]-o)return s[e+1]-o}return t},getTrack:function(e){var t=e.bounds,n=e.prefixCls,a=e.reverse,o=e.vertical,r=e.included,s=e.offsets,l=e.trackStyle;return t.slice(0,-1).map(function(u,c){var h,f=c+1,p=G((h={},B(h,"".concat(n,"-track"),!0),B(h,"".concat(n,"-track-").concat(f),!0),h));return k(ot,{class:p,vertical:o,reverse:a,included:r,offset:s[f-1],length:s[f]-s[f-1],style:l[c],key:f},null)})},renderSlider:function(){var e=this,t=this.sHandle,n=this.bounds,a=this.prefixCls,o=this.vertical,r=this.included,s=this.disabled,l=this.min,u=this.max,c=this.reverse,h=this.handle,f=this.defaultHandle,p=this.trackStyle,w=this.handleStyle,M=this.tabindex,_=this.ariaLabelGroupForHandles,T=this.ariaLabelledByGroupForHandles,y=this.ariaValueTextFormatterGroupForHandles,S=h||f,C=n.map(function(x){return e.calcOffset(x)}),d="".concat(a,"-handle"),m=n.map(function(x,b){var V,P=M[b]||0;(s||M[b]===null)&&(P=null);var v=t===b;return S({class:G((V={},B(V,d,!0),B(V,"".concat(d,"-").concat(b+1),!0),B(V,"".concat(d,"-dragging"),v),V)),prefixCls:a,vertical:o,dragging:v,offset:C[b],value:x,index:b,tabindex:P,min:l,max:u,reverse:c,disabled:s,style:w[b],ref:function(N){return e.saveHandle(b,N)},onFocus:e.onFocus,onBlur:e.onBlur,ariaLabel:_[b],ariaLabelledBy:T[b],ariaValueTextFormatter:y[b]})});return{tracks:this.getTrack({bounds:n,prefixCls:a,reverse:c,vertical:o,included:r,offsets:C,trackStyle:p}),handles:m}}}});const Ca=Pn(wa),xa=j({compatConfig:{MODE:3},name:"SliderTooltip",inheritAttrs:!1,props:hn(),setup:function(e,t){var n=t.attrs,a=t.slots,o=D(null),r=D(null);function s(){J.cancel(r.value),r.value=null}function l(){r.value=J(function(){var c;(c=o.value)===null||c===void 0||c.forcePopupAlign(),r.value=null})}var u=function(){s(),e.visible&&l()};return z([function(){return e.visible},function(){return e.title}],function(){u()},{flush:"post",immediate:!0}),Wn(function(){u()}),Ne(function(){s()}),function(){return k(va,g(g({ref:o},e),n),a)}}});var Pa=["value","dragging","index"],Ta=["tooltipPrefixCls","range","id"],Sa=function(e){return typeof e=="number"?e.toString():""},Ma=function(){return{id:String,prefixCls:String,tooltipPrefixCls:String,range:{type:[Boolean,Object],default:void 0},reverse:{type:Boolean,default:void 0},min:Number,max:Number,step:{type:[Number,Object]},marks:{type:Object},dots:{type:Boolean,default:void 0},value:{type:[Number,Array]},defaultValue:{type:[Number,Array]},included:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},vertical:{type:Boolean,default:void 0},tipFormatter:{type:[Function,Object],default:function(){return Sa}},tooltipVisible:{type:Boolean,default:void 0},tooltipPlacement:{type:String},getTooltipPopupContainer:{type:Function},autofocus:{type:Boolean,default:void 0},handleStyle:{type:[Object,Array]},trackStyle:{type:[Object,Array]},onChange:{type:Function},onAfterChange:{type:Function},onFocus:{type:Function},onBlur:{type:Function},"onUpdate:value":{type:Function}}},Oa=j({compatConfig:{MODE:3},name:"ASlider",inheritAttrs:!1,props:Ma(),slots:["mark"],setup:function(e,t){var n=t.attrs,a=t.slots,o=t.emit,r=t.expose,s=Zt("slider",e),l=s.prefixCls,u=s.rootPrefixCls,c=s.direction,h=s.getPopupContainer,f=s.configProvider,p=ti(),w=D(),M=D({}),_=function(b,V){M.value[b]=V},T=L(function(){return e.tooltipPlacement?e.tooltipPlacement:e.vertical?c.value==="rtl"?"left":"right":"top"}),y=function(){var b;(b=w.value)===null||b===void 0||b.focus()},S=function(){var b;(b=w.value)===null||b===void 0||b.blur()},C=function(b){o("update:value",b),o("change",b),p.onFieldChange()},d=function(b){o("blur",b)};r({focus:y,blur:S});var m=function(b){var V=b.tooltipPrefixCls,P=b.info,v=P.value,$=P.dragging,N=P.index,H=$e(P,Pa),R=e.tipFormatter,F=e.tooltipVisible,U=e.getTooltipPopupContainer,re=R?M.value[N]||$:!1,de=F||F===void 0&&re;return k(xa,{prefixCls:V,title:R?R(v):"",visible:de,placement:T.value,transitionName:"".concat(u.value,"-zoom-down"),key:N,overlayClassName:"".concat(l.value,"-tooltip"),getPopupContainer:U||h.value},{default:function(){return[k(yn,g(g({},H),{},{value:v,onMouseenter:function(){return _(N,!0)},onMouseleave:function(){return _(N,!1)}}),null)]}})};return function(){var x=e.tooltipPrefixCls,b=e.range,V=e.id,P=V===void 0?p.id.value:V,v=$e(e,Ta),$=f.getPrefixCls("tooltip",x),N=G(n.class,B({},"".concat(l.value,"-rtl"),c.value==="rtl"));c.value==="rtl"&&!v.vertical&&(v.reverse=!v.reverse);var H;return fe(b)==="object"&&(H=b.draggableTrack),b?k(Ca,g(g({},v),{},{step:v.step,draggableTrack:H,class:N,ref:w,handle:function(F){return m({tooltipPrefixCls:$,prefixCls:l.value,info:F})},prefixCls:l.value,onChange:C,onBlur:d}),{mark:a.mark}):k(ya,g(g({},v),{},{id:P,step:v.step,class:N,ref:w,handle:function(F){return m({tooltipPrefixCls:$,prefixCls:l.value,info:F})},prefixCls:l.value,onChange:C,onBlur:d}),{mark:a.mark})}}});const ka=Jt(Oa),Va=["aria-expanded"],_a={class:"dd__title"},$a={class:"dd__chevron","aria-hidden":"true"},Aa=["inert"],Da={class:"dd__clip"},Ba={class:"dd__body"},Na=j({__name:"DropDown",props:{text:{},defaultOpen:{type:Boolean,default:!1}},setup(i){const t=D(i.defaultOpen);return(n,a)=>(I(),W("div",{class:le(["dd",{"is-open":t.value}])},[E("button",{type:"button",class:"dd__head","aria-expanded":t.value,onClick:a[0]||(a[0]=o=>t.value=!t.value)},[E("h3",_a,[ft(n.$slots,"text",{},()=>[ge(oe(i.text),1)],!0)]),E("span",$a,[k(Ae,{icon:"vuesax-linear:arrow-down",size:"16"})])],8,Va),E("div",{class:"dd__panel",inert:!t.value},[E("div",Da,[E("div",Ba,[ft(n.$slots,"default",{},void 0,!0)])])],8,Aa)],2))}}),Ut=en(Na,[["__scopeId","data-v-7988b636"]]),Ea={class:"fSheet__headRow"},Fa={id:"fSheet-title",class:"fSheet__title"},Ha={key:0,class:"fSheet__count"},Ra={class:"fSheet__body"},La={key:0,class:"fSheet__chips"},ja=["aria-pressed","onClick"],Ia={key:1,class:"fSheet__empty"},Wa={class:"fSheet__gram"},za={class:"fSheet__gramFigures"},Ua={class:"fSheet__gramFigure"},Xa={class:"fSheet__gramFigure"},Ya=90,Ga=.5,Ka=j({__name:"Filters",props:{show:{type:Boolean},modelValue:{},filterKeys:{},products:{}},emits:["update:show","update:filterKeys"],setup(i,{emit:e}){const t=i,n=e,a=L(()=>{const P=new Map;for(const v of t.products)v.brand&&P.set(v.brand.id,v.brand);return[...P.values()]}),o=L(()=>{const P=t.products.flatMap(v=>v.variants.map($=>parseFloat($.rashWeightGrams)));return P.length===0?[0,100]:[Math.floor(Math.min(...P)),Math.ceil(Math.max(...P))]}),r=D([]),s=D([...o.value]);let l=!1;function u(){r.value=[...t.modelValue.brands];const P=t.modelValue.limit_gram;l=P.length===2,s.value=P.length===2?[P[0],P[1]]:[...o.value]}z(()=>t.show,P=>{P&&u()},{immediate:!0}),z(o,P=>{l||(s.value=[...P])});function c(P){Array.isArray(P)&&(s.value=[P[0],P[1]],l=!0)}const h=L(()=>{const[P,v]=s.value,[$,N]=o.value;return Math.abs(P-$)>.001||Math.abs(v-N)>.001}),f=L(()=>r.value.length+(h.value?1:0));function p(P){const v=r.value.indexOf(P);r.value=v===-1?[...r.value,P]:r.value.filter($=>$!==P)}function w(P){return P%1===0?String(P):String(+P.toFixed(2))}function M(){const P=t.modelValue;P.brands=[...r.value],P.limit_gram=h.value?[...s.value]:[];const v=[];P.brands.length&&v.push("brands"),P.limit_gram.length&&v.push("limit_gram"),n("update:filterKeys",v),T()}function _(){r.value=[],s.value=[...o.value],l=!1,M()}function T(){n("update:show",!1)}const y=D(0),S=D(!1);let C=0,d=0;const m=L(()=>y.value?{transform:`translate3d(0, ${y.value}px, 0)`}:void 0);function x(P){P.target.closest("button")||(C=P.touches[0].clientY,d=Date.now(),S.value=!0)}function b(P){if(!S.value)return;const v=P.touches[0].clientY-C;y.value=v>0?v:v*.12}function V(){if(!S.value)return;S.value=!1;const P=y.value/Math.max(1,Date.now()-d);y.value>Ya||y.value>30&&P>Ga?T():y.value=0}return(P,v)=>(I(),tn(te(zn),{show:i.show,position:"bottom",teleport:"body",transition:"fSheet-slide",class:"fSheet","overlay-class":"fSheet__overlay","close-on-popstate":"","onUpdate:show":v[0]||(v[0]=$=>n("update:show",$)),onClosed:v[1]||(v[1]=$=>y.value=0)},{default:K(()=>[E("div",{class:le(["fSheet__card",{"is-dragging":S.value}]),style:Un(m.value),dir:"rtl",role:"dialog","aria-modal":"true","aria-labelledby":"fSheet-title"},[E("header",{class:"fSheet__head",onTouchstartPassive:x,onTouchmovePassive:b,onTouchend:V,onTouchcancel:V},[v[3]||(v[3]=E("span",{class:"fSheet__grip","aria-hidden":"true"},null,-1)),E("div",Ea,[E("h3",Fa,[v[2]||(v[2]=ge(" فیلترها ",-1)),f.value?(I(),W("span",Ha,oe(f.value),1)):Oe("",!0)]),E("button",{type:"button",class:"fSheet__close","aria-label":"بستن",onClick:T},[k(Ae,{icon:"vuesax-linear:add",size:"18"})])])],32),E("div",Ra,[k(Ut,{text:"برند","default-open":""},{default:K(()=>[a.value.length?(I(),W("div",La,[(I(!0),W(Ve,null,Ue(a.value,$=>(I(),W("button",{key:$.id,type:"button",class:le(["fSheet__chip",{"is-on":r.value.includes($.id)}]),"aria-pressed":r.value.includes($.id),onClick:N=>p($.id)},oe($.title),11,ja))),128))])):(I(),W("p",Ia,"برندی برای فیلتر موجود نیست."))]),_:1}),k(Ut,{text:"وزن (گرم)","default-open":""},{default:K(()=>[E("div",Wa,[k(te(ka),{value:s.value,step:.01,range:"",reverse:"",min:o.value[0],max:o.value[1],"tooltip-visible":!1,"onUpdate:value":c},null,8,["value","min","max"]),E("div",za,[E("span",Ua,[v[4]||(v[4]=E("i",null,"کمترین",-1)),E("b",null,oe(w(s.value[0])),1),v[5]||(v[5]=ge(" گرم ",-1))]),E("span",Xa,[v[6]||(v[6]=E("i",null,"بیشترین",-1)),E("b",null,oe(w(s.value[1])),1),v[7]||(v[7]=ge(" گرم ",-1))])])])]),_:1})]),E("footer",{class:"fSheet__bar"},[E("button",{type:"button",class:"fSheet__clear",onClick:_},"پاک کردن"),E("button",{type:"button",class:"fSheet__apply",onClick:M},"اعمال فیلتر")])],6)]),_:1},8,["show"]))}}),qa={class:"search"},Za={class:"search__barExtra"},Qa={class:"search__chips no-scrollbar"},Ja=["onClick"],eo={key:0,class:"search__grid"},to={key:2,class:"search__empty"},We=20,no=j({__name:"SearchView",setup(i){const e=Xn(),t=D(!1),n=D(!1),a=D([]),o=D(!1),r=D([]),s=L(()=>{const C=new Map;for(const d of a.value)d.category&&C.set(d.category.id,d.category);return[...C.values()]}),l=L(()=>{let C=a.value;const d=e.query;return d.text&&(C=C.filter(m=>m.title.includes(d.text))),d.cats&&d.cats.length>0&&(C=C.filter(m=>m.category&&d.cats.includes(m.category.id))),d.brands.length>0&&(C=C.filter(m=>m.brand&&d.brands.includes(m.brand.id))),d.limit_gram.length===2&&(C=C.filter(m=>m.variants.some(x=>parseFloat(x.rashWeightGrams)>=d.limit_gram[0]&&parseFloat(x.rashWeightGrams)<=d.limit_gram[1]))),C}),u=D(We),c=L(()=>l.value.slice(0,u.value)),h=L(()=>u.value{C.some(d=>d.isIntersecting)&&h.value&&(u.value+=We)},{rootMargin:"400px"}),p.observe(f.value))}z(l,()=>{u.value=We}),z(f,w),Ne(()=>p==null?void 0:p.disconnect());async function M(){t.value=!0;try{a.value=await Yn.listProducts()}finally{t.value=!1}}async function _(){await M(),n.value=!1}function T(C){e.query.text=C}function y(C){e.query.cats=C?[C]:void 0}function S(){o.value=!0}return be(M),(C,d)=>{const m=vt("Loading"),x=vt("container");return I(),W("div",qa,[k(Gn,{title:"جستجو"},{below:K(()=>[E("div",Za,[k(Kn,{onSearch:T,"place-holder":"جستجوی دسته بندی، محصولات و ..."}),E("div",Qa,[E("button",{type:"button",class:le(["search__chip search__chip--filter",{"is-on":r.value.length>0}]),onClick:S},[k(Ae,{icon:"vuesax-linear:filter",size:"15"}),ge(" "+oe(r.value.length>0?`${r.value.length} فیلتر`:"فیلتر"),1)],2),E("button",{type:"button",class:le(["search__chip",{"is-on":!te(e).query.cats}]),onClick:d[0]||(d[0]=b=>y(void 0))}," همه ",2),(I(!0),W(Ve,null,Ue(s.value,b=>(I(),W("button",{key:b.id,type:"button",class:le(["search__chip",{"is-on":te(e).query.cats&&te(e).query.cats[0]===b.id}]),onClick:V=>y(b.id)},oe(b.title),11,Ja))),128))])])]),_:1}),k(dt,{spinning:t.value,tip:"درحال دریافت اطلاعات"},{default:K(()=>[k(te(ii),{modelValue:n.value,"onUpdate:modelValue":d[1]||(d[1]=b=>n.value=b),onRefresh:_},{pulling:K(()=>[k(m,{size:"18"})]),loosing:K(()=>[k(m,{size:"18"})]),loading:K(()=>[k(m,{size:"18"})]),success:K(()=>[...d[5]||(d[5]=[E("span",null,null,-1)])]),default:K(()=>[k(x,{class:"search__body"},{default:K(()=>[l.value.length?(I(),W("div",eo,[(I(!0),W(Ve,null,Ue(c.value,b=>(I(),tn(ni,{key:b.id,value:b},null,8,["value"]))),128))])):Oe("",!0),h.value?(I(),W("div",{key:1,ref_key:"sentinel",ref:f,class:"search__more"},[k(dt,{spinning:!0,indicator:!0,fixed:!1,tip:"",cls:"my-[10px]"})],512)):Oe("",!0),!l.value.length&&!t.value?(I(),W("section",to,[k(Ae,{icon:"vuesax-linear:search-normal-1",size:"26"}),d[6]||(d[6]=E("p",null,"محصولی با این مشخصات پیدا نشد.",-1))])):Oe("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["spinning"]),k(Ka,{show:o.value,"onUpdate:show":d[2]||(d[2]=b=>o.value=b),filterKeys:r.value,"onUpdate:filterKeys":d[3]||(d[3]=b=>r.value=b),modelValue:te(e).query,"onUpdate:modelValue":d[4]||(d[4]=b=>te(e).query=b),products:a.value},null,8,["show","filterKeys","modelValue","products"])])}}}),po=en(no,[["__scopeId","data-v-036a6a0e"]]);export{po as default}; +import{a1 as g,p as k,V as qe,w as Xt,l as kn,d as j,af as Yt,ap as G,g as D,Q as z,o as be,a as Ne,at as lt,h as L,ax as ke,x as ze,Y as Vn,Z as _n,ah as fe,aT as $n,T as An,aN as ut,a8 as B,aU as Dn,as as q,aV as Bn,a0 as Nn,ab as O,aG as Gt,aW as Kt,aX as ct,F as Ve,aY as _e,aZ as En,$ as xe,an as Fn,a9 as Hn,ad as Rn,aL as $e,aR as Ln,ao as qt,aa as Zt,aK as Ze,au as Qt,ag as Qe,a_ as jn,aQ as Jt,a$ as In,b0 as Wn,f as I,c as W,b as E,H as ft,N as ge,t as oe,I as Ae,i as le,_ as en,j as tn,z as K,m as te,b1 as zn,e as Oe,r as Ue,n as Un,v as Xn,J as dt,s as Yn,B as vt}from"./index-Dp9sxvBv.js";import{P as Gn}from"./PageBar-El-laHqK.js";import{S as Kn}from"./SearchInput-OrOd8Tqr.js";import{s as ne,P as pt,u as qn,a as Zn,K as ee}from"./KeyCode-DAs3W-5E.js";import{w as J}from"./raf-nDFcuFT6.js";import{_ as Qn,i as Jn,B as De,z as ei,A as ti}from"./FormItemContext-C33n6IMx.js";import{P as ni}from"./ProductCard-CvKEozHI.js";import{P as ii}from"./index-B0RgkHMm.js";function Z(i,e,t,n){if(i&&i.addEventListener){var a=n;a===void 0&&ne&&(e==="touchstart"||e==="touchmove"||e==="wheel")&&(a={passive:!1}),i.addEventListener(e,t,a)}return{remove:function(){i&&i.removeEventListener&&i.removeEventListener(e,t)}}}function se(i,e){return i?i.contains(e):!1}var nn=["moz","ms","webkit"];function ai(){var i=0;return function(e){var t=new Date().getTime(),n=Math.max(0,16-(t-i)),a=window.setTimeout(function(){e(t+n)},n);return i=t+n,a}}function oi(){if(typeof window>"u")return function(){};if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);var i=nn.filter(function(e){return"".concat(e,"RequestAnimationFrame")in window})[0];return i?window["".concat(i,"RequestAnimationFrame")]:ai()}function ri(i){if(typeof window>"u")return null;if(window.cancelAnimationFrame)return window.cancelAnimationFrame(i);var e=nn.filter(function(t){return"".concat(t,"CancelAnimationFrame")in window||"".concat(t,"CancelRequestAnimationFrame")in window})[0];return e?(window["".concat(e,"CancelAnimationFrame")]||window["".concat(e,"CancelRequestAnimationFrame")]).call(this,i):clearTimeout(i)}var ht=oi(),si=function(e){return ri(e.id)},li=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=Date.now();function a(){Date.now()-n>=t?e.call():o.id=ht(a)}var o={id:ht(a)};return o},Je={visible:Boolean,prefixCls:String,zIndex:Number,destroyPopupOnHide:Boolean,forceRender:Boolean,animation:[String,Object],transitionName:String,stretch:{type:String},align:{type:Object},point:{type:Object},getRootDomNode:{type:Function},getClassNameFromAlign:{type:Function},onMouseenter:{type:Function},onMouseleave:{type:Function},onMousedown:{type:Function},onTouchstart:{type:Function}},ui=g(g({},Je),{},{mobile:{type:Object}}),ci=g(g({},Je),{},{mask:Boolean,mobile:{type:Object},maskAnimation:String,maskTransitionName:String});function an(i){var e=i.prefixCls,t=i.animation,n=i.transitionName;return t?{name:"".concat(e,"-").concat(t)}:n?{name:n}:{}}function on(i){var e=i.prefixCls,t=i.visible,n=i.zIndex,a=i.mask,o=i.maskAnimation,r=i.maskTransitionName;if(!a)return null;var s={};return(r||o)&&(s=an({prefixCls:e,transitionName:r,animation:o})),k(qe,g({appear:!0},s),{default:function(){return[Xt(k("div",{style:{zIndex:n},class:"".concat(e,"-mask")},null),[[kn("if"),t]])]}})}on.displayName="Mask";const fi=j({compatConfig:{MODE:3},name:"MobilePopupInner",inheritAttrs:!1,props:ui,emits:["mouseenter","mouseleave","mousedown","touchstart","align"],setup:function(e,t){var n=t.expose,a=t.slots,o=D();return n({forceAlign:function(){},getElement:function(){return o.value}}),function(){var r,s=e.zIndex,l=e.visible,u=e.prefixCls,c=e.mobile,h=c===void 0?{}:c,f=h.popupClassName,p=h.popupStyle,w=h.popupMotion,M=w===void 0?{}:w,_=h.popupRender,T=g({zIndex:s},p),y=Yt((r=a.default)===null||r===void 0?void 0:r.call(a));y.length>1&&(y=k("div",{class:"".concat(u,"-content")},[y])),_&&(y=_(y));var S=G(u,f);return k(qe,g({ref:o},M),{default:function(){return[l?k("div",{class:S,style:T},[y]):null]}})}}});var mt=["measure","align",null,"motion"];const di=function(i,e){var t=D(null),n=D(),a=D(!1);function o(l){a.value||(t.value=l)}function r(){J.cancel(n.value)}function s(l){r(),n.value=J(function(){var u=t.value;switch(t.value){case"align":u="motion";break;case"motion":u="stable";break}o(u),l==null||l()})}return z(i,function(){o("measure")},{immediate:!0,flush:"post"}),be(function(){z(t,function(){switch(t.value){case"measure":e();break}t.value&&(n.value=J(Qn(lt.mark(function l(){var u,c;return lt.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:u=mt.indexOf(t.value),c=mt[u+1],c&&u!==-1&&o(c);case 3:case"end":return f.stop()}},l)}))))},{immediate:!0,flush:"post"})}),Ne(function(){a.value=!0,r()}),[t,s]},vi=function(i){var e=D({width:0,height:0});function t(a){e.value={width:a.offsetWidth,height:a.offsetHeight}}var n=L(function(){var a={};if(i.value){var o=e.value,r=o.width,s=o.height;i.value.indexOf("height")!==-1&&s?a.height="".concat(s,"px"):i.value.indexOf("minHeight")!==-1&&s&&(a.minHeight="".concat(s,"px")),i.value.indexOf("width")!==-1&&r?a.width="".concat(r,"px"):i.value.indexOf("minWidth")!==-1&&r&&(a.minWidth="".concat(r,"px"))}return a});return[n,t]};function gt(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(i,a).enumerable})),t.push.apply(t,n)}return t}function yt(i){for(var e=1;e=0&&t.left>=0&&t.bottom>t.top&&t.right>t.left?t:null}function Ei(i,e,t,n){var a=A.clone(i),o={width:e.width,height:e.height};return n.adjustX&&a.left=t.left&&a.left+o.width>t.right&&(o.width-=a.left+o.width-t.right),n.adjustX&&a.left+o.width>t.right&&(a.left=Math.max(t.right-o.width,t.left)),n.adjustY&&a.top=t.top&&a.top+o.height>t.bottom&&(o.height-=a.top+o.height-t.bottom),n.adjustY&&a.top+o.height>t.bottom&&(a.top=Math.max(t.bottom-o.height,t.top)),A.mix(a,o)}function it(i){var e,t,n;if(!A.isWindow(i)&&i.nodeType!==9)e=A.offset(i),t=A.outerWidth(i),n=A.outerHeight(i);else{var a=A.getWindow(i);e={left:A.getWindowScrollLeft(a),top:A.getWindowScrollTop(a)},t=A.viewportWidth(a),n=A.viewportHeight(a)}return e.width=t,e.height=n,e}function Mt(i,e){var t=e.charAt(0),n=e.charAt(1),a=i.width,o=i.height,r=i.left,s=i.top;return t==="c"?s+=o/2:t==="b"&&(s+=o),n==="c"?r+=a/2:n==="r"&&(r+=a),{left:r,top:s}}function Te(i,e,t,n,a){var o=Mt(e,t[1]),r=Mt(i,t[0]),s=[r.left-o.left,r.top-o.top];return{left:Math.round(i.left-s[0]+n[0]-a[0]),top:Math.round(i.top-s[1]+n[1]-a[1])}}function Ot(i,e,t){return i.leftt.right}function kt(i,e,t){return i.topt.bottom}function Fi(i,e,t){return i.left>t.right||i.left+e.widtht.bottom||i.top+e.height=t.right||n.top>=t.bottom}function at(i,e,t){var n=t.target||e,a=it(n),o=!Ri(n,t.overflow&&t.overflow.alwaysByViewport);return vn(i,a,t,o)}at.__getOffsetParent=Ke;at.__getVisibleRectForElement=nt;function Li(i,e,t){var n,a,o=A.getDocument(i),r=o.defaultView||o.parentWindow,s=A.getWindowScrollLeft(r),l=A.getWindowScrollTop(r),u=A.viewportWidth(r),c=A.viewportHeight(r);"pageX"in e?n=e.pageX:n=s+e.clientX,"pageY"in e?a=e.pageY:a=l+e.clientY;var h={left:n,top:a,width:0,height:0},f=n>=0&&n<=s+u&&a>=0&&a<=l+c,p=[t.points[0],"cc"];return vn(i,h,yt(yt({},t),{},{points:p}),f)}const ji=function(i){if(!i)return!1;if(i.offsetParent)return!0;if(i.getBBox){var e=i.getBBox();if(e.width||e.height)return!0}if(i.getBoundingClientRect){var t=i.getBoundingClientRect();if(t.width||t.height)return!0}return!1};function Ii(i,e){return i===e?!0:!i||!e?!1:"pageX"in e&&"pageY"in e?i.pageX===e.pageX&&i.pageY===e.pageY:"clientX"in e&&"clientY"in e?i.clientX===e.clientX&&i.clientY===e.clientY:!1}function Wi(i,e){i!==document.activeElement&&se(e,i)&&typeof i.focus=="function"&&i.focus()}function $t(i,e){var t=null,n=null;function a(r){var s=ke(r,1),l=s[0].target;if(document.documentElement.contains(l)){var u=l.getBoundingClientRect(),c=u.width,h=u.height,f=Math.floor(c),p=Math.floor(h);(t!==f||n!==p)&&Promise.resolve().then(function(){e({width:f,height:p})}),t=f,n=p}}var o=new Jn(a);return i&&o.observe(i),function(){o.disconnect()}}const zi=function(i,e){var t=!1,n=null;function a(){clearTimeout(n)}function o(r){if(!t||r===!0){if(i()===!1)return;t=!0,a(),n=setTimeout(function(){t=!1},e.value)}else a(),n=setTimeout(function(){t=!1,o()},e.value)}return[o,function(){t=!1,a()}]};var Ui={align:Object,target:[Object,Function],onAlign:Function,monitorBufferTime:Number,monitorWindowResize:Boolean,disabled:Boolean};function At(i){return typeof i!="function"?null:i()}function Dt(i){return fe(i)!=="object"||!i?null:i}const Xi=j({compatConfig:{MODE:3},name:"Align",props:Ui,emits:["align"],setup:function(e,t){var n=t.expose,a=t.slots,o=D({}),r=D(),s=zi(function(){var M=e.disabled,_=e.target,T=e.align,y=e.onAlign;if(!M&&_&&r.value){var S=r.value,C,d=At(_),m=Dt(_);o.value.element=d,o.value.point=m,o.value.align=T;var x=document,b=x.activeElement;return d&&ji(d)?C=at(S,d,T):m&&(C=Li(S,m,T)),Wi(b,S),y&&C&&y(S,C),!0}return!1},L(function(){return e.monitorBufferTime})),l=ke(s,2),u=l[0],c=l[1],h=D({cancel:function(){}}),f=D({cancel:function(){}}),p=function(){var _=e.target,T=At(_),y=Dt(_);r.value!==f.value.element&&(f.value.cancel(),f.value.element=r.value,f.value.cancel=$t(r.value,u)),(o.value.element!==T||!Ii(o.value.point,y)||!ei(o.value.align,e.align))&&(u(),h.value.element!==T&&(h.value.cancel(),h.value.element=T,h.value.cancel=$t(T,u)))};be(function(){ze(function(){p()})}),Vn(function(){ze(function(){p()})}),z(function(){return e.disabled},function(M){M?c():u()},{immediate:!0,flush:"post"});var w=D(null);return z(function(){return e.monitorWindowResize},function(M){M?w.value||(w.value=Z(window,"resize",u)):w.value&&(w.value.remove(),w.value=null)},{flush:"post"}),_n(function(){h.value.cancel(),f.value.cancel(),w.value&&w.value.remove(),c()}),n({forceAlign:function(){return u(!0)}}),function(){var M=a==null?void 0:a.default();return M?De(M[0],{ref:r},!0,!0):null}}}),Yi=j({compatConfig:{MODE:3},name:"PopupInner",inheritAttrs:!1,props:Je,emits:["mouseenter","mouseleave","mousedown","touchstart","align"],setup:function(e,t){var n=t.expose,a=t.attrs,o=t.slots,r=D(),s=D(),l=D(),u=vi(Dn(e,"stretch")),c=ke(u,2),h=c[0],f=c[1],p=function(){e.stretch&&f(e.getRootDomNode())},w=D(!1),M;z(function(){return e.visible},function(v){clearTimeout(M),v?M=setTimeout(function(){w.value=e.visible}):w.value=!1},{immediate:!0});var _=di(w,p),T=ke(_,2),y=T[0],S=T[1],C=D(),d=function(){return e.point?e.point:e.getRootDomNode},m=function(){var $;($=r.value)===null||$===void 0||$.forceAlign()},x=function($,N){var H=e.getClassNameFromAlign(N),R=l.value;if(l.value!==H&&(l.value=H),y.value==="align"){var F;R!==H?Promise.resolve().then(function(){m()}):S(function(){var U;(U=C.value)===null||U===void 0||U.call(C)}),(F=e.onAlign)===null||F===void 0||F.call(e,$,N)}},b=L(function(){var v=fe(e.animation)==="object"?e.animation:an(e);return["onAfterEnter","onAfterLeave"].forEach(function($){var N=v[$];v[$]=function(H){S(),y.value="stable",N==null||N(H)}}),v}),V=function(){return new Promise(function($){C.value=$})};z([b,y],function(){!b.value&&y.value==="motion"&&S()},{immediate:!0}),n({forceAlign:m,getElement:function(){return s.value.$el||s.value}});var P=L(function(){var v;return!((v=e.align)!==null&&v!==void 0&&v.points&&(y.value==="align"||y.value==="stable"))});return function(){var v,$=e.zIndex,N=e.align,H=e.prefixCls,R=e.destroyPopupOnHide,F=e.onMouseenter,U=e.onMouseleave,re=e.onTouchstart,de=re===void 0?function(){}:re,st=e.onMousedown,ve=y.value,Tn=[g(g({},h.value),{},{zIndex:$,opacity:ve==="motion"||ve==="stable"||!w.value?null:0,pointerEvents:!w.value&&ve!=="stable"?"none":null}),a.style],Ce=Yt((v=o.default)===null||v===void 0?void 0:v.call(o,{visible:e.visible}));Ce.length>1&&(Ce=k("div",{class:"".concat(H,"-content")},[Ce]));var Sn=G(H,a.class,l.value),Mn=w.value||!e.visible,On=Mn?$n(b.value.name,b.value):{};return k(qe,g(g({ref:s},On),{},{onBeforeEnter:V}),{default:function(){return!R||e.visible?Xt(k(Xi,{target:d(),key:"popup",ref:r,monitorWindowResize:!0,disabled:P.value,align:N,onAlign:x},{default:function(){return k("div",g(g({class:Sn,onMouseenter:F,onMouseleave:U,onMousedown:ut(st,["capture"])},B({},ne?"onTouchstartPassive":"onTouchstart",ut(de,["capture"]))),{},{style:Tn}),[Ce])}}),[[An,w.value]]):null}})}}}),Gi=j({compatConfig:{MODE:3},name:"Popup",inheritAttrs:!1,props:ci,setup:function(e,t){var n=t.attrs,a=t.slots,o=t.expose,r=D(!1),s=D(!1),l=D();return z([function(){return e.visible},function(){return e.mobile}],function(){r.value=e.visible,e.visible&&e.mobile&&(s.value=!0)},{immediate:!0,flush:"post"}),o({forceAlign:function(){var c;(c=l.value)===null||c===void 0||c.forceAlign()},getElement:function(){var c;return(c=l.value)===null||c===void 0?void 0:c.getElement()}}),function(){var u=g(g(g({},e),n),{},{visible:r.value}),c=s.value?k(fi,g(g({},u),{},{mobile:e.mobile,ref:l}),{default:a.default}):k(Yi,g(g({},u),{},{ref:l}),{default:a.default});return k("div",null,[k(on,u,null),c])}}});function Ki(i,e,t){return t?i[0]===e[0]:i[0]===e[0]&&i[1]===e[1]}function Bt(i,e,t){var n=i[e]||{};return g(g({},n),t)}function qi(i,e,t,n){for(var a=t.points,o=Object.keys(i),r=0;r0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=typeof e=="function"?e(this.$data,this.$props):e;if(this.getDerivedStateFromProps){var a=this.getDerivedStateFromProps(Bn(this),g(g({},this.$data),n));if(a===null)return;n=g(g({},n),a||{})}Nn(this.$data,n),this._.isMounted&&this.$forceUpdate(),ze(function(){t&&t()})},__emit:function(){var e=[].slice.call(arguments,0),t=e[0];t="on".concat(t[0].toUpperCase()).concat(t.substring(1));var n=this.$props[t]||this.$attrs[t];if(e.length&&n)if(Array.isArray(n))for(var a=0,o=n.length;a0&&arguments[0]!==void 0?arguments[0]:[],e=0,t=i.length;e=0||V.indexOf("Bottom")>=0?v.top="".concat(P.height-x.offset[1],"px"):(V.indexOf("Top")>=0||V.indexOf("bottom")>=0)&&(v.top="".concat(-x.offset[1],"px")),V.indexOf("left")>=0||V.indexOf("Right")>=0?v.left="".concat(P.width-x.offset[0],"px"):(V.indexOf("right")>=0||V.indexOf("Left")>=0)&&(v.left="".concat(-x.offset[0],"px")),m.style.transformOrigin="".concat(v.left," ").concat(v.top)}};return function(){var d,m,x,b=e.openClassName,V=e.color,P=e.overlayClassName,v=(d=Gt((m=n.default)===null||m===void 0?void 0:m.call(n)))!==null&&d!==void 0?d:null;v=v.length===1?v[0]:v;var $=c.value;if(e.visible===void 0&&p()&&($=!1),!v)return null;var N=y(Qt(v)?v:k("span",null,[v])),H=G((x={},B(x,b||"".concat(l.value,"-open"),!0),B(x,N.props&&N.props.class,N.props&&N.props.class),x)),R=G(P,B({},"".concat(l.value,"-").concat(V),V&&Rt.test(V))),F,U;V&&!Rt.test(V)&&(F={backgroundColor:V},U={backgroundColor:V});var re=g(g(g({},o),e),{},{prefixCls:l.value,getPopupContainer:u.value,builtinPlacements:_.value,visible:$,ref:h,overlayClassName:R,overlayInnerStyle:F,onVisibleChange:w,onPopupAlign:C});return k(aa,re,{default:function(){return[c.value?De(N,{class:H}):N]},arrowContent:function(){return k("span",{class:"".concat(l.value,"-arrow-content"),style:U},null)},overlay:S})}}}),va=Jt(da);var ot=function(e,t){var n,a,o=t.attrs,r=o.included,s=o.vertical,l=o.style,u=o.class,c=o.length,h=o.offset,f=o.reverse;c<0&&(f=!f,c=Math.abs(c),h=100-h);var p=s?(n={},B(n,f?"top":"bottom","".concat(h,"%")),B(n,f?"bottom":"top","auto"),B(n,"height","".concat(c,"%")),n):(a={},B(a,f?"right":"left","".concat(h,"%")),B(a,f?"left":"right","auto"),B(a,"width","".concat(c,"%")),a),w=g(g({},l),p);return r?k("div",{class:u,style:w},null):null};ot.inheritAttrs=!1;var pa=function(e,t,n,a,o,r){Ze(n?a>0:!0,"Slider","`Slider[step]` should be a positive number in order to make Slider[dots] work.");var s=Object.keys(t).map(parseFloat).sort(function(u,c){return u-c});if(n&&a)for(var l=o;l<=r;l+=a)s.indexOf(l)===-1&&s.push(l);return s},mn=function(e,t){var n=t.attrs,a=n.prefixCls,o=n.vertical,r=n.reverse,s=n.marks,l=n.dots,u=n.step,c=n.included,h=n.lowerBound,f=n.upperBound,p=n.max,w=n.min,M=n.dotStyle,_=n.activeDotStyle,T=p-w,y=pa(o,s,l,u,w,p).map(function(S){var C,d="".concat(Math.abs(S-w)/T*100,"%"),m=!c&&S===f||c&&S<=f&&S>=h,x=o?g(g({},M),{},B({},r?"top":"bottom",d)):g(g({},M),{},B({},r?"right":"left",d));m&&(x=g(g({},x),_));var b=G((C={},B(C,"".concat(a,"-dot"),!0),B(C,"".concat(a,"-dot-active"),m),B(C,"".concat(a,"-dot-reverse"),r),C));return k("span",{class:b,style:x,key:S},null)});return k("div",{class:"".concat(a,"-step")},[y])};mn.inheritAttrs=!1;var gn=function(e,t){var n=t.attrs,a=t.slots,o=n.class,r=n.vertical,s=n.reverse,l=n.marks,u=n.included,c=n.upperBound,h=n.lowerBound,f=n.max,p=n.min,w=n.onClickLabel,M=Object.keys(l),_=a.mark,T=f-p,y=M.map(parseFloat).sort(function(S,C){return S-C}).map(function(S){var C,d=typeof l[S]=="function"?l[S]():l[S],m=fe(d)==="object"&&!Qt(d),x=m?d.label:d;if(!x&&x!==0)return null;_&&(x=_({point:S,label:x}));var b=!u&&S===c||u&&S<=c&&S>=h,V=G((C={},B(C,"".concat(o,"-text"),!0),B(C,"".concat(o,"-text-active"),b),C)),P=B({marginBottom:"-50%"},s?"top":"bottom","".concat((S-p)/T*100,"%")),v=B({transform:"translateX(".concat(s?"50%":"-50%",")"),msTransform:"translateX(".concat(s?"50%":"-50%",")")},s?"right":"left","".concat((S-p)/T*100,"%")),$=r?P:v,N=m?g(g({},$),d.style):$,H=B({},ne?"onTouchstartPassive":"onTouchstart",function(R){return w(R,S)});return k("span",g({class:V,style:N,key:S,onMousedown:function(F){return w(F,S)}},H),[x])});return k("div",{class:o},[y])};gn.inheritAttrs=!1;const yn=j({compatConfig:{MODE:3},name:"Handle",inheritAttrs:!1,props:{prefixCls:String,vertical:{type:Boolean,default:void 0},offset:Number,disabled:{type:Boolean,default:void 0},min:Number,max:Number,value:Number,tabindex:O.oneOfType([O.number,O.string]),reverse:{type:Boolean,default:void 0},ariaLabel:String,ariaLabelledBy:String,ariaValueTextFormatter:Function,onMouseenter:{type:Function},onMouseleave:{type:Function},onMousedown:{type:Function}},setup:function(e,t){var n=t.attrs,a=t.emit,o=t.expose,r=D(!1),s=D(),l=function(){document.activeElement===s.value&&(r.value=!0)},u=function(y){r.value=!1,a("blur",y)},c=function(){r.value=!1},h=function(){var y;(y=s.value)===null||y===void 0||y.focus()},f=function(){var y;(y=s.value)===null||y===void 0||y.blur()},p=function(){r.value=!0,h()},w=function(y){y.preventDefault(),h(),a("mousedown",y)};o({focus:h,blur:f,clickFocus:p,ref:s});var M=null;be(function(){M=Z(document,"mouseup",l)}),Ne(function(){var T;(T=M)===null||T===void 0||T.remove()});var _=L(function(){var T,y,S=e.vertical,C=e.offset,d=e.reverse;return S?(T={},B(T,d?"top":"bottom","".concat(C,"%")),B(T,d?"bottom":"top","auto"),B(T,"transform",d?null:"translateY(+50%)"),T):(y={},B(y,d?"right":"left","".concat(C,"%")),B(y,d?"left":"right","auto"),B(y,"transform","translateX(".concat(d?"+":"-","50%)")),y)});return function(){var T=e.prefixCls,y=e.disabled,S=e.min,C=e.max,d=e.value,m=e.tabindex,x=e.ariaLabel,b=e.ariaLabelledBy,V=e.ariaValueTextFormatter,P=e.onMouseenter,v=e.onMouseleave,$=G(n.class,B({},"".concat(T,"-handle-click-focused"),r.value)),N={"aria-valuemin":S,"aria-valuemax":C,"aria-valuenow":d,"aria-disabled":!!y},H=[n.style,_.value],R=m||0;(y||m===null)&&(R=null);var F;V&&(F=V(d));var U=g(g(g({},n),{},{role:"slider",tabindex:R},N),{},{class:$,onBlur:u,onKeydown:c,onMousedown:w,onMouseenter:P,onMouseleave:v,ref:s,style:H});return k("div",g(g({},U),{},{"aria-label":x,"aria-labelledby":b,"aria-valuetext":F}),null)}}});function Ie(i,e){try{return Object.keys(e).some(function(t){return i.target===e[t].ref})}catch{return!1}}function bn(i,e){var t=e.min,n=e.max;return in}function Lt(i){return i.touches.length>1||i.type.toLowerCase()==="touchend"&&i.touches.length>0}function jt(i,e){var t=e.marks,n=e.step,a=e.min,o=e.max,r=Object.keys(t).map(parseFloat);if(n!==null){var s=Math.pow(10,wn(n)),l=Math.floor((o*s-a*s)/(n*s)),u=Math.min((i-a)/n,l),c=Math.round(u)*n+a;r.push(c)}var h=r.map(function(f){return Math.abs(i-f)});return r[h.indexOf(Math.min.apply(Math,q(h)))]}function wn(i){var e=i.toString(),t=0;return e.indexOf(".")>=0&&(t=e.length-e.indexOf(".")-1),t}function It(i,e){var t=1;return window.visualViewport&&(t=+(window.visualViewport.width/document.body.getBoundingClientRect().width).toFixed(2)),(i?e.clientY:e.pageX)/t}function Wt(i,e){var t=1;return window.visualViewport&&(t=+(window.visualViewport.width/document.body.getBoundingClientRect().width).toFixed(2)),(i?e.touches[0].clientY:e.touches[0].pageX)/t}function zt(i,e){var t=e.getBoundingClientRect();return i?t.top+t.height*.5:window.pageXOffset+t.left+t.width*.5}function rt(i,e){var t=e.max,n=e.min;return i<=n?n:i>=t?t:i}function Cn(i,e){var t=e.step,n=isFinite(jt(i,e))?jt(i,e):0;return t===null?n:parseFloat(n.toFixed(wn(t)))}function ce(i){i.stopPropagation(),i.preventDefault()}function ha(i,e,t){var n={increase:function(s,l){return s+l},decrease:function(s,l){return s-l}},a=n[i](Object.keys(t.marks).indexOf(JSON.stringify(e)),1),o=Object.keys(t.marks)[a];return t.step?n[i](e,t.step):Object.keys(t.marks).length&&t.marks[o]?t.marks[o]:e}function xn(i,e,t){var n="increase",a="decrease",o=n;switch(i.keyCode){case ee.UP:o=e&&t?a:n;break;case ee.RIGHT:o=!e&&t?a:n;break;case ee.DOWN:o=e&&t?n:a;break;case ee.LEFT:o=!e&&t?n:a;break;case ee.END:return function(r,s){return s.max};case ee.HOME:return function(r,s){return s.min};case ee.PAGE_UP:return function(r,s){return r+s.step*2};case ee.PAGE_DOWN:return function(r,s){return r-s.step*2};default:return}return function(r,s){return ha(o,r,s)}}var ma=["index","directives","className","style"];function ae(){}function Pn(i){var e={id:String,min:Number,max:Number,step:Number,marks:O.object,included:{type:Boolean,default:void 0},prefixCls:String,disabled:{type:Boolean,default:void 0},handle:Function,dots:{type:Boolean,default:void 0},vertical:{type:Boolean,default:void 0},reverse:{type:Boolean,default:void 0},minimumTrackStyle:O.object,maximumTrackStyle:O.object,handleStyle:O.oneOfType([O.object,O.arrayOf(O.object)]),trackStyle:O.oneOfType([O.object,O.arrayOf(O.object)]),railStyle:O.object,dotStyle:O.object,activeDotStyle:O.object,autofocus:{type:Boolean,default:void 0},draggableTrack:{type:Boolean,default:void 0}};return j({compatConfig:{MODE:3},name:"CreateSlider",mixins:[Fe,i],inheritAttrs:!1,slots:["mark"],props:Qe(e,{prefixCls:"rc-slider",min:0,max:100,step:1,marks:{},included:!0,disabled:!1,dots:!1,vertical:!1,reverse:!1,trackStyle:[{}],handleStyle:[{}],railStyle:{},dotStyle:{},activeDotStyle:{}}),emits:["change","blur","focus"],data:function(){var n=this.step,a=this.max,o=this.min,r=isFinite(a-o)?(a-o)%n===0:!0;return Ze(n&&Math.floor(n)===n?r:!0,"Slider[max] - Slider[min] (".concat(a-o,") should be a multiple of Slider[step] (").concat(n,")")),this.handlesRefs={},{}},mounted:function(){var n=this;this.$nextTick(function(){n.document=n.sliderRef&&n.sliderRef.ownerDocument;var a=n.autofocus,o=n.disabled;a&&!o&&n.focus()})},beforeUnmount:function(){var n=this;this.$nextTick(function(){n.removeDocumentEvents()})},methods:{defaultHandle:function(n){var a=n.index;n.directives;var o=n.className,r=n.style,s=$e(n,ma);if(delete s.dragging,s.value===null)return null;var l=g(g({},s),{},{class:o,style:r,key:a});return k(yn,l,null)},onDown:function(n,a){var o=a,r=this.$props,s=r.draggableTrack,l=r.vertical,u=this.$data.bounds,c=s&&this.positionGetValue?this.positionGetValue(o)||[]:[],h=Ie(n,this.handlesRefs);if(this.dragTrack=s&&u.length>=2&&!h&&!c.map(function(p,w){var M=w?!0:p>=u[w];return w===c.length-1?p<=u[w]:M}).some(function(p){return!p}),this.dragTrack)this.dragOffset=o,this.startBounds=q(u);else{if(!h)this.dragOffset=0;else{var f=zt(l,n.target);this.dragOffset=o-f,o=f}this.onStart(o)}},onMouseDown:function(n){if(n.button===0){this.removeDocumentEvents();var a=this.$props.vertical,o=It(a,n);this.onDown(n,o),this.addDocumentMouseEvents()}},onTouchStart:function(n){if(!Lt(n)){var a=this.vertical,o=Wt(a,n);this.onDown(n,o),this.addDocumentTouchEvents(),ce(n)}},onFocus:function(n){var a=this.vertical;if(Ie(n,this.handlesRefs)&&!this.dragTrack){var o=zt(a,n.target);this.dragOffset=0,this.onStart(o),ce(n),this.$emit("focus",n)}},onBlur:function(n){this.dragTrack||this.onEnd(),this.$emit("blur",n)},onMouseUp:function(){this.handlesRefs[this.prevMovedHandleIndex]&&this.handlesRefs[this.prevMovedHandleIndex].clickFocus()},onMouseMove:function(n){if(!this.sliderRef){this.onEnd();return}var a=It(this.vertical,n);this.onMove(n,a-this.dragOffset,this.dragTrack,this.startBounds)},onTouchMove:function(n){if(Lt(n)||!this.sliderRef){this.onEnd();return}var a=Wt(this.vertical,n);this.onMove(n,a-this.dragOffset,this.dragTrack,this.startBounds)},onKeyDown:function(n){this.sliderRef&&Ie(n,this.handlesRefs)&&this.onKeyboard(n)},onClickMarkLabel:function(n,a){var o=this;n.stopPropagation(),this.onChange({sValue:a}),this.setState({sValue:a},function(){return o.onEnd(!0)})},getSliderStart:function(){var n=this.sliderRef,a=this.vertical,o=this.reverse,r=n.getBoundingClientRect();return a?o?r.bottom:r.top:window.pageXOffset+(o?r.right:r.left)},getSliderLength:function(){var n=this.sliderRef;if(!n)return 0;var a=n.getBoundingClientRect();return this.vertical?a.height:a.width},addDocumentTouchEvents:function(){this.onTouchMoveListener=Z(this.document,"touchmove",this.onTouchMove),this.onTouchUpListener=Z(this.document,"touchend",this.onEnd)},addDocumentMouseEvents:function(){this.onMouseMoveListener=Z(this.document,"mousemove",this.onMouseMove),this.onMouseUpListener=Z(this.document,"mouseup",this.onEnd)},removeDocumentEvents:function(){this.onTouchMoveListener&&this.onTouchMoveListener.remove(),this.onTouchUpListener&&this.onTouchUpListener.remove(),this.onMouseMoveListener&&this.onMouseMoveListener.remove(),this.onMouseUpListener&&this.onMouseUpListener.remove()},focus:function(){var n;this.$props.disabled||(n=this.handlesRefs[0])===null||n===void 0||n.focus()},blur:function(){var n=this;this.$props.disabled||Object.keys(this.handlesRefs).forEach(function(a){var o,r;(o=n.handlesRefs[a])===null||o===void 0||(r=o.blur)===null||r===void 0||r.call(o)})},calcValue:function(n){var a=this.vertical,o=this.min,r=this.max,s=Math.abs(Math.max(n,0)/this.getSliderLength()),l=a?(1-s)*(r-o)+o:s*(r-o)+o;return l},calcValueByPos:function(n){var a=this.reverse?-1:1,o=a*(n-this.getSliderStart()),r=this.trimAlignValue(this.calcValue(o));return r},calcOffset:function(n){var a=this.min,o=this.max,r=(n-a)/(o-a);return Math.max(0,r*100)},saveSlider:function(n){this.sliderRef=n},saveHandle:function(n,a){this.handlesRefs[n]=a}},render:function(){var n,a=this.prefixCls,o=this.marks,r=this.dots,s=this.step,l=this.included,u=this.disabled,c=this.vertical,h=this.reverse,f=this.min,p=this.max,w=this.maximumTrackStyle,M=this.railStyle,_=this.dotStyle,T=this.activeDotStyle,y=this.id,S=this.$attrs,C=S.class,d=S.style,m=this.renderSlider(),x=m.tracks,b=m.handles,V=G(a,C,(n={},B(n,"".concat(a,"-with-marks"),Object.keys(o).length),B(n,"".concat(a,"-disabled"),u),B(n,"".concat(a,"-vertical"),c),n)),P={vertical:c,marks:o,included:l,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:p,min:f,reverse:h,class:"".concat(a,"-mark"),onClickLabel:u?ae:this.onClickMarkLabel},v=B({},ne?"onTouchstartPassive":"onTouchstart",u?ae:this.onTouchStart);return k("div",g(g({id:y,ref:this.saveSlider,tabindex:"-1",class:V},v),{},{onMousedown:u?ae:this.onMouseDown,onMouseup:u?ae:this.onMouseUp,onKeydown:u?ae:this.onKeyDown,onFocus:u?ae:this.onFocus,onBlur:u?ae:this.onBlur,style:d}),[k("div",{class:"".concat(a,"-rail"),style:g(g({},w),M)},null),x,k(mn,{prefixCls:a,vertical:c,reverse:h,marks:o,dots:r,step:s,included:l,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:p,min:f,dotStyle:_,activeDotStyle:T},null),b,k(gn,P,{mark:this.$slots.mark}),Kt(this)])}})}var ga=j({compatConfig:{MODE:3},name:"Slider",mixins:[Fe],inheritAttrs:!1,props:{defaultValue:Number,value:Number,disabled:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},tabindex:O.oneOfType([O.number,O.string]),reverse:{type:Boolean,default:void 0},min:Number,max:Number,ariaLabelForHandle:String,ariaLabelledByForHandle:String,ariaValueTextFormatterForHandle:String,startPoint:Number},emits:["beforeChange","afterChange","change"],data:function(){var e=this.defaultValue!==void 0?this.defaultValue:this.min,t=this.value!==void 0?this.value:e;return{sValue:this.trimAlignValue(t),dragging:!1}},watch:{value:{handler:function(e){this.setChangeValue(e)},deep:!0},min:function(){var e=this.sValue;this.setChangeValue(e)},max:function(){var e=this.sValue;this.setChangeValue(e)}},methods:{setChangeValue:function(e){var t=e!==void 0?e:this.sValue,n=this.trimAlignValue(t,this.$props);n!==this.sValue&&(this.setState({sValue:n}),bn(t,this.$props)&&this.$emit("change",n))},onChange:function(e){var t=!_e(this,"value"),n=e.sValue>this.max?g(g({},e),{},{sValue:this.max}):e;t&&this.setState(n);var a=n.sValue;this.$emit("change",a)},onStart:function(e){this.setState({dragging:!0});var t=this.sValue;this.$emit("beforeChange",t);var n=this.calcValueByPos(e);this.startValue=n,this.startPosition=e,n!==t&&(this.prevMovedHandleIndex=0,this.onChange({sValue:n}))},onEnd:function(e){var t=this.dragging;this.removeDocumentEvents(),(t||e)&&this.$emit("afterChange",this.sValue),this.setState({dragging:!1})},onMove:function(e,t){ce(e);var n=this.sValue,a=this.calcValueByPos(t);a!==n&&this.onChange({sValue:a})},onKeyboard:function(e){var t=this.$props,n=t.reverse,a=t.vertical,o=xn(e,a,n);if(o){ce(e);var r=this.sValue,s=o(r,this.$props),l=this.trimAlignValue(s);if(l===r)return;this.onChange({sValue:l}),this.$emit("afterChange",l),this.onEnd()}},getLowerBound:function(){var e=this.$props.startPoint||this.$props.min;return this.$data.sValue>e?e:this.$data.sValue},getUpperBound:function(){return this.$data.sValue1&&arguments[1]!==void 0?arguments[1]:{};if(e===null)return null;var n=g(g({},this.$props),t),a=rt(e,n);return Cn(a,n)},getTrack:function(e){var t=e.prefixCls,n=e.reverse,a=e.vertical,o=e.included,r=e.minimumTrackStyle,s=e.mergedTrackStyle,l=e.length,u=e.offset;return k(ot,{class:"".concat(t,"-track"),vertical:a,included:o,offset:u,reverse:n,length:l,style:g(g({},r),s)},null)},renderSlider:function(){var e=this,t=this.prefixCls,n=this.vertical,a=this.included,o=this.disabled,r=this.minimumTrackStyle,s=this.trackStyle,l=this.handleStyle,u=this.tabindex,c=this.ariaLabelForHandle,h=this.ariaLabelledByForHandle,f=this.ariaValueTextFormatterForHandle,p=this.min,w=this.max,M=this.startPoint,_=this.reverse,T=this.handle,y=this.defaultHandle,S=T||y,C=this.sValue,d=this.dragging,m=this.calcOffset(C),x=S({class:"".concat(t,"-handle"),prefixCls:t,vertical:n,offset:m,value:C,dragging:d,disabled:o,min:p,max:w,reverse:_,index:0,tabindex:u,ariaLabel:c,ariaLabelledBy:h,ariaValueTextFormatter:f,style:l[0]||l,ref:function(v){return e.saveHandle(0,v)},onFocus:this.onFocus,onBlur:this.onBlur}),b=M!==void 0?this.calcOffset(M):0,V=s[0]||s;return{tracks:this.getTrack({prefixCls:t,reverse:_,vertical:n,included:a,offset:b,minimumTrackStyle:r,mergedTrackStyle:V,length:m-b}),handles:x}}}});const ya=Pn(ga);var he=function(e){var t=e.value,n=e.handle,a=e.bounds,o=e.props,r=o.allowCross,s=o.pushable,l=Number(s),u=rt(t,o),c=u;return!r&&n!=null&&a!==void 0&&(n>0&&u<=a[n-1]+l&&(c=a[n-1]+l),n=a[n+1]-l&&(c=a[n+1]-l)),Cn(c,o)},ba={defaultValue:O.arrayOf(O.number),value:O.arrayOf(O.number),count:Number,pushable:In(O.oneOfType([O.looseBool,O.number])),allowCross:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},reverse:{type:Boolean,default:void 0},tabindex:O.arrayOf(O.number),prefixCls:String,min:Number,max:Number,autofocus:{type:Boolean,default:void 0},ariaLabelGroupForHandles:Array,ariaLabelledByGroupForHandles:Array,ariaValueTextFormatterGroupForHandles:Array,draggableTrack:{type:Boolean,default:void 0}},wa=j({compatConfig:{MODE:3},name:"Range",mixins:[Fe],inheritAttrs:!1,props:Qe(ba,{count:1,allowCross:!0,pushable:!1,tabindex:[],draggableTrack:!1,ariaLabelGroupForHandles:[],ariaLabelledByGroupForHandles:[],ariaValueTextFormatterGroupForHandles:[]}),emits:["beforeChange","afterChange","change"],displayName:"Range",data:function(){var e=this,t=this.count,n=this.min,a=this.max,o=Array.apply(void 0,q(Array(t+1))).map(function(){return n}),r=_e(this,"defaultValue")?this.defaultValue:o,s=this.value;s===void 0&&(s=r);var l=s.map(function(c,h){return he({value:c,handle:h,props:e.$props})}),u=l[0]===a?0:l.length-1;return{sHandle:null,recent:u,bounds:l}},watch:{value:{handler:function(e){var t=this.bounds;this.setChangeValue(e||t)},deep:!0},min:function(){var e=this.value;this.setChangeValue(e||this.bounds)},max:function(){var e=this.value;this.setChangeValue(e||this.bounds)}},methods:{setChangeValue:function(e){var t=this,n=this.bounds,a=e.map(function(r,s){return he({value:r,handle:s,bounds:n,props:t.$props})});if(n.length===a.length){if(a.every(function(r,s){return r===n[s]}))return null}else a=e.map(function(r,s){return he({value:r,handle:s,props:t.$props})});if(this.setState({bounds:a}),e.some(function(r){return bn(r,t.$props)})){var o=e.map(function(r){return rt(r,t.$props)});this.$emit("change",o)}},onChange:function(e){var t=!_e(this,"value");if(t)this.setState(e);else{var n={};["sHandle","recent"].forEach(function(r){e[r]!==void 0&&(n[r]=e[r])}),Object.keys(n).length&&this.setState(n)}var a=g(g({},this.$data),e),o=a.bounds;this.$emit("change",o)},positionGetValue:function(e){var t=this.getValue(),n=this.calcValueByPos(e),a=this.getClosestBound(n),o=this.getBoundNeedMoving(n,a),r=t[o];if(n===r)return null;var s=q(t);return s[o]=n,s},onStart:function(e){var t=this.bounds;this.$emit("beforeChange",t);var n=this.calcValueByPos(e);this.startValue=n,this.startPosition=e;var a=this.getClosestBound(n);this.prevMovedHandleIndex=this.getBoundNeedMoving(n,a),this.setState({sHandle:this.prevMovedHandleIndex,recent:this.prevMovedHandleIndex});var o=t[this.prevMovedHandleIndex];if(n!==o){var r=q(t);r[this.prevMovedHandleIndex]=n,this.onChange({bounds:r})}},onEnd:function(e){var t=this.sHandle;this.removeDocumentEvents(),t||(this.dragTrack=!1),(t!==null||e)&&this.$emit("afterChange",this.bounds),this.setState({sHandle:null})},onMove:function(e,t,n,a){ce(e);var o=this.$data,r=this.$props,s=r.max||100,l=r.min||0;if(n){var u=r.vertical?-t:t;u=r.reverse?-u:u;var c=s-Math.max.apply(Math,q(a)),h=l-Math.min.apply(Math,q(a)),f=Math.min(Math.max(u/(this.getSliderLength()/100),h),c),p=a.map(function(y){return Math.floor(Math.max(Math.min(y+f,s),l))});o.bounds.map(function(y,S){return y===p[S]}).some(function(y){return!y})&&this.onChange({bounds:p});return}var w=this.bounds,M=this.sHandle,_=this.calcValueByPos(t),T=w[M];_!==T&&this.moveTo(_)},onKeyboard:function(e){var t=this.$props,n=t.reverse,a=t.vertical,o=xn(e,a,n);if(o){ce(e);var r=this.bounds,s=this.sHandle,l=r[s===null?this.recent:s],u=o(l,this.$props),c=he({value:u,handle:s,bounds:r,props:this.$props});if(c===l)return;var h=!0;this.moveTo(c,h)}},getClosestBound:function(e){for(var t=this.bounds,n=0,a=1;a=t[a]&&(n=a);return Math.abs(t[n+1]-e)=a.length||r<0)return!1;var s=t+n,l=a[r],u=this.pushable,c=Number(u),h=n*(e[s]-l);return this.pushHandle(e,s,n,c-h)?(e[t]=l,!0):!1},trimAlignValue:function(e){var t=this.sHandle,n=this.bounds;return he({value:e,handle:t,bounds:n,props:this.$props})},ensureValueNotConflict:function(e,t,n){var a=n.allowCross,o=n.pushable,r=this.$data||{},s=r.bounds;if(e=e===void 0?r.sHandle:e,o=Number(o),!a&&e!=null&&s!==void 0){if(e>0&&t<=s[e-1]+o)return s[e-1]+o;if(e=s[e+1]-o)return s[e+1]-o}return t},getTrack:function(e){var t=e.bounds,n=e.prefixCls,a=e.reverse,o=e.vertical,r=e.included,s=e.offsets,l=e.trackStyle;return t.slice(0,-1).map(function(u,c){var h,f=c+1,p=G((h={},B(h,"".concat(n,"-track"),!0),B(h,"".concat(n,"-track-").concat(f),!0),h));return k(ot,{class:p,vertical:o,reverse:a,included:r,offset:s[f-1],length:s[f]-s[f-1],style:l[c],key:f},null)})},renderSlider:function(){var e=this,t=this.sHandle,n=this.bounds,a=this.prefixCls,o=this.vertical,r=this.included,s=this.disabled,l=this.min,u=this.max,c=this.reverse,h=this.handle,f=this.defaultHandle,p=this.trackStyle,w=this.handleStyle,M=this.tabindex,_=this.ariaLabelGroupForHandles,T=this.ariaLabelledByGroupForHandles,y=this.ariaValueTextFormatterGroupForHandles,S=h||f,C=n.map(function(x){return e.calcOffset(x)}),d="".concat(a,"-handle"),m=n.map(function(x,b){var V,P=M[b]||0;(s||M[b]===null)&&(P=null);var v=t===b;return S({class:G((V={},B(V,d,!0),B(V,"".concat(d,"-").concat(b+1),!0),B(V,"".concat(d,"-dragging"),v),V)),prefixCls:a,vertical:o,dragging:v,offset:C[b],value:x,index:b,tabindex:P,min:l,max:u,reverse:c,disabled:s,style:w[b],ref:function(N){return e.saveHandle(b,N)},onFocus:e.onFocus,onBlur:e.onBlur,ariaLabel:_[b],ariaLabelledBy:T[b],ariaValueTextFormatter:y[b]})});return{tracks:this.getTrack({bounds:n,prefixCls:a,reverse:c,vertical:o,included:r,offsets:C,trackStyle:p}),handles:m}}}});const Ca=Pn(wa),xa=j({compatConfig:{MODE:3},name:"SliderTooltip",inheritAttrs:!1,props:hn(),setup:function(e,t){var n=t.attrs,a=t.slots,o=D(null),r=D(null);function s(){J.cancel(r.value),r.value=null}function l(){r.value=J(function(){var c;(c=o.value)===null||c===void 0||c.forcePopupAlign(),r.value=null})}var u=function(){s(),e.visible&&l()};return z([function(){return e.visible},function(){return e.title}],function(){u()},{flush:"post",immediate:!0}),Wn(function(){u()}),Ne(function(){s()}),function(){return k(va,g(g({ref:o},e),n),a)}}});var Pa=["value","dragging","index"],Ta=["tooltipPrefixCls","range","id"],Sa=function(e){return typeof e=="number"?e.toString():""},Ma=function(){return{id:String,prefixCls:String,tooltipPrefixCls:String,range:{type:[Boolean,Object],default:void 0},reverse:{type:Boolean,default:void 0},min:Number,max:Number,step:{type:[Number,Object]},marks:{type:Object},dots:{type:Boolean,default:void 0},value:{type:[Number,Array]},defaultValue:{type:[Number,Array]},included:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},vertical:{type:Boolean,default:void 0},tipFormatter:{type:[Function,Object],default:function(){return Sa}},tooltipVisible:{type:Boolean,default:void 0},tooltipPlacement:{type:String},getTooltipPopupContainer:{type:Function},autofocus:{type:Boolean,default:void 0},handleStyle:{type:[Object,Array]},trackStyle:{type:[Object,Array]},onChange:{type:Function},onAfterChange:{type:Function},onFocus:{type:Function},onBlur:{type:Function},"onUpdate:value":{type:Function}}},Oa=j({compatConfig:{MODE:3},name:"ASlider",inheritAttrs:!1,props:Ma(),slots:["mark"],setup:function(e,t){var n=t.attrs,a=t.slots,o=t.emit,r=t.expose,s=Zt("slider",e),l=s.prefixCls,u=s.rootPrefixCls,c=s.direction,h=s.getPopupContainer,f=s.configProvider,p=ti(),w=D(),M=D({}),_=function(b,V){M.value[b]=V},T=L(function(){return e.tooltipPlacement?e.tooltipPlacement:e.vertical?c.value==="rtl"?"left":"right":"top"}),y=function(){var b;(b=w.value)===null||b===void 0||b.focus()},S=function(){var b;(b=w.value)===null||b===void 0||b.blur()},C=function(b){o("update:value",b),o("change",b),p.onFieldChange()},d=function(b){o("blur",b)};r({focus:y,blur:S});var m=function(b){var V=b.tooltipPrefixCls,P=b.info,v=P.value,$=P.dragging,N=P.index,H=$e(P,Pa),R=e.tipFormatter,F=e.tooltipVisible,U=e.getTooltipPopupContainer,re=R?M.value[N]||$:!1,de=F||F===void 0&&re;return k(xa,{prefixCls:V,title:R?R(v):"",visible:de,placement:T.value,transitionName:"".concat(u.value,"-zoom-down"),key:N,overlayClassName:"".concat(l.value,"-tooltip"),getPopupContainer:U||h.value},{default:function(){return[k(yn,g(g({},H),{},{value:v,onMouseenter:function(){return _(N,!0)},onMouseleave:function(){return _(N,!1)}}),null)]}})};return function(){var x=e.tooltipPrefixCls,b=e.range,V=e.id,P=V===void 0?p.id.value:V,v=$e(e,Ta),$=f.getPrefixCls("tooltip",x),N=G(n.class,B({},"".concat(l.value,"-rtl"),c.value==="rtl"));c.value==="rtl"&&!v.vertical&&(v.reverse=!v.reverse);var H;return fe(b)==="object"&&(H=b.draggableTrack),b?k(Ca,g(g({},v),{},{step:v.step,draggableTrack:H,class:N,ref:w,handle:function(F){return m({tooltipPrefixCls:$,prefixCls:l.value,info:F})},prefixCls:l.value,onChange:C,onBlur:d}),{mark:a.mark}):k(ya,g(g({},v),{},{id:P,step:v.step,class:N,ref:w,handle:function(F){return m({tooltipPrefixCls:$,prefixCls:l.value,info:F})},prefixCls:l.value,onChange:C,onBlur:d}),{mark:a.mark})}}});const ka=Jt(Oa),Va=["aria-expanded"],_a={class:"dd__title"},$a={class:"dd__chevron","aria-hidden":"true"},Aa=["inert"],Da={class:"dd__clip"},Ba={class:"dd__body"},Na=j({__name:"DropDown",props:{text:{},defaultOpen:{type:Boolean,default:!1}},setup(i){const t=D(i.defaultOpen);return(n,a)=>(I(),W("div",{class:le(["dd",{"is-open":t.value}])},[E("button",{type:"button",class:"dd__head","aria-expanded":t.value,onClick:a[0]||(a[0]=o=>t.value=!t.value)},[E("h3",_a,[ft(n.$slots,"text",{},()=>[ge(oe(i.text),1)],!0)]),E("span",$a,[k(Ae,{icon:"vuesax-linear:arrow-down",size:"16"})])],8,Va),E("div",{class:"dd__panel",inert:!t.value},[E("div",Da,[E("div",Ba,[ft(n.$slots,"default",{},void 0,!0)])])],8,Aa)],2))}}),Ut=en(Na,[["__scopeId","data-v-7988b636"]]),Ea={class:"fSheet__headRow"},Fa={id:"fSheet-title",class:"fSheet__title"},Ha={key:0,class:"fSheet__count"},Ra={class:"fSheet__body"},La={key:0,class:"fSheet__chips"},ja=["aria-pressed","onClick"],Ia={key:1,class:"fSheet__empty"},Wa={class:"fSheet__gram"},za={class:"fSheet__gramFigures"},Ua={class:"fSheet__gramFigure"},Xa={class:"fSheet__gramFigure"},Ya=90,Ga=.5,Ka=j({__name:"Filters",props:{show:{type:Boolean},modelValue:{},filterKeys:{},products:{}},emits:["update:show","update:filterKeys"],setup(i,{emit:e}){const t=i,n=e,a=L(()=>{const P=new Map;for(const v of t.products)v.brand&&P.set(v.brand.id,v.brand);return[...P.values()]}),o=L(()=>{const P=t.products.flatMap(v=>v.variants.map($=>parseFloat($.rashWeightGrams)));return P.length===0?[0,100]:[Math.floor(Math.min(...P)),Math.ceil(Math.max(...P))]}),r=D([]),s=D([...o.value]);let l=!1;function u(){r.value=[...t.modelValue.brands];const P=t.modelValue.limit_gram;l=P.length===2,s.value=P.length===2?[P[0],P[1]]:[...o.value]}z(()=>t.show,P=>{P&&u()},{immediate:!0}),z(o,P=>{l||(s.value=[...P])});function c(P){Array.isArray(P)&&(s.value=[P[0],P[1]],l=!0)}const h=L(()=>{const[P,v]=s.value,[$,N]=o.value;return Math.abs(P-$)>.001||Math.abs(v-N)>.001}),f=L(()=>r.value.length+(h.value?1:0));function p(P){const v=r.value.indexOf(P);r.value=v===-1?[...r.value,P]:r.value.filter($=>$!==P)}function w(P){return P%1===0?String(P):String(+P.toFixed(2))}function M(){const P=t.modelValue;P.brands=[...r.value],P.limit_gram=h.value?[...s.value]:[];const v=[];P.brands.length&&v.push("brands"),P.limit_gram.length&&v.push("limit_gram"),n("update:filterKeys",v),T()}function _(){r.value=[],s.value=[...o.value],l=!1,M()}function T(){n("update:show",!1)}const y=D(0),S=D(!1);let C=0,d=0;const m=L(()=>y.value?{transform:`translate3d(0, ${y.value}px, 0)`}:void 0);function x(P){P.target.closest("button")||(C=P.touches[0].clientY,d=Date.now(),S.value=!0)}function b(P){if(!S.value)return;const v=P.touches[0].clientY-C;y.value=v>0?v:v*.12}function V(){if(!S.value)return;S.value=!1;const P=y.value/Math.max(1,Date.now()-d);y.value>Ya||y.value>30&&P>Ga?T():y.value=0}return(P,v)=>(I(),tn(te(zn),{show:i.show,position:"bottom",teleport:"body",transition:"fSheet-slide",class:"fSheet","overlay-class":"fSheet__overlay","close-on-popstate":"","onUpdate:show":v[0]||(v[0]=$=>n("update:show",$)),onClosed:v[1]||(v[1]=$=>y.value=0)},{default:K(()=>[E("div",{class:le(["fSheet__card",{"is-dragging":S.value}]),style:Un(m.value),dir:"rtl",role:"dialog","aria-modal":"true","aria-labelledby":"fSheet-title"},[E("header",{class:"fSheet__head",onTouchstartPassive:x,onTouchmovePassive:b,onTouchend:V,onTouchcancel:V},[v[3]||(v[3]=E("span",{class:"fSheet__grip","aria-hidden":"true"},null,-1)),E("div",Ea,[E("h3",Fa,[v[2]||(v[2]=ge(" فیلترها ",-1)),f.value?(I(),W("span",Ha,oe(f.value),1)):Oe("",!0)]),E("button",{type:"button",class:"fSheet__close","aria-label":"بستن",onClick:T},[k(Ae,{icon:"vuesax-linear:add",size:"18"})])])],32),E("div",Ra,[k(Ut,{text:"برند","default-open":""},{default:K(()=>[a.value.length?(I(),W("div",La,[(I(!0),W(Ve,null,Ue(a.value,$=>(I(),W("button",{key:$.id,type:"button",class:le(["fSheet__chip",{"is-on":r.value.includes($.id)}]),"aria-pressed":r.value.includes($.id),onClick:N=>p($.id)},oe($.title),11,ja))),128))])):(I(),W("p",Ia,"برندی برای فیلتر موجود نیست."))]),_:1}),k(Ut,{text:"وزن (گرم)","default-open":""},{default:K(()=>[E("div",Wa,[k(te(ka),{value:s.value,step:.01,range:"",reverse:"",min:o.value[0],max:o.value[1],"tooltip-visible":!1,"onUpdate:value":c},null,8,["value","min","max"]),E("div",za,[E("span",Ua,[v[4]||(v[4]=E("i",null,"کمترین",-1)),E("b",null,oe(w(s.value[0])),1),v[5]||(v[5]=ge(" گرم ",-1))]),E("span",Xa,[v[6]||(v[6]=E("i",null,"بیشترین",-1)),E("b",null,oe(w(s.value[1])),1),v[7]||(v[7]=ge(" گرم ",-1))])])])]),_:1})]),E("footer",{class:"fSheet__bar"},[E("button",{type:"button",class:"fSheet__clear",onClick:_},"پاک کردن"),E("button",{type:"button",class:"fSheet__apply",onClick:M},"اعمال فیلتر")])],6)]),_:1},8,["show"]))}}),qa={class:"search"},Za={class:"search__barExtra"},Qa={class:"search__chips no-scrollbar"},Ja=["onClick"],eo={key:0,class:"search__grid"},to={key:2,class:"search__empty"},We=20,no=j({__name:"SearchView",setup(i){const e=Xn(),t=D(!1),n=D(!1),a=D([]),o=D(!1),r=D([]),s=L(()=>{const C=new Map;for(const d of a.value)d.category&&C.set(d.category.id,d.category);return[...C.values()]}),l=L(()=>{let C=a.value;const d=e.query;return d.text&&(C=C.filter(m=>m.title.includes(d.text))),d.cats&&d.cats.length>0&&(C=C.filter(m=>m.category&&d.cats.includes(m.category.id))),d.brands.length>0&&(C=C.filter(m=>m.brand&&d.brands.includes(m.brand.id))),d.limit_gram.length===2&&(C=C.filter(m=>m.variants.some(x=>parseFloat(x.rashWeightGrams)>=d.limit_gram[0]&&parseFloat(x.rashWeightGrams)<=d.limit_gram[1]))),C}),u=D(We),c=L(()=>l.value.slice(0,u.value)),h=L(()=>u.value{C.some(d=>d.isIntersecting)&&h.value&&(u.value+=We)},{rootMargin:"400px"}),p.observe(f.value))}z(l,()=>{u.value=We}),z(f,w),Ne(()=>p==null?void 0:p.disconnect());async function M(){t.value=!0;try{a.value=await Yn.listProducts()}finally{t.value=!1}}async function _(){await M(),n.value=!1}function T(C){e.query.text=C}function y(C){e.query.cats=C?[C]:void 0}function S(){o.value=!0}return be(M),(C,d)=>{const m=vt("Loading"),x=vt("container");return I(),W("div",qa,[k(Gn,{title:"جستجو"},{below:K(()=>[E("div",Za,[k(Kn,{onSearch:T,"place-holder":"جستجوی دسته بندی، محصولات و ..."}),E("div",Qa,[E("button",{type:"button",class:le(["search__chip search__chip--filter",{"is-on":r.value.length>0}]),onClick:S},[k(Ae,{icon:"vuesax-linear:filter",size:"15"}),ge(" "+oe(r.value.length>0?`${r.value.length} فیلتر`:"فیلتر"),1)],2),E("button",{type:"button",class:le(["search__chip",{"is-on":!te(e).query.cats}]),onClick:d[0]||(d[0]=b=>y(void 0))}," همه ",2),(I(!0),W(Ve,null,Ue(s.value,b=>(I(),W("button",{key:b.id,type:"button",class:le(["search__chip",{"is-on":te(e).query.cats&&te(e).query.cats[0]===b.id}]),onClick:V=>y(b.id)},oe(b.title),11,Ja))),128))])])]),_:1}),k(dt,{spinning:t.value,tip:"درحال دریافت اطلاعات"},{default:K(()=>[k(te(ii),{modelValue:n.value,"onUpdate:modelValue":d[1]||(d[1]=b=>n.value=b),onRefresh:_},{pulling:K(()=>[k(m,{size:"18"})]),loosing:K(()=>[k(m,{size:"18"})]),loading:K(()=>[k(m,{size:"18"})]),success:K(()=>[...d[5]||(d[5]=[E("span",null,null,-1)])]),default:K(()=>[k(x,{class:"search__body"},{default:K(()=>[l.value.length?(I(),W("div",eo,[(I(!0),W(Ve,null,Ue(c.value,b=>(I(),tn(ni,{key:b.id,value:b},null,8,["value"]))),128))])):Oe("",!0),h.value?(I(),W("div",{key:1,ref_key:"sentinel",ref:f,class:"search__more"},[k(dt,{spinning:!0,indicator:!0,fixed:!1,tip:"",cls:"my-[10px]"})],512)):Oe("",!0),!l.value.length&&!t.value?(I(),W("section",to,[k(Ae,{icon:"vuesax-linear:search-normal-1",size:"26"}),d[6]||(d[6]=E("p",null,"محصولی با این مشخصات پیدا نشد.",-1))])):Oe("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["spinning"]),k(Ka,{show:o.value,"onUpdate:show":d[2]||(d[2]=b=>o.value=b),filterKeys:r.value,"onUpdate:filterKeys":d[3]||(d[3]=b=>r.value=b),modelValue:te(e).query,"onUpdate:modelValue":d[4]||(d[4]=b=>te(e).query=b),products:a.value},null,8,["show","filterKeys","modelValue","products"])])}}}),po=en(no,[["__scopeId","data-v-036a6a0e"]]);export{po as default}; diff --git a/apps/user-app-v2/dist/assets/SectionHead-BiCEpXAe.js b/apps/user-app-v2/dist/assets/SectionHead-DNG9ywW4.js similarity index 90% rename from apps/user-app-v2/dist/assets/SectionHead-BiCEpXAe.js rename to apps/user-app-v2/dist/assets/SectionHead-DNG9ywW4.js index 4d601f2..ce2cc39 100644 --- a/apps/user-app-v2/dist/assets/SectionHead-BiCEpXAe.js +++ b/apps/user-app-v2/dist/assets/SectionHead-DNG9ywW4.js @@ -1 +1 @@ -import{d as r,f as t,c as s,b as o,t as a,e as n,N as _,p as d,I as u,_ as b}from"./index-BWyw3RAx.js";const m={class:"sec"},f={class:"sec__text"},x={class:"sec__title"},h={key:0,class:"sec__sub"},k=r({__name:"SectionHead",props:{title:{},subtitle:{},actionLabel:{}},emits:["action"],setup(e,{emit:i}){const l=i;return(p,c)=>(t(),s("header",m,[o("div",f,[o("h2",x,a(e.title),1),e.subtitle?(t(),s("p",h,a(e.subtitle),1)):n("",!0)]),e.actionLabel?(t(),s("button",{key:0,type:"button",class:"sec__action",onClick:c[0]||(c[0]=N=>l("action"))},[_(a(e.actionLabel)+" ",1),d(u,{icon:"vuesax-linear:arrow-left-2",size:"15"})])):n("",!0)]))}}),y=b(k,[["__scopeId","data-v-e5c65b7c"]]);export{y as S}; +import{d as r,f as t,c as s,b as o,t as a,e as n,N as _,p as d,I as u,_ as b}from"./index-Dp9sxvBv.js";const m={class:"sec"},f={class:"sec__text"},x={class:"sec__title"},h={key:0,class:"sec__sub"},k=r({__name:"SectionHead",props:{title:{},subtitle:{},actionLabel:{}},emits:["action"],setup(e,{emit:i}){const l=i;return(p,c)=>(t(),s("header",m,[o("div",f,[o("h2",x,a(e.title),1),e.subtitle?(t(),s("p",h,a(e.subtitle),1)):n("",!0)]),e.actionLabel?(t(),s("button",{key:0,type:"button",class:"sec__action",onClick:c[0]||(c[0]=N=>l("action"))},[_(a(e.actionLabel)+" ",1),d(u,{icon:"vuesax-linear:arrow-left-2",size:"15"})])):n("",!0)]))}}),y=b(k,[["__scopeId","data-v-e5c65b7c"]]);export{y as S}; diff --git a/apps/user-app-v2/dist/assets/TransactionsView-BaIYETDv.js b/apps/user-app-v2/dist/assets/TransactionsView-CUA8xQcy.js similarity index 91% rename from apps/user-app-v2/dist/assets/TransactionsView-BaIYETDv.js rename to apps/user-app-v2/dist/assets/TransactionsView-CUA8xQcy.js index 1a9e4bb..9b60080 100644 --- a/apps/user-app-v2/dist/assets/TransactionsView-BaIYETDv.js +++ b/apps/user-app-v2/dist/assets/TransactionsView-CUA8xQcy.js @@ -1 +1 @@ -import{d as k,O as A,o as C,s as D,c as i,p as _,z as f,J as w,j as L,m as E,e as m,g as u,f as l,F as y,b as s,r as N,I as g,t as o,i as p,B as M,_ as O}from"./index-BWyw3RAx.js";import{P}from"./PageBar-D5DXU6sO.js";import{S as B}from"./SectionHead-BiCEpXAe.js";import{j as R,p as U}from"./filters-DVocLz3o.js";import{D as I}from"./index-sLHXZqt3.js";import"./KeyCode-CA5MXqE7.js";import"./classCallCheck-Ou87VTNv.js";import"./raf-nDFcuFT6.js";const V={class:"tx"},$={class:"tx__list"},z=["onClick"],Y={class:"tx__main"},j={class:"tx__head"},F={class:"tx__kind"},G={key:0,class:"tx__note"},H={class:"tx__foot"},J={class:"tx__date"},K={key:1,class:"tx__empty"},Q={class:"sheet"},W={class:"sheet__specs"},q={class:"sheet__spec"},X={class:"sheet__spec"},Z={class:"sheet__spec"},ss={class:"sheet__spec"},es={class:"sheet__spec"},ts=k({__name:"TransactionsView",setup(os){const x={ORDER_STOCK:"سفارش",ORDER_PRE_ORDER:"سفارش ساخت",REPAYMENT_MELTED_GOLD:"طلای آب‌شده",REPAYMENT_TRANSFER:"حواله",REPAYMENT_CHEQUE:"چک",REPAYMENT_CASH:"پولی",WALLET_BONUS:"پاداش",ADJUSTMENT:"اصلاحیه"},T=A(),r=u(!1),d=u([]),v=u(!1),n=u(null),c=a=>a.direction==="CREDIT",h=a=>a.currency==="GOLD_GRAM"?`${a.amount} گرم`:`${U(a.amount)} ریال`,S=a=>{n.value=a,v.value=!0};return C(async()=>{if(T.isLoggedIn){r.value=!0;try{d.value=await D.getMyLedgerEntries()}finally{r.value=!1}}}),(a,e)=>{const b=M("container");return l(),i("div",V,[_(P,{title:"اسناد","back-to":"userPage::hasSubRoute"}),_(w,{spinning:r.value,tip:"درحال دریافت اطلاعات"},{default:f(()=>[_(b,{class:"tx__body"},{default:f(()=>[d.value.length?(l(),i(y,{key:0},[_(B,{title:"گردش حساب",subtitle:`${d.value.length} سند`},null,8,["subtitle"]),s("div",$,[(l(!0),i(y,null,N(d.value,t=>(l(),i("article",{key:t.id,class:"tx__row",onClick:ns=>S(t)},[s("span",{class:p(["tx__mark",c(t)?"is-in":"is-out"]),"aria-hidden":"true"},[_(g,{icon:c(t)?"vuesax-linear:arrow-down":"vuesax-linear:arrow-up",size:"16"},null,8,["icon"])],2),s("div",Y,[s("div",j,[s("h3",F,o(x[t.sourceType]??t.sourceType),1),s("span",{class:p(["tx__amount",c(t)?"is-in":"is-out"])},o(h(t)),3)]),t.note?(l(),i("p",G,o(t.note),1)):m("",!0),s("div",H,[s("span",J,o(E(R)(t.createdAt)),1),s("span",{class:p(["tx__state",{"is-pending":!t.confirmed}])},o(t.confirmed?"تایید شده":"در انتظار تایید"),3)])])],8,z))),128))])],64)):r.value?m("",!0):(l(),i("section",K,[_(g,{icon:"vuesax-linear:receipt-text",size:"26"}),e[1]||(e[1]=s("p",null,"سندی برای حساب شما ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"]),n.value?(l(),L(E(I),{key:0,visible:v.value,"onUpdate:visible":e[0]||(e[0]=t=>v.value=t),placement:"bottom",closable:!1,height:"420px",class:"rtl",bodyStyle:{padding:0}},{default:f(()=>[s("div",Q,[e[7]||(e[7]=s("h3",{class:"sheet__title"},"جزئیات سند",-1)),s("dl",W,[s("div",q,[e[2]||(e[2]=s("dt",null,"نوع سند",-1)),s("dd",null,o(x[n.value.sourceType]??n.value.sourceType),1)]),s("div",X,[e[3]||(e[3]=s("dt",null,"مبلغ",-1)),s("dd",{class:p(c(n.value)?"is-in":"is-out")},o(h(n.value)),3)]),s("div",Z,[e[4]||(e[4]=s("dt",null,"وضعیت",-1)),s("dd",null,o(n.value.confirmed?"تایید شده":"در انتظار تایید"),1)]),s("div",ss,[e[5]||(e[5]=s("dt",null,"تاریخ",-1)),s("dd",null,o(E(R)(n.value.createdAt)),1)]),s("div",es,[e[6]||(e[6]=s("dt",null,"توضیحات",-1)),s("dd",null,o(n.value.note||"—"),1)])])])]),_:1},8,["visible"])):m("",!0)])}}}),ps=O(ts,[["__scopeId","data-v-3923099b"]]);export{ps as default}; +import{d as k,O as A,o as C,s as D,c as i,p as _,z as f,J as w,j as L,m as E,e as m,g as u,f as l,F as y,b as s,r as N,I as g,t as o,i as p,B as M,_ as O}from"./index-Dp9sxvBv.js";import{P}from"./PageBar-El-laHqK.js";import{S as B}from"./SectionHead-DNG9ywW4.js";import{j as R,p as U}from"./filters-CUgGgSea.js";import{D as I}from"./index-UuozCFb-.js";import"./KeyCode-DAs3W-5E.js";import"./classCallCheck-BTVV3tFI.js";import"./raf-nDFcuFT6.js";const V={class:"tx"},$={class:"tx__list"},z=["onClick"],Y={class:"tx__main"},j={class:"tx__head"},F={class:"tx__kind"},G={key:0,class:"tx__note"},H={class:"tx__foot"},J={class:"tx__date"},K={key:1,class:"tx__empty"},Q={class:"sheet"},W={class:"sheet__specs"},q={class:"sheet__spec"},X={class:"sheet__spec"},Z={class:"sheet__spec"},ss={class:"sheet__spec"},es={class:"sheet__spec"},ts=k({__name:"TransactionsView",setup(os){const x={ORDER_STOCK:"سفارش",ORDER_PRE_ORDER:"سفارش ساخت",REPAYMENT_MELTED_GOLD:"طلای آب‌شده",REPAYMENT_TRANSFER:"حواله",REPAYMENT_CHEQUE:"چک",REPAYMENT_CASH:"پولی",WALLET_BONUS:"پاداش",ADJUSTMENT:"اصلاحیه"},T=A(),r=u(!1),d=u([]),v=u(!1),n=u(null),c=a=>a.direction==="CREDIT",h=a=>a.currency==="GOLD_GRAM"?`${a.amount} گرم`:`${U(a.amount)} ریال`,S=a=>{n.value=a,v.value=!0};return C(async()=>{if(T.isLoggedIn){r.value=!0;try{d.value=await D.getMyLedgerEntries()}finally{r.value=!1}}}),(a,e)=>{const b=M("container");return l(),i("div",V,[_(P,{title:"اسناد","back-to":"userPage::hasSubRoute"}),_(w,{spinning:r.value,tip:"درحال دریافت اطلاعات"},{default:f(()=>[_(b,{class:"tx__body"},{default:f(()=>[d.value.length?(l(),i(y,{key:0},[_(B,{title:"گردش حساب",subtitle:`${d.value.length} سند`},null,8,["subtitle"]),s("div",$,[(l(!0),i(y,null,N(d.value,t=>(l(),i("article",{key:t.id,class:"tx__row",onClick:ns=>S(t)},[s("span",{class:p(["tx__mark",c(t)?"is-in":"is-out"]),"aria-hidden":"true"},[_(g,{icon:c(t)?"vuesax-linear:arrow-down":"vuesax-linear:arrow-up",size:"16"},null,8,["icon"])],2),s("div",Y,[s("div",j,[s("h3",F,o(x[t.sourceType]??t.sourceType),1),s("span",{class:p(["tx__amount",c(t)?"is-in":"is-out"])},o(h(t)),3)]),t.note?(l(),i("p",G,o(t.note),1)):m("",!0),s("div",H,[s("span",J,o(E(R)(t.createdAt)),1),s("span",{class:p(["tx__state",{"is-pending":!t.confirmed}])},o(t.confirmed?"تایید شده":"در انتظار تایید"),3)])])],8,z))),128))])],64)):r.value?m("",!0):(l(),i("section",K,[_(g,{icon:"vuesax-linear:receipt-text",size:"26"}),e[1]||(e[1]=s("p",null,"سندی برای حساب شما ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"]),n.value?(l(),L(E(I),{key:0,visible:v.value,"onUpdate:visible":e[0]||(e[0]=t=>v.value=t),placement:"bottom",closable:!1,height:"420px",class:"rtl",bodyStyle:{padding:0}},{default:f(()=>[s("div",Q,[e[7]||(e[7]=s("h3",{class:"sheet__title"},"جزئیات سند",-1)),s("dl",W,[s("div",q,[e[2]||(e[2]=s("dt",null,"نوع سند",-1)),s("dd",null,o(x[n.value.sourceType]??n.value.sourceType),1)]),s("div",X,[e[3]||(e[3]=s("dt",null,"مبلغ",-1)),s("dd",{class:p(c(n.value)?"is-in":"is-out")},o(h(n.value)),3)]),s("div",Z,[e[4]||(e[4]=s("dt",null,"وضعیت",-1)),s("dd",null,o(n.value.confirmed?"تایید شده":"در انتظار تایید"),1)]),s("div",ss,[e[5]||(e[5]=s("dt",null,"تاریخ",-1)),s("dd",null,o(E(R)(n.value.createdAt)),1)]),s("div",es,[e[6]||(e[6]=s("dt",null,"توضیحات",-1)),s("dd",null,o(n.value.note||"—"),1)])])])]),_:1},8,["visible"])):m("",!0)])}}}),ps=O(ts,[["__scopeId","data-v-3923099b"]]);export{ps as default}; diff --git a/apps/user-app-v2/dist/assets/classCallCheck-Ou87VTNv.js b/apps/user-app-v2/dist/assets/classCallCheck-BTVV3tFI.js similarity index 80% rename from apps/user-app-v2/dist/assets/classCallCheck-Ou87VTNv.js rename to apps/user-app-v2/dist/assets/classCallCheck-BTVV3tFI.js index afed7e3..ce79a23 100644 --- a/apps/user-app-v2/dist/assets/classCallCheck-Ou87VTNv.js +++ b/apps/user-app-v2/dist/assets/classCallCheck-BTVV3tFI.js @@ -1 +1 @@ -import{a0 as n}from"./index-BWyw3RAx.js";function l(a,t){for(var r=n({},a),e=0;e>>0,s;for(s=0;s0)for(r=0;r>>0,s;for(s=0;s0)for(r=0;r=0;return(i?r?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+s}var pt=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ve=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Yt={},pe={};function M(e,t,r,s){var a=s;typeof s=="string"&&(a=function(){return this[s]()}),e&&(pe[e]=a),t&&(pe[t[0]]=function(){return B(a.apply(this,arguments),t[1],t[2])}),r&&(pe[r]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function ps(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function Ys(e){var t=e.match(pt),r,s;for(r=0,s=t.length;r=0&&Ve.test(e);)e=e.replace(Ve,s),Ve.lastIndex=0,r-=1;return e}var ws={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function gs(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(pt).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[e])}var ks="Invalid date";function Ss(){return this._invalidDate}var vs="%d",Os=/\d{1,2}/;function Ts(e){return this._ordinal.replace("%d",e)}var js={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function bs(e,t,r,s){var a=this._relativeTime[r];return q(a)?a(e,t,r,s):a.replace(/%d/i,e)}function xs(e,t){var r=this._relativeTime[e>0?"future":"past"];return q(r)?r(t):r.replace(/%s/i,t)}var ar={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function V(e){return typeof e=="string"?ar[e]||ar[e.toLowerCase()]:void 0}function wt(e){var t={},r,s;for(s in e)c(e,s)&&(r=V(s),r&&(t[r]=e[s]));return t}var Ps={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Ls(e){var t=[],r;for(r in e)c(e,r)&&t.push({unit:r,priority:Ps[r]});return t.sort(function(s,a){return s.priority-a.priority}),t}var nr=/\d/,H=/\d\d/,ir=/\d{3}/,gt=/\d{4}/,ze=/[+-]?\d{6}/,j=/\d\d?/,or=/\d\d\d\d?/,lr=/\d\d\d\d\d\d?/,Ze=/\d{1,3}/,kt=/\d{1,4}/,$e=/[+-]?\d{1,6}/,Ye=/\d+/,Je=/[+-]?\d+/,Ns=/Z|[+-]\d\d:?\d\d/gi,qe=/Z|[+-]\d\d(?::?\d\d)?/gi,Fs=/[+-]?\d+(\.\d{1,3})?/,be=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,we=/^[1-9]\d?/,St=/^([1-9]\d|\d)/,Be;Be={};function y(e,t,r){Be[e]=q(t)?t:function(s,a){return s&&r?r:t}}function Ws(e,t){return c(Be,e)?Be[e](t._strict,t._locale):new RegExp(Rs(e))}function Rs(e){return K(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,r,s,a,i){return r||s||a||i}))}function K(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function G(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function g(e){var t=+e,r=0;return t!==0&&isFinite(t)&&(r=G(t)),r}var vt={};function O(e,t){var r,s=t,a;for(typeof e=="string"&&(e=[e]),C(t)&&(s=function(i,d){d[t]=g(i)}),a=e.length,r=0;r68?1900:2e3)};var ur=ge("FullYear",!0);function Hs(){return Qe(this.year())}function ge(e,t){return function(r){return r!=null?(dr(this,e,r),l.updateOffset(this,t),this):Le(this,e)}}function Le(e,t){if(!e.isValid())return NaN;var r=e._d,s=e._isUTC;switch(t){case"Milliseconds":return s?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return s?r.getUTCSeconds():r.getSeconds();case"Minutes":return s?r.getUTCMinutes():r.getMinutes();case"Hours":return s?r.getUTCHours():r.getHours();case"Date":return s?r.getUTCDate():r.getDate();case"Day":return s?r.getUTCDay():r.getDay();case"Month":return s?r.getUTCMonth():r.getMonth();case"FullYear":return s?r.getUTCFullYear():r.getFullYear();default:return NaN}}function dr(e,t,r){var s,a,i,d,m;if(!(!e.isValid()||isNaN(r))){switch(s=e._d,a=e._isUTC,t){case"Milliseconds":return void(a?s.setUTCMilliseconds(r):s.setMilliseconds(r));case"Seconds":return void(a?s.setUTCSeconds(r):s.setSeconds(r));case"Minutes":return void(a?s.setUTCMinutes(r):s.setMinutes(r));case"Hours":return void(a?s.setUTCHours(r):s.setHours(r));case"Date":return void(a?s.setUTCDate(r):s.setDate(r));case"FullYear":break;default:return}i=r,d=e.month(),m=e.date(),m=m===29&&d===1&&!Qe(i)?28:m,a?s.setUTCFullYear(i,d,m):s.setFullYear(i,d,m)}}function As(e){return e=V(e),q(this[e])?this[e]():this}function Es(e,t){if(typeof e=="object"){e=wt(e);var r=Ls(e),s,a=r.length;for(s=0;s=0?(m=new Date(e+400,t,r,s,a,i,d),isFinite(m.getFullYear())&&m.setFullYear(e)):m=new Date(e,t,r,s,a,i,d),m}function Ne(e){var t,r;return e<100&&e>=0?(r=Array.prototype.slice.call(arguments),r[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Xe(e,t,r){var s=7+t-r,a=(7+Ne(e,0,s).getUTCDay()-t)%7;return-a+s-1}function yr(e,t,r,s,a){var i=(7+r-s)%7,d=Xe(e,s,a),m=1+7*(t-1)+i+d,D,k;return m<=0?(D=e-1,k=Pe(D)+m):m>Pe(e)?(D=e+1,k=m-Pe(e)):(D=e,k=m),{year:D,dayOfYear:k}}function Fe(e,t,r){var s=Xe(e.year(),t,r),a=Math.floor((e.dayOfYear()-s-1)/7)+1,i,d;return a<1?(d=e.year()-1,i=a+re(d,t,r)):a>re(e.year(),t,r)?(i=a-re(e.year(),t,r),d=e.year()+1):(d=e.year(),i=a),{week:i,year:d}}function re(e,t,r){var s=Xe(e,t,r),a=Xe(e+1,t,r);return(Pe(e)-s+a)/7}M("w",["ww",2],"wo","week"),M("W",["WW",2],"Wo","isoWeek"),y("w",j,we),y("ww",j,H),y("W",j,we),y("WW",j,H),xe(["w","ww","W","WW"],function(e,t,r,s){t[s.substr(0,1)]=g(e)});function ta(e){return Fe(e,this._week.dow,this._week.doy).week}var ra={dow:0,doy:6};function sa(){return this._week.dow}function aa(){return this._week.doy}function na(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function ia(e){var t=Fe(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}M("d",0,"do","day"),M("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),M("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),M("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),M("e",0,0,"weekday"),M("E",0,0,"isoWeekday"),y("d",j),y("e",j),y("E",j),y("dd",function(e,t){return t.weekdaysMinRegex(e)}),y("ddd",function(e,t){return t.weekdaysShortRegex(e)}),y("dddd",function(e,t){return t.weekdaysRegex(e)}),xe(["dd","ddd","dddd"],function(e,t,r,s){var a=r._locale.weekdaysParse(e,s,r._strict);a!=null?t.d=a:w(r).invalidWeekday=e}),xe(["d","e","E"],function(e,t,r,s){t[s]=g(e)});function oa(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function la(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Tt(e,t){return e.slice(t,7).concat(e.slice(0,t))}var ua="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Mr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),da="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),fa=be,ha=be,ca=be;function _a(e,t){var r=_(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Tt(r,this._week.dow):e?r[e.day()]:r}function ma(e){return e===!0?Tt(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function ya(e){return e===!0?Tt(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Ma(e,t,r){var s,a,i,d=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)i=J([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(i,"").toLocaleLowerCase();return r?t==="dddd"?(a=N.call(this._weekdaysParse,d),a!==-1?a:null):t==="ddd"?(a=N.call(this._shortWeekdaysParse,d),a!==-1?a:null):(a=N.call(this._minWeekdaysParse,d),a!==-1?a:null):t==="dddd"?(a=N.call(this._weekdaysParse,d),a!==-1||(a=N.call(this._shortWeekdaysParse,d),a!==-1)?a:(a=N.call(this._minWeekdaysParse,d),a!==-1?a:null)):t==="ddd"?(a=N.call(this._shortWeekdaysParse,d),a!==-1||(a=N.call(this._weekdaysParse,d),a!==-1)?a:(a=N.call(this._minWeekdaysParse,d),a!==-1?a:null)):(a=N.call(this._minWeekdaysParse,d),a!==-1||(a=N.call(this._weekdaysParse,d),a!==-1)?a:(a=N.call(this._shortWeekdaysParse,d),a!==-1?a:null))}function Da(e,t,r){var s,a,i;if(this._weekdaysParseExact)return Ma.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(a=J([2e3,1]).day(s),r&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(i="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[s]=new RegExp(i.replace(".",""),"i")),r&&t==="dddd"&&this._fullWeekdaysParse[s].test(e))return s;if(r&&t==="ddd"&&this._shortWeekdaysParse[s].test(e))return s;if(r&&t==="dd"&&this._minWeekdaysParse[s].test(e))return s;if(!r&&this._weekdaysParse[s].test(e))return s}}function pa(e){if(!this.isValid())return e!=null?this:NaN;var t=Le(this,"Day");return e!=null?(e=oa(e,this.localeData()),this.add(e-t,"d")):t}function Ya(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function wa(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=la(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function ga(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||jt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=fa),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function ka(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||jt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ha),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Sa(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||jt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ca),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function jt(){function e(U,oe){return oe.length-U.length}var t=[],r=[],s=[],a=[],i,d,m,D,k;for(i=0;i<7;i++)d=J([2e3,1]).day(i),m=K(this.weekdaysMin(d,"")),D=K(this.weekdaysShort(d,"")),k=K(this.weekdays(d,"")),t.push(m),r.push(D),s.push(k),a.push(m),a.push(D),a.push(k);t.sort(e),r.sort(e),s.sort(e),a.sort(e),this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function bt(){return this.hours()%12||12}function va(){return this.hours()||24}M("H",["HH",2],0,"hour"),M("h",["hh",2],0,bt),M("k",["kk",2],0,va),M("hmm",0,0,function(){return""+bt.apply(this)+B(this.minutes(),2)}),M("hmmss",0,0,function(){return""+bt.apply(this)+B(this.minutes(),2)+B(this.seconds(),2)}),M("Hmm",0,0,function(){return""+this.hours()+B(this.minutes(),2)}),M("Hmmss",0,0,function(){return""+this.hours()+B(this.minutes(),2)+B(this.seconds(),2)});function Dr(e,t){M(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Dr("a",!0),Dr("A",!1);function pr(e,t){return t._meridiemParse}y("a",pr),y("A",pr),y("H",j,St),y("h",j,we),y("k",j,we),y("HH",j,H),y("hh",j,H),y("kk",j,H),y("hmm",or),y("hmmss",lr),y("Hmm",or),y("Hmmss",lr),O(["H","HH"],W),O(["k","kk"],function(e,t,r){var s=g(e);t[W]=s===24?0:s}),O(["a","A"],function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e}),O(["h","hh"],function(e,t,r){t[W]=g(e),w(r).bigHour=!0}),O("hmm",function(e,t,r){var s=e.length-2;t[W]=g(e.substr(0,s)),t[Z]=g(e.substr(s)),w(r).bigHour=!0}),O("hmmss",function(e,t,r){var s=e.length-4,a=e.length-2;t[W]=g(e.substr(0,s)),t[Z]=g(e.substr(s,2)),t[te]=g(e.substr(a)),w(r).bigHour=!0}),O("Hmm",function(e,t,r){var s=e.length-2;t[W]=g(e.substr(0,s)),t[Z]=g(e.substr(s))}),O("Hmmss",function(e,t,r){var s=e.length-4,a=e.length-2;t[W]=g(e.substr(0,s)),t[Z]=g(e.substr(s,2)),t[te]=g(e.substr(a))});function Oa(e){return(e+"").toLowerCase().charAt(0)==="p"}var Ta=/[ap]\.?m?\.?/i,ja=ge("Hours",!0);function ba(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var Yr={calendar:Ms,longDateFormat:ws,invalidDate:ks,ordinal:vs,dayOfMonthOrdinalParse:Os,relativeTime:js,months:Gs,monthsShort:fr,week:ra,weekdays:ua,weekdaysMin:da,weekdaysShort:Mr,meridiemParse:Ta},P={},We={},Re;function xa(e,t){var r,s=Math.min(e.length,t.length);for(r=0;r0;){if(a=Ke(i.slice(0,r).join("-")),a)return a;if(s&&s.length>=r&&xa(i,s)>=r-1)break;r--}t++}return Re}function La(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Ke(e){var t=null,r;if(P[e]===void 0&&n&&n.exports&&La(e))try{t=Re._abbr,r=Do,r("./locale/"+e),de(t)}catch{P[e]=null}return P[e]}function de(e,t){var r;return e&&(F(t)?r=se(e):r=xt(e,t),r?Re=r:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Re._abbr}function xt(e,t){if(t!==null){var r,s=Yr;if(t.abbr=e,P[e]!=null)rr("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=P[e]._config;else if(t.parentLocale!=null)if(P[t.parentLocale]!=null)s=P[t.parentLocale]._config;else if(r=Ke(t.parentLocale),r!=null)s=r._config;else return We[t.parentLocale]||(We[t.parentLocale]=[]),We[t.parentLocale].push({name:e,config:t}),null;return P[e]=new Mt(yt(s,t)),We[e]&&We[e].forEach(function(a){xt(a.name,a.config)}),de(e),P[e]}else return delete P[e],null}function Na(e,t){if(t!=null){var r,s,a=Yr;P[e]!=null&&P[e].parentLocale!=null?P[e].set(yt(P[e]._config,t)):(s=Ke(e),s!=null&&(a=s._config),t=yt(a,t),s==null&&(t.abbr=e),r=new Mt(t),r.parentLocale=P[e],P[e]=r),de(e)}else P[e]!=null&&(P[e].parentLocale!=null?(P[e]=P[e].parentLocale,e===de()&&de(e)):P[e]!=null&&delete P[e]);return P[e]}function se(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Re;if(!_(e)){if(t=Ke(e),t)return t;e=[e]}return Pa(e)}function Fa(){return Dt(P)}function Pt(e){var t,r=e._a;return r&&w(e).overflow===-2&&(t=r[ee]<0||r[ee]>11?ee:r[Q]<1||r[Q]>Ot(r[R],r[ee])?Q:r[W]<0||r[W]>24||r[W]===24&&(r[Z]!==0||r[te]!==0||r[ye]!==0)?W:r[Z]<0||r[Z]>59?Z:r[te]<0||r[te]>59?te:r[ye]<0||r[ye]>999?ye:-1,w(e)._overflowDayOfYear&&(tQ)&&(t=Q),w(e)._overflowWeeks&&t===-1&&(t=Us),w(e)._overflowWeekday&&t===-1&&(t=Is),w(e).overflow=t),e}var Wa=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ra=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ca=/Z|[+-]\d\d(?::?\d\d)?/,et=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Lt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ua=/^\/?Date\((-?\d+)/i,Ia=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Ha={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function gr(e){var t,r,s=e._i,a=Wa.exec(s)||Ra.exec(s),i,d,m,D,k=et.length,U=Lt.length;if(a){for(w(e).iso=!0,t=0,r=k;tPe(d)||e._dayOfYear===0)&&(w(e)._overflowDayOfYear=!0),r=Ne(d,0,e._dayOfYear),e._a[ee]=r.getUTCMonth(),e._a[Q]=r.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=s[t]=a[t];for(;t<7;t++)e._a[t]=s[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[W]===24&&e._a[Z]===0&&e._a[te]===0&&e._a[ye]===0&&(e._nextDay=!0,e._a[W]=0),e._d=(e._useUTC?Ne:ea).apply(null,s),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[W]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==i&&(w(e).weekdayMismatch=!0)}}function Ja(e){var t,r,s,a,i,d,m,D,k;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(i=1,d=4,r=ke(t.GG,e._a[R],Fe(b(),1,4).year),s=ke(t.W,1),a=ke(t.E,1),(a<1||a>7)&&(D=!0)):(i=e._locale._week.dow,d=e._locale._week.doy,k=Fe(b(),i,d),r=ke(t.gg,e._a[R],k.year),s=ke(t.w,k.week),t.d!=null?(a=t.d,(a<0||a>6)&&(D=!0)):t.e!=null?(a=t.e+i,(t.e<0||t.e>6)&&(D=!0)):a=i),s<1||s>re(r,i,d)?w(e)._overflowWeeks=!0:D!=null?w(e)._overflowWeekday=!0:(m=yr(r,s,a,i,d),e._a[R]=m.year,e._dayOfYear=m.dayOfYear)}l.ISO_8601=function(){},l.RFC_2822=function(){};function Ft(e){if(e._f===l.ISO_8601){gr(e);return}if(e._f===l.RFC_2822){kr(e);return}e._a=[],w(e).empty=!0;var t=""+e._i,r,s,a,i,d,m=t.length,D=0,k,U;for(a=sr(e._f,e._locale).match(pt)||[],U=a.length,r=0;r0&&w(e).unusedInput.push(d),t=t.slice(t.indexOf(s)+s.length),D+=s.length),pe[i]?(s?w(e).empty=!1:w(e).unusedTokens.push(i),Cs(i,s,e)):e._strict&&!s&&w(e).unusedTokens.push(i);w(e).charsLeftOver=m-D,t.length>0&&w(e).unusedInput.push(t),e._a[W]<=12&&w(e).bigHour===!0&&e._a[W]>0&&(w(e).bigHour=void 0),w(e).parsedDateParts=e._a.slice(0),w(e).meridiem=e._meridiem,e._a[W]=qa(e._locale,e._a[W],e._meridiem),k=w(e).era,k!==null&&(e._a[R]=e._locale.erasConvertYear(k,e._a[R])),Nt(e),Pt(e)}function qa(e,t,r){var s;return r==null?t:e.meridiemHour!=null?e.meridiemHour(t,r):(e.isPM!=null&&(s=e.isPM(r),s&&t<12&&(t+=12),!s&&t===12&&(t=0)),t)}function Ba(e){var t,r,s,a,i,d,m=!1,D=e._f.length;if(D===0){w(e).invalidFormat=!0,e._d=new Date(NaN);return}for(a=0;athis?this:e:Ee()});function Or(e,t){var r,s;if(t.length===1&&_(t[0])&&(t=t[0]),!t.length)return b();for(r=t[0],s=1;sthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Dn(){if(!F(this._isDSTShifted))return this._isDSTShifted;var e={},t;return mt(e,this),e=Sr(e),e._a?(t=e._isUTC?J(e._a):b(e._a),this._isDSTShifted=this.isValid()&&un(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function pn(){return this.isValid()?!this._isUTC:!1}function Yn(){return this.isValid()?this._isUTC:!1}function jr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var wn=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,gn=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function $(e,t){var r=e,s=null,a,i,d;return rt(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:C(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(s=wn.exec(e))?(a=s[1]==="-"?-1:1,r={y:0,d:g(s[Q])*a,h:g(s[W])*a,m:g(s[Z])*a,s:g(s[te])*a,ms:g(Wt(s[ye]*1e3))*a}):(s=gn.exec(e))?(a=s[1]==="-"?-1:1,r={y:Me(s[2],a),M:Me(s[3],a),w:Me(s[4],a),d:Me(s[5],a),h:Me(s[6],a),m:Me(s[7],a),s:Me(s[8],a)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(d=kn(b(r.from),b(r.to)),r={},r.ms=d.milliseconds,r.M=d.months),i=new tt(r),rt(e)&&c(e,"_locale")&&(i._locale=e._locale),rt(e)&&c(e,"_isValid")&&(i._isValid=e._isValid),i}$.fn=tt.prototype,$.invalid=ln;function Me(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function br(e,t){var r={};return r.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function kn(e,t){var r;return e.isValid()&&t.isValid()?(t=Ct(t,e),e.isBefore(t)?r=br(e,t):(r=br(t,e),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function xr(e,t){return function(r,s){var a,i;return s!==null&&!isNaN(+s)&&(rr(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=r,r=s,s=i),a=$(r,s),Pr(this,a,e),this}}function Pr(e,t,r,s){var a=t._milliseconds,i=Wt(t._days),d=Wt(t._months);e.isValid()&&(s=s??!0,d&&cr(e,Le(e,"Month")+d*r),i&&dr(e,"Date",Le(e,"Date")+i*r),a&&e._d.setTime(e._d.valueOf()+a*r),s&&l.updateOffset(e,i||d))}var Sn=xr(1,"add"),vn=xr(-1,"subtract");function Lr(e){return typeof e=="string"||e instanceof String}function On(e){return z(e)||I(e)||Lr(e)||C(e)||jn(e)||Tn(e)||e===null||e===void 0}function Tn(e){var t=p(e)&&!T(e),r=!1,s=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],a,i,d=s.length;for(a=0;ar.valueOf():r.valueOf()9999?Ge(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):q(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Ge(r,"Z")):Ge(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function En(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",r,s,a,i;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),r="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",i=t+'[")]',this.format(r+s+a+i)}function Vn(e){e||(e=this.isUtc()?l.defaultFormatUtc:l.defaultFormat);var t=Ge(this,e);return this.localeData().postformat(t)}function Gn(e,t){return this.isValid()&&(z(e)&&e.isValid()||b(e).isValid())?$({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function zn(e){return this.from(b(),e)}function Zn(e,t){return this.isValid()&&(z(e)&&e.isValid()||b(e).isValid())?$({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function $n(e){return this.to(b(),e)}function Nr(e){var t;return e===void 0?this._locale._abbr:(t=se(e),t!=null&&(this._locale=t),this)}var Fr=E("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function Wr(){return this._locale}var at=1e3,Se=60*at,nt=60*Se,Rr=(365*400+97)*24*nt;function ve(e,t){return(e%t+t)%t}function Cr(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-Rr:new Date(e,t,r).valueOf()}function Ur(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-Rr:Date.UTC(e,t,r)}function Jn(e){var t,r;if(e=V(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?Ur:Cr,e){case"year":t=r(this.year(),0,1);break;case"quarter":t=r(this.year(),this.month()-this.month()%3,1);break;case"month":t=r(this.year(),this.month(),1);break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=r(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=ve(t+(this._isUTC?0:this.utcOffset()*Se),nt);break;case"minute":t=this._d.valueOf(),t-=ve(t,Se);break;case"second":t=this._d.valueOf(),t-=ve(t,at);break}return this._d.setTime(t),l.updateOffset(this,!0),this}function qn(e){var t,r;if(e=V(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?Ur:Cr,e){case"year":t=r(this.year()+1,0,1)-1;break;case"quarter":t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=r(this.year(),this.month()+1,1)-1;break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=nt-ve(t+(this._isUTC?0:this.utcOffset()*Se),nt)-1;break;case"minute":t=this._d.valueOf(),t+=Se-ve(t,Se)-1;break;case"second":t=this._d.valueOf(),t+=at-ve(t,at)-1;break}return this._d.setTime(t),l.updateOffset(this,!0),this}function Bn(){return this._d.valueOf()-(this._offset||0)*6e4}function Qn(){return Math.floor(this.valueOf()/1e3)}function Xn(){return new Date(this.valueOf())}function Kn(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function ei(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function ti(){return this.isValid()?this.toISOString():null}function ri(){return ct(this)}function si(){return ue({},w(this))}function ai(){return w(this).overflow}function ni(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}M("N",0,0,"eraAbbr"),M("NN",0,0,"eraAbbr"),M("NNN",0,0,"eraAbbr"),M("NNNN",0,0,"eraName"),M("NNNNN",0,0,"eraNarrow"),M("y",["y",1],"yo","eraYear"),M("y",["yy",2],0,"eraYear"),M("y",["yyy",3],0,"eraYear"),M("y",["yyyy",4],0,"eraYear"),y("N",It),y("NN",It),y("NNN",It),y("NNNN",yi),y("NNNNN",Mi),O(["N","NN","NNN","NNNN","NNNNN"],function(e,t,r,s){var a=r._locale.erasParse(e,s,r._strict);a?w(r).era=a:w(r).invalidEra=e}),y("y",Ye),y("yy",Ye),y("yyy",Ye),y("yyyy",Ye),y("yo",Di),O(["y","yy","yyy","yyyy"],R),O(["yo"],function(e,t,r,s){var a;r._locale._eraYearOrdinalRegex&&(a=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[R]=r._locale.eraYearOrdinalParse(e,a):t[R]=parseInt(e,10)});function ii(e,t){var r,s,a,i=this._eras||se("en")._eras;for(r=0,s=i.length;r=0)return i[s]}function li(e,t){var r=e.since<=e.until?1:-1;return t===void 0?l(e.since).year():l(e.since).year()+(t-e.offset)*r}function ui(){var e,t,r,s=this.localeData().eras();for(e=0,t=s.length;ei&&(t=i),vi.call(this,e,t,r,s,a))}function vi(e,t,r,s,a){var i=yr(e,t,r,s,a),d=Ne(i.year,0,i.dayOfYear);return this.year(d.getUTCFullYear()),this.month(d.getUTCMonth()),this.date(d.getUTCDate()),this}M("Q",0,"Qo","quarter"),y("Q",nr),O("Q",function(e,t){t[ee]=(g(e)-1)*3});function Oi(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}M("D",["DD",2],"Do","date"),y("D",j,we),y("DD",j,H),y("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),O(["D","DD"],Q),O("Do",function(e,t){t[Q]=g(e.match(j)[0])});var Hr=ge("Date",!0);M("DDD",["DDDD",3],"DDDo","dayOfYear"),y("DDD",Ze),y("DDDD",ir),O(["DDD","DDDD"],function(e,t,r){r._dayOfYear=g(e)});function Ti(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}M("m",["mm",2],0,"minute"),y("m",j,St),y("mm",j,H),O(["m","mm"],Z);var ji=ge("Minutes",!1);M("s",["ss",2],0,"second"),y("s",j,St),y("ss",j,H),O(["s","ss"],te);var bi=ge("Seconds",!1);M("S",0,0,function(){return~~(this.millisecond()/100)}),M(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),M(0,["SSS",3],0,"millisecond"),M(0,["SSSS",4],0,function(){return this.millisecond()*10}),M(0,["SSSSS",5],0,function(){return this.millisecond()*100}),M(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),M(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),M(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),M(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),y("S",Ze,nr),y("SS",Ze,H),y("SSS",Ze,ir);var fe,Ar;for(fe="SSSS";fe.length<=9;fe+="S")y(fe,Ye);function xi(e,t){t[ye]=g(("0."+e)*1e3)}for(fe="S";fe.length<=9;fe+="S")O(fe,xi);Ar=ge("Milliseconds",!1),M("z",0,0,"zoneAbbr"),M("zz",0,0,"zoneName");function Pi(){return this._isUTC?"UTC":""}function Li(){return this._isUTC?"Coordinated Universal Time":""}var f=je.prototype;f.add=Sn,f.calendar=Pn,f.clone=Ln,f.diff=In,f.endOf=qn,f.format=Vn,f.from=Gn,f.fromNow=zn,f.to=Zn,f.toNow=$n,f.get=As,f.invalidAt=ai,f.isAfter=Nn,f.isBefore=Fn,f.isBetween=Wn,f.isSame=Rn,f.isSameOrAfter=Cn,f.isSameOrBefore=Un,f.isValid=ri,f.lang=Fr,f.locale=Nr,f.localeData=Wr,f.max=tn,f.min=en,f.parsingFlags=si,f.set=Es,f.startOf=Jn,f.subtract=vn,f.toArray=Kn,f.toObject=ei,f.toDate=Xn,f.toISOString=An,f.inspect=En,typeof Symbol<"u"&&Symbol.for!=null&&(f[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),f.toJSON=ti,f.toString=Hn,f.unix=Qn,f.valueOf=Bn,f.creationData=ni,f.eraName=ui,f.eraNarrow=di,f.eraAbbr=fi,f.eraYear=hi,f.year=ur,f.isLeapYear=Hs,f.weekYear=pi,f.isoWeekYear=Yi,f.quarter=f.quarters=Oi,f.month=_r,f.daysInMonth=Qs,f.week=f.weeks=na,f.isoWeek=f.isoWeeks=ia,f.weeksInYear=ki,f.weeksInWeekYear=Si,f.isoWeeksInYear=wi,f.isoWeeksInISOWeekYear=gi,f.date=Hr,f.day=f.days=pa,f.weekday=Ya,f.isoWeekday=wa,f.dayOfYear=Ti,f.hour=f.hours=ja,f.minute=f.minutes=ji,f.second=f.seconds=bi,f.millisecond=f.milliseconds=Ar,f.utcOffset=fn,f.utc=cn,f.local=_n,f.parseZone=mn,f.hasAlignedHourOffset=yn,f.isDST=Mn,f.isLocal=pn,f.isUtcOffset=Yn,f.isUtc=jr,f.isUTC=jr,f.zoneAbbr=Pi,f.zoneName=Li,f.dates=E("dates accessor is deprecated. Use date instead.",Hr),f.months=E("months accessor is deprecated. Use month instead",_r),f.years=E("years accessor is deprecated. Use year instead",ur),f.zone=E("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",hn),f.isDSTShifted=E("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Dn);function Ni(e){return b(e*1e3)}function Fi(){return b.apply(null,arguments).parseZone()}function Er(e){return e}var v=Mt.prototype;v.calendar=Ds,v.longDateFormat=gs,v.invalidDate=Ss,v.ordinal=Ts,v.preparse=Er,v.postformat=Er,v.relativeTime=bs,v.pastFuture=xs,v.set=ys,v.eras=ii,v.erasParse=oi,v.erasConvertYear=li,v.erasAbbrRegex=_i,v.erasNameRegex=ci,v.erasNarrowRegex=mi,v.months=$s,v.monthsShort=Js,v.monthsParse=Bs,v.monthsRegex=Ks,v.monthsShortRegex=Xs,v.week=ta,v.firstDayOfYear=aa,v.firstDayOfWeek=sa,v.weekdays=_a,v.weekdaysMin=ya,v.weekdaysShort=ma,v.weekdaysParse=Da,v.weekdaysRegex=ga,v.weekdaysShortRegex=ka,v.weekdaysMinRegex=Sa,v.isPM=Oa,v.meridiem=ba;function ot(e,t,r,s){var a=se(),i=J().set(s,t);return a[r](i,e)}function Vr(e,t,r){if(C(e)&&(t=e,e=void 0),e=e||"",t!=null)return ot(e,t,r,"month");var s,a=[];for(s=0;s<12;s++)a[s]=ot(e,s,r,"month");return a}function At(e,t,r,s){typeof e=="boolean"?(C(t)&&(r=t,t=void 0),t=t||""):(t=e,r=t,e=!1,C(t)&&(r=t,t=void 0),t=t||"");var a=se(),i=e?a._week.dow:0,d,m=[];if(r!=null)return ot(t,(r+i)%7,s,"day");for(d=0;d<7;d++)m[d]=ot(t,(d+i)%7,s,"day");return m}function Wi(e,t){return Vr(e,t,"months")}function Ri(e,t){return Vr(e,t,"monthsShort")}function Ci(e,t,r){return At(e,t,r,"weekdays")}function Ui(e,t,r){return At(e,t,r,"weekdaysShort")}function Ii(e,t,r){return At(e,t,r,"weekdaysMin")}de("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,r=g(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+r}}),l.lang=E("moment.lang is deprecated. Use moment.locale instead.",de),l.langData=E("moment.langData is deprecated. Use moment.localeData instead.",se);var ae=Math.abs;function Hi(){var e=this._data;return this._milliseconds=ae(this._milliseconds),this._days=ae(this._days),this._months=ae(this._months),e.milliseconds=ae(e.milliseconds),e.seconds=ae(e.seconds),e.minutes=ae(e.minutes),e.hours=ae(e.hours),e.months=ae(e.months),e.years=ae(e.years),this}function Gr(e,t,r,s){var a=$(t,r);return e._milliseconds+=s*a._milliseconds,e._days+=s*a._days,e._months+=s*a._months,e._bubble()}function Ai(e,t){return Gr(this,e,t,1)}function Ei(e,t){return Gr(this,e,t,-1)}function zr(e){return e<0?Math.floor(e):Math.ceil(e)}function Vi(){var e=this._milliseconds,t=this._days,r=this._months,s=this._data,a,i,d,m,D;return e>=0&&t>=0&&r>=0||e<=0&&t<=0&&r<=0||(e+=zr(Et(r)+t)*864e5,t=0,r=0),s.milliseconds=e%1e3,a=G(e/1e3),s.seconds=a%60,i=G(a/60),s.minutes=i%60,d=G(i/60),s.hours=d%24,t+=G(d/24),D=G(Zr(t)),r+=D,t-=zr(Et(D)),m=G(r/12),r%=12,s.days=t,s.months=r,s.years=m,this}function Zr(e){return e*4800/146097}function Et(e){return e*146097/4800}function Gi(e){if(!this.isValid())return NaN;var t,r,s=this._milliseconds;if(e=V(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+s/864e5,r=this._months+Zr(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(Et(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return t*24+s/36e5;case"minute":return t*1440+s/6e4;case"second":return t*86400+s/1e3;case"millisecond":return Math.floor(t*864e5)+s;default:throw new Error("Unknown unit "+e)}}function ne(e){return function(){return this.as(e)}}var $r=ne("ms"),zi=ne("s"),Zi=ne("m"),$i=ne("h"),Ji=ne("d"),qi=ne("w"),Bi=ne("M"),Qi=ne("Q"),Xi=ne("y"),Ki=$r;function eo(){return $(this)}function to(e){return e=V(e),this.isValid()?this[e+"s"]():NaN}function De(e){return function(){return this.isValid()?this._data[e]:NaN}}var ro=De("milliseconds"),so=De("seconds"),ao=De("minutes"),no=De("hours"),io=De("days"),oo=De("months"),lo=De("years");function uo(){return G(this.days()/7)}var ie=Math.round,Oe={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function fo(e,t,r,s,a){return a.relativeTime(t||1,!!r,e,s)}function ho(e,t,r,s){var a=$(e).abs(),i=ie(a.as("s")),d=ie(a.as("m")),m=ie(a.as("h")),D=ie(a.as("d")),k=ie(a.as("M")),U=ie(a.as("w")),oe=ie(a.as("y")),he=i<=r.ss&&["s",i]||i0,he[4]=s,fo.apply(null,he)}function co(e){return e===void 0?ie:typeof e=="function"?(ie=e,!0):!1}function _o(e,t){return Oe[e]===void 0?!1:t===void 0?Oe[e]:(Oe[e]=t,e==="s"&&(Oe.ss=t-1),!0)}function mo(e,t){if(!this.isValid())return this.localeData().invalidDate();var r=!1,s=Oe,a,i;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(r=e),typeof t=="object"&&(s=Object.assign({},Oe,t),t.s!=null&&t.ss==null&&(s.ss=t.s-1)),a=this.localeData(),i=ho(this,!r,s,a),r&&(i=a.pastFuture(+this,i)),a.postformat(i)}var Vt=Math.abs;function Te(e){return(e>0)-(e<0)||+e}function lt(){if(!this.isValid())return this.localeData().invalidDate();var e=Vt(this._milliseconds)/1e3,t=Vt(this._days),r=Vt(this._months),s,a,i,d,m=this.asSeconds(),D,k,U,oe;return m?(s=G(e/60),a=G(s/60),e%=60,s%=60,i=G(r/12),r%=12,d=e?e.toFixed(3).replace(/\.?0+$/,""):"",D=m<0?"-":"",k=Te(this._months)!==Te(m)?"-":"",U=Te(this._days)!==Te(m)?"-":"",oe=Te(this._milliseconds)!==Te(m)?"-":"",D+"P"+(i?k+i+"Y":"")+(r?k+r+"M":"")+(t?U+t+"D":"")+(a||s||e?"T":"")+(a?oe+a+"H":"")+(s?oe+s+"M":"")+(e?oe+d+"S":"")):"P0D"}var S=tt.prototype;S.isValid=on,S.abs=Hi,S.add=Ai,S.subtract=Ei,S.as=Gi,S.asMilliseconds=$r,S.asSeconds=zi,S.asMinutes=Zi,S.asHours=$i,S.asDays=Ji,S.asWeeks=qi,S.asMonths=Bi,S.asQuarters=Qi,S.asYears=Xi,S.valueOf=Ki,S._bubble=Vi,S.clone=eo,S.get=to,S.milliseconds=ro,S.seconds=so,S.minutes=ao,S.hours=no,S.days=io,S.weeks=uo,S.months=oo,S.years=lo,S.humanize=mo,S.toISOString=lt,S.toString=lt,S.toJSON=lt,S.locale=Nr,S.localeData=Wr,S.toIsoString=E("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",lt),S.lang=Fr,M("X",0,0,"unix"),M("x",0,0,"valueOf"),y("x",Je),y("X",Fs),O("X",function(e,t,r){r._d=new Date(parseFloat(e)*1e3)}),O("x",function(e,t,r){r._d=new Date(g(e))});//! moment.js diff --git a/apps/user-app-v2/dist/assets/index-ecOSUWQv.js b/apps/user-app-v2/dist/assets/index-B0RgkHMm.js similarity index 97% rename from apps/user-app-v2/dist/assets/index-ecOSUWQv.js rename to apps/user-app-v2/dist/assets/index-B0RgkHMm.js index fa05507..cc18715 100644 --- a/apps/user-app-v2/dist/assets/index-ecOSUWQv.js +++ b/apps/user-app-v2/dist/assets/index-B0RgkHMm.js @@ -1 +1 @@ -import{d as H,b6 as v,p as n,b7 as w,b8 as A,b9 as P,h as B,ba as C,bb as L,bc as _,bd as N,Q as U,be as M,g as D,K as R,bf as Y,x as F,bg as S,bh as G,bi as K}from"./index-BWyw3RAx.js";const[Q,h]=P("loading"),X=Array(12).fill(null).map((t,l)=>n("i",{class:h("line",String(l+1))},null)),j=n("svg",{class:h("circular"),viewBox:"25 25 50 50"},[n("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),q={size:v,type:A("circular"),color:String,vertical:Boolean,textSize:v,textColor:String};var J=H({name:Q,props:q,setup(t,{slots:l}){const o=B(()=>C({color:t.color},L(t.size))),c=()=>{const i=t.type==="spinner"?X:j;return n("span",{class:h("spinner",t.type),style:o.value},[l.icon?l.icon():i])},g=()=>{var i;if(l.default)return n("span",{class:h("text"),style:{fontSize:w(t.textSize),color:(i=t.textColor)!=null?i:t.color}},[l.default()])};return()=>{const{type:i,vertical:m}=t;return n("div",{class:h([i,{vertical:m}]),"aria-live":"polite","aria-busy":!0},[c(),g()])}}});const O=_(J),[W,f,Z]=P("pull-refresh"),k=50,ee=["pulling","loosing","success"],te={disabled:Boolean,modelValue:Boolean,headHeight:S(k),successText:String,pullingText:String,loosingText:String,loadingText:String,pullDistance:v,successDuration:S(500),animationDuration:S(300)};var ae=H({name:W,props:te,emits:["change","refresh","update:modelValue"],setup(t,{emit:l,slots:o}){let c;const g=D(),i=D(),m=N(g),a=R({status:"normal",distance:0,duration:0}),r=K(),p=()=>{if(t.headHeight!==k)return{height:`${t.headHeight}px`}},T=()=>a.status!=="loading"&&a.status!=="success"&&!t.disabled,$=e=>{const s=+(t.pullDistance||t.headHeight);return e>s&&(e{const d=+(t.pullDistance||t.headHeight);a.distance=e,s?a.status="loading":e===0?a.status="normal":e{const{status:e}=a;return e==="normal"?"":t[`${e}Text`]||Z(e)},z=()=>{const{status:e,distance:s}=a;if(o[e])return o[e]({distance:s});const d=[];return ee.includes(e)&&d.push(n("div",{class:f("text")},[x()])),e==="loading"&&d.push(n(O,{class:f("loading")},{default:x})),d},E=()=>{a.status="success",setTimeout(()=>{u(0)},+t.successDuration)},b=e=>{c=G(m.value)===0,c&&(a.duration=0,r.start(e))},I=e=>{T()&&b(e)},V=e=>{if(T()){c||b(e);const{deltaY:s}=r;r.move(e),c&&s.value>=0&&r.isVertical()&&(Y(e),u($(s.value)))}},y=()=>{c&&r.deltaY.value&&T()&&(a.duration=+t.animationDuration,a.status==="loosing"?(u(+t.headHeight,!0),l("update:modelValue",!0),F(()=>l("refresh"))):u(0))};return U(()=>t.modelValue,e=>{a.duration=+t.animationDuration,e?u(+t.headHeight,!0):o.success||t.successText?E():u(0,!1)}),M("touchmove",V,{target:i}),()=>{var e;const s={transitionDuration:`${a.duration}ms`,transform:a.distance?`translate3d(0,${a.distance}px, 0)`:""};return n("div",{ref:g,class:f()},[n("div",{ref:i,class:f("track"),style:s,onTouchstartPassive:I,onTouchend:y,onTouchcancel:y},[n("div",{class:f("head"),style:p()},[z()]),(e=o.default)==null?void 0:e.call(o)])])}}});const ne=_(ae);export{O as L,ne as P}; +import{d as H,b6 as v,p as n,b7 as w,b8 as A,b9 as P,h as B,ba as C,bb as L,bc as _,bd as N,Q as U,be as M,g as D,K as R,bf as Y,x as F,bg as S,bh as G,bi as K}from"./index-Dp9sxvBv.js";const[Q,h]=P("loading"),X=Array(12).fill(null).map((t,l)=>n("i",{class:h("line",String(l+1))},null)),j=n("svg",{class:h("circular"),viewBox:"25 25 50 50"},[n("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),q={size:v,type:A("circular"),color:String,vertical:Boolean,textSize:v,textColor:String};var J=H({name:Q,props:q,setup(t,{slots:l}){const o=B(()=>C({color:t.color},L(t.size))),c=()=>{const i=t.type==="spinner"?X:j;return n("span",{class:h("spinner",t.type),style:o.value},[l.icon?l.icon():i])},g=()=>{var i;if(l.default)return n("span",{class:h("text"),style:{fontSize:w(t.textSize),color:(i=t.textColor)!=null?i:t.color}},[l.default()])};return()=>{const{type:i,vertical:m}=t;return n("div",{class:h([i,{vertical:m}]),"aria-live":"polite","aria-busy":!0},[c(),g()])}}});const O=_(J),[W,f,Z]=P("pull-refresh"),k=50,ee=["pulling","loosing","success"],te={disabled:Boolean,modelValue:Boolean,headHeight:S(k),successText:String,pullingText:String,loosingText:String,loadingText:String,pullDistance:v,successDuration:S(500),animationDuration:S(300)};var ae=H({name:W,props:te,emits:["change","refresh","update:modelValue"],setup(t,{emit:l,slots:o}){let c;const g=D(),i=D(),m=N(g),a=R({status:"normal",distance:0,duration:0}),r=K(),p=()=>{if(t.headHeight!==k)return{height:`${t.headHeight}px`}},T=()=>a.status!=="loading"&&a.status!=="success"&&!t.disabled,$=e=>{const s=+(t.pullDistance||t.headHeight);return e>s&&(e{const d=+(t.pullDistance||t.headHeight);a.distance=e,s?a.status="loading":e===0?a.status="normal":e{const{status:e}=a;return e==="normal"?"":t[`${e}Text`]||Z(e)},z=()=>{const{status:e,distance:s}=a;if(o[e])return o[e]({distance:s});const d=[];return ee.includes(e)&&d.push(n("div",{class:f("text")},[x()])),e==="loading"&&d.push(n(O,{class:f("loading")},{default:x})),d},E=()=>{a.status="success",setTimeout(()=>{u(0)},+t.successDuration)},b=e=>{c=G(m.value)===0,c&&(a.duration=0,r.start(e))},I=e=>{T()&&b(e)},V=e=>{if(T()){c||b(e);const{deltaY:s}=r;r.move(e),c&&s.value>=0&&r.isVertical()&&(Y(e),u($(s.value)))}},y=()=>{c&&r.deltaY.value&&T()&&(a.duration=+t.animationDuration,a.status==="loosing"?(u(+t.headHeight,!0),l("update:modelValue",!0),F(()=>l("refresh"))):u(0))};return U(()=>t.modelValue,e=>{a.duration=+t.animationDuration,e?u(+t.headHeight,!0):o.success||t.successText?E():u(0,!1)}),M("touchmove",V,{target:i}),()=>{var e;const s={transitionDuration:`${a.duration}ms`,transform:a.distance?`translate3d(0,${a.distance}px, 0)`:""};return n("div",{ref:g,class:f()},[n("div",{ref:i,class:f("track"),style:s,onTouchstartPassive:I,onTouchend:y,onTouchcancel:y},[n("div",{class:f("head"),style:p()},[z()]),(e=o.default)==null?void 0:e.call(o)])])}}});const ne=_(ae);export{O as L,ne as P}; diff --git a/apps/user-app-v2/dist/assets/index-BWyw3RAx.js b/apps/user-app-v2/dist/assets/index-Dp9sxvBv.js similarity index 90% rename from apps/user-app-v2/dist/assets/index-BWyw3RAx.js rename to apps/user-app-v2/dist/assets/index-Dp9sxvBv.js index b408e64..0e3892d 100644 --- a/apps/user-app-v2/dist/assets/index-BWyw3RAx.js +++ b/apps/user-app-v2/dist/assets/index-Dp9sxvBv.js @@ -1,39 +1,39 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomeView-BLj03XEk.js","assets/RateStrip-0Viss8IX.js","assets/filters-DVocLz3o.js","assets/RateStrip-BjkE-E9D.css","assets/index-ecOSUWQv.js","assets/HomeView-BsWyRfva.css","assets/NewestView--pb6tWn4.js","assets/PageBar-D5DXU6sO.js","assets/PageBar-CKAnfXNs.css","assets/SectionHead-BiCEpXAe.js","assets/SectionHead-X7JFvmOG.css","assets/ProductCard-nL92ZIkB.js","assets/ProductCard-C8bieA3Y.css","assets/NewestView-D2rB4-Sw.css","assets/CartView-DyEDwwD2.js","assets/index-sLHXZqt3.js","assets/KeyCode-CA5MXqE7.js","assets/classCallCheck-Ou87VTNv.js","assets/raf-nDFcuFT6.js","assets/index-7kdFQ8tV.js","assets/FormItemContext-Bxnh5gKQ.js","assets/CartView-DSMBGhzx.css","assets/LoginRegisterView-CFYOzXdH.js","assets/LoginRegisterView-COhrUF6E.css","assets/DashboardView-B0WNzWOb.js","assets/DashboardView-D5cEPlGT.css","assets/OrdersView-BcT-EgU-.js","assets/SearchInput-BZCG2e_m.js","assets/SearchInput-DEfgrsbu.css","assets/OrdersView-B7LDWHTY.css","assets/TransactionsView-BaIYETDv.js","assets/TransactionsView-CE67aKDY.css","assets/ProfileView-Bcb3A35W.js","assets/ProfileView-0KcCKpWF.css","assets/FavoritesView-CiVaZUZb.js","assets/FavoritesView-ChC1yylj.css","assets/AppearanceView-ckFSThyi.js","assets/AppearanceView-B8ytXsfh.css","assets/ChildOrdersView-qV6oiil_.js","assets/ChildOrdersView-DS4jSTHf.css","assets/CustomerChoiceView-Yt6glUHR.js","assets/CustomerChoiceView-B2Wj4PsY.css","assets/CompleteProfileView-h4pf7JXN.js","assets/CompleteProfileView-Cy-typLQ.css","assets/ReportView-NtWL-hNL.js","assets/ReportView-DjU8BNPp.css","assets/NotificationsView-QOE6v-gp.js","assets/NotificationsView-BYJ2kMU3.css","assets/SearchView-uJ2hiU7a.js","assets/SearchView-CS1oUiFo.css","assets/CollectionView-C1GrIPCU.js","assets/CollectionView-hOc6F2Q6.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomeView-C0cpdx4l.js","assets/RateStrip-Cjr1qlEL.js","assets/filters-CUgGgSea.js","assets/RateStrip-BjkE-E9D.css","assets/index-B0RgkHMm.js","assets/HomeView-BsWyRfva.css","assets/NewestView-BG4MNUeW.js","assets/PageBar-El-laHqK.js","assets/PageBar-CKAnfXNs.css","assets/SectionHead-DNG9ywW4.js","assets/SectionHead-X7JFvmOG.css","assets/ProductCard-CvKEozHI.js","assets/ProductCard-C8bieA3Y.css","assets/NewestView-D2rB4-Sw.css","assets/CartView-MDu3XibQ.js","assets/index-UuozCFb-.js","assets/KeyCode-DAs3W-5E.js","assets/classCallCheck-BTVV3tFI.js","assets/raf-nDFcuFT6.js","assets/index-UkXhTnpw.js","assets/FormItemContext-C33n6IMx.js","assets/CartView-DSMBGhzx.css","assets/LoginRegisterView-GyFoinkN.js","assets/LoginRegisterView-COhrUF6E.css","assets/DashboardView-BRB4XUhz.js","assets/DashboardView-Dd-mLt1P.css","assets/OrdersView-C8fvzMFb.js","assets/SearchInput-OrOd8Tqr.js","assets/SearchInput-DEfgrsbu.css","assets/OrdersView-BULq1WHJ.css","assets/TransactionsView-CUA8xQcy.js","assets/TransactionsView-CE67aKDY.css","assets/ProfileView-qElFZKrE.js","assets/ProfileView-0KcCKpWF.css","assets/FavoritesView-DxHQrp9E.js","assets/FavoritesView-ChC1yylj.css","assets/AppearanceView-B0bKuyHr.js","assets/AppearanceView-B8ytXsfh.css","assets/ChildOrdersView-CTHMBAuv.js","assets/ChildOrdersView-BSUeH1Jr.css","assets/CustomerChoiceView-D-JqOITb.js","assets/CustomerChoiceView-H1FeybTn.css","assets/CompleteProfileView-CxdqhMlz.js","assets/CompleteProfileView-Cy-typLQ.css","assets/ReportView-ooq-YW_N.js","assets/ReportView-tLoo_9HZ.css","assets/NotificationsView-BuhDQ6dh.js","assets/NotificationsView-BYJ2kMU3.css","assets/SearchView-DNae1fsD.js","assets/SearchView-CS1oUiFo.css","assets/CollectionView-CjJy961h.js","assets/CollectionView-hOc6F2Q6.css"])))=>i.map(i=>d[i]); (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();/** * @vue/shared v3.5.42 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function nr(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const g1={},Je=[],N2=()=>{},ms=()=>!1,dn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),an=e=>e.startsWith("onUpdate:"),P1=Object.assign,or=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Ul=Object.prototype.hasOwnProperty,x1=(e,t)=>Ul.call(e,t),X=Array.isArray,me=e=>ct(e)==="[object Map]",oe=e=>ct(e)==="[object Set]",Kr=e=>ct(e)==="[object Date]",zl=e=>ct(e)==="[object RegExp]",a1=e=>typeof e=="function",y1=e=>typeof e=="string",g2=e=>typeof e=="symbol",m1=e=>e!==null&&typeof e=="object",Ms=e=>(m1(e)||a1(e))&&a1(e.then)&&a1(e.catch),js=Object.prototype.toString,ct=e=>js.call(e),Wl=e=>ct(e).slice(8,-1),xs=e=>ct(e)==="[object Object]",kn=e=>y1(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ot=nr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),un=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Gl=/-\w/g,n2=un(e=>e.replace(Gl,t=>t.slice(1).toUpperCase())),Kl=/\B([A-Z])/g,ke=un(e=>e.replace(Kl,"-$1").toLowerCase()),hn=un(e=>e.charAt(0).toUpperCase()+e.slice(1)),An=un(e=>e?`on${hn(e)}`:""),Y1=(e,t)=>!Object.is(e,t),et=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},pn=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Ls=e=>{const t=y1(e)?Number(e):NaN;return isNaN(t)?e:t};let Yr;const cn=()=>Yr||(Yr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function re(e){if(X(e)){const t={};for(let n=0;n{if(n){const o=n.split(Ql);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function F1(e){let t="";if(y1(e))t=e;else if(X(e))for(let n=0;nb2(n,t))}const Vs=e=>!!(e&&e.__v_isRef===!0),M1=e=>y1(e)?e:e==null?"":X(e)||m1(e)&&(e.toString===js||!a1(e.toString))?Vs(e)?M1(e.value):JSON.stringify(e,ys,2):String(e),ys=(e,t)=>Vs(t)?ys(e,t.value):me(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,r],i)=>(n[Tn(o,i)+" =>"]=r,n),{})}:oe(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Tn(n))}:g2(t)?Tn(t):m1(t)&&!X(t)&&!xs(t)?String(t):t,Tn=(e,t="")=>{var n;return g2(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/** +**/function nr(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const g1={},Je=[],F2=()=>{},ms=()=>!1,dn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),an=e=>e.startsWith("onUpdate:"),A1=Object.assign,or=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},zl=Object.prototype.hasOwnProperty,x1=(e,t)=>zl.call(e,t),X=Array.isArray,me=e=>ct(e)==="[object Map]",oe=e=>ct(e)==="[object Set]",Kr=e=>ct(e)==="[object Date]",Wl=e=>ct(e)==="[object RegExp]",a1=e=>typeof e=="function",y1=e=>typeof e=="string",g2=e=>typeof e=="symbol",m1=e=>e!==null&&typeof e=="object",Ms=e=>(m1(e)||a1(e))&&a1(e.then)&&a1(e.catch),js=Object.prototype.toString,ct=e=>js.call(e),Gl=e=>ct(e).slice(8,-1),xs=e=>ct(e)==="[object Object]",kn=e=>y1(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ot=nr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),un=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Kl=/-\w/g,n2=un(e=>e.replace(Kl,t=>t.slice(1).toUpperCase())),Yl=/\B([A-Z])/g,ke=un(e=>e.replace(Yl,"-$1").toLowerCase()),hn=un(e=>e.charAt(0).toUpperCase()+e.slice(1)),Pn=un(e=>e?`on${hn(e)}`:""),Y1=(e,t)=>!Object.is(e,t),et=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},pn=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Ls=e=>{const t=y1(e)?Number(e):NaN;return isNaN(t)?e:t};let Yr;const cn=()=>Yr||(Yr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function re(e){if(X(e)){const t={};for(let n=0;n{if(n){const o=n.split(Xl);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function N1(e){let t="";if(y1(e))t=e;else if(X(e))for(let n=0;nb2(n,t))}const Vs=e=>!!(e&&e.__v_isRef===!0),M1=e=>y1(e)?e:e==null?"":X(e)||m1(e)&&(e.toString===js||!a1(e.toString))?Vs(e)?M1(e.value):JSON.stringify(e,ys,2):String(e),ys=(e,t)=>Vs(t)?ys(e,t.value):me(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,r],i)=>(n[Tn(o,i)+" =>"]=r,n),{})}:oe(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Tn(n))}:g2(t)?Tn(t):m1(t)&&!X(t)&&!xs(t)?String(t):t,Tn=(e,t="")=>{var n;return g2(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/** * @vue/reactivity v3.5.42 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let N1;class bs{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&N1&&(N1.active?(this.parent=N1,this.index=(N1.scopes||(N1.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const o=this.scopes.slice();for(t=0,n=o.length;t0&&--this._on===0){if(N1===this)N1=this.prevScope;else{let t=N1;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n0)return;if(At){let t=At;for(At=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Pt;){let t=Pt;for(Pt=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function Os(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ps(e){let t,n=e.depsTail,o=n;for(;o;){const r=o.prevDep;o.version===-1?(o===n&&(n=r),dr(o),o3(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=r}e.deps=t,e.depsTail=n}function go(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(As(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function As(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===zt)||(e.globalVersion=zt,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!go(e))))return;e.flags|=2;const t=e.dep,n=V1,o=y2;V1=e,y2=!0;try{Os(e);const r=e.fn(e._value);(t.version===0||Y1(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{V1=n,y2=o,Ps(e),e.flags&=-3}}function dr(e,t=!1){const{dep:n,prevSub:o,nextSub:r}=e;if(o&&(o.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)dr(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function o3(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let y2=!0;const Ts=[];function ie(){Ts.push(y2),y2=!1}function se(){const e=Ts.pop();y2=e===void 0?!0:e}function Xr(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=V1;V1=void 0;try{t()}finally{V1=n}}}let zt=0;class r3{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class wn{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!V1||!y2||V1===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==V1)n=this.activeLink=new r3(V1,this),V1.deps?(n.prevDep=V1.depsTail,V1.depsTail.nextDep=n,V1.depsTail=n):V1.deps=V1.depsTail=n,Is(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=V1.depsTail,n.nextDep=void 0,V1.depsTail.nextDep=n,V1.depsTail=n,V1.deps===n&&(V1.deps=o)}return n}trigger(t){this.version++,zt++,this.notify(t)}notify(t){sr();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{lr()}}}function Is(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)Is(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const R9=new WeakMap,Te=Symbol(""),vo=Symbol(""),Wt=Symbol("");function J1(e,t,n){if(y2&&V1){let o=R9.get(e);o||R9.set(e,o=new Map);let r=o.get(n);r||(o.set(n,r=new wn),r.map=o,r.key=n),r.track()}}function X2(e,t,n,o,r,i){const s=R9.get(e);if(!s){zt++;return}const l=d=>{d&&d.trigger()};if(sr(),t==="clear")s.forEach(l);else{const d=X(e),a=d&&kn(n);if(d&&n==="length"){const k=Number(o);s.forEach((u,h)=>{(h==="length"||h===Wt||!g2(h)&&h>=k)&&l(u)})}else switch((n!==void 0||s.has(void 0))&&l(s.get(n)),a&&l(s.get(Wt)),t){case"add":d?a&&l(s.get("length")):(l(s.get(Te)),me(e)&&l(s.get(vo)));break;case"delete":d||(l(s.get(Te)),me(e)&&l(s.get(vo)));break;case"set":me(e)&&l(s.get(Te));break}}lr()}function i3(e,t){const n=R9.get(e);return n&&n.get(t)}function We(e){const t=w1(e);return t===e?t:(J1(t,"iterate",Wt),w2(e)?t:t.map(Z2))}function Cn(e){return J1(e=w1(e),"iterate",Wt),e}function I2(e,t){return le(e)?st(te(e)?Z2(t):t):Z2(t)}const s3={__proto__:null,[Symbol.iterator](){return Rn(this,Symbol.iterator,e=>I2(this,e))},concat(...e){return We(this).concat(...e.map(t=>X(t)?We(t):t))},entries(){return Rn(this,"entries",e=>(e[1]=I2(this,e[1]),e))},every(e,t){return z2(this,"every",e,t,void 0,arguments)},filter(e,t){return z2(this,"filter",e,t,n=>n.map(o=>I2(this,o)),arguments)},find(e,t){return z2(this,"find",e,t,n=>I2(this,n),arguments)},findIndex(e,t){return z2(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return z2(this,"findLast",e,t,n=>I2(this,n),arguments)},findLastIndex(e,t){return z2(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return z2(this,"forEach",e,t,void 0,arguments)},includes(...e){return $n(this,"includes",e)},indexOf(...e){return $n(this,"indexOf",e)},join(e){return We(this).join(e)},lastIndexOf(...e){return $n(this,"lastIndexOf",e)},map(e,t){return z2(this,"map",e,t,void 0,arguments)},pop(){return vt(this,"pop")},push(...e){return vt(this,"push",e)},reduce(e,...t){return Jr(this,"reduce",e,t)},reduceRight(e,...t){return Jr(this,"reduceRight",e,t)},shift(){return vt(this,"shift")},some(e,t){return z2(this,"some",e,t,void 0,arguments)},splice(...e){return vt(this,"splice",e)},toReversed(){return We(this).toReversed()},toSorted(e){return We(this).toSorted(e)},toSpliced(...e){return We(this).toSpliced(...e)},unshift(...e){return vt(this,"unshift",e)},values(){return Rn(this,"values",e=>I2(this,e))}};function Rn(e,t,n){const o=Cn(e),r=o[t]();return o!==e&&!w2(e)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.done||(i.value=n(i.value)),i}),r}const l3=Array.prototype;function z2(e,t,n,o,r,i){const s=Cn(e),l=s!==e&&!w2(e),d=s[t];if(d!==l3[t]){const u=d.apply(e,i);return l?Z2(u):u}let a=n;s!==e&&(l?a=function(u,h){return n.call(this,I2(e,u),h,e)}:n.length>2&&(a=function(u,h){return n.call(this,u,h,e)}));const k=d.call(s,a,o);return l&&r?r(k):k}function Jr(e,t,n,o){const r=Cn(e),i=r!==e&&!w2(e);let s=n,l=!1;r!==e&&(i?(l=o.length===0,s=function(a,k,u){return l&&(l=!1,a=I2(e,a)),n.call(this,a,I2(e,k),u,e)}):n.length>3&&(s=function(a,k,u){return n.call(this,a,k,u,e)}));const d=r[t](s,...o);return l?I2(e,d):d}function $n(e,t,n){const o=w1(e);J1(o,"iterate",Wt);const r=o[t](...n);return(r===-1||r===!1)&&gn(n[0])?(n[0]=w1(n[0]),o[t](...n)):r}function vt(e,t,n=[]){ie(),sr();const o=w1(e)[t].apply(e,n);return lr(),se(),o}const d3=nr("__proto__,__v_isRef,__isVue"),Rs=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(g2));function a3(e){g2(e)||(e=String(e));const t=w1(this);return J1(t,"has",e),t.hasOwnProperty(e)}class $s{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return o===(r?i?f3:Us:i?qs:Fs).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const s=X(t);if(!r){let d;if(s&&(d=s3[n]))return d;if(n==="hasOwnProperty")return a3}const l=Reflect.get(t,n,_1(t)?t:o);if((g2(n)?Rs.has(n):d3(n))||(r||J1(t,"get",n),i))return l;if(_1(l)){const d=s&&kn(n)?l:l.value;return r&&m1(d)?mo(d):d}return m1(l)?r?mo(l):W1(l):l}}class Ns extends $s{constructor(t=!1){super(!1,t)}set(t,n,o,r){let i=t[n];const s=X(t)&&kn(n);if(!this._isShallow){const a=le(i);if(!w2(o)&&!le(o)&&(i=w1(i),o=w1(o)),!s&&_1(i)&&!_1(o))return a||(i.value=o),!0}const l=s?Number(n)e,w9=e=>Reflect.getPrototypeOf(e);function c3(e,t,n){return function(...o){const r=this.__v_raw,i=w1(r),s=me(i),l=e==="entries"||e===Symbol.iterator&&s,d=e==="keys"&&s,a=r[e](...o),k=n?fo:t?st:Z2;return!t&&J1(i,"iterate",d?vo:Te),P1(Object.create(a),{next(){const{value:u,done:h}=a.next();return h?{value:u,done:h}:{value:l?[k(u[0]),k(u[1])]:k(u),done:h}}})}}function C9(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function w3(e,t){const n={get(r){const i=this.__v_raw,s=w1(i),l=w1(r);e||(Y1(r,l)&&J1(s,"get",r),J1(s,"get",l));const{has:d}=w9(s),a=t?fo:e?st:Z2;if(d.call(s,r))return a(i.get(r));if(d.call(s,l))return a(i.get(l));i!==s&&i.get(r)},get size(){const r=this.__v_raw;return!e&&J1(w1(r),"iterate",Te),r.size},has(r){const i=this.__v_raw,s=w1(i),l=w1(r);return e||(Y1(r,l)&&J1(s,"has",r),J1(s,"has",l)),r===l?i.has(r):i.has(r)||i.has(l)},forEach(r,i){const s=this,l=s.__v_raw,d=w1(l),a=t?fo:e?st:Z2;return!e&&J1(d,"iterate",Te),l.forEach((k,u)=>r.call(i,a(k),a(u),s))}};return P1(n,e?{add:C9("add"),set:C9("set"),delete:C9("delete"),clear:C9("clear")}:{add(r){const i=w1(this),s=w9(i),l=w1(r),d=!t&&!w2(r)&&!le(r)?l:r;return s.has.call(i,d)||Y1(r,d)&&s.has.call(i,r)||Y1(l,d)&&s.has.call(i,l)||(i.add(d),X2(i,"add",d,d)),this},set(r,i){!t&&!w2(i)&&!le(i)&&(i=w1(i));const s=w1(this),{has:l,get:d}=w9(s);let a=l.call(s,r);a||(r=w1(r),a=l.call(s,r));const k=d.call(s,r);return s.set(r,i),a?Y1(i,k)&&X2(s,"set",r,i):X2(s,"add",r,i),this},delete(r){const i=w1(this),{has:s,get:l}=w9(i);let d=s.call(i,r);d||(r=w1(r),d=s.call(i,r)),l&&l.call(i,r);const a=i.delete(r);return d&&X2(i,"delete",r,void 0),a},clear(){const r=w1(this),i=r.size!==0,s=r.clear();return i&&X2(r,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=c3(r,e,t)}),n}function ar(e,t){const n=w3(e,t);return(o,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?o:Reflect.get(x1(n,r)&&r in o?n:o,r,i)}const C3={get:ar(!1,!1)},g3={get:ar(!1,!0)},v3={get:ar(!0,!1)};const Fs=new WeakMap,qs=new WeakMap,Us=new WeakMap,f3=new WeakMap;function m3(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function W1(e){return le(e)?e:kr(e,!1,u3,C3,Fs)}function zs(e){return kr(e,!1,p3,g3,qs)}function mo(e){return kr(e,!0,h3,v3,Us)}function kr(e,t,n,o,r){if(!m1(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=r.get(e);if(i)return i;const s=m3(Wl(e));if(s===0)return e;const l=new Proxy(e,s===2?o:n);return r.set(e,l),l}function te(e){return le(e)?te(e.__v_raw):!!(e&&e.__v_isReactive)}function le(e){return!!(e&&e.__v_isReadonly)}function w2(e){return!!(e&&e.__v_isShallow)}function gn(e){return e?!!e.__v_raw:!1}function w1(e){const t=e&&e.__v_raw;return t?w1(t):e}function ur(e){return!x1(e,"__v_skip")&&Object.isExtensible(e)&&Ds(e,"__v_skip",!0),e}const Z2=e=>m1(e)?W1(e):e,st=e=>m1(e)?mo(e):e;function _1(e){return e?e.__v_isRef===!0:!1}function Q(e){return Ws(e,!1)}function hr(e){return Ws(e,!0)}function Ws(e,t){return _1(e)?e:new M3(e,t)}class M3{constructor(t,n){this.dep=new wn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:w1(t),this._value=n?t:Z2(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||w2(t)||le(t);t=o?t:w1(t),Y1(t,n)&&(this._rawValue=t,this._value=o?t:Z2(t),this.dep.trigger())}}function v1(e){return _1(e)?e.value:e}const j3={get:(e,t,n)=>t==="__v_raw"?e:v1(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const r=e[t];return _1(r)&&!_1(n)?(r.value=n,!0):Reflect.set(e,t,n,o)}};function Gs(e){return te(e)?e:new Proxy(e,j3)}class x3{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new wn,{get:o,set:r}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=r}get value(){return this._value=this._get()}set value(t){this._set(t)}}function D3(e){return new x3(e)}function L3(e){const t=X(e)?new Array(e.length):{};for(const n in e)t[n]=Ks(e,n);return t}class H3{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=g2(n)?n:String(n),this._raw=w1(t);let r=!0,i=t;if(!X(t)||g2(this._key)||!kn(this._key))do r=!gn(i)||w2(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let t=this._object[this._key];return this._shallow&&(t=v1(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&_1(this._raw[this._key])){const n=this._object[this._key];if(_1(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return i3(this._raw,this._key)}}class V3{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function aw(e,t,n){return _1(e)?e:a1(e)?new V3(e):m1(e)&&arguments.length>1?Ks(e,t,n):Q(e)}function Ks(e,t,n){return new H3(e,t,n)}class y3{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new wn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=zt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&V1!==this)return Es(this,!0),!0}get value(){const t=this.dep.track();return As(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function b3(e,t,n=!1){let o,r;return a1(e)?o=e:(o=e.get,r=e.set),new y3(o,r,n)}const g9={},$9=new WeakMap;let _e;function Z3(e,t=!1,n=_e){if(n){let o=$9.get(n);o||$9.set(n,o=[]),o.push(e)}}function _3(e,t,n=g1){const{immediate:o,deep:r,once:i,scheduler:s,augmentJob:l,call:d}=n,a=f=>r?f:w2(f)||r===!1||r===0?J2(f,1):J2(f);let k,u,h,p,C=!1,v=!1;if(_1(e)?(u=()=>e.value,C=w2(e)):te(e)?(u=()=>a(e),C=!0):X(e)?(v=!0,C=e.some(f=>te(f)||w2(f)),u=()=>e.map(f=>{if(_1(f))return f.value;if(te(f))return a(f);if(a1(f))return d?d(f,2):f()})):a1(e)?t?u=d?()=>d(e,2):e:u=()=>{if(h){ie();try{h()}finally{se()}}const f=_e;_e=k;try{return d?d(e,3,[p]):e(p)}finally{_e=f}}:u=N2,t&&r){const f=u,x=r===!0?1/0:r;u=()=>J2(f(),x)}const m=ir(),H=()=>{k.stop(),m&&m.active&&or(m.effects,k)};if(i&&t){const f=t;t=(...x)=>{const D=f(...x);return H(),D}}let g=v?new Array(e.length).fill(g9):g9;const j=f=>{if(!(!(k.flags&1)||!k.dirty&&!f))if(t){const x=k.run();if(f||r||C||(v?x.some((D,y)=>Y1(D,g[y])):Y1(x,g))){h&&h();const D=_e;_e=k;try{const y=[x,g===g9?void 0:v&&g[0]===g9?[]:g,p];g=x,d?d(t,3,y):t(...y)}finally{_e=D}}}else k.run()};return l&&l(j),k=new Bs(u),k.scheduler=s?()=>s(j,!1):j,p=f=>Z3(f,!1,k),h=k.onStop=()=>{const f=$9.get(k);if(f){if(d)d(f,4);else for(const x of f)x();$9.delete(k)}},t?o?j(!0):g=k.run():s?s(j.bind(null,!0),!0):k.run(),H.pause=k.pause.bind(k),H.resume=k.resume.bind(k),H.stop=H,H}function J2(e,t=1/0,n){if(t<=0||!m1(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,_1(e))J2(e.value,t,n);else if(X(e))for(let o=0;o{J2(o,t,n)});else if(xs(e)){for(const o in e)J2(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&J2(e[o],t,n)}return e}/** +**/let F1;class bs{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&F1&&(F1.active?(this.parent=F1,this.index=(F1.scopes||(F1.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const o=this.scopes.slice();for(t=0,n=o.length;t0&&--this._on===0){if(F1===this)F1=this.prevScope;else{let t=F1;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n0)return;if(Pt){let t=Pt;for(Pt=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;At;){let t=At;for(At=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function Os(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function As(e){let t,n=e.depsTail,o=n;for(;o;){const r=o.prevDep;o.version===-1?(o===n&&(n=r),dr(o),r3(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=r}e.deps=t,e.depsTail=n}function go(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ps(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ps(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===zt)||(e.globalVersion=zt,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!go(e))))return;e.flags|=2;const t=e.dep,n=V1,o=y2;V1=e,y2=!0;try{Os(e);const r=e.fn(e._value);(t.version===0||Y1(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{V1=n,y2=o,As(e),e.flags&=-3}}function dr(e,t=!1){const{dep:n,prevSub:o,nextSub:r}=e;if(o&&(o.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)dr(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function r3(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let y2=!0;const Ts=[];function ie(){Ts.push(y2),y2=!1}function se(){const e=Ts.pop();y2=e===void 0?!0:e}function Xr(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=V1;V1=void 0;try{t()}finally{V1=n}}}let zt=0;class i3{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class wn{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!V1||!y2||V1===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==V1)n=this.activeLink=new i3(V1,this),V1.deps?(n.prevDep=V1.depsTail,V1.depsTail.nextDep=n,V1.depsTail=n):V1.deps=V1.depsTail=n,Is(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=V1.depsTail,n.nextDep=void 0,V1.depsTail.nextDep=n,V1.depsTail=n,V1.deps===n&&(V1.deps=o)}return n}trigger(t){this.version++,zt++,this.notify(t)}notify(t){sr();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{lr()}}}function Is(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)Is(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const R9=new WeakMap,Te=Symbol(""),vo=Symbol(""),Wt=Symbol("");function J1(e,t,n){if(y2&&V1){let o=R9.get(e);o||R9.set(e,o=new Map);let r=o.get(n);r||(o.set(n,r=new wn),r.map=o,r.key=n),r.track()}}function X2(e,t,n,o,r,i){const s=R9.get(e);if(!s){zt++;return}const l=d=>{d&&d.trigger()};if(sr(),t==="clear")s.forEach(l);else{const d=X(e),a=d&&kn(n);if(d&&n==="length"){const k=Number(o);s.forEach((u,h)=>{(h==="length"||h===Wt||!g2(h)&&h>=k)&&l(u)})}else switch((n!==void 0||s.has(void 0))&&l(s.get(n)),a&&l(s.get(Wt)),t){case"add":d?a&&l(s.get("length")):(l(s.get(Te)),me(e)&&l(s.get(vo)));break;case"delete":d||(l(s.get(Te)),me(e)&&l(s.get(vo)));break;case"set":me(e)&&l(s.get(Te));break}}lr()}function s3(e,t){const n=R9.get(e);return n&&n.get(t)}function We(e){const t=w1(e);return t===e?t:(J1(t,"iterate",Wt),w2(e)?t:t.map(Z2))}function Cn(e){return J1(e=w1(e),"iterate",Wt),e}function I2(e,t){return le(e)?st(te(e)?Z2(t):t):Z2(t)}const l3={__proto__:null,[Symbol.iterator](){return Rn(this,Symbol.iterator,e=>I2(this,e))},concat(...e){return We(this).concat(...e.map(t=>X(t)?We(t):t))},entries(){return Rn(this,"entries",e=>(e[1]=I2(this,e[1]),e))},every(e,t){return z2(this,"every",e,t,void 0,arguments)},filter(e,t){return z2(this,"filter",e,t,n=>n.map(o=>I2(this,o)),arguments)},find(e,t){return z2(this,"find",e,t,n=>I2(this,n),arguments)},findIndex(e,t){return z2(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return z2(this,"findLast",e,t,n=>I2(this,n),arguments)},findLastIndex(e,t){return z2(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return z2(this,"forEach",e,t,void 0,arguments)},includes(...e){return $n(this,"includes",e)},indexOf(...e){return $n(this,"indexOf",e)},join(e){return We(this).join(e)},lastIndexOf(...e){return $n(this,"lastIndexOf",e)},map(e,t){return z2(this,"map",e,t,void 0,arguments)},pop(){return vt(this,"pop")},push(...e){return vt(this,"push",e)},reduce(e,...t){return Jr(this,"reduce",e,t)},reduceRight(e,...t){return Jr(this,"reduceRight",e,t)},shift(){return vt(this,"shift")},some(e,t){return z2(this,"some",e,t,void 0,arguments)},splice(...e){return vt(this,"splice",e)},toReversed(){return We(this).toReversed()},toSorted(e){return We(this).toSorted(e)},toSpliced(...e){return We(this).toSpliced(...e)},unshift(...e){return vt(this,"unshift",e)},values(){return Rn(this,"values",e=>I2(this,e))}};function Rn(e,t,n){const o=Cn(e),r=o[t]();return o!==e&&!w2(e)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.done||(i.value=n(i.value)),i}),r}const d3=Array.prototype;function z2(e,t,n,o,r,i){const s=Cn(e),l=s!==e&&!w2(e),d=s[t];if(d!==d3[t]){const u=d.apply(e,i);return l?Z2(u):u}let a=n;s!==e&&(l?a=function(u,h){return n.call(this,I2(e,u),h,e)}:n.length>2&&(a=function(u,h){return n.call(this,u,h,e)}));const k=d.call(s,a,o);return l&&r?r(k):k}function Jr(e,t,n,o){const r=Cn(e),i=r!==e&&!w2(e);let s=n,l=!1;r!==e&&(i?(l=o.length===0,s=function(a,k,u){return l&&(l=!1,a=I2(e,a)),n.call(this,a,I2(e,k),u,e)}):n.length>3&&(s=function(a,k,u){return n.call(this,a,k,u,e)}));const d=r[t](s,...o);return l?I2(e,d):d}function $n(e,t,n){const o=w1(e);J1(o,"iterate",Wt);const r=o[t](...n);return(r===-1||r===!1)&&gn(n[0])?(n[0]=w1(n[0]),o[t](...n)):r}function vt(e,t,n=[]){ie(),sr();const o=w1(e)[t].apply(e,n);return lr(),se(),o}const a3=nr("__proto__,__v_isRef,__isVue"),Rs=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(g2));function k3(e){g2(e)||(e=String(e));const t=w1(this);return J1(t,"has",e),t.hasOwnProperty(e)}class $s{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return o===(r?i?m3:Us:i?qs:Ns).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const s=X(t);if(!r){let d;if(s&&(d=l3[n]))return d;if(n==="hasOwnProperty")return k3}const l=Reflect.get(t,n,_1(t)?t:o);if((g2(n)?Rs.has(n):a3(n))||(r||J1(t,"get",n),i))return l;if(_1(l)){const d=s&&kn(n)?l:l.value;return r&&m1(d)?mo(d):d}return m1(l)?r?mo(l):W1(l):l}}class Fs extends $s{constructor(t=!1){super(!1,t)}set(t,n,o,r){let i=t[n];const s=X(t)&&kn(n);if(!this._isShallow){const a=le(i);if(!w2(o)&&!le(o)&&(i=w1(i),o=w1(o)),!s&&_1(i)&&!_1(o))return a||(i.value=o),!0}const l=s?Number(n)e,w9=e=>Reflect.getPrototypeOf(e);function w3(e,t,n){return function(...o){const r=this.__v_raw,i=w1(r),s=me(i),l=e==="entries"||e===Symbol.iterator&&s,d=e==="keys"&&s,a=r[e](...o),k=n?fo:t?st:Z2;return!t&&J1(i,"iterate",d?vo:Te),A1(Object.create(a),{next(){const{value:u,done:h}=a.next();return h?{value:u,done:h}:{value:l?[k(u[0]),k(u[1])]:k(u),done:h}}})}}function C9(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function C3(e,t){const n={get(r){const i=this.__v_raw,s=w1(i),l=w1(r);e||(Y1(r,l)&&J1(s,"get",r),J1(s,"get",l));const{has:d}=w9(s),a=t?fo:e?st:Z2;if(d.call(s,r))return a(i.get(r));if(d.call(s,l))return a(i.get(l));i!==s&&i.get(r)},get size(){const r=this.__v_raw;return!e&&J1(w1(r),"iterate",Te),r.size},has(r){const i=this.__v_raw,s=w1(i),l=w1(r);return e||(Y1(r,l)&&J1(s,"has",r),J1(s,"has",l)),r===l?i.has(r):i.has(r)||i.has(l)},forEach(r,i){const s=this,l=s.__v_raw,d=w1(l),a=t?fo:e?st:Z2;return!e&&J1(d,"iterate",Te),l.forEach((k,u)=>r.call(i,a(k),a(u),s))}};return A1(n,e?{add:C9("add"),set:C9("set"),delete:C9("delete"),clear:C9("clear")}:{add(r){const i=w1(this),s=w9(i),l=w1(r),d=!t&&!w2(r)&&!le(r)?l:r;return s.has.call(i,d)||Y1(r,d)&&s.has.call(i,r)||Y1(l,d)&&s.has.call(i,l)||(i.add(d),X2(i,"add",d,d)),this},set(r,i){!t&&!w2(i)&&!le(i)&&(i=w1(i));const s=w1(this),{has:l,get:d}=w9(s);let a=l.call(s,r);a||(r=w1(r),a=l.call(s,r));const k=d.call(s,r);return s.set(r,i),a?Y1(i,k)&&X2(s,"set",r,i):X2(s,"add",r,i),this},delete(r){const i=w1(this),{has:s,get:l}=w9(i);let d=s.call(i,r);d||(r=w1(r),d=s.call(i,r)),l&&l.call(i,r);const a=i.delete(r);return d&&X2(i,"delete",r,void 0),a},clear(){const r=w1(this),i=r.size!==0,s=r.clear();return i&&X2(r,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=w3(r,e,t)}),n}function ar(e,t){const n=C3(e,t);return(o,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?o:Reflect.get(x1(n,r)&&r in o?n:o,r,i)}const g3={get:ar(!1,!1)},v3={get:ar(!1,!0)},f3={get:ar(!0,!1)};const Ns=new WeakMap,qs=new WeakMap,Us=new WeakMap,m3=new WeakMap;function M3(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function W1(e){return le(e)?e:kr(e,!1,h3,g3,Ns)}function zs(e){return kr(e,!1,c3,v3,qs)}function mo(e){return kr(e,!0,p3,f3,Us)}function kr(e,t,n,o,r){if(!m1(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=r.get(e);if(i)return i;const s=M3(Gl(e));if(s===0)return e;const l=new Proxy(e,s===2?o:n);return r.set(e,l),l}function te(e){return le(e)?te(e.__v_raw):!!(e&&e.__v_isReactive)}function le(e){return!!(e&&e.__v_isReadonly)}function w2(e){return!!(e&&e.__v_isShallow)}function gn(e){return e?!!e.__v_raw:!1}function w1(e){const t=e&&e.__v_raw;return t?w1(t):e}function ur(e){return!x1(e,"__v_skip")&&Object.isExtensible(e)&&Ds(e,"__v_skip",!0),e}const Z2=e=>m1(e)?W1(e):e,st=e=>m1(e)?mo(e):e;function _1(e){return e?e.__v_isRef===!0:!1}function Q(e){return Ws(e,!1)}function hr(e){return Ws(e,!0)}function Ws(e,t){return _1(e)?e:new j3(e,t)}class j3{constructor(t,n){this.dep=new wn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:w1(t),this._value=n?t:Z2(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||w2(t)||le(t);t=o?t:w1(t),Y1(t,n)&&(this._rawValue=t,this._value=o?t:Z2(t),this.dep.trigger())}}function v1(e){return _1(e)?e.value:e}const x3={get:(e,t,n)=>t==="__v_raw"?e:v1(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const r=e[t];return _1(r)&&!_1(n)?(r.value=n,!0):Reflect.set(e,t,n,o)}};function Gs(e){return te(e)?e:new Proxy(e,x3)}class D3{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new wn,{get:o,set:r}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=r}get value(){return this._value=this._get()}set value(t){this._set(t)}}function L3(e){return new D3(e)}function H3(e){const t=X(e)?new Array(e.length):{};for(const n in e)t[n]=Ks(e,n);return t}class V3{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=g2(n)?n:String(n),this._raw=w1(t);let r=!0,i=t;if(!X(t)||g2(this._key)||!kn(this._key))do r=!gn(i)||w2(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let t=this._object[this._key];return this._shallow&&(t=v1(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&_1(this._raw[this._key])){const n=this._object[this._key];if(_1(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return s3(this._raw,this._key)}}class y3{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function kw(e,t,n){return _1(e)?e:a1(e)?new y3(e):m1(e)&&arguments.length>1?Ks(e,t,n):Q(e)}function Ks(e,t,n){return new V3(e,t,n)}class b3{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new wn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=zt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&V1!==this)return Ss(this,!0),!0}get value(){const t=this.dep.track();return Ps(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Z3(e,t,n=!1){let o,r;return a1(e)?o=e:(o=e.get,r=e.set),new b3(o,r,n)}const g9={},$9=new WeakMap;let _e;function _3(e,t=!1,n=_e){if(n){let o=$9.get(n);o||$9.set(n,o=[]),o.push(e)}}function B3(e,t,n=g1){const{immediate:o,deep:r,once:i,scheduler:s,augmentJob:l,call:d}=n,a=f=>r?f:w2(f)||r===!1||r===0?J2(f,1):J2(f);let k,u,h,p,C=!1,v=!1;if(_1(e)?(u=()=>e.value,C=w2(e)):te(e)?(u=()=>a(e),C=!0):X(e)?(v=!0,C=e.some(f=>te(f)||w2(f)),u=()=>e.map(f=>{if(_1(f))return f.value;if(te(f))return a(f);if(a1(f))return d?d(f,2):f()})):a1(e)?t?u=d?()=>d(e,2):e:u=()=>{if(h){ie();try{h()}finally{se()}}const f=_e;_e=k;try{return d?d(e,3,[p]):e(p)}finally{_e=f}}:u=F2,t&&r){const f=u,x=r===!0?1/0:r;u=()=>J2(f(),x)}const m=ir(),H=()=>{k.stop(),m&&m.active&&or(m.effects,k)};if(i&&t){const f=t;t=(...x)=>{const D=f(...x);return H(),D}}let g=v?new Array(e.length).fill(g9):g9;const j=f=>{if(!(!(k.flags&1)||!k.dirty&&!f))if(t){const x=k.run();if(f||r||C||(v?x.some((D,y)=>Y1(D,g[y])):Y1(x,g))){h&&h();const D=_e;_e=k;try{const y=[x,g===g9?void 0:v&&g[0]===g9?[]:g,p];g=x,d?d(t,3,y):t(...y)}finally{_e=D}}}else k.run()};return l&&l(j),k=new Bs(u),k.scheduler=s?()=>s(j,!1):j,p=f=>_3(f,!1,k),h=k.onStop=()=>{const f=$9.get(k);if(f){if(d)d(f,4);else for(const x of f)x();$9.delete(k)}},t?o?j(!0):g=k.run():s?s(j.bind(null,!0),!0):k.run(),H.pause=k.pause.bind(k),H.resume=k.resume.bind(k),H.stop=H,H}function J2(e,t=1/0,n){if(t<=0||!m1(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,_1(e))J2(e.value,t,n);else if(X(e))for(let o=0;o{J2(o,t,n)});else if(xs(e)){for(const o in e)J2(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&J2(e[o],t,n)}return e}/** * @vue/runtime-core v3.5.42 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function l9(e,t,n,o){try{return o?e(...o):e()}catch(r){d9(r,t,n)}}function x2(e,t,n,o){if(a1(e)){const r=l9(e,t,n,o);return r&&Ms(r)&&r.catch(i=>{d9(i,t,n)}),r}if(X(e)){const r=[];for(let i=0;i>>1,r=i2[o],i=Gt(r);i=Gt(n)?i2.push(e):i2.splice(S3(t),0,e),e.flags|=1,Qs()}}function Qs(){N9||(N9=Ys.then(Js))}function Mo(e){if(!X(e))ge&&e.id===-1?ge.splice(Ye+1,0,e):e.flags&1||(tt.push(e),e.flags|=1);else for(let t=0;tGt(n)-Gt(o));if(tt.length=0,ge){for(let n=0;ne.id==null?e.flags&2?-1:1/0:e.id;function Js(e){try{for(T2=0;T2{o._d&&Y9(-1);const i=F9(t),s=ne.length;let l;try{l=e(...r)}finally{for(let d=ne.length;d>s;d--)Vn();F9(i),o._d&&Y9(1)}return l};return o._n=!0,o._c=!0,o._d=!0,o}function cr(e,t){if(Q1===null)return e;const n=yn(Q1),o=e.dirs||(e.dirs=[]);for(let r=0;r1)return n&&a1(t)?t.call(o&&o.proxy):t}}function E3(){return!!(U2()||Ie)}const O3=Symbol.for("v-scx"),P3=()=>z1(O3);function vn(e,t){return fn(e,null,t)}function A3(e,t){return fn(e,null,{flush:"sync"})}function S1(e,t,n){return fn(e,t,n)}function fn(e,t,n=g1){const{immediate:o,deep:r,flush:i,once:s}=n,l=P1({},n),d=t&&o||!t&&i!=="post";let a;if(Jt){if(i==="sync"){const p=P3();a=p.__watcherHandles||(p.__watcherHandles=[])}else if(!d){const p=()=>{};return p.stop=N2,p.resume=N2,p.pause=N2,p}}const k=t2;l.call=(p,C,v)=>x2(p,k,C,v);let u=!1;i==="post"?l.scheduler=p=>{I1(p,k&&k.suspense)}:i!=="sync"&&(u=!0,l.scheduler=(p,C)=>{C?p():pr(p)}),l.augmentJob=p=>{t&&(p.flags|=4),u&&(p.flags|=2,k&&(p.id=k.uid,p.i=k))};const h=_3(e,t,l);return Jt&&(a?a.push(h):d&&h()),h}function T3(e,t,n){const o=this.proxy,r=y1(e)?e.includes(".")?t5(o,e):()=>o[e]:e.bind(o,o);let i;a1(t)?i=t:(i=t.handler,n=t);const s=u9(this),l=fn(r,i.bind(o),n);return s(),l}function t5(e,t){const n=t.split(".");return()=>{let o=e;for(let r=0;re.__isTeleport,Be=e=>e&&(e.disabled||e.disabled===""),I3=e=>e&&(e.defer||e.defer===""),t0=e=>typeof SVGElement<"u"&&e instanceof SVGElement,n0=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,jo=(e,t)=>{const n=e&&e.to;return y1(n)?t?t(n):null:n},R3={name:"Teleport",__isTeleport:!0,process(e,t,n,o,r,i,s,l,d,a){const{mc:k,pc:u,pbc:h,o:{insert:p,querySelector:C,createText:v,createComment:m,parentNode:H}}=a,g=Be(t.props);let{dynamicChildren:j}=t;const f=(y,P,L)=>{y.shapeFlag&16&&k(y.children,P,L,r,i,s,l,d)},x=(y=t)=>{const P=Be(y.props),L=y.target=jo(y.props,C),A=xo(L,y,v,p);L&&(s!=="svg"&&t0(L)?s="svg":s!=="mathml"&&n0(L)&&(s="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(L),P||(f(y,L,A),Zt(y,!1)))},D=y=>{const P=()=>{if(ce.get(y)===P){if(ce.delete(y),Be(y.props)){const L=H(y.el)||n;f(y,L,y.anchor),Zt(y,!0)}x(y)}};ce.set(y,P),I1(P,i)};if(e==null){const y=t.el=v(""),P=t.anchor=v("");if(p(y,n,o),p(P,n,o),I3(t.props)||i&&i.pendingBranch){D(t);return}g&&(f(t,n,P),Zt(t,!0)),x()}else{t.el=e.el;const y=t.anchor=e.anchor,P=ce.get(e);if(P){P.flags|=8,ce.delete(e),D(t);return}t.targetStart=e.targetStart;const L=t.target=e.target,A=t.targetAnchor=e.targetAnchor,U=Be(e.props),I=U?n:L,J=U?y:A;if(s==="svg"||t0(L)?s="svg":(s==="mathml"||n0(L))&&(s="mathml"),j?(h(e.dynamicChildren,j,I,r,i,s,l),Dr(e,t,!0)):d||u(e,t,I,J,r,i,s,l,!1),g)U?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):v9(t,n,y,a,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const l1=jo(t.props,C);l1&&(t.target=l1,v9(t,l1,null,a,0))}else U&&v9(t,L,A,a,1);Zt(t,g)}},remove(e,t,n,{um:o,o:{remove:r}},i){const{shapeFlag:s,children:l,anchor:d,targetStart:a,targetAnchor:k,target:u,props:h}=e,p=Be(h),C=i||!p,v=ce.get(e);if(v&&(v.flags|=8,ce.delete(e)),u&&(r(a),r(k)),i&&r(d),!v&&(p||u)&&s&16)for(let m=0;m{e.isMounted=!0}),Ue(()=>{e.isUnmounting=!0}),e}const m2=[Function,Array],r5={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:m2,onEnter:m2,onAfterEnter:m2,onEnterCancelled:m2,onBeforeLeave:m2,onLeave:m2,onAfterLeave:m2,onLeaveCancelled:m2,onBeforeAppear:m2,onAppear:m2,onAfterAppear:m2,onAppearCancelled:m2},i5=e=>{const t=e.subTree;return t.component?i5(t.component):t},N3={name:"BaseTransition",props:r5,setup(e,{slots:t}){const n=U2(),o=o5();return()=>{const r=t.default&&wr(t.default(),!0),i=r&&r.length?s5(r):n.subTree?L1():void 0;if(!i)return;const s=w1(e),{mode:l}=s;if(o.isLeaving)return Nn(i);const d=q9(i);if(!d)return Nn(i);let a=Kt(d,s,o,n,u=>a=u);d.type!==R1&&xe(d,a);let k=n.subTree&&q9(n.subTree);if(k&&k.type!==R1&&!V2(k,d)&&i5(n).type!==R1){let u=Kt(k,s,o,n);if(xe(k,u),l==="out-in"&&d.type!==R1)return o.isLeaving=!0,u.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete u.afterLeave,k=void 0},Nn(i);l==="in-out"&&d.type!==R1?u.delayLeave=(h,p,C)=>{const v=l5(o,k);v[String(k.key)]=k,h[j2]=()=>{p(),h[j2]=void 0,delete a.delayedLeave,k=void 0},a.delayedLeave=()=>{C(),delete a.delayedLeave,k=void 0}}:k=void 0}else k&&(k=void 0);return i}}};function s5(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==R1){t=n;break}}return t}const F3=N3;function l5(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function Kt(e,t,n,o,r){const{appear:i,mode:s,persisted:l=!1,onBeforeEnter:d,onEnter:a,onAfterEnter:k,onEnterCancelled:u,onBeforeLeave:h,onLeave:p,onAfterLeave:C,onLeaveCancelled:v,onBeforeAppear:m,onAppear:H,onAfterAppear:g,onAppearCancelled:j}=t,f=String(e.key),x=l5(n,e),D=(L,A)=>{L&&x2(L,o,9,A)},y=(L,A)=>{const U=A[1];D(L,A),X(L)?L.every(I=>I.length<=1)&&U():L.length<=1&&U()},P={mode:s,persisted:l,beforeEnter(L){let A=d;if(!n.isMounted)if(i)A=m||d;else return;L[j2]&&L[j2](!0);const U=x[f];U&&V2(e,U)&&U.el[j2]&&U.el[j2](),D(A,[L])},enter(L){if(x[f]===e)return;let A=a,U=k,I=u;if(!n.isMounted)if(i)A=H||a,U=g||k,I=j||u;else return;let J=!1;L[ft]=h1=>{J||(J=!0,h1?D(I,[L]):D(U,[L]),P.delayedLeave&&P.delayedLeave(),L[ft]=void 0)};const l1=L[ft].bind(null,!1);A?y(A,[L,l1]):l1()},leave(L,A){const U=String(e.key);if(L[ft]&&L[ft](!0),n.isUnmounting)return A();D(h,[L]);let I=!1;L[j2]=l1=>{I||(I=!0,A(),l1?D(v,[L]):D(C,[L]),L[j2]=void 0,x[U]===e&&delete x[U])};const J=L[j2].bind(null,!1);x[U]=e,p?y(p,[L,J]):J()},clone(L){const A=Kt(L,t,n,o,r);return r&&r(A),A}};return P}function Nn(e){if(Mn(e))return e=_2(e),e.children=null,e}function q9(e){if(!Mn(e))return mn(e.type)&&e.children?s5(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&a1(n.default))return n.default()}}function xe(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;xe(mn(n.type)&&q9(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function wr(e,t=!1,n){let o=[],r=0;for(let i=0;i1)for(let i=0;iTt(v,t&&(X(t)?t[m]:t),n,o,r));return}if(je(o)&&!r){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&Tt(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?yn(o.component):o.el,s=r?null:i,{i:l,r:d}=e,a=t&&t.r,k=l.refs===g1?l.refs={}:l.refs,u=l.setupState,h=w1(u),p=u===g1?ms:v=>o0(k,v)?!1:x1(h,v),C=(v,m)=>!(m&&o0(k,m));if(a!=null&&a!==d){if(r0(t),y1(a))k[a]=null,p(a)&&(u[a]=null);else if(_1(a)){const v=t;C(a,v.k)&&(a.value=null),v.k&&(k[v.k]=null)}}if(a1(d))l9(d,l,12,[s,k]);else{const v=y1(d),m=_1(d);if(v||m){const H=()=>{if(e.f){const g=v?p(d)?u[d]:k[d]:C()||!e.k?d.value:k[e.k];if(r)X(g)&&or(g,i);else if(X(g))g.includes(i)||g.push(i);else if(v)k[d]=[i],p(d)&&(u[d]=k[d]);else{const j=[i];C(d,e.k)&&(d.value=j),e.k&&(k[e.k]=j)}}else v?(k[d]=s,p(d)&&(u[d]=s)):m&&(C(d,e.k)&&(d.value=s),e.k&&(k[e.k]=s))};if(s){const g=()=>{H(),U9.delete(e)};g.id=-1,U9.set(e,g),I1(g,n)}else r0(e),H()}}}function r0(e){const t=U9.get(e);t&&(t.flags|=8,U9.delete(e))}cn().requestIdleCallback;cn().cancelIdleCallback;const je=e=>!!e.type.__asyncLoader,Mn=e=>e.type.__isKeepAlive,U3={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=U2(),o=n.ctx;if(!o.renderer)return()=>{const g=t.default&&t.default();return g&&g.length===1?g[0]:g};const r=new Map,i=new Set;let s=null;const l=n.suspense,{renderer:{p:d,m:a,um:k,o:{createElement:u}}}=o,h=u("div");o.activate=(g,j,f,x,D)=>{const y=g.component;a(g,j,f,0,l),d(y.vnode,g,j,f,y,l,x,g.slotScopeIds,D),I1(()=>{y.isDeactivated=!1,y.a&&et(y.a);const P=g.props&&g.props.onVnodeMounted;P&&M2(P,y.parent,g)},l)},o.deactivate=g=>{const j=g.component;G9(j.m),G9(j.a),a(g,h,null,1,l),I1(()=>{j.da&&et(j.da);const f=g.props&&g.props.onVnodeUnmounted;f&&M2(f,j.parent,g),j.isDeactivated=!0},l)};function p(g){Fn(g),k(g,n,l,!0)}function C(g){r.forEach((j,f)=>{const x=Bo(je(j)?j.type.__asyncResolved||{}:j.type);x&&!g(x)&&v(f)})}function v(g){const j=r.get(g);j&&(!s||!V2(j,s))?p(j):s&&Fn(s),r.delete(g),i.delete(g)}S1(()=>[e.include,e.exclude],([g,j])=>{g&&C(f=>_t(g,f)),j&&C(f=>!_t(j,f))},{flush:"post",deep:!0});let m=null;const H=()=>{m!=null&&(K9(n.subTree.type)?I1(()=>{const g=f9(n.subTree);g.component&&r.set(m,g)},n.subTree.suspense):r.set(m,f9(n.subTree)))};return q2(H),vr(H),Ue(()=>{r.forEach(g=>{const{subTree:j,suspense:f}=n,x=f9(j);if(g.type===x.type&&g.key===x.key){Fn(x);const D=x.component.da;D&&I1(D,f);return}p(g)})}),()=>{if(m=null,!t.default)return s=null;const g=t.default(),j=g[0];if(g.length>1)return s=null,g;if(!a2(j)||!(j.shapeFlag&4)&&!(j.shapeFlag&128))return s=null,j;let f=f9(j);if(f.type===R1)return s=null,f;const x=f.type,D=Bo(je(f)?f.type.__asyncResolved||{}:x),{include:y,exclude:P,max:L}=e;if(y&&(!D||!_t(y,D))||P&&D&&_t(P,D))return f.shapeFlag&=-257,s=f,j;const A=f.key==null?x:f.key,U=r.get(A);return f.el&&(f=_2(f),j.shapeFlag&128&&(j.ssContent=f)),m=A,U?(f.el=U.el,f.component=U.component,f.transition&&xe(f,f.transition),f.shapeFlag|=512,i.delete(A),i.add(A)):(i.add(A),L&&i.size>parseInt(L,10)&&v(i.values().next().value)),f.shapeFlag|=256,s=f,K9(j.type)?j:f}}},z3=U3;function _t(e,t){return X(e)?e.some(n=>_t(n,t)):y1(e)?e.split(",").includes(t):zl(e)?(e.lastIndex=0,e.test(t)):!1}function Cr(e,t){a5(e,"a",t)}function jn(e,t){a5(e,"da",t)}function a5(e,t,n=t2){const o=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(xn(t,o,n),n){let r=n.parent;for(;r&&r.parent;)Mn(r.parent.vnode)&&W3(o,t,n,r),r=r.parent}}function W3(e,t,n,o){const r=xn(t,e,o,!0);Dn(()=>{or(o[t],r)},n)}function Fn(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function f9(e){return e.shapeFlag&128?e.ssContent:e}function xn(e,t,n=t2,o=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...s)=>{ie();const l=u9(n),d=x2(t,n,e,s);return l(),se(),d});return o?r.unshift(i):r.push(i),i}}const ue=e=>(t,n=t2)=>{(!Jt||e==="sp")&&xn(e,(...o)=>t(...o),n)},gr=ue("bm"),q2=ue("m"),G3=ue("bu"),vr=ue("u"),Ue=ue("bum"),Dn=ue("um"),K3=ue("sp"),Y3=ue("rtg"),Q3=ue("rtc");function X3(e,t=t2){xn("ec",e,t)}const fr="components",J3="directives";function a9(e,t){return mr(fr,e,!0,t)||e}const k5=Symbol.for("v-ndc");function Do(e){return y1(e)?mr(fr,e,!1)||e:e||k5}function kw(e){return mr(J3,e)}function mr(e,t,n=!0,o=!1){const r=Q1||t2;if(r){const i=r.type;if(e===fr){const l=Bo(i,!1);if(l&&(l===t||l===n2(t)||l===hn(n2(t))))return i}const s=i0(r[e]||i[e],t)||i0(r.appContext[e],t);return!s&&o?i:s}}function i0(e,t){return e&&(e[t]||e[n2(t)]||e[hn(n2(t))])}function nt(e,t,n,o){let r;const i=n,s=X(e);if(s||y1(e)){const l=s&&te(e);let d=!1,a=!1;l&&(d=!w2(e),a=le(e),e=Cn(e)),r=new Array(e.length);for(let k=0,u=e.length;kt(l,d,void 0,i));else{const l=Object.keys(e);r=new Array(l.length);for(let d=0,a=l.length;d0;return t!=="default"&&(a.name=t),W(),O1(f1,null,[b("slot",a,o&&o())],k?-2:64)}let s=e[t];s&&s._c&&(s._d=!1);const l=ne.length;W();let d;try{const a=s&&u5(s(n)),k=n.key||i||a&&a.key;d=O1(f1,{key:(k&&!g2(k)?k:`_${t}`)+(!a&&o?"_fb":"")},a||(o?o():[]),a&&e._===1?64:-2)}catch(a){for(let k=ne.length;k>l;k--)Vn();throw a}finally{s&&s._c&&(s._d=!0)}return!r&&d.scopeId&&(d.slotScopeIds=[d.scopeId+"-s"]),d}function u5(e){return e.some(t=>a2(t)?!(t.type===R1||t.type===f1&&!u5(t.children)):!0)?e:null}const Lo=e=>e?_5(e)?yn(e):Lo(e.parent):null,It=P1(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Lo(e.parent),$root:e=>Lo(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>p5(e),$forceUpdate:e=>e.f||(e.f=()=>{pr(e.update)}),$nextTick:e=>e.n||(e.n=v2.bind(e.proxy)),$watch:e=>T3.bind(e)}),qn=(e,t)=>e!==g1&&!e.__isScriptSetup&&x1(e,t),ed={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:r,props:i,accessCache:s,type:l,appContext:d}=e;if(t[0]!=="$"){const h=s[t];if(h!==void 0)switch(h){case 1:return o[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(qn(o,t))return s[t]=1,o[t];if(r!==g1&&x1(r,t))return s[t]=2,r[t];if(x1(i,t))return s[t]=3,i[t];if(n!==g1&&x1(n,t))return s[t]=4,n[t];Ho&&(s[t]=0)}}const a=It[t];let k,u;if(a)return t==="$attrs"&&J1(e.attrs,"get",""),a(e);if((k=l.__cssModules)&&(k=k[t]))return k;if(n!==g1&&x1(n,t))return s[t]=4,n[t];if(u=d.config.globalProperties,x1(u,t))return u[t]},set({_:e},t,n){const{data:o,setupState:r,ctx:i}=e;return qn(r,t)?(r[t]=n,!0):o!==g1&&x1(o,t)?(o[t]=n,!0):x1(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:r,props:i,type:s}},l){let d;return!!(n[l]||e!==g1&&l[0]!=="$"&&x1(e,l)||qn(t,l)||x1(i,l)||x1(o,l)||x1(It,l)||x1(r.config.globalProperties,l)||(d=s.__cssModules)&&d[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:x1(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function z9(e){return X(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function s0(e,t){return!e||!t?e||t:X(e)&&X(t)?e.concat(t):P1({},z9(e),z9(t))}let Ho=!0;function td(e){const t=p5(e),n=e.proxy,o=e.ctx;Ho=!1,t.beforeCreate&&l0(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:s,watch:l,provide:d,inject:a,created:k,beforeMount:u,mounted:h,beforeUpdate:p,updated:C,activated:v,deactivated:m,beforeDestroy:H,beforeUnmount:g,destroyed:j,unmounted:f,render:x,renderTracked:D,renderTriggered:y,errorCaptured:P,serverPrefetch:L,expose:A,inheritAttrs:U,components:I,directives:J,filters:l1}=t;if(a&&nd(a,o,null),s)for(const Y in s){const n1=s[Y];a1(n1)&&(o[Y]=n1.bind(n))}if(r){const Y=r.call(n,n);m1(Y)&&(e.data=W1(Y))}if(Ho=!0,i)for(const Y in i){const n1=i[Y],C1=a1(n1)?n1.bind(n,n):a1(n1.get)?n1.get.bind(n,n):N2,p1=!a1(n1)&&a1(n1.set)?n1.set.bind(n):N2,E1=F({get:C1,set:p1});Object.defineProperty(o,Y,{enumerable:!0,configurable:!0,get:()=>E1.value,set:Z1=>E1.value=Z1})}if(l)for(const Y in l)h5(l[Y],o,n,Y);if(d){const Y=a1(d)?d.call(n):d;Reflect.ownKeys(Y).forEach(n1=>{Me(n1,Y[n1])})}k&&l0(k,e,"c");function k1(Y,n1){X(n1)?n1.forEach(C1=>Y(C1.bind(n))):n1&&Y(n1.bind(n))}if(k1(gr,u),k1(q2,h),k1(G3,p),k1(vr,C),k1(Cr,v),k1(jn,m),k1(X3,P),k1(Q3,D),k1(Y3,y),k1(Ue,g),k1(Dn,f),k1(K3,L),X(A))if(A.length){const Y=e.exposed||(e.exposed={});A.forEach(n1=>{Object.defineProperty(Y,n1,{get:()=>n[n1],set:C1=>n[n1]=C1,enumerable:!0})})}else e.exposed||(e.exposed={});x&&e.render===N2&&(e.render=x),U!=null&&(e.inheritAttrs=U),I&&(e.components=I),J&&(e.directives=J),L&&d5(e)}function nd(e,t,n=N2){X(e)&&(e=Vo(e));for(const o in e){const r=e[o];let i;m1(r)?"default"in r?i=z1(r.from||o,r.default,!0):i=z1(r.from||o):i=z1(r),_1(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:s=>i.value=s}):t[o]=i}}function l0(e,t,n){x2(X(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function h5(e,t,n,o){let r=o.includes(".")?t5(n,o):()=>n[o];if(y1(e)){const i=t[e];a1(i)&&S1(r,i)}else if(a1(e))S1(r,e.bind(n));else if(m1(e))if(X(e))e.forEach(i=>h5(i,t,n,o));else{const i=a1(e.handler)?e.handler.bind(n):t[e.handler];a1(i)&&S1(r,i,e)}}function p5(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:s}}=e.appContext,l=i.get(t);let d;return l?d=l:!r.length&&!n&&!o?d=t:(d={},r.length&&r.forEach(a=>W9(d,a,s,!0)),W9(d,t,s)),m1(t)&&i.set(t,d),d}function W9(e,t,n,o=!1){const{mixins:r,extends:i}=t;i&&W9(e,i,n,!0),r&&r.forEach(s=>W9(e,s,n,!0));for(const s in t)if(!(o&&s==="expose")){const l=od[s]||n&&n[s];e[s]=l?l(e[s],t[s]):t[s]}return e}const od={data:d0,props:a0,emits:a0,methods:Bt,computed:Bt,beforeCreate:o2,created:o2,beforeMount:o2,mounted:o2,beforeUpdate:o2,updated:o2,beforeDestroy:o2,beforeUnmount:o2,destroyed:o2,unmounted:o2,activated:o2,deactivated:o2,errorCaptured:o2,serverPrefetch:o2,components:Bt,directives:Bt,watch:id,provide:d0,inject:rd};function d0(e,t){return t?e?function(){return P1(a1(e)?e.call(this,this):e,a1(t)?t.call(this,this):t)}:t:e}function rd(e,t){return Bt(Vo(e),Vo(t))}function Vo(e){if(X(e)){const t={};for(let n=0;n{let k,u=g1,h;return A3(()=>{const p=e[r];Y1(k,p)&&(k=p,a())}),{get(){return d(),n.get?n.get(k):k},set(p){const C=n.set?n.set(p):p;if(!Y1(C,k)&&!(u!==g1&&Y1(p,u)))return;const v=o.vnode.props,m=!!(v&&(t in v||r in v||i in v)&&(`onUpdate:${t}`in v||`onUpdate:${r}`in v||`onUpdate:${i}`in v));m||(k=p,a()),o.emit(`update:${t}`,C),Y1(p,u)&&(Y1(p,C)&&!Y1(C,h)||m&&u!==g1&&!Y1(C,k))&&a(),u=p,h=C}}});return l[Symbol.iterator]=()=>{let d=0;return{next(){return d<2?{value:d++?s||g1:l,done:!1}:{done:!0}}}},l}const w5=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${n2(t)}Modifiers`]||e[`${ke(t)}Modifiers`];function ad(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||g1;let r=n;const i=t.startsWith("update:"),s=i&&w5(o,t.slice(7));s&&(s.trim&&(r=n.map(k=>y1(k)?k.trim():k)),s.number&&(r=r.map(pn)));let l,d=o[l=An(t)]||o[l=An(n2(t))];!d&&i&&(d=o[l=An(ke(t))]),d&&x2(d,e,6,r);const a=o[l+"Once"];if(a){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,x2(a,e,6,r)}}const kd=new WeakMap;function C5(e,t,n=!1){const o=n?kd:t.emitsCache,r=o.get(e);if(r!==void 0)return r;const i=e.emits;let s={},l=!1;if(!a1(e)){const d=a=>{const k=C5(a,t,!0);k&&(l=!0,P1(s,k))};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}return!i&&!l?(m1(e)&&o.set(e,null),null):(X(i)?i.forEach(d=>s[d]=null):P1(s,i),m1(e)&&o.set(e,s),s)}function Hn(e,t){return!e||!dn(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),x1(e,t[0].toLowerCase()+t.slice(1))||x1(e,ke(t))||x1(e,t))}function k0(e){const{type:t,vnode:n,proxy:o,withProxy:r,propsOptions:[i],slots:s,attrs:l,emit:d,render:a,renderCache:k,props:u,data:h,setupState:p,ctx:C,inheritAttrs:v}=e,m=F9(e);let H,g;try{if(n.shapeFlag&4){const f=r||o,x=f;H=H2(a.call(x,f,k,u,p,h,C)),g=l}else{const f=t;H=H2(f.length>1?f(u,{attrs:l,slots:s,emit:d}):f(u,null)),g=t.props?l:hd(l)}}catch(f){ne.length=0,d9(f,e,1),H=b(R1)}let j=H;if(g&&v!==!1){const f=Object.keys(g),{shapeFlag:x}=j;f.length&&x&7&&(i&&f.some(an)&&(g=pd(g,i)),j=_2(j,g,!1,!0))}if(n.dirs&&(j=_2(j,null,!1,!0),j.dirs=j.dirs?j.dirs.concat(n.dirs):n.dirs),n.transition){const f=mn(j.type)&&q9(j)||j;xe(f,n.transition)}return H=j,F9(m),H}function ud(e,t=!0){let n;for(let o=0;o{let t;for(const n in e)(n==="class"||n==="style"||dn(n))&&((t||(t={}))[n]=e[n]);return t},pd=(e,t)=>{const n={};for(const o in e)(!an(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function cd(e,t,n){const{props:o,children:r,component:i}=e,{props:s,children:l,patchFlag:d}=t,a=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&d>=0){if(d&1024)return!0;if(d&16)return o?u0(o,s,a):!!s;if(d&8){const k=t.dynamicProps;for(let u=0;uObject.create(v5),m5=e=>Object.getPrototypeOf(e)===v5;function wd(e,t,n,o=!1){const r={},i=f5();e.propsDefaults=Object.create(null),M5(e,t,r,i);for(const s in e.propsOptions[0])s in r||(r[s]=void 0);n?e.props=o?r:zs(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function Cd(e,t,n,o){const{props:r,attrs:i,vnode:{patchFlag:s}}=e,l=w1(r),[d]=e.propsOptions;let a=!1;if((o||s>0)&&!(s&16)){if(s&8){const k=e.vnode.dynamicProps;for(let u=0;u{d=!0;const[h,p]=j5(u,t,!0);P1(s,h),p&&l.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(k),e.extends&&k(e.extends),e.mixins&&e.mixins.forEach(k)}if(!i&&!d)return m1(e)&&o.set(e,Je),Je;if(X(i))for(let k=0;ke==="_"||e==="_ctx"||e==="$stable",xr=e=>X(e)?e.map(H2):[H2(e)],vd=(e,t,n)=>{if(t._n)return t;const o=e2((...r)=>xr(t(...r)),n);return o._c=!1,o},x5=(e,t,n)=>{const o=e._ctx;for(const r in e){if(jr(r))continue;const i=e[r];if(a1(i))t[r]=vd(r,i,o);else if(i!=null){const s=xr(i);t[r]=()=>s}}},D5=(e,t)=>{const n=xr(t);e.slots.default=()=>n},L5=(e,t,n)=>{for(const o in t)(n||!jr(o))&&(e[o]=t[o])},fd=(e,t,n)=>{const o=e.slots=f5();if(e.vnode.shapeFlag&32){const r=t._;r?(L5(o,t,n),n&&Ds(o,"_",r,!0)):x5(t,o)}else t&&D5(e,t)},md=(e,t,n)=>{const{vnode:o,slots:r}=e;let i=!0,s=g1;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:L5(r,t,n):(i=!t.$stable,x5(t,r)),s=t}else t&&(D5(e,t),s={default:1});if(i)for(const l in r)!jr(l)&&s[l]==null&&delete r[l]},I1=_d;function Md(e){return jd(e)}function jd(e,t){const n=cn();n.__VUE__=!0;const{insert:o,remove:r,patchProp:i,createElement:s,createText:l,createComment:d,setText:a,setElementText:k,parentNode:u,nextSibling:h,setScopeId:p=N2,insertStaticContent:C}=e,v=(c,w,M,_=null,E=null,B=null,q=void 0,S=null,Z=!!w.dynamicChildren)=>{if(c===w)return;c&&!V2(c,w)&&(_=V(c),Z1(c,E,B,!0),c=null),w.patchFlag===-2&&(Z=!1,w.dynamicChildren=null);const{type:T,ref:G,shapeFlag:z}=w;switch(T){case k9:m(c,w,M,_);break;case R1:H(c,w,M,_);break;case Z9:c==null&&g(w,M,_,q);break;case f1:I(c,w,M,_,E,B,q,S,Z);break;default:z&1?x(c,w,M,_,E,B,q,S,Z):z&6?J(c,w,M,_,E,B,q,S,Z):(z&64||z&128)&&T.process(c,w,M,_,E,B,q,S,Z,K)}G!=null&&E?Tt(G,c&&c.ref,B,w||c,!w):G==null&&c&&c.ref!=null&&Tt(c.ref,null,B,c,!0)},m=(c,w,M,_)=>{if(c==null)o(w.el=l(w.children),M,_);else{const E=w.el=c.el;w.children!==c.children&&a(E,w.children)}},H=(c,w,M,_)=>{c==null?o(w.el=d(w.children||""),M,_):w.el=c.el},g=(c,w,M,_)=>{[c.el,c.anchor]=C(c.children,w,M,_,c.el,c.anchor)},j=({el:c,anchor:w},M,_)=>{let E;for(;c&&c!==w;)E=h(c),o(c,M,_),c=E;o(w,M,_)},f=({el:c,anchor:w})=>{let M;for(;c&&c!==w;)M=h(c),r(c),c=M;r(w)},x=(c,w,M,_,E,B,q,S,Z)=>{if(w.type==="svg"?q="svg":w.type==="math"&&(q="mathml"),c==null)D(w,M,_,E,B,q,S,Z);else{const T=c.el&&c.el._isVueCE?c.el:null;try{T&&T._beginPatch(),L(c,w,E,B,q,S,Z)}finally{T&&T._endPatch()}}},D=(c,w,M,_,E,B,q,S)=>{let Z,T;const{props:G,shapeFlag:z,transition:e1,dirs:s1}=c;if(Z=c.el=s(c.type,B,G&&G.is,G),z&8?k(Z,c.children):z&16&&P(c.children,Z,null,_,E,Un(c,B),q,S),s1&&ye(c,null,_,"created"),y(Z,c,c.scopeId,q,_),G){for(const H1 in G)H1!=="value"&&!Ot(H1)&&i(Z,H1,null,G[H1],B,_);"value"in G&&i(Z,"value",null,G.value,B),(T=G.onVnodeBeforeMount)&&M2(T,_,c)}s1&&ye(c,null,_,"beforeMount");const c1=xd(E,e1);c1&&e1.beforeEnter(Z),o(Z,w,M),((T=G&&G.onVnodeMounted)||c1||s1)&&I1(()=>{try{T&&M2(T,_,c),c1&&e1.enter(Z),s1&&ye(c,null,_,"mounted")}finally{}},E)},y=(c,w,M,_,E)=>{if(M&&p(c,M),_)for(let B=0;B<_.length;B++)p(c,_[B]);if(E){let B=E.subTree;if(w===B||K9(B.type)&&(B.ssContent===w||B.ssFallback===w)){const q=E.vnode;y(c,q,q.scopeId,q.slotScopeIds,E.parent)}}},P=(c,w,M,_,E,B,q,S,Z=0)=>{for(let T=Z;T{const S=w.el=c.el;let{patchFlag:Z,dynamicChildren:T,dirs:G}=w;Z|=c.patchFlag&16;const z=c.props||g1,e1=w.props||g1;let s1;if(M&&be(M,!1),(s1=e1.onVnodeBeforeUpdate)&&M2(s1,M,w,c),G&&ye(w,c,M,"beforeUpdate"),M&&be(M,!0),T&&(!c.dynamicChildren||c.dynamicChildren.length!==T.length)&&(Z=0,q=!1,T=null),(z.innerHTML&&e1.innerHTML==null||z.textContent&&e1.textContent==null)&&k(S,""),T?A(c.dynamicChildren,T,S,M,_,Un(w,E),B):q||n1(c,w,S,null,M,_,Un(w,E),B,!1),Z>0){if(Z&16)U(S,z,e1,M,E);else if(Z&2&&z.class!==e1.class&&i(S,"class",null,e1.class,E),Z&4&&i(S,"style",z.style,e1.style,E),Z&8){const c1=w.dynamicProps;for(let H1=0;H1{s1&&M2(s1,M,w,c),G&&ye(w,c,M,"updated")},_)},A=(c,w,M,_,E,B,q)=>{for(let S=0;S{if(w!==M){if(w!==g1)for(const B in w)!Ot(B)&&!(B in M)&&i(c,B,w[B],null,E,_);for(const B in M){if(Ot(B))continue;const q=M[B],S=w[B];q!==S&&B!=="value"&&i(c,B,S,q,E,_)}"value"in M&&i(c,"value",w.value,M.value,E)}},I=(c,w,M,_,E,B,q,S,Z)=>{const T=w.el=c?c.el:l(""),G=w.anchor=c?c.anchor:l("");let{patchFlag:z,dynamicChildren:e1,slotScopeIds:s1}=w;s1&&(S=S?S.concat(s1):s1),c==null?(o(T,M,_),o(G,M,_),P(w.children||[],M,G,E,B,q,S,Z)):z>0&&z&64&&e1&&c.dynamicChildren&&c.dynamicChildren.length===e1.length?(A(c.dynamicChildren,e1,M,E,B,q,S),(w.key!=null||E&&w===E.subTree)&&Dr(c,w,!0)):n1(c,w,M,G,E,B,q,S,Z)},J=(c,w,M,_,E,B,q,S,Z)=>{w.slotScopeIds=S,c==null?w.shapeFlag&512?E.ctx.activate(w,M,_,q,Z):l1(w,M,_,E,B,q,Z):h1(c,w,Z)},l1=(c,w,M,_,E,B,q)=>{const S=c.component=Ad(c,_,E);if(Mn(c)&&(S.ctx.renderer=K),Td(S,!1,q),S.asyncDep){if(E&&E.registerDep(S,k1,q),!c.el){const Z=S.subTree=b(R1);H(null,Z,w,M),c.placeholder=Z.el}}else k1(S,c,w,M,E,B,q)},h1=(c,w,M)=>{const _=w.component=c.component;if(cd(c,w,M))if(_.asyncDep&&!_.asyncResolved){Y(_,w,M);return}else _.next=w,_.update();else w.el=c.el,_.vnode=w},k1=(c,w,M,_,E,B,q)=>{const S=()=>{if(c.isMounted){let{next:z,bu:e1,u:s1,parent:c1,vnode:H1}=c;{const E2=H5(c);if(E2){z&&(z.el=H1.el,Y(c,z,q)),E2.asyncDep.then(()=>{I1(()=>{c.isUnmounted||T()},E)});return}}let D1=z,A1;be(c,!1),z?(z.el=H1.el,Y(c,z,q)):z=H1,e1&&et(e1),(A1=z.props&&z.props.onVnodeBeforeUpdate)&&M2(A1,c1,z,H1),be(c,!0);const G1=k0(c),S2=c.subTree;c.subTree=G1,v(S2,G1,u(S2.el),V(S2),c,E,B),z.el=G1.el,D1===null&&Mr(c,G1.el),s1&&I1(s1,E),(A1=z.props&&z.props.onVnodeUpdated)&&I1(()=>M2(A1,c1,z,H1),E)}else{let z;const{el:e1,props:s1}=w,{bm:c1,m:H1,parent:D1,root:A1,type:G1}=c,S2=je(w);be(c,!1),c1&&et(c1),!S2&&(z=s1&&s1.onVnodeBeforeMount)&&M2(z,D1,w),be(c,!0);{A1.ce&&A1.ce._hasShadowRoot()&&A1.ce._injectChildStyle(G1,c.parent?c.parent.type:void 0);const E2=c.subTree=k0(c);v(null,E2,M,_,c,E,B),w.el=E2.el}if(H1&&I1(H1,E),!S2&&(z=s1&&s1.onVnodeMounted)){const E2=w;I1(()=>M2(z,D1,E2),E)}(w.shapeFlag&256||D1&&je(D1.vnode)&&D1.vnode.shapeFlag&256)&&c.a&&I1(c.a,E),c.isMounted=!0,w=M=_=null}};c.scope.on();const Z=c.effect=new Bs(S);c.scope.off();const T=c.update=Z.run.bind(Z),G=c.job=Z.runIfDirty.bind(Z);G.i=c,G.id=c.uid,Z.scheduler=()=>pr(G),be(c,!0),T()},Y=(c,w,M)=>{w.component=c;const _=c.vnode.props;c.vnode=w,c.next=null,Cd(c,w.props,_,M),md(c,w.children,M),ie(),e0(c),se()},n1=(c,w,M,_,E,B,q,S,Z=!1)=>{const T=c&&c.children,G=c?c.shapeFlag:0,z=w.children,{patchFlag:e1,shapeFlag:s1}=w;if(e1>0){if(e1&128){p1(T,z,M,_,E,B,q,S,Z);return}else if(e1&256){C1(T,z,M,_,E,B,q,S,Z);return}}s1&8?(G&16&&t1(T,E,B),z!==T&&k(M,z)):G&16?s1&16?p1(T,z,M,_,E,B,q,S,Z):t1(T,E,B,!0):(G&8&&k(M,""),s1&16&&P(z,M,_,E,B,q,S,Z))},C1=(c,w,M,_,E,B,q,S,Z)=>{c=c||Je,w=w||Je;const T=c.length,G=w.length,z=Math.min(T,G);let e1;for(e1=0;e1G?t1(c,E,B,!0,!1,z):P(w,M,_,E,B,q,S,Z,z)},p1=(c,w,M,_,E,B,q,S,Z)=>{let T=0;const G=w.length;let z=c.length-1,e1=G-1;for(;T<=z&&T<=e1;){const s1=c[T],c1=w[T]=Z?Q2(w[T]):H2(w[T]);if(V2(s1,c1))v(s1,c1,M,null,E,B,q,S,Z);else break;T++}for(;T<=z&&T<=e1;){const s1=c[z],c1=w[e1]=Z?Q2(w[e1]):H2(w[e1]);if(V2(s1,c1))v(s1,c1,M,null,E,B,q,S,Z);else break;z--,e1--}if(T>z){if(T<=e1){const s1=e1+1,c1=s1e1)for(;T<=z;)Z1(c[T],E,B,!0),T++;else{const s1=T,c1=T,H1=new Map;for(T=c1;T<=e1;T++){const k2=w[T]=Z?Q2(w[T]):H2(w[T]);k2.key!=null&&H1.set(k2.key,T)}let D1,A1=0;const G1=e1-c1+1;let S2=!1,E2=0;const gt=new Array(G1);for(T=0;T=G1){Z1(k2,E,B,!0);continue}let O2;if(k2.key!=null)O2=H1.get(k2.key);else for(D1=c1;D1<=e1;D1++)if(gt[D1-c1]===0&&V2(k2,w[D1])){O2=D1;break}O2===void 0?Z1(k2,E,B,!0):(gt[O2-c1]=T+1,O2>=E2?E2=O2:S2=!0,v(k2,w[O2],M,null,E,B,q,S,Z),A1++)}const zr=S2?Dd(gt):Je;for(D1=zr.length-1,T=G1-1;T>=0;T--){const k2=c1+T,O2=w[k2],Wr=w[k2+1],Gr=k2+1{const{el:B,type:q,transition:S,children:Z,shapeFlag:T}=c;if(T&6){E1(c.component.subTree,w,M,_);return}if(T&128){c.suspense.move(w,M,_);return}if(T&64){q.move(c,w,M,K);return}if(q===f1){o(B,w,M);for(let z=0;zS.enter(B),E));else{const{leave:z,delayLeave:e1,afterLeave:s1}=S,c1=()=>{c.ctx.isUnmounted?r(B):o(B,w,M)},H1=()=>{const D1=B._isLeaving||!!B[j2];B._isLeaving&&B[j2](!0),S.persisted&&!D1?c1():z(B,()=>{c1(),s1&&s1()})};e1?e1(B,c1,H1):H1()}else o(B,w,M)},Z1=(c,w,M,_=!1,E=!1)=>{const{type:B,props:q,ref:S,children:Z,dynamicChildren:T,shapeFlag:G,patchFlag:z,dirs:e1,cacheIndex:s1,memo:c1}=c;if(z===-2&&(E=!1),S!=null&&(ie(),Tt(S,null,M,c,!0),se()),s1!=null&&(w.renderCache[s1]=void 0),G&256){w.ctx.deactivate(c);return}const H1=G&1&&e1,D1=!je(c);let A1;if(D1&&(A1=q&&q.onVnodeBeforeUnmount)&&M2(A1,w,c),G&6)d1(c.component,M,_);else{if(G&128){c.suspense.unmount(M,_);return}H1&&ye(c,null,w,"beforeUnmount"),G&64?c.type.remove(c,w,M,K,_):T&&!T.hasOnce&&(B!==f1||z>0&&z&64)?t1(T,w,M,!1,!0):(B===f1&&z&384||!E&&G&16)&&t1(Z,w,M),_&&$(c)}const G1=c1!=null&&s1==null;(D1&&(A1=q&&q.onVnodeUnmounted)||H1||G1)&&I1(()=>{A1&&M2(A1,w,c),H1&&ye(c,null,w,"unmounted"),G1&&(c.el=null)},M)},$=c=>{const{type:w,el:M,anchor:_,transition:E}=c;if(w===f1){r1(M,_);return}if(w===Z9){f(c);return}const B=()=>{r(M),E&&!E.persisted&&E.afterLeave&&E.afterLeave()};if(c.shapeFlag&1&&E&&!E.persisted){const{leave:q,delayLeave:S}=E,Z=()=>q(M,B);S?S(c.el,B,Z):Z()}else B()},r1=(c,w)=>{let M;for(;c!==w;)M=h(c),r(c),c=M;r(w)},d1=(c,w,M)=>{const{bum:_,scope:E,job:B,subTree:q,um:S,m:Z,a:T}=c;G9(Z),G9(T),_&&et(_),E.stop(),B&&(B.flags|=8,Z1(q,c,w,M)),S&&I1(S,w),I1(()=>{c.isUnmounted=!0},w)},t1=(c,w,M,_=!1,E=!1,B=0)=>{for(let q=B;q{if(c.shapeFlag&6)return V(c.component.subTree);if(c.shapeFlag&128)return c.suspense.next();const w=h(c.anchor||c.el),M=w&&w[n5];return M?h(M):w};let N=!1;const R=(c,w,M)=>{let _;c==null?w._vnode&&(Z1(w._vnode,null,null,!0),_=w._vnode.component):v(w._vnode||null,c,w,null,null,null,M),w._vnode=c,N||(N=!0,e0(_),Xs(),N=!1)},K={p:v,um:Z1,m:E1,r:$,mt:l1,mc:P,pc:n1,pbc:A,n:V,o:e};return{render:R,hydrate:void 0,createApp:ld(R)}}function Un({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function be({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function xd(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Dr(e,t,n=!1){const o=e.children,r=t.children;if(X(o)&&X(r))for(let i=0;i>1,e[n[l]]0&&(t[o]=n[i-1]),n[i]=o)}}for(i=n.length,s=n[i-1];i-- >0;)n[i]=s,s=t[s];return n}function H5(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:H5(t)}function G9(e){if(e)for(let t=0;te.__isSuspense;let bo=0;const Ld={name:"Suspense",__isSuspense:!0,process(e,t,n,o,r,i,s,l,d,a){if(e==null)Vd(t,n,o,r,i,s,l,d,a);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}yd(e,t,n,o,r,s,l,d,a)}},hydrate:bd,normalize:Zd},Hd=Ld;function Yt(e,t){const n=e.props&&e.props[t];a1(n)&&n()}function Vd(e,t,n,o,r,i,s,l,d){const{p:a,o:{createElement:k}}=d,u=k("div"),h=e.suspense=y5(e,r,o,t,u,n,i,s,l,d);a(null,h.pendingBranch=e.ssContent,u,null,o,h,i,s),h.deps>0?(Yt(e,"onPending"),Yt(e,"onFallback"),a(null,e.ssFallback,t,n,o,null,i,s),ot(h,e.ssFallback)):h.resolve(!1,!0)}function yd(e,t,n,o,r,i,s,l,{p:d,um:a,o:{createElement:k}}){const u=t.suspense=e.suspense;u.vnode=t,t.el=e.el;const h=t.ssContent,p=t.ssFallback,{activeBranch:C,pendingBranch:v,isInFallback:m,isHydrating:H}=u;if(v)u.pendingBranch=h,V2(v,h)?(d(v,h,u.hiddenContainer,null,r,u,i,s,l),u.deps<=0?u.resolve():m&&!H&&!u.isFallbackMountPending&&(d(C,p,n,o,r,null,i,s,l),ot(u,p))):(u.pendingId=bo++,H?(u.isHydrating=!1,u.activeBranch=v):a(v,r,u),u.deps=0,u.effects.length=0,u.hiddenContainer=k("div"),m?(d(null,h,u.hiddenContainer,null,r,u,i,s,l),u.deps<=0?u.resolve():u.isFallbackMountPending||(d(C,p,n,o,r,null,i,s,l),ot(u,p))):C&&V2(C,h)?(d(C,h,n,o,r,u,i,s,l),u.resolve(!0)):(d(null,h,u.hiddenContainer,null,r,u,i,s,l),u.deps<=0&&u.resolve()));else if(C&&V2(C,h))d(C,h,n,o,r,u,i,s,l),ot(u,h);else if(Yt(t,"onPending"),u.pendingBranch=h,h.shapeFlag&512?u.pendingId=h.component.suspenseId:u.pendingId=bo++,d(null,h,u.hiddenContainer,null,r,u,i,s,l),u.deps<=0)u.resolve();else{const{timeout:g,pendingId:j}=u;g>0?setTimeout(()=>{u.pendingId===j&&u.fallback(p)},g):g===0&&u.fallback(p)}}function y5(e,t,n,o,r,i,s,l,d,a,k=!1){const{p:u,m:h,um:p,n:C,o:{parentNode:v,remove:m}}=a;let H;const g=Bd(e);g&&t&&t.pendingBranch&&(H=t.pendingId,t.deps++);const j=e.props?Ls(e.props.timeout):void 0,f=i,x={vnode:e,parent:t,parentComponent:n,namespace:s,container:o,hiddenContainer:r,deps:0,pendingId:bo++,timeout:typeof j=="number"?j:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!k,isHydrating:k,isUnmounted:!1,effects:[],resolve(D=!1,y=!1){const{vnode:P,activeBranch:L,pendingBranch:A,pendingId:U,effects:I,parentComponent:J,container:l1,isInFallback:h1}=x;let k1=!1;if(x.isHydrating)x.isHydrating=!1;else if(!D){k1=L&&A.transition&&A.transition.mode==="out-in";let C1=!1;k1&&(L.transition.afterLeave=()=>{U===x.pendingId&&(h(A,l1,i===f&&!C1?C(L):i,0),Mo(I),h1&&P.ssFallback&&(P.ssFallback.el=null))}),L&&!x.isFallbackMountPending&&(v(L.el)===l1&&(i=C(L),C1=!0),p(L,J,x,!0),!k1&&h1&&P.ssFallback&&I1(()=>P.ssFallback.el=null,x)),k1||h(A,l1,i,0)}x.isFallbackMountPending=!1,ot(x,A),x.pendingBranch=null,x.isInFallback=!1;let Y=x.parent,n1=!1;for(;Y;){if(Y.pendingBranch){for(let C1=0;C1{if(x.isFallbackMountPending=!1,!x.isInFallback)return;const h1=x.vnode.ssFallback;u(null,h1,A,I,L,null,U,l,d),ot(x,h1)},l1=D.transition&&D.transition.mode==="out-in";l1&&(x.isFallbackMountPending=!0,P.transition.afterLeave=J),x.isInFallback=!0,p(P,L,null,!0),l1||J()},move(D,y,P){x.activeBranch&&h(x.activeBranch,D,y,P),x.container=D},next(){return x.activeBranch&&C(x.activeBranch)},registerDep(D,y,P){const L=!!x.pendingBranch;L&&x.deps++;const A=D.vnode.el;D.asyncDep.catch(U=>{d9(U,D,0)}).then(U=>{if(D.isUnmounted||x.isUnmounted||x.pendingId!==D.suspenseId)return;Zo(),D.asyncResolved=!0;const{vnode:I}=D;_o(D,U),A&&(I.el=A);const J=!A&&D.subTree.el;y(D,I,v(A||D.subTree.el),A?null:C(D.subTree),x,s,P),J&&(I.placeholder=null,m(J)),Mr(D,I.el),L&&--x.deps===0&&x.resolve()})},unmount(D,y){x.isUnmounted=!0,x.activeBranch&&p(x.activeBranch,n,D,y),x.pendingBranch&&p(x.pendingBranch,n,D,y)}};return x}function bd(e,t,n,o,r,i,s,l,d){const a=t.suspense=y5(t,o,n,e.parentNode,document.createElement("div"),null,r,i,s,l,!0),k=d(e,a.pendingBranch=t.ssContent,n,a,i,s);return a.deps===0&&a.resolve(!1,!0),k}function Zd(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=p0(o?n.default:n),e.ssFallback=o?p0(n.fallback):b(R1)}function p0(e){let t;if(a1(e)){const n=lt&&e._c;n&&(e._d=!1,W()),e=e(),n&&(e._d=!0,t=d2,Vn())}return X(e)&&(e=ud(e)),e=H2(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function _d(e,t){t&&t.pendingBranch?X(e)?t.effects.push(...e):t.effects.push(e):Mo(e)}function ot(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e;let r=t.el;for(;!r&&t.component;)t=t.component.subTree,r=t.el;n.el=r,o&&o.subTree===n&&(o.vnode.el=r,Mr(o,r))}function Bd(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const f1=Symbol.for("v-fgt"),k9=Symbol.for("v-txt"),R1=Symbol.for("v-cmt"),Z9=Symbol.for("v-stc"),ne=[];let d2=null;function W(e=!1){ne.push(d2=e?null:[])}function Vn(){ne.pop(),d2=ne[ne.length-1]||null}let lt=1;function Y9(e,t=!1){lt+=e,e<0&&d2&&t&&(d2.hasOnce=!0)}function b5(e){return e.dynamicChildren=lt>0?d2||Je:null,Vn(),lt>0&&d2&&d2.push(e),e}function o1(e,t,n,o,r,i){return b5(O(e,t,n,o,r,i,!0))}function O1(e,t,n,o,r){return b5(b(e,t,n,o,r,!0))}function a2(e){return e?e.__v_isVNode===!0:!1}function V2(e,t){return e.type===t.type&&e.key===t.key}const Z5=({key:e})=>e??null,_9=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?y1(e)||_1(e)||a1(e)?{i:Q1,r:e,k:t,f:!!n}:e:null);function O(e,t=null,n=null,o=0,r=null,i=e===f1?0:1,s=!1,l=!1){const d={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Z5(t),ref:t&&_9(t),scopeId:e5,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Q1};return l?(Q9(d,n),i&128&&e.normalize(d)):n&&(d.shapeFlag|=y1(n)?8:16),lt>0&&!s&&d2&&(d.patchFlag>0||i&6)&&d.patchFlag!==32&&d2.push(d),d}const b=Sd;function Sd(e,t=null,n=null,o=0,r=null,i=!1){if((!e||e===k5)&&(e=R1),a2(e)){const l=_2(e,t,!0);return n&&Q9(l,n),lt>0&&!i&&d2&&(l.shapeFlag&6?d2[d2.indexOf(e)]=l:d2.push(l)),l.patchFlag=-2,l}if(Nd(e)&&(e=e.__vccOpts),t){t=Ed(t);let{class:l,style:d}=t;l&&!y1(l)&&(t.class=F1(l)),m1(d)&&(gn(d)&&!X(d)&&(d=P1({},d)),t.style=re(d))}const s=y1(e)?1:K9(e)?128:mn(e)?64:m1(e)?4:a1(e)?2:0;return O(e,t,n,o,r,s,i,!0)}function Ed(e){return e?gn(e)||m5(e)?P1({},e):e:null}function _2(e,t,n=!1,o=!1){const{props:r,ref:i,patchFlag:s,children:l,transition:d}=e,a=t?Qt(r||{},t):r,k={__v_isVNode:!0,__v_skip:!0,type:e.type,props:a,key:a&&Z5(a),ref:t&&t.ref?n&&i?X(i)?i.concat(_9(t)):[i,_9(t)]:_9(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==f1?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:d,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&_2(e.ssContent),ssFallback:e.ssFallback&&_2(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return d&&o&&xe(k,d.clone(k)),k}function K2(e=" ",t=0){return b(k9,null,e,t)}function m9(e,t){const n=b(Z9,null,e);return n.staticCount=t,n}function L1(e="",t=!1){return t?(W(),O1(R1,null,e)):b(R1,null,e)}function H2(e){return e==null||typeof e=="boolean"?b(R1):X(e)?b(f1,null,e.slice()):a2(e)?Q2(e):b(k9,null,String(e))}function Q2(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:_2(e)}function Q9(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(X(t))n=16;else if(typeof t=="object")if(o&65){const r=t.default;r&&(r._c&&(r._d=!1),Q9(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!m5(t)?t._ctx=Q1:r===3&&Q1&&(Q1.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(a1(t)){if(o&65){Q9(e,{default:t});return}t={default:t,_ctx:Q1},n=32}else t=String(t),o&64?(n=16,t=[K2(t)]):n=8;e.children=t,e.shapeFlag|=n}function Qt(...e){const t={};for(let n=0;nt2||Q1;let X9,Xt;{const e=cn(),t=(n,o)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(o),i=>{r.length>1?r.forEach(s=>s(i)):r[0](i)}};X9=t("__VUE_INSTANCE_SETTERS__",n=>t2=n),Xt=t("__VUE_SSR_SETTERS__",n=>Jt=n)}const u9=e=>{const t=t2;return X9(e),e.scope.on(),()=>{e.scope.off(),X9(t)}},Zo=()=>{t2&&t2.scope.off(),X9(null)};function _5(e){return e.vnode.shapeFlag&4}let Jt=!1;function Td(e,t=!1,n=!1){t&&Xt(t);const{props:o,children:r}=e.vnode,i=_5(e);wd(e,o,i,t),fd(e,r,n||t);const s=i?Id(e,t):void 0;return t&&Xt(!1),s}function Id(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ed);const{setup:o}=n;if(o){ie();const r=e.setupContext=o.length>1?$d(e):null,i=u9(e),s=l9(o,e,0,[e.props,r]),l=Ms(s);if(se(),i(),(l||e.sp)&&!je(e)&&d5(e),l){if(s.then(Zo,Zo),t)return s.then(d=>{Xt(!0);try{_o(e,d,t)}finally{Xt(!1)}}).catch(d=>{d9(d,e,0)});e.asyncDep=s}else _o(e,s)}else B5(e)}function _o(e,t,n){a1(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:m1(t)&&(e.setupState=Gs(t)),B5(e)}function B5(e,t,n){const o=e.type;e.render||(e.render=o.render||N2);{const r=u9(e);ie();try{td(e)}finally{se(),r()}}}const Rd={get(e,t){return J1(e,"get",""),e[t]}};function $d(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Rd),slots:e.slots,emit:e.emit,expose:t}}function yn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Gs(ur(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in It)return It[n](e)},has(t,n){return n in t||n in It}})):e.proxy}function Bo(e,t=!0){return a1(e)?e.displayName||e.name:e.name||t&&e.__name}function Nd(e){return a1(e)&&"__vccOpts"in e}const F=(e,t)=>b3(e,t,Jt);function e9(e,t,n){try{Y9(-1);const o=arguments.length;return o===2?m1(t)&&!X(t)?a2(t)?b(e,null,[t]):b(e,t):b(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&a2(n)&&(n=[n]),b(e,t,n))}finally{Y9(1)}}const Fd="3.5.42";/** +**/function l9(e,t,n,o){try{return o?e(...o):e()}catch(r){d9(r,t,n)}}function x2(e,t,n,o){if(a1(e)){const r=l9(e,t,n,o);return r&&Ms(r)&&r.catch(i=>{d9(i,t,n)}),r}if(X(e)){const r=[];for(let i=0;i>>1,r=i2[o],i=Gt(r);i=Gt(n)?i2.push(e):i2.splice(S3(t),0,e),e.flags|=1,Qs()}}function Qs(){F9||(F9=Ys.then(Js))}function Mo(e){if(!X(e))ge&&e.id===-1?ge.splice(Ye+1,0,e):e.flags&1||(tt.push(e),e.flags|=1);else for(let t=0;tGt(n)-Gt(o));if(tt.length=0,ge){for(let n=0;ne.id==null?e.flags&2?-1:1/0:e.id;function Js(e){try{for(T2=0;T2{o._d&&Y9(-1);const i=N9(t),s=ne.length;let l;try{l=e(...r)}finally{for(let d=ne.length;d>s;d--)Vn();N9(i),o._d&&Y9(1)}return l};return o._n=!0,o._c=!0,o._d=!0,o}function cr(e,t){if(Q1===null)return e;const n=yn(Q1),o=e.dirs||(e.dirs=[]);for(let r=0;r1)return n&&a1(t)?t.call(o&&o.proxy):t}}function O3(){return!!(U2()||Ie)}const A3=Symbol.for("v-scx"),P3=()=>z1(A3);function vn(e,t){return fn(e,null,t)}function T3(e,t){return fn(e,null,{flush:"sync"})}function E1(e,t,n){return fn(e,t,n)}function fn(e,t,n=g1){const{immediate:o,deep:r,flush:i,once:s}=n,l=A1({},n),d=t&&o||!t&&i!=="post";let a;if(Jt){if(i==="sync"){const p=P3();a=p.__watcherHandles||(p.__watcherHandles=[])}else if(!d){const p=()=>{};return p.stop=F2,p.resume=F2,p.pause=F2,p}}const k=t2;l.call=(p,C,v)=>x2(p,k,C,v);let u=!1;i==="post"?l.scheduler=p=>{I1(p,k&&k.suspense)}:i!=="sync"&&(u=!0,l.scheduler=(p,C)=>{C?p():pr(p)}),l.augmentJob=p=>{t&&(p.flags|=4),u&&(p.flags|=2,k&&(p.id=k.uid,p.i=k))};const h=B3(e,t,l);return Jt&&(a?a.push(h):d&&h()),h}function I3(e,t,n){const o=this.proxy,r=y1(e)?e.includes(".")?t5(o,e):()=>o[e]:e.bind(o,o);let i;a1(t)?i=t:(i=t.handler,n=t);const s=u9(this),l=fn(r,i.bind(o),n);return s(),l}function t5(e,t){const n=t.split(".");return()=>{let o=e;for(let r=0;re.__isTeleport,Be=e=>e&&(e.disabled||e.disabled===""),R3=e=>e&&(e.defer||e.defer===""),t0=e=>typeof SVGElement<"u"&&e instanceof SVGElement,n0=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,jo=(e,t)=>{const n=e&&e.to;return y1(n)?t?t(n):null:n},$3={name:"Teleport",__isTeleport:!0,process(e,t,n,o,r,i,s,l,d,a){const{mc:k,pc:u,pbc:h,o:{insert:p,querySelector:C,createText:v,createComment:m,parentNode:H}}=a,g=Be(t.props);let{dynamicChildren:j}=t;const f=(y,A,L)=>{y.shapeFlag&16&&k(y.children,A,L,r,i,s,l,d)},x=(y=t)=>{const A=Be(y.props),L=y.target=jo(y.props,C),P=xo(L,y,v,p);L&&(s!=="svg"&&t0(L)?s="svg":s!=="mathml"&&n0(L)&&(s="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(L),A||(f(y,L,P),Zt(y,!1)))},D=y=>{const A=()=>{if(ce.get(y)===A){if(ce.delete(y),Be(y.props)){const L=H(y.el)||n;f(y,L,y.anchor),Zt(y,!0)}x(y)}};ce.set(y,A),I1(A,i)};if(e==null){const y=t.el=v(""),A=t.anchor=v("");if(p(y,n,o),p(A,n,o),R3(t.props)||i&&i.pendingBranch){D(t);return}g&&(f(t,n,A),Zt(t,!0)),x()}else{t.el=e.el;const y=t.anchor=e.anchor,A=ce.get(e);if(A){A.flags|=8,ce.delete(e),D(t);return}t.targetStart=e.targetStart;const L=t.target=e.target,P=t.targetAnchor=e.targetAnchor,U=Be(e.props),I=U?n:L,J=U?y:P;if(s==="svg"||t0(L)?s="svg":(s==="mathml"||n0(L))&&(s="mathml"),j?(h(e.dynamicChildren,j,I,r,i,s,l),Dr(e,t,!0)):d||u(e,t,I,J,r,i,s,l,!1),g)U?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):v9(t,n,y,a,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const l1=jo(t.props,C);l1&&(t.target=l1,v9(t,l1,null,a,0))}else U&&v9(t,L,P,a,1);Zt(t,g)}},remove(e,t,n,{um:o,o:{remove:r}},i){const{shapeFlag:s,children:l,anchor:d,targetStart:a,targetAnchor:k,target:u,props:h}=e,p=Be(h),C=i||!p,v=ce.get(e);if(v&&(v.flags|=8,ce.delete(e)),u&&(r(a),r(k)),i&&r(d),!v&&(p||u)&&s&16)for(let m=0;m{e.isMounted=!0}),Ue(()=>{e.isUnmounting=!0}),e}const m2=[Function,Array],r5={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:m2,onEnter:m2,onAfterEnter:m2,onEnterCancelled:m2,onBeforeLeave:m2,onLeave:m2,onAfterLeave:m2,onLeaveCancelled:m2,onBeforeAppear:m2,onAppear:m2,onAfterAppear:m2,onAppearCancelled:m2},i5=e=>{const t=e.subTree;return t.component?i5(t.component):t},N3={name:"BaseTransition",props:r5,setup(e,{slots:t}){const n=U2(),o=o5();return()=>{const r=t.default&&wr(t.default(),!0),i=r&&r.length?s5(r):n.subTree?L1():void 0;if(!i)return;const s=w1(e),{mode:l}=s;if(o.isLeaving)return Fn(i);const d=q9(i);if(!d)return Fn(i);let a=Kt(d,s,o,n,u=>a=u);d.type!==R1&&xe(d,a);let k=n.subTree&&q9(n.subTree);if(k&&k.type!==R1&&!V2(k,d)&&i5(n).type!==R1){let u=Kt(k,s,o,n);if(xe(k,u),l==="out-in"&&d.type!==R1)return o.isLeaving=!0,u.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete u.afterLeave,k=void 0},Fn(i);l==="in-out"&&d.type!==R1?u.delayLeave=(h,p,C)=>{const v=l5(o,k);v[String(k.key)]=k,h[j2]=()=>{p(),h[j2]=void 0,delete a.delayedLeave,k=void 0},a.delayedLeave=()=>{C(),delete a.delayedLeave,k=void 0}}:k=void 0}else k&&(k=void 0);return i}}};function s5(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==R1){t=n;break}}return t}const q3=N3;function l5(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function Kt(e,t,n,o,r){const{appear:i,mode:s,persisted:l=!1,onBeforeEnter:d,onEnter:a,onAfterEnter:k,onEnterCancelled:u,onBeforeLeave:h,onLeave:p,onAfterLeave:C,onLeaveCancelled:v,onBeforeAppear:m,onAppear:H,onAfterAppear:g,onAppearCancelled:j}=t,f=String(e.key),x=l5(n,e),D=(L,P)=>{L&&x2(L,o,9,P)},y=(L,P)=>{const U=P[1];D(L,P),X(L)?L.every(I=>I.length<=1)&&U():L.length<=1&&U()},A={mode:s,persisted:l,beforeEnter(L){let P=d;if(!n.isMounted)if(i)P=m||d;else return;L[j2]&&L[j2](!0);const U=x[f];U&&V2(e,U)&&U.el[j2]&&U.el[j2](),D(P,[L])},enter(L){if(x[f]===e)return;let P=a,U=k,I=u;if(!n.isMounted)if(i)P=H||a,U=g||k,I=j||u;else return;let J=!1;L[ft]=h1=>{J||(J=!0,h1?D(I,[L]):D(U,[L]),A.delayedLeave&&A.delayedLeave(),L[ft]=void 0)};const l1=L[ft].bind(null,!1);P?y(P,[L,l1]):l1()},leave(L,P){const U=String(e.key);if(L[ft]&&L[ft](!0),n.isUnmounting)return P();D(h,[L]);let I=!1;L[j2]=l1=>{I||(I=!0,P(),l1?D(v,[L]):D(C,[L]),L[j2]=void 0,x[U]===e&&delete x[U])};const J=L[j2].bind(null,!1);x[U]=e,p?y(p,[L,J]):J()},clone(L){const P=Kt(L,t,n,o,r);return r&&r(P),P}};return A}function Fn(e){if(Mn(e))return e=_2(e),e.children=null,e}function q9(e){if(!Mn(e))return mn(e.type)&&e.children?s5(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&a1(n.default))return n.default()}}function xe(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;xe(mn(n.type)&&q9(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function wr(e,t=!1,n){let o=[],r=0;for(let i=0;i1)for(let i=0;iTt(v,t&&(X(t)?t[m]:t),n,o,r));return}if(je(o)&&!r){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&Tt(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?yn(o.component):o.el,s=r?null:i,{i:l,r:d}=e,a=t&&t.r,k=l.refs===g1?l.refs={}:l.refs,u=l.setupState,h=w1(u),p=u===g1?ms:v=>o0(k,v)?!1:x1(h,v),C=(v,m)=>!(m&&o0(k,m));if(a!=null&&a!==d){if(r0(t),y1(a))k[a]=null,p(a)&&(u[a]=null);else if(_1(a)){const v=t;C(a,v.k)&&(a.value=null),v.k&&(k[v.k]=null)}}if(a1(d))l9(d,l,12,[s,k]);else{const v=y1(d),m=_1(d);if(v||m){const H=()=>{if(e.f){const g=v?p(d)?u[d]:k[d]:C()||!e.k?d.value:k[e.k];if(r)X(g)&&or(g,i);else if(X(g))g.includes(i)||g.push(i);else if(v)k[d]=[i],p(d)&&(u[d]=k[d]);else{const j=[i];C(d,e.k)&&(d.value=j),e.k&&(k[e.k]=j)}}else v?(k[d]=s,p(d)&&(u[d]=s)):m&&(C(d,e.k)&&(d.value=s),e.k&&(k[e.k]=s))};if(s){const g=()=>{H(),U9.delete(e)};g.id=-1,U9.set(e,g),I1(g,n)}else r0(e),H()}}}function r0(e){const t=U9.get(e);t&&(t.flags|=8,U9.delete(e))}cn().requestIdleCallback;cn().cancelIdleCallback;const je=e=>!!e.type.__asyncLoader,Mn=e=>e.type.__isKeepAlive,z3={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=U2(),o=n.ctx;if(!o.renderer)return()=>{const g=t.default&&t.default();return g&&g.length===1?g[0]:g};const r=new Map,i=new Set;let s=null;const l=n.suspense,{renderer:{p:d,m:a,um:k,o:{createElement:u}}}=o,h=u("div");o.activate=(g,j,f,x,D)=>{const y=g.component;a(g,j,f,0,l),d(y.vnode,g,j,f,y,l,x,g.slotScopeIds,D),I1(()=>{y.isDeactivated=!1,y.a&&et(y.a);const A=g.props&&g.props.onVnodeMounted;A&&M2(A,y.parent,g)},l)},o.deactivate=g=>{const j=g.component;G9(j.m),G9(j.a),a(g,h,null,1,l),I1(()=>{j.da&&et(j.da);const f=g.props&&g.props.onVnodeUnmounted;f&&M2(f,j.parent,g),j.isDeactivated=!0},l)};function p(g){Nn(g),k(g,n,l,!0)}function C(g){r.forEach((j,f)=>{const x=Bo(je(j)?j.type.__asyncResolved||{}:j.type);x&&!g(x)&&v(f)})}function v(g){const j=r.get(g);j&&(!s||!V2(j,s))?p(j):s&&Nn(s),r.delete(g),i.delete(g)}E1(()=>[e.include,e.exclude],([g,j])=>{g&&C(f=>_t(g,f)),j&&C(f=>!_t(j,f))},{flush:"post",deep:!0});let m=null;const H=()=>{m!=null&&(K9(n.subTree.type)?I1(()=>{const g=f9(n.subTree);g.component&&r.set(m,g)},n.subTree.suspense):r.set(m,f9(n.subTree)))};return q2(H),vr(H),Ue(()=>{r.forEach(g=>{const{subTree:j,suspense:f}=n,x=f9(j);if(g.type===x.type&&g.key===x.key){Nn(x);const D=x.component.da;D&&I1(D,f);return}p(g)})}),()=>{if(m=null,!t.default)return s=null;const g=t.default(),j=g[0];if(g.length>1)return s=null,g;if(!a2(j)||!(j.shapeFlag&4)&&!(j.shapeFlag&128))return s=null,j;let f=f9(j);if(f.type===R1)return s=null,f;const x=f.type,D=Bo(je(f)?f.type.__asyncResolved||{}:x),{include:y,exclude:A,max:L}=e;if(y&&(!D||!_t(y,D))||A&&D&&_t(A,D))return f.shapeFlag&=-257,s=f,j;const P=f.key==null?x:f.key,U=r.get(P);return f.el&&(f=_2(f),j.shapeFlag&128&&(j.ssContent=f)),m=P,U?(f.el=U.el,f.component=U.component,f.transition&&xe(f,f.transition),f.shapeFlag|=512,i.delete(P),i.add(P)):(i.add(P),L&&i.size>parseInt(L,10)&&v(i.values().next().value)),f.shapeFlag|=256,s=f,K9(j.type)?j:f}}},W3=z3;function _t(e,t){return X(e)?e.some(n=>_t(n,t)):y1(e)?e.split(",").includes(t):Wl(e)?(e.lastIndex=0,e.test(t)):!1}function Cr(e,t){a5(e,"a",t)}function jn(e,t){a5(e,"da",t)}function a5(e,t,n=t2){const o=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(xn(t,o,n),n){let r=n.parent;for(;r&&r.parent;)Mn(r.parent.vnode)&&G3(o,t,n,r),r=r.parent}}function G3(e,t,n,o){const r=xn(t,e,o,!0);Dn(()=>{or(o[t],r)},n)}function Nn(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function f9(e){return e.shapeFlag&128?e.ssContent:e}function xn(e,t,n=t2,o=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...s)=>{ie();const l=u9(n),d=x2(t,n,e,s);return l(),se(),d});return o?r.unshift(i):r.push(i),i}}const ue=e=>(t,n=t2)=>{(!Jt||e==="sp")&&xn(e,(...o)=>t(...o),n)},gr=ue("bm"),q2=ue("m"),K3=ue("bu"),vr=ue("u"),Ue=ue("bum"),Dn=ue("um"),Y3=ue("sp"),Q3=ue("rtg"),X3=ue("rtc");function J3(e,t=t2){xn("ec",e,t)}const fr="components",ed="directives";function a9(e,t){return mr(fr,e,!0,t)||e}const k5=Symbol.for("v-ndc");function Do(e){return y1(e)?mr(fr,e,!1)||e:e||k5}function uw(e){return mr(ed,e)}function mr(e,t,n=!0,o=!1){const r=Q1||t2;if(r){const i=r.type;if(e===fr){const l=Bo(i,!1);if(l&&(l===t||l===n2(t)||l===hn(n2(t))))return i}const s=i0(r[e]||i[e],t)||i0(r.appContext[e],t);return!s&&o?i:s}}function i0(e,t){return e&&(e[t]||e[n2(t)]||e[hn(n2(t))])}function nt(e,t,n,o){let r;const i=n,s=X(e);if(s||y1(e)){const l=s&&te(e);let d=!1,a=!1;l&&(d=!w2(e),a=le(e),e=Cn(e)),r=new Array(e.length);for(let k=0,u=e.length;kt(l,d,void 0,i));else{const l=Object.keys(e);r=new Array(l.length);for(let d=0,a=l.length;d0;return t!=="default"&&(a.name=t),W(),O1(f1,null,[b("slot",a,o&&o())],k?-2:64)}let s=e[t];s&&s._c&&(s._d=!1);const l=ne.length;W();let d;try{const a=s&&u5(s(n)),k=n.key||i||a&&a.key;d=O1(f1,{key:(k&&!g2(k)?k:`_${t}`)+(!a&&o?"_fb":"")},a||(o?o():[]),a&&e._===1?64:-2)}catch(a){for(let k=ne.length;k>l;k--)Vn();throw a}finally{s&&s._c&&(s._d=!0)}return!r&&d.scopeId&&(d.slotScopeIds=[d.scopeId+"-s"]),d}function u5(e){return e.some(t=>a2(t)?!(t.type===R1||t.type===f1&&!u5(t.children)):!0)?e:null}const Lo=e=>e?_5(e)?yn(e):Lo(e.parent):null,It=A1(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Lo(e.parent),$root:e=>Lo(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>p5(e),$forceUpdate:e=>e.f||(e.f=()=>{pr(e.update)}),$nextTick:e=>e.n||(e.n=v2.bind(e.proxy)),$watch:e=>I3.bind(e)}),qn=(e,t)=>e!==g1&&!e.__isScriptSetup&&x1(e,t),td={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:r,props:i,accessCache:s,type:l,appContext:d}=e;if(t[0]!=="$"){const h=s[t];if(h!==void 0)switch(h){case 1:return o[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(qn(o,t))return s[t]=1,o[t];if(r!==g1&&x1(r,t))return s[t]=2,r[t];if(x1(i,t))return s[t]=3,i[t];if(n!==g1&&x1(n,t))return s[t]=4,n[t];Ho&&(s[t]=0)}}const a=It[t];let k,u;if(a)return t==="$attrs"&&J1(e.attrs,"get",""),a(e);if((k=l.__cssModules)&&(k=k[t]))return k;if(n!==g1&&x1(n,t))return s[t]=4,n[t];if(u=d.config.globalProperties,x1(u,t))return u[t]},set({_:e},t,n){const{data:o,setupState:r,ctx:i}=e;return qn(r,t)?(r[t]=n,!0):o!==g1&&x1(o,t)?(o[t]=n,!0):x1(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:r,props:i,type:s}},l){let d;return!!(n[l]||e!==g1&&l[0]!=="$"&&x1(e,l)||qn(t,l)||x1(i,l)||x1(o,l)||x1(It,l)||x1(r.config.globalProperties,l)||(d=s.__cssModules)&&d[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:x1(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function z9(e){return X(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function s0(e,t){return!e||!t?e||t:X(e)&&X(t)?e.concat(t):A1({},z9(e),z9(t))}let Ho=!0;function nd(e){const t=p5(e),n=e.proxy,o=e.ctx;Ho=!1,t.beforeCreate&&l0(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:s,watch:l,provide:d,inject:a,created:k,beforeMount:u,mounted:h,beforeUpdate:p,updated:C,activated:v,deactivated:m,beforeDestroy:H,beforeUnmount:g,destroyed:j,unmounted:f,render:x,renderTracked:D,renderTriggered:y,errorCaptured:A,serverPrefetch:L,expose:P,inheritAttrs:U,components:I,directives:J,filters:l1}=t;if(a&&od(a,o,null),s)for(const Y in s){const n1=s[Y];a1(n1)&&(o[Y]=n1.bind(n))}if(r){const Y=r.call(n,n);m1(Y)&&(e.data=W1(Y))}if(Ho=!0,i)for(const Y in i){const n1=i[Y],C1=a1(n1)?n1.bind(n,n):a1(n1.get)?n1.get.bind(n,n):F2,p1=!a1(n1)&&a1(n1.set)?n1.set.bind(n):F2,S1=N({get:C1,set:p1});Object.defineProperty(o,Y,{enumerable:!0,configurable:!0,get:()=>S1.value,set:Z1=>S1.value=Z1})}if(l)for(const Y in l)h5(l[Y],o,n,Y);if(d){const Y=a1(d)?d.call(n):d;Reflect.ownKeys(Y).forEach(n1=>{Me(n1,Y[n1])})}k&&l0(k,e,"c");function k1(Y,n1){X(n1)?n1.forEach(C1=>Y(C1.bind(n))):n1&&Y(n1.bind(n))}if(k1(gr,u),k1(q2,h),k1(K3,p),k1(vr,C),k1(Cr,v),k1(jn,m),k1(J3,A),k1(X3,D),k1(Q3,y),k1(Ue,g),k1(Dn,f),k1(Y3,L),X(P))if(P.length){const Y=e.exposed||(e.exposed={});P.forEach(n1=>{Object.defineProperty(Y,n1,{get:()=>n[n1],set:C1=>n[n1]=C1,enumerable:!0})})}else e.exposed||(e.exposed={});x&&e.render===F2&&(e.render=x),U!=null&&(e.inheritAttrs=U),I&&(e.components=I),J&&(e.directives=J),L&&d5(e)}function od(e,t,n=F2){X(e)&&(e=Vo(e));for(const o in e){const r=e[o];let i;m1(r)?"default"in r?i=z1(r.from||o,r.default,!0):i=z1(r.from||o):i=z1(r),_1(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:s=>i.value=s}):t[o]=i}}function l0(e,t,n){x2(X(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function h5(e,t,n,o){let r=o.includes(".")?t5(n,o):()=>n[o];if(y1(e)){const i=t[e];a1(i)&&E1(r,i)}else if(a1(e))E1(r,e.bind(n));else if(m1(e))if(X(e))e.forEach(i=>h5(i,t,n,o));else{const i=a1(e.handler)?e.handler.bind(n):t[e.handler];a1(i)&&E1(r,i,e)}}function p5(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:s}}=e.appContext,l=i.get(t);let d;return l?d=l:!r.length&&!n&&!o?d=t:(d={},r.length&&r.forEach(a=>W9(d,a,s,!0)),W9(d,t,s)),m1(t)&&i.set(t,d),d}function W9(e,t,n,o=!1){const{mixins:r,extends:i}=t;i&&W9(e,i,n,!0),r&&r.forEach(s=>W9(e,s,n,!0));for(const s in t)if(!(o&&s==="expose")){const l=rd[s]||n&&n[s];e[s]=l?l(e[s],t[s]):t[s]}return e}const rd={data:d0,props:a0,emits:a0,methods:Bt,computed:Bt,beforeCreate:o2,created:o2,beforeMount:o2,mounted:o2,beforeUpdate:o2,updated:o2,beforeDestroy:o2,beforeUnmount:o2,destroyed:o2,unmounted:o2,activated:o2,deactivated:o2,errorCaptured:o2,serverPrefetch:o2,components:Bt,directives:Bt,watch:sd,provide:d0,inject:id};function d0(e,t){return t?e?function(){return A1(a1(e)?e.call(this,this):e,a1(t)?t.call(this,this):t)}:t:e}function id(e,t){return Bt(Vo(e),Vo(t))}function Vo(e){if(X(e)){const t={};for(let n=0;n{let k,u=g1,h;return T3(()=>{const p=e[r];Y1(k,p)&&(k=p,a())}),{get(){return d(),n.get?n.get(k):k},set(p){const C=n.set?n.set(p):p;if(!Y1(C,k)&&!(u!==g1&&Y1(p,u)))return;const v=o.vnode.props,m=!!(v&&(t in v||r in v||i in v)&&(`onUpdate:${t}`in v||`onUpdate:${r}`in v||`onUpdate:${i}`in v));m||(k=p,a()),o.emit(`update:${t}`,C),Y1(p,u)&&(Y1(p,C)&&!Y1(C,h)||m&&u!==g1&&!Y1(C,k))&&a(),u=p,h=C}}});return l[Symbol.iterator]=()=>{let d=0;return{next(){return d<2?{value:d++?s||g1:l,done:!1}:{done:!0}}}},l}const w5=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${n2(t)}Modifiers`]||e[`${ke(t)}Modifiers`];function kd(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||g1;let r=n;const i=t.startsWith("update:"),s=i&&w5(o,t.slice(7));s&&(s.trim&&(r=n.map(k=>y1(k)?k.trim():k)),s.number&&(r=r.map(pn)));let l,d=o[l=Pn(t)]||o[l=Pn(n2(t))];!d&&i&&(d=o[l=Pn(ke(t))]),d&&x2(d,e,6,r);const a=o[l+"Once"];if(a){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,x2(a,e,6,r)}}const ud=new WeakMap;function C5(e,t,n=!1){const o=n?ud:t.emitsCache,r=o.get(e);if(r!==void 0)return r;const i=e.emits;let s={},l=!1;if(!a1(e)){const d=a=>{const k=C5(a,t,!0);k&&(l=!0,A1(s,k))};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}return!i&&!l?(m1(e)&&o.set(e,null),null):(X(i)?i.forEach(d=>s[d]=null):A1(s,i),m1(e)&&o.set(e,s),s)}function Hn(e,t){return!e||!dn(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),x1(e,t[0].toLowerCase()+t.slice(1))||x1(e,ke(t))||x1(e,t))}function k0(e){const{type:t,vnode:n,proxy:o,withProxy:r,propsOptions:[i],slots:s,attrs:l,emit:d,render:a,renderCache:k,props:u,data:h,setupState:p,ctx:C,inheritAttrs:v}=e,m=N9(e);let H,g;try{if(n.shapeFlag&4){const f=r||o,x=f;H=H2(a.call(x,f,k,u,p,h,C)),g=l}else{const f=t;H=H2(f.length>1?f(u,{attrs:l,slots:s,emit:d}):f(u,null)),g=t.props?l:pd(l)}}catch(f){ne.length=0,d9(f,e,1),H=b(R1)}let j=H;if(g&&v!==!1){const f=Object.keys(g),{shapeFlag:x}=j;f.length&&x&7&&(i&&f.some(an)&&(g=cd(g,i)),j=_2(j,g,!1,!0))}if(n.dirs&&(j=_2(j,null,!1,!0),j.dirs=j.dirs?j.dirs.concat(n.dirs):n.dirs),n.transition){const f=mn(j.type)&&q9(j)||j;xe(f,n.transition)}return H=j,N9(m),H}function hd(e,t=!0){let n;for(let o=0;o{let t;for(const n in e)(n==="class"||n==="style"||dn(n))&&((t||(t={}))[n]=e[n]);return t},cd=(e,t)=>{const n={};for(const o in e)(!an(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function wd(e,t,n){const{props:o,children:r,component:i}=e,{props:s,children:l,patchFlag:d}=t,a=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&d>=0){if(d&1024)return!0;if(d&16)return o?u0(o,s,a):!!s;if(d&8){const k=t.dynamicProps;for(let u=0;uObject.create(v5),m5=e=>Object.getPrototypeOf(e)===v5;function Cd(e,t,n,o=!1){const r={},i=f5();e.propsDefaults=Object.create(null),M5(e,t,r,i);for(const s in e.propsOptions[0])s in r||(r[s]=void 0);n?e.props=o?r:zs(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function gd(e,t,n,o){const{props:r,attrs:i,vnode:{patchFlag:s}}=e,l=w1(r),[d]=e.propsOptions;let a=!1;if((o||s>0)&&!(s&16)){if(s&8){const k=e.vnode.dynamicProps;for(let u=0;u{d=!0;const[h,p]=j5(u,t,!0);A1(s,h),p&&l.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(k),e.extends&&k(e.extends),e.mixins&&e.mixins.forEach(k)}if(!i&&!d)return m1(e)&&o.set(e,Je),Je;if(X(i))for(let k=0;ke==="_"||e==="_ctx"||e==="$stable",xr=e=>X(e)?e.map(H2):[H2(e)],fd=(e,t,n)=>{if(t._n)return t;const o=e2((...r)=>xr(t(...r)),n);return o._c=!1,o},x5=(e,t,n)=>{const o=e._ctx;for(const r in e){if(jr(r))continue;const i=e[r];if(a1(i))t[r]=fd(r,i,o);else if(i!=null){const s=xr(i);t[r]=()=>s}}},D5=(e,t)=>{const n=xr(t);e.slots.default=()=>n},L5=(e,t,n)=>{for(const o in t)(n||!jr(o))&&(e[o]=t[o])},md=(e,t,n)=>{const o=e.slots=f5();if(e.vnode.shapeFlag&32){const r=t._;r?(L5(o,t,n),n&&Ds(o,"_",r,!0)):x5(t,o)}else t&&D5(e,t)},Md=(e,t,n)=>{const{vnode:o,slots:r}=e;let i=!0,s=g1;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:L5(r,t,n):(i=!t.$stable,x5(t,r)),s=t}else t&&(D5(e,t),s={default:1});if(i)for(const l in r)!jr(l)&&s[l]==null&&delete r[l]},I1=Bd;function jd(e){return xd(e)}function xd(e,t){const n=cn();n.__VUE__=!0;const{insert:o,remove:r,patchProp:i,createElement:s,createText:l,createComment:d,setText:a,setElementText:k,parentNode:u,nextSibling:h,setScopeId:p=F2,insertStaticContent:C}=e,v=(c,w,M,_=null,S=null,B=null,q=void 0,E=null,Z=!!w.dynamicChildren)=>{if(c===w)return;c&&!V2(c,w)&&(_=V(c),Z1(c,S,B,!0),c=null),w.patchFlag===-2&&(Z=!1,w.dynamicChildren=null);const{type:T,ref:G,shapeFlag:z}=w;switch(T){case k9:m(c,w,M,_);break;case R1:H(c,w,M,_);break;case Z9:c==null&&g(w,M,_,q);break;case f1:I(c,w,M,_,S,B,q,E,Z);break;default:z&1?x(c,w,M,_,S,B,q,E,Z):z&6?J(c,w,M,_,S,B,q,E,Z):(z&64||z&128)&&T.process(c,w,M,_,S,B,q,E,Z,K)}G!=null&&S?Tt(G,c&&c.ref,B,w||c,!w):G==null&&c&&c.ref!=null&&Tt(c.ref,null,B,c,!0)},m=(c,w,M,_)=>{if(c==null)o(w.el=l(w.children),M,_);else{const S=w.el=c.el;w.children!==c.children&&a(S,w.children)}},H=(c,w,M,_)=>{c==null?o(w.el=d(w.children||""),M,_):w.el=c.el},g=(c,w,M,_)=>{[c.el,c.anchor]=C(c.children,w,M,_,c.el,c.anchor)},j=({el:c,anchor:w},M,_)=>{let S;for(;c&&c!==w;)S=h(c),o(c,M,_),c=S;o(w,M,_)},f=({el:c,anchor:w})=>{let M;for(;c&&c!==w;)M=h(c),r(c),c=M;r(w)},x=(c,w,M,_,S,B,q,E,Z)=>{if(w.type==="svg"?q="svg":w.type==="math"&&(q="mathml"),c==null)D(w,M,_,S,B,q,E,Z);else{const T=c.el&&c.el._isVueCE?c.el:null;try{T&&T._beginPatch(),L(c,w,S,B,q,E,Z)}finally{T&&T._endPatch()}}},D=(c,w,M,_,S,B,q,E)=>{let Z,T;const{props:G,shapeFlag:z,transition:e1,dirs:s1}=c;if(Z=c.el=s(c.type,B,G&&G.is,G),z&8?k(Z,c.children):z&16&&A(c.children,Z,null,_,S,Un(c,B),q,E),s1&&ye(c,null,_,"created"),y(Z,c,c.scopeId,q,_),G){for(const H1 in G)H1!=="value"&&!Ot(H1)&&i(Z,H1,null,G[H1],B,_);"value"in G&&i(Z,"value",null,G.value,B),(T=G.onVnodeBeforeMount)&&M2(T,_,c)}s1&&ye(c,null,_,"beforeMount");const c1=Dd(S,e1);c1&&e1.beforeEnter(Z),o(Z,w,M),((T=G&&G.onVnodeMounted)||c1||s1)&&I1(()=>{try{T&&M2(T,_,c),c1&&e1.enter(Z),s1&&ye(c,null,_,"mounted")}finally{}},S)},y=(c,w,M,_,S)=>{if(M&&p(c,M),_)for(let B=0;B<_.length;B++)p(c,_[B]);if(S){let B=S.subTree;if(w===B||K9(B.type)&&(B.ssContent===w||B.ssFallback===w)){const q=S.vnode;y(c,q,q.scopeId,q.slotScopeIds,S.parent)}}},A=(c,w,M,_,S,B,q,E,Z=0)=>{for(let T=Z;T{const E=w.el=c.el;let{patchFlag:Z,dynamicChildren:T,dirs:G}=w;Z|=c.patchFlag&16;const z=c.props||g1,e1=w.props||g1;let s1;if(M&&be(M,!1),(s1=e1.onVnodeBeforeUpdate)&&M2(s1,M,w,c),G&&ye(w,c,M,"beforeUpdate"),M&&be(M,!0),T&&(!c.dynamicChildren||c.dynamicChildren.length!==T.length)&&(Z=0,q=!1,T=null),(z.innerHTML&&e1.innerHTML==null||z.textContent&&e1.textContent==null)&&k(E,""),T?P(c.dynamicChildren,T,E,M,_,Un(w,S),B):q||n1(c,w,E,null,M,_,Un(w,S),B,!1),Z>0){if(Z&16)U(E,z,e1,M,S);else if(Z&2&&z.class!==e1.class&&i(E,"class",null,e1.class,S),Z&4&&i(E,"style",z.style,e1.style,S),Z&8){const c1=w.dynamicProps;for(let H1=0;H1{s1&&M2(s1,M,w,c),G&&ye(w,c,M,"updated")},_)},P=(c,w,M,_,S,B,q)=>{for(let E=0;E{if(w!==M){if(w!==g1)for(const B in w)!Ot(B)&&!(B in M)&&i(c,B,w[B],null,S,_);for(const B in M){if(Ot(B))continue;const q=M[B],E=w[B];q!==E&&B!=="value"&&i(c,B,E,q,S,_)}"value"in M&&i(c,"value",w.value,M.value,S)}},I=(c,w,M,_,S,B,q,E,Z)=>{const T=w.el=c?c.el:l(""),G=w.anchor=c?c.anchor:l("");let{patchFlag:z,dynamicChildren:e1,slotScopeIds:s1}=w;s1&&(E=E?E.concat(s1):s1),c==null?(o(T,M,_),o(G,M,_),A(w.children||[],M,G,S,B,q,E,Z)):z>0&&z&64&&e1&&c.dynamicChildren&&c.dynamicChildren.length===e1.length?(P(c.dynamicChildren,e1,M,S,B,q,E),(w.key!=null||S&&w===S.subTree)&&Dr(c,w,!0)):n1(c,w,M,G,S,B,q,E,Z)},J=(c,w,M,_,S,B,q,E,Z)=>{w.slotScopeIds=E,c==null?w.shapeFlag&512?S.ctx.activate(w,M,_,q,Z):l1(w,M,_,S,B,q,Z):h1(c,w,Z)},l1=(c,w,M,_,S,B,q)=>{const E=c.component=Td(c,_,S);if(Mn(c)&&(E.ctx.renderer=K),Id(E,!1,q),E.asyncDep){if(S&&S.registerDep(E,k1,q),!c.el){const Z=E.subTree=b(R1);H(null,Z,w,M),c.placeholder=Z.el}}else k1(E,c,w,M,S,B,q)},h1=(c,w,M)=>{const _=w.component=c.component;if(wd(c,w,M))if(_.asyncDep&&!_.asyncResolved){Y(_,w,M);return}else _.next=w,_.update();else w.el=c.el,_.vnode=w},k1=(c,w,M,_,S,B,q)=>{const E=()=>{if(c.isMounted){let{next:z,bu:e1,u:s1,parent:c1,vnode:H1}=c;{const S2=H5(c);if(S2){z&&(z.el=H1.el,Y(c,z,q)),S2.asyncDep.then(()=>{I1(()=>{c.isUnmounted||T()},S)});return}}let D1=z,P1;be(c,!1),z?(z.el=H1.el,Y(c,z,q)):z=H1,e1&&et(e1),(P1=z.props&&z.props.onVnodeBeforeUpdate)&&M2(P1,c1,z,H1),be(c,!0);const G1=k0(c),E2=c.subTree;c.subTree=G1,v(E2,G1,u(E2.el),V(E2),c,S,B),z.el=G1.el,D1===null&&Mr(c,G1.el),s1&&I1(s1,S),(P1=z.props&&z.props.onVnodeUpdated)&&I1(()=>M2(P1,c1,z,H1),S)}else{let z;const{el:e1,props:s1}=w,{bm:c1,m:H1,parent:D1,root:P1,type:G1}=c,E2=je(w);be(c,!1),c1&&et(c1),!E2&&(z=s1&&s1.onVnodeBeforeMount)&&M2(z,D1,w),be(c,!0);{P1.ce&&P1.ce._hasShadowRoot()&&P1.ce._injectChildStyle(G1,c.parent?c.parent.type:void 0);const S2=c.subTree=k0(c);v(null,S2,M,_,c,S,B),w.el=S2.el}if(H1&&I1(H1,S),!E2&&(z=s1&&s1.onVnodeMounted)){const S2=w;I1(()=>M2(z,D1,S2),S)}(w.shapeFlag&256||D1&&je(D1.vnode)&&D1.vnode.shapeFlag&256)&&c.a&&I1(c.a,S),c.isMounted=!0,w=M=_=null}};c.scope.on();const Z=c.effect=new Bs(E);c.scope.off();const T=c.update=Z.run.bind(Z),G=c.job=Z.runIfDirty.bind(Z);G.i=c,G.id=c.uid,Z.scheduler=()=>pr(G),be(c,!0),T()},Y=(c,w,M)=>{w.component=c;const _=c.vnode.props;c.vnode=w,c.next=null,gd(c,w.props,_,M),Md(c,w.children,M),ie(),e0(c),se()},n1=(c,w,M,_,S,B,q,E,Z=!1)=>{const T=c&&c.children,G=c?c.shapeFlag:0,z=w.children,{patchFlag:e1,shapeFlag:s1}=w;if(e1>0){if(e1&128){p1(T,z,M,_,S,B,q,E,Z);return}else if(e1&256){C1(T,z,M,_,S,B,q,E,Z);return}}s1&8?(G&16&&t1(T,S,B),z!==T&&k(M,z)):G&16?s1&16?p1(T,z,M,_,S,B,q,E,Z):t1(T,S,B,!0):(G&8&&k(M,""),s1&16&&A(z,M,_,S,B,q,E,Z))},C1=(c,w,M,_,S,B,q,E,Z)=>{c=c||Je,w=w||Je;const T=c.length,G=w.length,z=Math.min(T,G);let e1;for(e1=0;e1G?t1(c,S,B,!0,!1,z):A(w,M,_,S,B,q,E,Z,z)},p1=(c,w,M,_,S,B,q,E,Z)=>{let T=0;const G=w.length;let z=c.length-1,e1=G-1;for(;T<=z&&T<=e1;){const s1=c[T],c1=w[T]=Z?Q2(w[T]):H2(w[T]);if(V2(s1,c1))v(s1,c1,M,null,S,B,q,E,Z);else break;T++}for(;T<=z&&T<=e1;){const s1=c[z],c1=w[e1]=Z?Q2(w[e1]):H2(w[e1]);if(V2(s1,c1))v(s1,c1,M,null,S,B,q,E,Z);else break;z--,e1--}if(T>z){if(T<=e1){const s1=e1+1,c1=s1e1)for(;T<=z;)Z1(c[T],S,B,!0),T++;else{const s1=T,c1=T,H1=new Map;for(T=c1;T<=e1;T++){const k2=w[T]=Z?Q2(w[T]):H2(w[T]);k2.key!=null&&H1.set(k2.key,T)}let D1,P1=0;const G1=e1-c1+1;let E2=!1,S2=0;const gt=new Array(G1);for(T=0;T=G1){Z1(k2,S,B,!0);continue}let O2;if(k2.key!=null)O2=H1.get(k2.key);else for(D1=c1;D1<=e1;D1++)if(gt[D1-c1]===0&&V2(k2,w[D1])){O2=D1;break}O2===void 0?Z1(k2,S,B,!0):(gt[O2-c1]=T+1,O2>=S2?S2=O2:E2=!0,v(k2,w[O2],M,null,S,B,q,E,Z),P1++)}const zr=E2?Ld(gt):Je;for(D1=zr.length-1,T=G1-1;T>=0;T--){const k2=c1+T,O2=w[k2],Wr=w[k2+1],Gr=k2+1{const{el:B,type:q,transition:E,children:Z,shapeFlag:T}=c;if(T&6){S1(c.component.subTree,w,M,_);return}if(T&128){c.suspense.move(w,M,_);return}if(T&64){q.move(c,w,M,K);return}if(q===f1){o(B,w,M);for(let z=0;zE.enter(B),S));else{const{leave:z,delayLeave:e1,afterLeave:s1}=E,c1=()=>{c.ctx.isUnmounted?r(B):o(B,w,M)},H1=()=>{const D1=B._isLeaving||!!B[j2];B._isLeaving&&B[j2](!0),E.persisted&&!D1?c1():z(B,()=>{c1(),s1&&s1()})};e1?e1(B,c1,H1):H1()}else o(B,w,M)},Z1=(c,w,M,_=!1,S=!1)=>{const{type:B,props:q,ref:E,children:Z,dynamicChildren:T,shapeFlag:G,patchFlag:z,dirs:e1,cacheIndex:s1,memo:c1}=c;if(z===-2&&(S=!1),E!=null&&(ie(),Tt(E,null,M,c,!0),se()),s1!=null&&(w.renderCache[s1]=void 0),G&256){w.ctx.deactivate(c);return}const H1=G&1&&e1,D1=!je(c);let P1;if(D1&&(P1=q&&q.onVnodeBeforeUnmount)&&M2(P1,w,c),G&6)d1(c.component,M,_);else{if(G&128){c.suspense.unmount(M,_);return}H1&&ye(c,null,w,"beforeUnmount"),G&64?c.type.remove(c,w,M,K,_):T&&!T.hasOnce&&(B!==f1||z>0&&z&64)?t1(T,w,M,!1,!0):(B===f1&&z&384||!S&&G&16)&&t1(Z,w,M),_&&$(c)}const G1=c1!=null&&s1==null;(D1&&(P1=q&&q.onVnodeUnmounted)||H1||G1)&&I1(()=>{P1&&M2(P1,w,c),H1&&ye(c,null,w,"unmounted"),G1&&(c.el=null)},M)},$=c=>{const{type:w,el:M,anchor:_,transition:S}=c;if(w===f1){r1(M,_);return}if(w===Z9){f(c);return}const B=()=>{r(M),S&&!S.persisted&&S.afterLeave&&S.afterLeave()};if(c.shapeFlag&1&&S&&!S.persisted){const{leave:q,delayLeave:E}=S,Z=()=>q(M,B);E?E(c.el,B,Z):Z()}else B()},r1=(c,w)=>{let M;for(;c!==w;)M=h(c),r(c),c=M;r(w)},d1=(c,w,M)=>{const{bum:_,scope:S,job:B,subTree:q,um:E,m:Z,a:T}=c;G9(Z),G9(T),_&&et(_),S.stop(),B&&(B.flags|=8,Z1(q,c,w,M)),E&&I1(E,w),I1(()=>{c.isUnmounted=!0},w)},t1=(c,w,M,_=!1,S=!1,B=0)=>{for(let q=B;q{if(c.shapeFlag&6)return V(c.component.subTree);if(c.shapeFlag&128)return c.suspense.next();const w=h(c.anchor||c.el),M=w&&w[n5];return M?h(M):w};let F=!1;const R=(c,w,M)=>{let _;c==null?w._vnode&&(Z1(w._vnode,null,null,!0),_=w._vnode.component):v(w._vnode||null,c,w,null,null,null,M),w._vnode=c,F||(F=!0,e0(_),Xs(),F=!1)},K={p:v,um:Z1,m:S1,r:$,mt:l1,mc:A,pc:n1,pbc:P,n:V,o:e};return{render:R,hydrate:void 0,createApp:dd(R)}}function Un({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function be({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Dd(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Dr(e,t,n=!1){const o=e.children,r=t.children;if(X(o)&&X(r))for(let i=0;i>1,e[n[l]]0&&(t[o]=n[i-1]),n[i]=o)}}for(i=n.length,s=n[i-1];i-- >0;)n[i]=s,s=t[s];return n}function H5(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:H5(t)}function G9(e){if(e)for(let t=0;te.__isSuspense;let bo=0;const Hd={name:"Suspense",__isSuspense:!0,process(e,t,n,o,r,i,s,l,d,a){if(e==null)yd(t,n,o,r,i,s,l,d,a);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}bd(e,t,n,o,r,s,l,d,a)}},hydrate:Zd,normalize:_d},Vd=Hd;function Yt(e,t){const n=e.props&&e.props[t];a1(n)&&n()}function yd(e,t,n,o,r,i,s,l,d){const{p:a,o:{createElement:k}}=d,u=k("div"),h=e.suspense=y5(e,r,o,t,u,n,i,s,l,d);a(null,h.pendingBranch=e.ssContent,u,null,o,h,i,s),h.deps>0?(Yt(e,"onPending"),Yt(e,"onFallback"),a(null,e.ssFallback,t,n,o,null,i,s),ot(h,e.ssFallback)):h.resolve(!1,!0)}function bd(e,t,n,o,r,i,s,l,{p:d,um:a,o:{createElement:k}}){const u=t.suspense=e.suspense;u.vnode=t,t.el=e.el;const h=t.ssContent,p=t.ssFallback,{activeBranch:C,pendingBranch:v,isInFallback:m,isHydrating:H}=u;if(v)u.pendingBranch=h,V2(v,h)?(d(v,h,u.hiddenContainer,null,r,u,i,s,l),u.deps<=0?u.resolve():m&&!H&&!u.isFallbackMountPending&&(d(C,p,n,o,r,null,i,s,l),ot(u,p))):(u.pendingId=bo++,H?(u.isHydrating=!1,u.activeBranch=v):a(v,r,u),u.deps=0,u.effects.length=0,u.hiddenContainer=k("div"),m?(d(null,h,u.hiddenContainer,null,r,u,i,s,l),u.deps<=0?u.resolve():u.isFallbackMountPending||(d(C,p,n,o,r,null,i,s,l),ot(u,p))):C&&V2(C,h)?(d(C,h,n,o,r,u,i,s,l),u.resolve(!0)):(d(null,h,u.hiddenContainer,null,r,u,i,s,l),u.deps<=0&&u.resolve()));else if(C&&V2(C,h))d(C,h,n,o,r,u,i,s,l),ot(u,h);else if(Yt(t,"onPending"),u.pendingBranch=h,h.shapeFlag&512?u.pendingId=h.component.suspenseId:u.pendingId=bo++,d(null,h,u.hiddenContainer,null,r,u,i,s,l),u.deps<=0)u.resolve();else{const{timeout:g,pendingId:j}=u;g>0?setTimeout(()=>{u.pendingId===j&&u.fallback(p)},g):g===0&&u.fallback(p)}}function y5(e,t,n,o,r,i,s,l,d,a,k=!1){const{p:u,m:h,um:p,n:C,o:{parentNode:v,remove:m}}=a;let H;const g=Ed(e);g&&t&&t.pendingBranch&&(H=t.pendingId,t.deps++);const j=e.props?Ls(e.props.timeout):void 0,f=i,x={vnode:e,parent:t,parentComponent:n,namespace:s,container:o,hiddenContainer:r,deps:0,pendingId:bo++,timeout:typeof j=="number"?j:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!k,isHydrating:k,isUnmounted:!1,effects:[],resolve(D=!1,y=!1){const{vnode:A,activeBranch:L,pendingBranch:P,pendingId:U,effects:I,parentComponent:J,container:l1,isInFallback:h1}=x;let k1=!1;if(x.isHydrating)x.isHydrating=!1;else if(!D){k1=L&&P.transition&&P.transition.mode==="out-in";let C1=!1;k1&&(L.transition.afterLeave=()=>{U===x.pendingId&&(h(P,l1,i===f&&!C1?C(L):i,0),Mo(I),h1&&A.ssFallback&&(A.ssFallback.el=null))}),L&&!x.isFallbackMountPending&&(v(L.el)===l1&&(i=C(L),C1=!0),p(L,J,x,!0),!k1&&h1&&A.ssFallback&&I1(()=>A.ssFallback.el=null,x)),k1||h(P,l1,i,0)}x.isFallbackMountPending=!1,ot(x,P),x.pendingBranch=null,x.isInFallback=!1;let Y=x.parent,n1=!1;for(;Y;){if(Y.pendingBranch){for(let C1=0;C1{if(x.isFallbackMountPending=!1,!x.isInFallback)return;const h1=x.vnode.ssFallback;u(null,h1,P,I,L,null,U,l,d),ot(x,h1)},l1=D.transition&&D.transition.mode==="out-in";l1&&(x.isFallbackMountPending=!0,A.transition.afterLeave=J),x.isInFallback=!0,p(A,L,null,!0),l1||J()},move(D,y,A){x.activeBranch&&h(x.activeBranch,D,y,A),x.container=D},next(){return x.activeBranch&&C(x.activeBranch)},registerDep(D,y,A){const L=!!x.pendingBranch;L&&x.deps++;const P=D.vnode.el;D.asyncDep.catch(U=>{d9(U,D,0)}).then(U=>{if(D.isUnmounted||x.isUnmounted||x.pendingId!==D.suspenseId)return;Zo(),D.asyncResolved=!0;const{vnode:I}=D;_o(D,U),P&&(I.el=P);const J=!P&&D.subTree.el;y(D,I,v(P||D.subTree.el),P?null:C(D.subTree),x,s,A),J&&(I.placeholder=null,m(J)),Mr(D,I.el),L&&--x.deps===0&&x.resolve()})},unmount(D,y){x.isUnmounted=!0,x.activeBranch&&p(x.activeBranch,n,D,y),x.pendingBranch&&p(x.pendingBranch,n,D,y)}};return x}function Zd(e,t,n,o,r,i,s,l,d){const a=t.suspense=y5(t,o,n,e.parentNode,document.createElement("div"),null,r,i,s,l,!0),k=d(e,a.pendingBranch=t.ssContent,n,a,i,s);return a.deps===0&&a.resolve(!1,!0),k}function _d(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=p0(o?n.default:n),e.ssFallback=o?p0(n.fallback):b(R1)}function p0(e){let t;if(a1(e)){const n=lt&&e._c;n&&(e._d=!1,W()),e=e(),n&&(e._d=!0,t=d2,Vn())}return X(e)&&(e=hd(e)),e=H2(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function Bd(e,t){t&&t.pendingBranch?X(e)?t.effects.push(...e):t.effects.push(e):Mo(e)}function ot(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e;let r=t.el;for(;!r&&t.component;)t=t.component.subTree,r=t.el;n.el=r,o&&o.subTree===n&&(o.vnode.el=r,Mr(o,r))}function Ed(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const f1=Symbol.for("v-fgt"),k9=Symbol.for("v-txt"),R1=Symbol.for("v-cmt"),Z9=Symbol.for("v-stc"),ne=[];let d2=null;function W(e=!1){ne.push(d2=e?null:[])}function Vn(){ne.pop(),d2=ne[ne.length-1]||null}let lt=1;function Y9(e,t=!1){lt+=e,e<0&&d2&&t&&(d2.hasOnce=!0)}function b5(e){return e.dynamicChildren=lt>0?d2||Je:null,Vn(),lt>0&&d2&&d2.push(e),e}function o1(e,t,n,o,r,i){return b5(O(e,t,n,o,r,i,!0))}function O1(e,t,n,o,r){return b5(b(e,t,n,o,r,!0))}function a2(e){return e?e.__v_isVNode===!0:!1}function V2(e,t){return e.type===t.type&&e.key===t.key}const Z5=({key:e})=>e??null,_9=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?y1(e)||_1(e)||a1(e)?{i:Q1,r:e,k:t,f:!!n}:e:null);function O(e,t=null,n=null,o=0,r=null,i=e===f1?0:1,s=!1,l=!1){const d={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Z5(t),ref:t&&_9(t),scopeId:e5,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Q1};return l?(Q9(d,n),i&128&&e.normalize(d)):n&&(d.shapeFlag|=y1(n)?8:16),lt>0&&!s&&d2&&(d.patchFlag>0||i&6)&&d.patchFlag!==32&&d2.push(d),d}const b=Sd;function Sd(e,t=null,n=null,o=0,r=null,i=!1){if((!e||e===k5)&&(e=R1),a2(e)){const l=_2(e,t,!0);return n&&Q9(l,n),lt>0&&!i&&d2&&(l.shapeFlag&6?d2[d2.indexOf(e)]=l:d2.push(l)),l.patchFlag=-2,l}if(Nd(e)&&(e=e.__vccOpts),t){t=Od(t);let{class:l,style:d}=t;l&&!y1(l)&&(t.class=N1(l)),m1(d)&&(gn(d)&&!X(d)&&(d=A1({},d)),t.style=re(d))}const s=y1(e)?1:K9(e)?128:mn(e)?64:m1(e)?4:a1(e)?2:0;return O(e,t,n,o,r,s,i,!0)}function Od(e){return e?gn(e)||m5(e)?A1({},e):e:null}function _2(e,t,n=!1,o=!1){const{props:r,ref:i,patchFlag:s,children:l,transition:d}=e,a=t?Qt(r||{},t):r,k={__v_isVNode:!0,__v_skip:!0,type:e.type,props:a,key:a&&Z5(a),ref:t&&t.ref?n&&i?X(i)?i.concat(_9(t)):[i,_9(t)]:_9(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==f1?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:d,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&_2(e.ssContent),ssFallback:e.ssFallback&&_2(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return d&&o&&xe(k,d.clone(k)),k}function K2(e=" ",t=0){return b(k9,null,e,t)}function m9(e,t){const n=b(Z9,null,e);return n.staticCount=t,n}function L1(e="",t=!1){return t?(W(),O1(R1,null,e)):b(R1,null,e)}function H2(e){return e==null||typeof e=="boolean"?b(R1):X(e)?b(f1,null,e.slice()):a2(e)?Q2(e):b(k9,null,String(e))}function Q2(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:_2(e)}function Q9(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(X(t))n=16;else if(typeof t=="object")if(o&65){const r=t.default;r&&(r._c&&(r._d=!1),Q9(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!m5(t)?t._ctx=Q1:r===3&&Q1&&(Q1.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(a1(t)){if(o&65){Q9(e,{default:t});return}t={default:t,_ctx:Q1},n=32}else t=String(t),o&64?(n=16,t=[K2(t)]):n=8;e.children=t,e.shapeFlag|=n}function Qt(...e){const t={};for(let n=0;nt2||Q1;let X9,Xt;{const e=cn(),t=(n,o)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(o),i=>{r.length>1?r.forEach(s=>s(i)):r[0](i)}};X9=t("__VUE_INSTANCE_SETTERS__",n=>t2=n),Xt=t("__VUE_SSR_SETTERS__",n=>Jt=n)}const u9=e=>{const t=t2;return X9(e),e.scope.on(),()=>{e.scope.off(),X9(t)}},Zo=()=>{t2&&t2.scope.off(),X9(null)};function _5(e){return e.vnode.shapeFlag&4}let Jt=!1;function Id(e,t=!1,n=!1){t&&Xt(t);const{props:o,children:r}=e.vnode,i=_5(e);Cd(e,o,i,t),md(e,r,n||t);const s=i?Rd(e,t):void 0;return t&&Xt(!1),s}function Rd(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,td);const{setup:o}=n;if(o){ie();const r=e.setupContext=o.length>1?Fd(e):null,i=u9(e),s=l9(o,e,0,[e.props,r]),l=Ms(s);if(se(),i(),(l||e.sp)&&!je(e)&&d5(e),l){if(s.then(Zo,Zo),t)return s.then(d=>{Xt(!0);try{_o(e,d,t)}finally{Xt(!1)}}).catch(d=>{d9(d,e,0)});e.asyncDep=s}else _o(e,s)}else B5(e)}function _o(e,t,n){a1(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:m1(t)&&(e.setupState=Gs(t)),B5(e)}function B5(e,t,n){const o=e.type;e.render||(e.render=o.render||F2);{const r=u9(e);ie();try{nd(e)}finally{se(),r()}}}const $d={get(e,t){return J1(e,"get",""),e[t]}};function Fd(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,$d),slots:e.slots,emit:e.emit,expose:t}}function yn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Gs(ur(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in It)return It[n](e)},has(t,n){return n in t||n in It}})):e.proxy}function Bo(e,t=!0){return a1(e)?e.displayName||e.name:e.name||t&&e.__name}function Nd(e){return a1(e)&&"__vccOpts"in e}const N=(e,t)=>Z3(e,t,Jt);function e9(e,t,n){try{Y9(-1);const o=arguments.length;return o===2?m1(t)&&!X(t)?a2(t)?b(e,null,[t]):b(e,t):b(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&a2(n)&&(n=[n]),b(e,t,n))}finally{Y9(1)}}const qd="3.5.42";/** * @vue/runtime-dom v3.5.42 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let So;const c0=typeof window<"u"&&window.trustedTypes;if(c0)try{So=c0.createPolicy("vue",{createHTML:e=>e})}catch{}const S5=So?e=>So.createHTML(e):e=>e,qd="http://www.w3.org/2000/svg",Ud="http://www.w3.org/1998/Math/MathML",Y2=typeof document<"u"?document:null,w0=Y2&&Y2.createElement("template"),zd={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const r=t==="svg"?Y2.createElementNS(qd,e):t==="mathml"?Y2.createElementNS(Ud,e):n?Y2.createElement(e,{is:n}):Y2.createElement(e);return e==="select"&&o&&o.multiple!=null&&r.setAttribute("multiple",o.multiple),r},createText:e=>Y2.createTextNode(e),createComment:e=>Y2.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Y2.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,r,i){const s=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{w0.innerHTML=S5(o==="svg"?`${e}`:o==="mathml"?`${e}`:e);const l=w0.content;if(o==="svg"||o==="mathml"){const d=l.firstChild;for(;d.firstChild;)l.appendChild(d.firstChild);l.removeChild(d)}t.insertBefore(l,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},he="transition",mt="animation",dt=Symbol("_vtc"),E5={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},O5=P1({},r5,E5),Wd=e=>(e.displayName="Transition",e.props=O5,e),bn=Wd((e,{slots:t})=>e9(F3,P5(e),t)),Ze=(e,t=[])=>{X(e)?e.forEach(n=>n(...t)):e&&e(...t)},C0=e=>e?X(e)?e.some(t=>t.length>1):e.length>1:!1;function P5(e){const t={};for(const I in e)I in E5||(t[I]=e[I]);if(e.css===!1)return t;const{name:n="v",type:o,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:d=i,appearActiveClass:a=s,appearToClass:k=l,leaveFromClass:u=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,C=Gd(r),v=C&&C[0],m=C&&C[1],{onBeforeEnter:H,onEnter:g,onEnterCancelled:j,onLeave:f,onLeaveCancelled:x,onBeforeAppear:D=H,onAppear:y=g,onAppearCancelled:P=j}=t,L=(I,J,l1,h1)=>{I._enterCancelled=h1,we(I,J?k:l),we(I,J?a:s),l1&&l1()},A=(I,J)=>{I._isLeaving=!1,we(I,u),we(I,p),we(I,h),J&&J()},U=I=>(J,l1)=>{const h1=I?y:g,k1=()=>L(J,I,l1);Ze(h1,[J,k1]),g0(()=>{we(J,I?d:i),P2(J,I?k:l),C0(h1)||v0(J,o,v,k1)})};return P1(t,{onBeforeEnter(I){Ze(H,[I]),P2(I,i),P2(I,s)},onBeforeAppear(I){Ze(D,[I]),P2(I,d),P2(I,a)},onEnter:U(!1),onAppear:U(!0),onLeave(I,J){I._isLeaving=!0;const l1=()=>A(I,J);P2(I,u),I._enterCancelled?(P2(I,h),Eo(I)):(Eo(I),P2(I,h)),g0(()=>{I._isLeaving&&(we(I,u),P2(I,p),C0(f)||v0(I,o,m,l1))}),Ze(f,[I,l1])},onEnterCancelled(I){L(I,!1,void 0,!0),Ze(j,[I])},onAppearCancelled(I){L(I,!0,void 0,!0),Ze(P,[I])},onLeaveCancelled(I){A(I),Ze(x,[I])}})}function Gd(e){if(e==null)return null;if(m1(e))return[zn(e.enter),zn(e.leave)];{const t=zn(e);return[t,t]}}function zn(e){return Ls(e)}function P2(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[dt]||(e[dt]=new Set)).add(t)}function we(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[dt];n&&(n.delete(t),n.size||(e[dt]=void 0))}function g0(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Kd=0;function v0(e,t,n,o){const r=e._endId=++Kd,i=()=>{r===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:s,timeout:l,propCount:d}=A5(e,t);if(!s)return o();const a=s+"end";let k=0;const u=()=>{e.removeEventListener(a,h),i()},h=p=>{p.target===e&&++k>=d&&u()};setTimeout(()=>{k(n[C]||"").split(", "),r=o(`${he}Delay`),i=o(`${he}Duration`),s=f0(r,i),l=o(`${mt}Delay`),d=o(`${mt}Duration`),a=f0(l,d);let k=null,u=0,h=0;t===he?s>0&&(k=he,u=s,h=i.length):t===mt?a>0&&(k=mt,u=a,h=d.length):(u=Math.max(s,a),k=u>0?s>a?he:mt:null,h=k?k===he?i.length:d.length:0);const p=k===he&&/\b(?:transform|all)(?:,|$)/.test(o(`${he}Property`).toString());return{type:k,timeout:u,propCount:h,hasTransform:p}}function f0(e,t){for(;e.lengthm0(n)+m0(e[o])))}function m0(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Eo(e){return(e?e.ownerDocument:document).body.offsetHeight}function Yd(e,t,n){const o=e[dt];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const J9=Symbol("_vod"),Lr=Symbol("_vsh"),Hr={name:"show",beforeMount(e,{value:t},{transition:n}){e[J9]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Mt(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),Mt(e,!0),o.enter(e)):o.leave(e,()=>{Mt(e,!1)}):Mt(e,t))},beforeUnmount(e,{value:t}){Mt(e,t)}};function Mt(e,t){e.style.display=t?e[J9]:"none",e[Lr]=!t}const Qd=Symbol(""),Xd=/(?:^|;)\s*display\s*:/;function Jd(e,t,n){const o=e.style,r=y1(n);let i=!1;if(n&&!r){if(t)if(y1(t))for(const s of t.split(";")){const l=s.slice(0,s.indexOf(":")).trim();n[l]==null&&St(o,l,"")}else for(const s in t)n[s]==null&&St(o,s,"");for(const s in n){s==="display"&&(i=!0);const l=n[s];l!=null?t7(e,s,!y1(t)&&t?t[s]:void 0,l)||St(o,s,l):St(o,s,"")}}else if(r){if(t!==n){const s=o[Qd];s&&(n+=";"+s),o.cssText=n,i=Xd.test(n)}}else t&&e.removeAttribute("style");J9 in e&&(e[J9]=i?o.display:"",e[Lr]&&(o.display="none"))}const M9=/\s*!important$/;function St(e,t,n){if(X(n))n.forEach(o=>St(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))M9.test(n)?e.setProperty(t,n.replace(M9,""),"important"):e.setProperty(t,n);else{const o=e7(e,t);M9.test(n)?e.setProperty(ke(o),n.replace(M9,""),"important"):e[o]=n}}const M0=["Webkit","Moz","ms"],Wn={};function e7(e,t){const n=Wn[t];if(n)return n;let o=n2(t);if(o!=="filter"&&o in e)return Wn[t]=o;o=hn(o);for(let r=0;rGn||(l7.then(()=>Gn=0),Gn=Date.now());function a7(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const r=n.value;if(X(r)){const i=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{i.call(o),o._stopped=!0};const s=r.slice(),l=[o];for(let d=0;de.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,k7=(e,t,n,o,r,i)=>{const s=r==="svg";t==="class"?Yd(e,o,s):t==="style"?Jd(e,n,o):dn(t)?an(t)||o7(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):u7(e,t,o,s))?(D0(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&x0(e,t,o,s,i,t!=="value")):e._isVueCE&&(h7(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!y1(o)))?D0(e,n2(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),x0(e,t,o,s))};function u7(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&H0(t)&&a1(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return H0(t)&&y1(n)?!1:t in e}function h7(e,t){const n=e._def.props;if(!n)return!1;const o=n2(t);return Array.isArray(n)?n.some(r=>n2(r)===o):Object.keys(n).some(r=>n2(r)===o)}const T5=new WeakMap,I5=new WeakMap,en=Symbol("_moveCb"),V0=Symbol("_enterCb"),p7=e=>(delete e.props.mode,e),c7=p7({name:"TransitionGroup",props:P1({},O5,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=U2(),o=o5();let r,i;return vr(()=>{if(!r.length)return;const s=e.moveClass||`${e.name||"v"}-move`;if(!v7(r[0].el,n.vnode.el,s)){r=[];return}r.forEach(w7),r.forEach(C7);const l=r.filter(g7);Eo(n.vnode.el),l.forEach(d=>{const a=d.el,k=a.style;P2(a,s),k.transform=k.webkitTransform=k.transitionDuration="";const u=a[en]=h=>{h&&h.target!==a||(!h||h.propertyName.endsWith("transform"))&&(a.removeEventListener("transitionend",u),a[en]=null,we(a,s))};a.addEventListener("transitionend",u)}),r=[]}),()=>{const s=w1(e),l=P5(s);let d=s.tag||f1;if(r=[],i)for(let a=0;a{l.split(/\s+/).forEach(d=>d&&o.classList.remove(d))}),n.split(/\s+/).forEach(l=>l&&o.classList.add(l)),o.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(o);const{hasTransform:s}=A5(o);return i.removeChild(o),s}const De=e=>{const t=e.props["onUpdate:modelValue"]||!1;return X(t)?n=>et(t,n):t};function f7(e){e.target.composing=!0}function y0(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const c2=Symbol("_assign"),j9=Symbol("_initialValue");function Kn(e,t,n){return t&&(e=e.trim()),n&&(e=pn(e)),e}const b0={created(e,{modifiers:{lazy:t,trim:n,number:o}},r){e.parentNode&&(e.type==="text"?e[j9]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[j9]=e.defaultValue.replace(/\r\n?/g,` -`))),e[c2]=De(r);const i=o||r.props&&r.props.type==="number";ee(e,t?"change":"input",s=>{s.target.composing||e[c2](Kn(e.value,n,i))}),(n||i)&&ee(e,"change",()=>{e.value=Kn(e.value,n,i)}),t||(ee(e,"compositionstart",f7),ee(e,"compositionend",y0),ee(e,"change",y0))},mounted(e,{value:t,modifiers:{trim:n,number:o}}){const r=t??"",i=e[j9];delete e[j9],i!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==i?e[c2](Kn(e.value,n,o)):e.value=r},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:r,number:i}},s){if(e[c2]=De(s),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?pn(e.value):e.value,d=t??"";if(l===d)return;const a=e.getRootNode();(a instanceof Document||a instanceof ShadowRoot)&&a.activeElement===e&&e.type!=="range"&&(o&&t===n||r&&e.value.trim()===d)||(e.value=d)}},m7={deep:!0,created(e,t,n){e[c2]=De(n),ee(e,"change",()=>{const o=e._modelValue,r=at(e),i=e.checked,s=e[c2];if(X(o)){const l=rr(o,r),d=l!==-1;if(i&&!d)s(o.concat(r));else if(!i&&d){const a=[...o];a.splice(l,1),s(a)}}else if(oe(o)){const l=new Set(o);i?l.add(r):l.delete(r),s(l)}else s(N5(e,i))})},mounted:Z0,beforeUpdate(e,t,n){e[c2]=De(n),Z0(e,t,n)}};function Z0(e,{value:t,oldValue:n},o){e._modelValue=t;let r;if(X(t))r=rr(t,o.props.value)>-1;else if(oe(t))r=t.has(o.props.value);else{if(t===n)return;r=b2(t,N5(e,!0))}e.checked!==r&&(e.checked=r)}const M7={created(e,{value:t},n){e.checked=b2(t,n.props.value),e[c2]=De(n),ee(e,"change",()=>{e[c2](at(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[c2]=De(o),t!==n&&(e.checked=b2(t,o.props.value))}},j7={deep:!0,created(e,{value:t,modifiers:{number:n}},o){e._modelValue=t,ee(e,"change",()=>{const r=Array.prototype.filter.call(e.options,d=>d.selected).map(d=>n?pn(at(d)):at(d)),i=e.multiple,s=i?oe(e._modelValue)?new Set(r):r:r[0],l=e._pendingValue=[i,i?X(s)?r.slice():r:s];try{e[c2](s)}finally{v2(()=>{e._pendingValue===l&&(e._pendingValue=void 0)})}}),e[c2]=De(o)},mounted(e,{value:t}){_0(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[c2]=De(n)},updated(e,{value:t}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!x7(t,n[1],n[0]))&&_0(e,t)}};function x7(e,t,n){if(!n||X(e))return b2(e,t);if(oe(e)){if(e.size!==t.length)return!1;for(const o of t)if(!e.has(o))return!1;return!0}return!1}function _0(e,t){const n=e.multiple,o=X(t);if(!(n&&!o&&!oe(t))){for(let r=0,i=e.options.length;rString(a)===String(l)):s.selected=rr(t,l)>-1}else s.selected=t.has(l);else if(b2(at(s),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function at(e){return"_value"in e?e._value:e.value}function N5(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const uw={created(e,t,n){x9(e,t,n,null,"created")},mounted(e,t,n){x9(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){x9(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){x9(e,t,n,o,"updated")}};function D7(e,t){switch(e){case"SELECT":return j7;case"TEXTAREA":return b0;default:switch(t){case"checkbox":return m7;case"radio":return M7;default:return b0}}}function x9(e,t,n,o,r){const s=D7(e.tagName,n.props&&n.props.type)[r];s&&s(e,t,n,o)}const L7=["ctrl","shift","alt","meta"],H7={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>L7.some(n=>e[`${n}Key`]&&!t.includes(n))},B0=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=(r,...i)=>{for(let s=0;s{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=r=>{if(!("key"in r))return;const i=ke(r.key);if(t.some(s=>s===i||V7[s]===i))return e(r)})},y7=P1({patchProp:k7},zd);let S0;function F5(){return S0||(S0=Md(y7))}const E0=(...e)=>{F5().render(...e)},b7=(...e)=>{const t=F5().createApp(...e),{mount:n}=t;return t.mount=o=>{const r=_7(o);if(!r)return;const i=t._component;!a1(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const s=n(r,!1,Z7(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),s},t};function Z7(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function _7(e){return y1(e)?document.querySelector(e):e}/*! +**/let Eo;const c0=typeof window<"u"&&window.trustedTypes;if(c0)try{Eo=c0.createPolicy("vue",{createHTML:e=>e})}catch{}const E5=Eo?e=>Eo.createHTML(e):e=>e,Ud="http://www.w3.org/2000/svg",zd="http://www.w3.org/1998/Math/MathML",Y2=typeof document<"u"?document:null,w0=Y2&&Y2.createElement("template"),Wd={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const r=t==="svg"?Y2.createElementNS(Ud,e):t==="mathml"?Y2.createElementNS(zd,e):n?Y2.createElement(e,{is:n}):Y2.createElement(e);return e==="select"&&o&&o.multiple!=null&&r.setAttribute("multiple",o.multiple),r},createText:e=>Y2.createTextNode(e),createComment:e=>Y2.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Y2.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,r,i){const s=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{w0.innerHTML=E5(o==="svg"?`${e}`:o==="mathml"?`${e}`:e);const l=w0.content;if(o==="svg"||o==="mathml"){const d=l.firstChild;for(;d.firstChild;)l.appendChild(d.firstChild);l.removeChild(d)}t.insertBefore(l,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},he="transition",mt="animation",dt=Symbol("_vtc"),S5={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},O5=A1({},r5,S5),Gd=e=>(e.displayName="Transition",e.props=O5,e),bn=Gd((e,{slots:t})=>e9(q3,A5(e),t)),Ze=(e,t=[])=>{X(e)?e.forEach(n=>n(...t)):e&&e(...t)},C0=e=>e?X(e)?e.some(t=>t.length>1):e.length>1:!1;function A5(e){const t={};for(const I in e)I in S5||(t[I]=e[I]);if(e.css===!1)return t;const{name:n="v",type:o,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:d=i,appearActiveClass:a=s,appearToClass:k=l,leaveFromClass:u=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,C=Kd(r),v=C&&C[0],m=C&&C[1],{onBeforeEnter:H,onEnter:g,onEnterCancelled:j,onLeave:f,onLeaveCancelled:x,onBeforeAppear:D=H,onAppear:y=g,onAppearCancelled:A=j}=t,L=(I,J,l1,h1)=>{I._enterCancelled=h1,we(I,J?k:l),we(I,J?a:s),l1&&l1()},P=(I,J)=>{I._isLeaving=!1,we(I,u),we(I,p),we(I,h),J&&J()},U=I=>(J,l1)=>{const h1=I?y:g,k1=()=>L(J,I,l1);Ze(h1,[J,k1]),g0(()=>{we(J,I?d:i),A2(J,I?k:l),C0(h1)||v0(J,o,v,k1)})};return A1(t,{onBeforeEnter(I){Ze(H,[I]),A2(I,i),A2(I,s)},onBeforeAppear(I){Ze(D,[I]),A2(I,d),A2(I,a)},onEnter:U(!1),onAppear:U(!0),onLeave(I,J){I._isLeaving=!0;const l1=()=>P(I,J);A2(I,u),I._enterCancelled?(A2(I,h),So(I)):(So(I),A2(I,h)),g0(()=>{I._isLeaving&&(we(I,u),A2(I,p),C0(f)||v0(I,o,m,l1))}),Ze(f,[I,l1])},onEnterCancelled(I){L(I,!1,void 0,!0),Ze(j,[I])},onAppearCancelled(I){L(I,!0,void 0,!0),Ze(A,[I])},onLeaveCancelled(I){P(I),Ze(x,[I])}})}function Kd(e){if(e==null)return null;if(m1(e))return[zn(e.enter),zn(e.leave)];{const t=zn(e);return[t,t]}}function zn(e){return Ls(e)}function A2(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[dt]||(e[dt]=new Set)).add(t)}function we(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[dt];n&&(n.delete(t),n.size||(e[dt]=void 0))}function g0(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Yd=0;function v0(e,t,n,o){const r=e._endId=++Yd,i=()=>{r===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:s,timeout:l,propCount:d}=P5(e,t);if(!s)return o();const a=s+"end";let k=0;const u=()=>{e.removeEventListener(a,h),i()},h=p=>{p.target===e&&++k>=d&&u()};setTimeout(()=>{k(n[C]||"").split(", "),r=o(`${he}Delay`),i=o(`${he}Duration`),s=f0(r,i),l=o(`${mt}Delay`),d=o(`${mt}Duration`),a=f0(l,d);let k=null,u=0,h=0;t===he?s>0&&(k=he,u=s,h=i.length):t===mt?a>0&&(k=mt,u=a,h=d.length):(u=Math.max(s,a),k=u>0?s>a?he:mt:null,h=k?k===he?i.length:d.length:0);const p=k===he&&/\b(?:transform|all)(?:,|$)/.test(o(`${he}Property`).toString());return{type:k,timeout:u,propCount:h,hasTransform:p}}function f0(e,t){for(;e.lengthm0(n)+m0(e[o])))}function m0(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function So(e){return(e?e.ownerDocument:document).body.offsetHeight}function Qd(e,t,n){const o=e[dt];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const J9=Symbol("_vod"),Lr=Symbol("_vsh"),Hr={name:"show",beforeMount(e,{value:t},{transition:n}){e[J9]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Mt(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),Mt(e,!0),o.enter(e)):o.leave(e,()=>{Mt(e,!1)}):Mt(e,t))},beforeUnmount(e,{value:t}){Mt(e,t)}};function Mt(e,t){e.style.display=t?e[J9]:"none",e[Lr]=!t}const Xd=Symbol(""),Jd=/(?:^|;)\s*display\s*:/;function e7(e,t,n){const o=e.style,r=y1(n);let i=!1;if(n&&!r){if(t)if(y1(t))for(const s of t.split(";")){const l=s.slice(0,s.indexOf(":")).trim();n[l]==null&&Et(o,l,"")}else for(const s in t)n[s]==null&&Et(o,s,"");for(const s in n){s==="display"&&(i=!0);const l=n[s];l!=null?n7(e,s,!y1(t)&&t?t[s]:void 0,l)||Et(o,s,l):Et(o,s,"")}}else if(r){if(t!==n){const s=o[Xd];s&&(n+=";"+s),o.cssText=n,i=Jd.test(n)}}else t&&e.removeAttribute("style");J9 in e&&(e[J9]=i?o.display:"",e[Lr]&&(o.display="none"))}const M9=/\s*!important$/;function Et(e,t,n){if(X(n))n.forEach(o=>Et(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))M9.test(n)?e.setProperty(t,n.replace(M9,""),"important"):e.setProperty(t,n);else{const o=t7(e,t);M9.test(n)?e.setProperty(ke(o),n.replace(M9,""),"important"):e[o]=n}}const M0=["Webkit","Moz","ms"],Wn={};function t7(e,t){const n=Wn[t];if(n)return n;let o=n2(t);if(o!=="filter"&&o in e)return Wn[t]=o;o=hn(o);for(let r=0;rGn||(d7.then(()=>Gn=0),Gn=Date.now());function k7(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const r=n.value;if(X(r)){const i=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{i.call(o),o._stopped=!0};const s=r.slice(),l=[o];for(let d=0;de.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,u7=(e,t,n,o,r,i)=>{const s=r==="svg";t==="class"?Qd(e,o,s):t==="style"?e7(e,n,o):dn(t)?an(t)||r7(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):h7(e,t,o,s))?(D0(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&x0(e,t,o,s,i,t!=="value")):e._isVueCE&&(p7(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!y1(o)))?D0(e,n2(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),x0(e,t,o,s))};function h7(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&H0(t)&&a1(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return H0(t)&&y1(n)?!1:t in e}function p7(e,t){const n=e._def.props;if(!n)return!1;const o=n2(t);return Array.isArray(n)?n.some(r=>n2(r)===o):Object.keys(n).some(r=>n2(r)===o)}const T5=new WeakMap,I5=new WeakMap,en=Symbol("_moveCb"),V0=Symbol("_enterCb"),c7=e=>(delete e.props.mode,e),w7=c7({name:"TransitionGroup",props:A1({},O5,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=U2(),o=o5();let r,i;return vr(()=>{if(!r.length)return;const s=e.moveClass||`${e.name||"v"}-move`;if(!f7(r[0].el,n.vnode.el,s)){r=[];return}r.forEach(C7),r.forEach(g7);const l=r.filter(v7);So(n.vnode.el),l.forEach(d=>{const a=d.el,k=a.style;A2(a,s),k.transform=k.webkitTransform=k.transitionDuration="";const u=a[en]=h=>{h&&h.target!==a||(!h||h.propertyName.endsWith("transform"))&&(a.removeEventListener("transitionend",u),a[en]=null,we(a,s))};a.addEventListener("transitionend",u)}),r=[]}),()=>{const s=w1(e),l=A5(s);let d=s.tag||f1;if(r=[],i)for(let a=0;a{l.split(/\s+/).forEach(d=>d&&o.classList.remove(d))}),n.split(/\s+/).forEach(l=>l&&o.classList.add(l)),o.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(o);const{hasTransform:s}=P5(o);return i.removeChild(o),s}const De=e=>{const t=e.props["onUpdate:modelValue"]||!1;return X(t)?n=>et(t,n):t};function m7(e){e.target.composing=!0}function y0(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const c2=Symbol("_assign"),j9=Symbol("_initialValue");function Kn(e,t,n){return t&&(e=e.trim()),n&&(e=pn(e)),e}const b0={created(e,{modifiers:{lazy:t,trim:n,number:o}},r){e.parentNode&&(e.type==="text"?e[j9]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[j9]=e.defaultValue.replace(/\r\n?/g,` +`))),e[c2]=De(r);const i=o||r.props&&r.props.type==="number";ee(e,t?"change":"input",s=>{s.target.composing||e[c2](Kn(e.value,n,i))}),(n||i)&&ee(e,"change",()=>{e.value=Kn(e.value,n,i)}),t||(ee(e,"compositionstart",m7),ee(e,"compositionend",y0),ee(e,"change",y0))},mounted(e,{value:t,modifiers:{trim:n,number:o}}){const r=t??"",i=e[j9];delete e[j9],i!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==i?e[c2](Kn(e.value,n,o)):e.value=r},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:r,number:i}},s){if(e[c2]=De(s),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?pn(e.value):e.value,d=t??"";if(l===d)return;const a=e.getRootNode();(a instanceof Document||a instanceof ShadowRoot)&&a.activeElement===e&&e.type!=="range"&&(o&&t===n||r&&e.value.trim()===d)||(e.value=d)}},M7={deep:!0,created(e,t,n){e[c2]=De(n),ee(e,"change",()=>{const o=e._modelValue,r=at(e),i=e.checked,s=e[c2];if(X(o)){const l=rr(o,r),d=l!==-1;if(i&&!d)s(o.concat(r));else if(!i&&d){const a=[...o];a.splice(l,1),s(a)}}else if(oe(o)){const l=new Set(o);i?l.add(r):l.delete(r),s(l)}else s(F5(e,i))})},mounted:Z0,beforeUpdate(e,t,n){e[c2]=De(n),Z0(e,t,n)}};function Z0(e,{value:t,oldValue:n},o){e._modelValue=t;let r;if(X(t))r=rr(t,o.props.value)>-1;else if(oe(t))r=t.has(o.props.value);else{if(t===n)return;r=b2(t,F5(e,!0))}e.checked!==r&&(e.checked=r)}const j7={created(e,{value:t},n){e.checked=b2(t,n.props.value),e[c2]=De(n),ee(e,"change",()=>{e[c2](at(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[c2]=De(o),t!==n&&(e.checked=b2(t,o.props.value))}},x7={deep:!0,created(e,{value:t,modifiers:{number:n}},o){e._modelValue=t,ee(e,"change",()=>{const r=Array.prototype.filter.call(e.options,d=>d.selected).map(d=>n?pn(at(d)):at(d)),i=e.multiple,s=i?oe(e._modelValue)?new Set(r):r:r[0],l=e._pendingValue=[i,i?X(s)?r.slice():r:s];try{e[c2](s)}finally{v2(()=>{e._pendingValue===l&&(e._pendingValue=void 0)})}}),e[c2]=De(o)},mounted(e,{value:t}){_0(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[c2]=De(n)},updated(e,{value:t}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!D7(t,n[1],n[0]))&&_0(e,t)}};function D7(e,t,n){if(!n||X(e))return b2(e,t);if(oe(e)){if(e.size!==t.length)return!1;for(const o of t)if(!e.has(o))return!1;return!0}return!1}function _0(e,t){const n=e.multiple,o=X(t);if(!(n&&!o&&!oe(t))){for(let r=0,i=e.options.length;rString(a)===String(l)):s.selected=rr(t,l)>-1}else s.selected=t.has(l);else if(b2(at(s),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function at(e){return"_value"in e?e._value:e.value}function F5(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const hw={created(e,t,n){x9(e,t,n,null,"created")},mounted(e,t,n){x9(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){x9(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){x9(e,t,n,o,"updated")}};function L7(e,t){switch(e){case"SELECT":return x7;case"TEXTAREA":return b0;default:switch(t){case"checkbox":return M7;case"radio":return j7;default:return b0}}}function x9(e,t,n,o,r){const s=L7(e.tagName,n.props&&n.props.type)[r];s&&s(e,t,n,o)}const H7=["ctrl","shift","alt","meta"],V7={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>H7.some(n=>e[`${n}Key`]&&!t.includes(n))},B0=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=(r,...i)=>{for(let s=0;s{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=r=>{if(!("key"in r))return;const i=ke(r.key);if(t.some(s=>s===i||y7[s]===i))return e(r)})},b7=A1({patchProp:u7},Wd);let E0;function N5(){return E0||(E0=jd(b7))}const S0=(...e)=>{N5().render(...e)},Z7=(...e)=>{const t=N5().createApp(...e),{mount:n}=t;return t.mount=o=>{const r=B7(o);if(!r)return;const i=t._component;!a1(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const s=n(r,!1,_7(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),s},t};function _7(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function B7(e){return y1(e)?document.querySelector(e):e}/*! * pinia v2.3.1 * (c) 2025 Eduardo San Martin Morote * @license MIT - */let q5;const Zn=e=>q5=e,U5=Symbol();function Oo(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Rt;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Rt||(Rt={}));function B7(){const e=Zs(!0),t=e.run(()=>Q({}));let n=[],o=[];const r=ur({install(i){Zn(r),r._a=i,i.provide(U5,r),i.config.globalProperties.$pinia=r,o.forEach(s=>n.push(s)),o=[]},use(i){return this._a?n.push(i):o.push(i),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return r}const z5=()=>{};function O0(e,t,n,o=z5){e.push(t);const r=()=>{const i=e.indexOf(t);i>-1&&(e.splice(i,1),o())};return!n&&ir()&&_s(r),r}function Ge(e,...t){e.slice().forEach(n=>{n(...t)})}const S7=e=>e(),P0=Symbol(),Yn=Symbol();function Po(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,o)=>e.set(o,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const o=t[n],r=e[n];Oo(r)&&Oo(o)&&e.hasOwnProperty(n)&&!_1(o)&&!te(o)?e[n]=Po(r,o):e[n]=o}return e}const E7=Symbol();function O7(e){return!Oo(e)||!e.hasOwnProperty(E7)}const{assign:Ce}=Object;function P7(e){return!!(_1(e)&&e.effect)}function A7(e,t,n,o){const{state:r,actions:i,getters:s}=t,l=n.state.value[e];let d;function a(){l||(n.state.value[e]=r?r():{});const k=L3(n.state.value[e]);return Ce(k,i,Object.keys(s||{}).reduce((u,h)=>(u[h]=ur(F(()=>{Zn(n);const p=n._s.get(e);return s[h].call(p,p)})),u),{}))}return d=W5(e,a,t,n,o,!0),d}function W5(e,t,n={},o,r,i){let s;const l=Ce({actions:{}},n),d={deep:!0};let a,k,u=[],h=[],p;const C=o.state.value[e];!i&&!C&&(o.state.value[e]={});let v;function m(P){let L;a=k=!1,typeof P=="function"?(P(o.state.value[e]),L={type:Rt.patchFunction,storeId:e,events:p}):(Po(o.state.value[e],P),L={type:Rt.patchObject,payload:P,storeId:e,events:p});const A=v=Symbol();v2().then(()=>{v===A&&(a=!0)}),k=!0,Ge(u,L,o.state.value[e])}const H=i?function(){const{state:L}=n,A=L?L():{};this.$patch(U=>{Ce(U,A)})}:z5;function g(){s.stop(),u=[],h=[],o._s.delete(e)}const j=(P,L="")=>{if(P0 in P)return P[Yn]=L,P;const A=function(){Zn(o);const U=Array.from(arguments),I=[],J=[];function l1(Y){I.push(Y)}function h1(Y){J.push(Y)}Ge(h,{args:U,name:A[Yn],store:x,after:l1,onError:h1});let k1;try{k1=P.apply(this&&this.$id===e?this:x,U)}catch(Y){throw Ge(J,Y),Y}return k1 instanceof Promise?k1.then(Y=>(Ge(I,Y),Y)).catch(Y=>(Ge(J,Y),Promise.reject(Y))):(Ge(I,k1),k1)};return A[P0]=!0,A[Yn]=L,A},f={_p:o,$id:e,$onAction:O0.bind(null,h),$patch:m,$reset:H,$subscribe(P,L={}){const A=O0(u,P,L.detached,()=>U()),U=s.run(()=>S1(()=>o.state.value[e],I=>{(L.flush==="sync"?k:a)&&P({storeId:e,type:Rt.direct,events:p},I)},Ce({},d,L)));return A},$dispose:g},x=W1(f);o._s.set(e,x);const y=(o._a&&o._a.runWithContext||S7)(()=>o._e.run(()=>(s=Zs()).run(()=>t({action:j}))));for(const P in y){const L=y[P];if(_1(L)&&!P7(L)||te(L))i||(C&&O7(L)&&(_1(L)?L.value=C[P]:Po(L,C[P])),o.state.value[e][P]=L);else if(typeof L=="function"){const A=j(L,P);y[P]=A,l.actions[P]=L}}return Ce(x,y),Ce(w1(x),y),Object.defineProperty(x,"$state",{get:()=>o.state.value[e],set:P=>{m(L=>{Ce(L,P)})}}),o._p.forEach(P=>{Ce(x,s.run(()=>P({store:x,app:o._a,pinia:o,options:l})))}),C&&i&&n.hydrate&&n.hydrate(x.$state,C),a=!0,k=!0,x}/*! #__NO_SIDE_EFFECTS__ */function Le(e,t,n){let o,r;const i=typeof t=="function";typeof e=="string"?(o=e,r=i?n:t):(r=e,o=e.id);function s(l,d){const a=E3();return l=l||(a?z1(U5,null):null),l&&Zn(l),l=q5,l._s.has(o)||(i?W5(o,t,r,l):A7(o,r,l)),l._s.get(o)}return s.$id=o,s}/*! + */let q5;const Zn=e=>q5=e,U5=Symbol();function Oo(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Rt;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Rt||(Rt={}));function E7(){const e=Zs(!0),t=e.run(()=>Q({}));let n=[],o=[];const r=ur({install(i){Zn(r),r._a=i,i.provide(U5,r),i.config.globalProperties.$pinia=r,o.forEach(s=>n.push(s)),o=[]},use(i){return this._a?n.push(i):o.push(i),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return r}const z5=()=>{};function O0(e,t,n,o=z5){e.push(t);const r=()=>{const i=e.indexOf(t);i>-1&&(e.splice(i,1),o())};return!n&&ir()&&_s(r),r}function Ge(e,...t){e.slice().forEach(n=>{n(...t)})}const S7=e=>e(),A0=Symbol(),Yn=Symbol();function Ao(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,o)=>e.set(o,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const o=t[n],r=e[n];Oo(r)&&Oo(o)&&e.hasOwnProperty(n)&&!_1(o)&&!te(o)?e[n]=Ao(r,o):e[n]=o}return e}const O7=Symbol();function A7(e){return!Oo(e)||!e.hasOwnProperty(O7)}const{assign:Ce}=Object;function P7(e){return!!(_1(e)&&e.effect)}function T7(e,t,n,o){const{state:r,actions:i,getters:s}=t,l=n.state.value[e];let d;function a(){l||(n.state.value[e]=r?r():{});const k=H3(n.state.value[e]);return Ce(k,i,Object.keys(s||{}).reduce((u,h)=>(u[h]=ur(N(()=>{Zn(n);const p=n._s.get(e);return s[h].call(p,p)})),u),{}))}return d=W5(e,a,t,n,o,!0),d}function W5(e,t,n={},o,r,i){let s;const l=Ce({actions:{}},n),d={deep:!0};let a,k,u=[],h=[],p;const C=o.state.value[e];!i&&!C&&(o.state.value[e]={});let v;function m(A){let L;a=k=!1,typeof A=="function"?(A(o.state.value[e]),L={type:Rt.patchFunction,storeId:e,events:p}):(Ao(o.state.value[e],A),L={type:Rt.patchObject,payload:A,storeId:e,events:p});const P=v=Symbol();v2().then(()=>{v===P&&(a=!0)}),k=!0,Ge(u,L,o.state.value[e])}const H=i?function(){const{state:L}=n,P=L?L():{};this.$patch(U=>{Ce(U,P)})}:z5;function g(){s.stop(),u=[],h=[],o._s.delete(e)}const j=(A,L="")=>{if(A0 in A)return A[Yn]=L,A;const P=function(){Zn(o);const U=Array.from(arguments),I=[],J=[];function l1(Y){I.push(Y)}function h1(Y){J.push(Y)}Ge(h,{args:U,name:P[Yn],store:x,after:l1,onError:h1});let k1;try{k1=A.apply(this&&this.$id===e?this:x,U)}catch(Y){throw Ge(J,Y),Y}return k1 instanceof Promise?k1.then(Y=>(Ge(I,Y),Y)).catch(Y=>(Ge(J,Y),Promise.reject(Y))):(Ge(I,k1),k1)};return P[A0]=!0,P[Yn]=L,P},f={_p:o,$id:e,$onAction:O0.bind(null,h),$patch:m,$reset:H,$subscribe(A,L={}){const P=O0(u,A,L.detached,()=>U()),U=s.run(()=>E1(()=>o.state.value[e],I=>{(L.flush==="sync"?k:a)&&A({storeId:e,type:Rt.direct,events:p},I)},Ce({},d,L)));return P},$dispose:g},x=W1(f);o._s.set(e,x);const y=(o._a&&o._a.runWithContext||S7)(()=>o._e.run(()=>(s=Zs()).run(()=>t({action:j}))));for(const A in y){const L=y[A];if(_1(L)&&!P7(L)||te(L))i||(C&&A7(L)&&(_1(L)?L.value=C[A]:Ao(L,C[A])),o.state.value[e][A]=L);else if(typeof L=="function"){const P=j(L,A);y[A]=P,l.actions[A]=L}}return Ce(x,y),Ce(w1(x),y),Object.defineProperty(x,"$state",{get:()=>o.state.value[e],set:A=>{m(L=>{Ce(L,A)})}}),o._p.forEach(A=>{Ce(x,s.run(()=>A({store:x,app:o._a,pinia:o,options:l})))}),C&&i&&n.hydrate&&n.hydrate(x.$state,C),a=!0,k=!0,x}/*! #__NO_SIDE_EFFECTS__ */function Le(e,t,n){let o,r;const i=typeof t=="function";typeof e=="string"?(o=e,r=i?n:t):(r=e,o=e.id);function s(l,d){const a=O3();return l=l||(a?z1(U5,null):null),l&&Zn(l),l=q5,l._s.has(o)||(i?W5(o,t,r,l):T7(o,r,l)),l._s.get(o)}return s.$id=o,s}/*! * Vue3-Lazyload.js v0.2.5-beta * A Vue3.x image lazyload plugin * (c) 2021 MuRong * Released under the MIT License. - */var L2;(function(e){e.LOADING="loading",e.LOADED="loaded",e.ERROR="error"})(L2||(L2={}));var T7=typeof window<"u"&&window!==null,I7=F7(),R7=Object.prototype.propertyIsEnumerable,A0=Object.getOwnPropertySymbols;function $t(e){return typeof e=="function"||toString.call(e)==="[object Object]"}function $7(e){return typeof e=="object"?e===null:typeof e!="function"}function N7(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"}function F7(){return T7&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype?("isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}}),!0):!1}function q7(e){for(var t=[],n=1;n0}}),!0):!1}function U7(e){for(var t=[],n=1;ne!==null&&typeof e=="object",$e=e=>e!=null,Po=e=>typeof e=="function",X7=e=>Vr(e)&&Po(e.then)&&Po(e.catch),K5=e=>typeof e=="number"||/^\d+(\.\d+)?$/.test(e),J7=()=>Q7?/ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()):!1;function I0(e,t){const n=t.split(".");let o=e;return n.forEach(r=>{var i;o=Vr(o)&&(i=o[r])!=null?i:""}),o}const Y5=null,de=[Number,String],Se={type:Boolean,default:!0},cw=e=>({type:de,default:e}),rt=e=>({type:String,default:e});var yr=typeof window<"u";function Q5(e){let t;q2(()=>{e(),v2(()=>{t=!0})}),Cr(()=>{t&&e()})}function X5(e,t,n={}){if(!yr)return;const{target:o=window,passive:r=!1,capture:i=!1}=n;let s=!1,l;const d=u=>{if(s)return;const h=v1(u);h&&!l&&(h.addEventListener(e,t,{capture:i,passive:r}),l=!0)},a=u=>{if(s)return;const h=v1(u);h&&l&&(h.removeEventListener(e,t,i),l=!1)};Dn(()=>a(o)),jn(()=>a(o)),Q5(()=>d(o));let k;return _1(o)&&(k=E1(o,(u,h)=>{a(h),d(u)})),()=>{k==null||k(),a(o),s=!0}}var D9,Qn;function e8(){if(!D9&&(D9=Q(0),Qn=Q(0),yr)){const e=()=>{D9.value=window.innerWidth,Qn.value=window.innerHeight};e(),window.addEventListener("resize",e,{passive:!0}),window.addEventListener("orientationchange",e,{passive:!0})}return{width:D9,height:Qn}}var t8=/scroll|auto|overlay/i,J5=yr?window:void 0;function n8(e){return e.tagName!=="HTML"&&e.tagName!=="BODY"&&e.nodeType===1}function To(e,t=J5){let n=e;for(;n&&n!==t&&n8(n);){const{overflowY:o}=window.getComputedStyle(n);if(t8.test(o))return n;n=n.parentNode}return t}function ww(e,t=J5){const n=Q();return q2(()=>{e.value&&(n.value=To(e.value,t))}),n}function Cw(e){const t="scrollTop"in e?e.scrollTop:e.pageYOffset;return Math.max(t,0)}J7();const o8=e=>e.stopPropagation();function e4(e,t){(typeof e.cancelable!="boolean"||e.cancelable)&&e.preventDefault(),t&&o8(e)}e8();function R2(e){if($e(e))return K5(e)?`${e}px`:String(e)}function gw(e){if($e(e)){if(Array.isArray(e))return{width:R2(e[0]),height:R2(e[1])};const t=R2(e);return{width:t,height:t}}}function r8(e){const t={};return e!==void 0&&(t.zIndex=+e),t}const i8=/-(\w)/g,t4=e=>e.replace(i8,(t,n)=>n.toUpperCase()),{hasOwnProperty:s8}=Object.prototype;function l8(e,t,n){const o=t[n];$e(o)&&(!s8.call(e,n)||!Vr(o)?e[n]=o:e[n]=n4(Object(e[n]),o))}function n4(e,t){return Object.keys(t).forEach(n=>{l8(e,t,n)}),e}var d8={name:"姓名",tel:"电话",save:"保存",clear:"清空",undo:"撤销",cancel:"取消",confirm:"确认",delete:"删除",loading:"加载中...",noCoupon:"暂无优惠券",nameEmpty:"请填写姓名",addContact:"添加联系人",telInvalid:"请填写正确的电话",vanCalendar:{end:"结束",start:"开始",title:"日期选择",weekdays:["日","一","二","三","四","五","六"],monthTitle:(e,t)=>`${e}年${t}月`,rangePrompt:e=>`最多选择 ${e} 天`},vanCascader:{select:"请选择"},vanPagination:{prev:"上一页",next:"下一页"},vanPullRefresh:{pulling:"下拉即可刷新...",loosing:"释放即可刷新..."},vanSubmitBar:{label:"合计:"},vanCoupon:{unlimited:"无门槛",discount:e=>`${e}折`,condition:e=>`满${e}元可用`},vanCouponCell:{title:"优惠券",count:e=>`${e}张可用`},vanCouponList:{exchange:"兑换",close:"不使用",enable:"可用",disabled:"不可用",placeholder:"输入优惠码"},vanAddressEdit:{area:"地区",areaEmpty:"请选择地区",addressEmpty:"请填写详细地址",addressDetail:"详细地址",defaultAddress:"设为默认收货地址"},vanAddressList:{add:"新增地址"}};const R0=Q("zh-CN"),$0=W1({"zh-CN":d8}),o4={messages(){return $0[R0.value]},use(e,t){R0.value=e,this.add({[e]:t})},add(e={}){n4($0,e)}};var a8=o4;function k8(e){const t=t4(e)+".";return(n,...o)=>{const r=a8.messages(),i=I0(r,t+n)||I0(r,n);return Po(i)?i(...o):i}}function Io(e,t){return t?typeof t=="string"?` ${e}--${t}`:Array.isArray(t)?t.reduce((n,o)=>n+Io(e,o),""):Object.keys(t).reduce((n,o)=>n+(t[o]?Io(e,o):""),""):""}function u8(e){return(t,n)=>(t&&typeof t!="string"&&(n=t,t=""),t=t?`${e}__${t}`:e,`${t}${Io(t,n)}`)}function h9(e){const t=`van-${e}`;return[t,u8(t),k8(t)]}const h8="van-haptics-feedback",F0=5;function p8(e,{args:t=[],done:n,canceled:o,error:r}){if(e){const i=e.apply(null,t);X7(i)?i.then(s=>{s?n():o&&o()}).catch(r||Y7):i?n():o&&o()}else n()}function Bn(e){return e.install=t=>{const{name:n}=e;n&&(t.component(n,e),t.component(t4(`-${n}`),e))},e}const c8=Symbol();function w8(e){const t=U2();t&&_n(t.proxy,e)}const[C8,N0]=h9("badge"),g8={dot:Boolean,max:de,tag:rt("div"),color:String,offset:Array,content:de,showZero:Se,position:rt("top-right")};var v8=b1({name:C8,props:g8,setup(e,{slots:t}){const n=()=>{if(t.content)return!0;const{content:l,showZero:d}=e;return $e(l)&&l!==""&&(d||l!==0&&l!=="0")},o=()=>{const{dot:l,max:d,content:a}=e;if(!l&&n())return t.content?t.content():$e(d)&&K5(a)&&+a>+d?`${d}+`:a},r=l=>l.startsWith("-")?l.replace("-",""):`-${l}`,i=N(()=>{const l={background:e.color};if(e.offset){const[d,a]=e.offset,{position:k}=e,[u,h]=k.split("-");t.default?(typeof a=="number"?l[u]=R2(u==="top"?a:-a):l[u]=u==="top"?R2(a):r(a),typeof d=="number"?l[h]=R2(h==="left"?d:-d):l[h]=h==="left"?R2(d):r(d)):(l.marginTop=R2(a),l.marginLeft=R2(d))}return l}),s=()=>{if(n()||e.dot)return b("div",{class:N0([e.position,{dot:e.dot,fixed:!!t.default}]),style:i.value},[o()])};return()=>{if(t.default){const{tag:l}=e;return b(l,{class:N0("wrapper")},{default:()=>[t.default(),s()]})}return s()}}});const f8=Bn(v8);let m8=2e3;const M8=()=>++m8,[j8]=h9("config-provider"),x8=Symbol(j8),[D8,q0]=h9("icon"),L8=e=>e==null?void 0:e.includes("/"),H8={dot:Boolean,tag:rt("i"),name:String,size:de,badge:de,color:String,badgeProps:Object,classPrefix:String};var V8=b1({name:D8,props:H8,setup(e,{slots:t}){const n=z1(x8,null),o=N(()=>e.classPrefix||(n==null?void 0:n.iconPrefix)||q0());return()=>{const{tag:r,dot:i,name:s,size:l,badge:d,color:a}=e,k=L8(s);return b(f8,Qt({dot:i,tag:r,class:[o.value,k?"":`${o.value}-${s}`],style:{color:a,fontSize:R2(l)},content:d},e.badgeProps),{default:()=>{var u;return[(u=t.default)==null?void 0:u.call(t),k&&b("img",{class:q0("image"),src:s},null)]}})}}});const y8=Bn(V8),b8={show:Boolean,zIndex:de,overlay:Se,duration:de,teleport:[String,Object],lockScroll:Se,lazyRender:Se,beforeClose:Function,overlayProps:Object,overlayStyle:Object,overlayClass:Y5,transitionAppear:Boolean,closeOnClickOverlay:Se};function Z8(e,t){return e>t?"horizontal":t>e?"vertical":""}function _8(){const e=Q(0),t=Q(0),n=Q(0),o=Q(0),r=Q(0),i=Q(0),s=Q(""),l=Q(!0),d=()=>s.value==="vertical",a=()=>s.value==="horizontal",k=()=>{n.value=0,o.value=0,r.value=0,i.value=0,s.value="",l.value=!0};return{move:p=>{const C=p.touches[0];n.value=(C.clientX<0?0:C.clientX)-e.value,o.value=C.clientY-t.value,r.value=Math.abs(n.value),i.value=Math.abs(o.value);const v=10;(!s.value||r.valueF0||i.value>F0)&&(l.value=!1)},start:p=>{k(),e.value=p.touches[0].clientX,t.value=p.touches[0].clientY},reset:k,startX:e,startY:t,deltaX:n,deltaY:o,offsetX:r,offsetY:i,direction:s,isVertical:d,isHorizontal:a,isTap:l}}let jt=0;const U0="van-overflow-hidden";function B8(e,t){const n=_8(),o="01",r="10",i=k=>{n.move(k);const u=n.deltaY.value>0?r:o;let h=To(k.target,e.value);for(;h.scrollHeight<=h.offsetHeight&&h!==e.value&&h.parentElement;)h=To(h.parentElement,e.value);const{scrollHeight:p,offsetHeight:C,scrollTop:v}=h;let m="11";v===0?m=C>=p?"00":"01":v+C>=p&&(m="10"),m!=="11"&&n.isVertical()&&!(parseInt(m,2)&parseInt(u,2))&&e4(k,!0)},s=()=>{document.addEventListener("touchstart",n.start),document.addEventListener("touchmove",i,{passive:!1}),jt||document.body.classList.add(U0),jt++},l=()=>{jt&&(document.removeEventListener("touchstart",n.start),document.removeEventListener("touchmove",i),jt--,jt||document.body.classList.remove(U0))},d=()=>t()&&s(),a=()=>t()&&l();Q5(d),jn(a),Ue(a),E1(t,k=>{k?s():l()})}function r4(e){const t=Q(!1);return E1(e,n=>{n&&(t.value=n)},{immediate:!0}),n=>()=>t.value?n():null}const z0=()=>{var e;const{scopeId:t}=((e=U2())==null?void 0:e.vnode)||{};return t?{[t]:""}:null},[E8,S8]=h9("overlay"),O8={show:Boolean,zIndex:de,duration:de,className:Y5,lockScroll:Se,lazyRender:Se,customStyle:Object,teleport:[String,Object]};var A8=b1({name:E8,inheritAttrs:!1,props:O8,setup(e,{attrs:t,slots:n}){const o=Q(),r=r4(()=>e.show||!e.lazyRender),i=l=>{e.lockScroll&&e4(l,!0)},s=r(()=>{var l;const d=_n(r8(e.zIndex),e.customStyle);return $e(e.duration)&&(d.animationDuration=`${e.duration}s`),cr(b("div",Qt({ref:o,style:d,class:[S8(),e.className]},t),[(l=n.default)==null?void 0:l.call(n)]),[[Hr,e.show]])});return X5("touchmove",i,{target:o}),()=>{const l=b(bn,{name:"van-fade",appear:!0},{default:s});return e.teleport?b(wt,{to:e.teleport},{default:()=>[l]}):l}}});const P8=Bn(A8),T8=_n({},b8,{round:Boolean,position:rt("center"),closeIcon:rt("cross"),closeable:Boolean,transition:String,iconPrefix:String,closeOnPopstate:Boolean,closeIconPosition:rt("top-right"),destroyOnClose:Boolean,safeAreaInsetTop:Boolean,safeAreaInsetBottom:Boolean}),[I8,W0]=h9("popup");var R8=b1({name:I8,inheritAttrs:!1,props:T8,emits:["open","close","opened","closed","keydown","update:show","clickOverlay","clickCloseIcon"],setup(e,{emit:t,attrs:n,slots:o}){let r,i;const s=Q(),l=Q(),d=r4(()=>e.show||!e.lazyRender),a=N(()=>{const D={zIndex:s.value};if($e(e.duration)){const y=e.position==="center"?"animationDuration":"transitionDuration";D[y]=`${e.duration}s`}return D}),k=()=>{r||(r=!0,s.value=e.zIndex!==void 0?+e.zIndex:M8(),t("open"))},u=()=>{r&&p8(e.beforeClose,{done(){r=!1,t("close"),t("update:show",!1)}})},h=D=>{t("clickOverlay",D),e.closeOnClickOverlay&&u()},p=()=>{if(e.overlay){const D=_n({show:e.show,class:e.overlayClass,zIndex:s.value,duration:e.duration,customStyle:e.overlayStyle,role:e.closeOnClickOverlay?"button":void 0,tabindex:e.closeOnClickOverlay?0:void 0},e.overlayProps);return b(P8,Qt(D,z0(),{onClick:h}),{default:o["overlay-content"]})}},C=D=>{t("clickCloseIcon",D),u()},v=()=>{if(e.closeable)return b(y8,{role:"button",tabindex:0,name:e.closeIcon,class:[W0("close-icon",e.closeIconPosition),h8],classPrefix:e.iconPrefix,onClick:C},null)};let m;const H=()=>{m&&clearTimeout(m),m=setTimeout(()=>{t("opened")})},g=()=>t("closed"),j=D=>t("keydown",D),f=d(()=>{var D;const{destroyOnClose:y,round:A,position:L,safeAreaInsetTop:P,safeAreaInsetBottom:U,show:I}=e;if(!(!I&&y))return cr(b("div",Qt({ref:l,style:a.value,role:"dialog",tabindex:0,class:[W0({round:A,[L]:L}),{"van-safe-area-top":P,"van-safe-area-bottom":U}],onKeydown:j},n,z0()),[(D=o.default)==null?void 0:D.call(o),v()]),[[Hr,I]])}),x=()=>{const{position:D,transition:y,transitionAppear:A}=e,L=D==="center"?"van-fade":`van-popup-slide-${D}`;return b(bn,{name:y||L,appear:A,onAfterEnter:H,onAfterLeave:g},{default:f})};return E1(()=>e.show,D=>{D&&!r&&(k(),n.tabindex===0&&v2(()=>{var y;(y=l.value)==null||y.focus()})),!D&&r&&(r=!1,t("close"))}),w8({popupRef:l}),B8(l,()=>e.show&&e.lockScroll),X5("popstate",()=>{e.closeOnPopstate&&(u(),i=!1)}),q2(()=>{e.show&&k()}),Cr(()=>{i&&(t("update:show",!0),i=!1)}),jn(()=>{e.show&&e.teleport&&(u(),i=!0)}),Me(c8,()=>e.show),()=>e.teleport?b(wt,{to:e.teleport},{default:()=>[p(),x()]}):b(f1,null,[p(),x()])}});const $8=Bn(R8);var F8={name:"نام",tel:"تلفن",save:"ذخیره",clear:"پاک کردن",undo:"واگرد",cancel:"انصراف",confirm:"تایید",delete:"حذف",loading:"در حال بارگزاری ...",noCoupon:"بدون کوپن",nameEmpty:"لطفا نام را وارد کنید",addContact:"افزودن مخاطب",telInvalid:"شماره تلفن ناقص",vanCalendar:{end:"پایان",start:"شروع",title:"تقویم",weekdays:["شنبه","یکشنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنج‌شنبه","جمعه"],monthTitle:(e,t)=>`${e}/${t}`,rangePrompt:e=>`بیشتر از ${e} روز انتخاب کنید`},vanCascader:{select:"انتخاب"},vanPagination:{prev:"قبلی",next:"بعدی"},vanPullRefresh:{pulling:"بکشید تا تازه شود ...",loosing:"رها کنید تا تازه شود ..."},vanSubmitBar:{label:"مجموع:"},vanCoupon:{unlimited:"نامحدود",discount:e=>`${e*10}% تخفیف`,condition:e=>`حداقل ${e}`},vanCouponCell:{title:"کوپن",count:e=>`شما ${e} کوپن دارید`},vanCouponList:{exchange:"تبادل",close:"بستن",enable:"موجود",disabled:"ناموجود",placeholder:"کد کوپن"},vanAddressEdit:{area:"محدوده",postal:"کد پستی",areaEmpty:"لطفا یک منطقه برای دریافت انتخاب کنید",addressEmpty:"آدرس نمی‌تواند خالی باشد",postalEmpty:"کد پستی نامعتبر است",addressDetail:"آدرس",defaultAddress:"تنظیم به عنوان آدرس پیش فرض"},vanAddressList:{add:"افزودن آدرس جدید"}};/*! * vue-router v4.6.4 * (c) 2025 Eduardo San Martin Morote * @license MIT - */const Qe=typeof document<"u";function K5(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function K7(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&K5(e.default)}const j1=Object.assign;function Qn(e,t){const n={};for(const o in t){const r=t[o];n[o]=B2(r)?r.map(e):e(r)}return n}const Nt=()=>{},B2=Array.isArray;function I0(e,t){const n={};for(const o in e)n[o]=o in t?t[o]:e[o];return n}const Y5=/#/g,Y7=/&/g,Q7=/\//g,X7=/=/g,J7=/\?/g,Q5=/\+/g,e8=/%5B/g,t8=/%5D/g,X5=/%5E/g,n8=/%60/g,J5=/%7B/g,o8=/%7C/g,e4=/%7D/g,r8=/%20/g;function Vr(e){return e==null?"":encodeURI(""+e).replace(o8,"|").replace(e8,"[").replace(t8,"]")}function i8(e){return Vr(e).replace(J5,"{").replace(e4,"}").replace(X5,"^")}function Ao(e){return Vr(e).replace(Q5,"%2B").replace(r8,"+").replace(Y5,"%23").replace(Y7,"%26").replace(n8,"`").replace(J5,"{").replace(e4,"}").replace(X5,"^")}function s8(e){return Ao(e).replace(X7,"%3D")}function l8(e){return Vr(e).replace(Y5,"%23").replace(J7,"%3F")}function d8(e){return l8(e).replace(Q7,"%2F")}function t9(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const a8=/\/$/,k8=e=>e.replace(a8,"");function Xn(e,t,n="/"){let o,r={},i="",s="";const l=t.indexOf("#");let d=t.indexOf("?");return d=l>=0&&d>l?-1:d,d>=0&&(o=t.slice(0,d),i=t.slice(d,l>0?l:t.length),r=e(i.slice(1))),l>=0&&(o=o||t.slice(0,l),s=t.slice(l,t.length)),o=c8(o??t,n),{fullPath:o+i+s,path:o,query:r,hash:t9(s)}}function u8(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function R0(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function h8(e,t,n){const o=t.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&kt(t.matched[o],n.matched[r])&&t4(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function kt(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function t4(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!p8(e[n],t[n]))return!1;return!0}function p8(e,t){return B2(e)?$0(e,t):B2(t)?$0(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function $0(e,t){return B2(t)?e.length===t.length&&e.every((n,o)=>n===t[o]):e.length===1&&e[0]===t}function c8(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),o=e.split("/"),r=o[o.length-1];(r===".."||r===".")&&o.push("");let i=n.length-1,s,l;for(s=0;s1&&i--;else break;return n.slice(0,i).join("/")+"/"+o.slice(s).join("/")}const pe={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let To=function(e){return e.pop="pop",e.push="push",e}({}),Jn=function(e){return e.back="back",e.forward="forward",e.unknown="",e}({});function w8(e){if(!e)if(Qe){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),k8(e)}const C8=/^[^#]+#/;function g8(e,t){return e.replace(C8,"#")+t}function v8(e,t){const n=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-n.left-(t.left||0),top:o.top-n.top-(t.top||0)}}const _n=()=>({left:window.scrollX,top:window.scrollY});function f8(e){let t;if("el"in e){const n=e.el,o=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=v8(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function N0(e,t){return(history.state?history.state.position-t:-1)+e}const Io=new Map;function m8(e,t){Io.set(e,t)}function M8(e){const t=Io.get(e);return Io.delete(e),t}function j8(e){return typeof e=="string"||e&&typeof e=="object"}function n4(e){return typeof e=="string"||typeof e=="symbol"}let B1=function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e}({});const o4=Symbol("");B1.MATCHER_NOT_FOUND+"",B1.NAVIGATION_GUARD_REDIRECT+"",B1.NAVIGATION_ABORTED+"",B1.NAVIGATION_CANCELLED+"",B1.NAVIGATION_DUPLICATED+"";function ut(e,t){return j1(new Error,{type:e,[o4]:!0},t)}function W2(e,t){return e instanceof Error&&o4 in e&&(t==null||!!(e.type&t))}const x8=["params","query","hash"];function D8(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of x8)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function L8(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let o=0;or&&Ao(r)):[o&&Ao(o)]).forEach(r=>{r!==void 0&&(t+=(t.length?"&":"")+n,r!=null&&(t+="="+r))})}return t}function H8(e){const t={};for(const n in e){const o=e[n];o!==void 0&&(t[n]=B2(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return t}const V8=Symbol(""),q0=Symbol(""),Bn=Symbol(""),yr=Symbol(""),Ro=Symbol("");function jt(){let e=[];function t(o){return e.push(o),()=>{const r=e.indexOf(o);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function ve(e,t,n,o,r,i=s=>s()){const s=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise((l,d)=>{const a=h=>{h===!1?d(ut(B1.NAVIGATION_ABORTED,{from:n,to:t})):h instanceof Error?d(h):j8(h)?d(ut(B1.NAVIGATION_GUARD_REDIRECT,{from:t,to:h})):(s&&o.enterCallbacks[r]===s&&typeof h=="function"&&s.push(h),l())},k=i(()=>e.call(o&&o.instances[r],t,n,a));let u=Promise.resolve(k);e.length<3&&(u=u.then(a)),u.catch(h=>d(h))})}function eo(e,t,n,o,r=i=>i()){const i=[];for(const s of e)for(const l in s.components){let d=s.components[l];if(!(t!=="beforeRouteEnter"&&!s.instances[l]))if(K5(d)){const a=(d.__vccOpts||d)[t];a&&i.push(ve(a,n,o,s,l,r))}else{let a=d();i.push(()=>a.then(k=>{if(!k)throw new Error(`Couldn't resolve component "${l}" at "${s.path}"`);const u=K7(k)?k.default:k;s.mods[l]=k,s.components[l]=u;const h=(u.__vccOpts||u)[t];return h&&ve(h,n,o,s,l,r)()}))}}return i}function y8(e,t){const n=[],o=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let s=0;skt(a,l))?o.push(l):n.push(l));const d=e.matched[s];d&&(t.matched.find(a=>kt(a,d))||r.push(d))}return[n,o,r]}/*! + */const Qe=typeof document<"u";function i4(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function N8(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&i4(e.default)}const j1=Object.assign;function Xn(e,t){const n={};for(const o in t){const r=t[o];n[o]=B2(r)?r.map(e):e(r)}return n}const Ft=()=>{},B2=Array.isArray;function G0(e,t){const n={};for(const o in e)n[o]=o in t?t[o]:e[o];return n}const s4=/#/g,q8=/&/g,U8=/\//g,z8=/=/g,W8=/\?/g,l4=/\+/g,G8=/%5B/g,K8=/%5D/g,d4=/%5E/g,Y8=/%60/g,a4=/%7B/g,Q8=/%7C/g,k4=/%7D/g,X8=/%20/g;function br(e){return e==null?"":encodeURI(""+e).replace(Q8,"|").replace(G8,"[").replace(K8,"]")}function J8(e){return br(e).replace(a4,"{").replace(k4,"}").replace(d4,"^")}function Ro(e){return br(e).replace(l4,"%2B").replace(X8,"+").replace(s4,"%23").replace(q8,"%26").replace(Y8,"`").replace(a4,"{").replace(k4,"}").replace(d4,"^")}function ea(e){return Ro(e).replace(z8,"%3D")}function ta(e){return br(e).replace(s4,"%23").replace(W8,"%3F")}function na(e){return ta(e).replace(U8,"%2F")}function t9(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const oa=/\/$/,ra=e=>e.replace(oa,"");function Jn(e,t,n="/"){let o,r={},i="",s="";const l=t.indexOf("#");let d=t.indexOf("?");return d=l>=0&&d>l?-1:d,d>=0&&(o=t.slice(0,d),i=t.slice(d,l>0?l:t.length),r=e(i.slice(1))),l>=0&&(o=o||t.slice(0,l),s=t.slice(l,t.length)),o=da(o??t,n),{fullPath:o+i+s,path:o,query:r,hash:t9(s)}}function ia(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function K0(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function sa(e,t,n){const o=t.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&kt(t.matched[o],n.matched[r])&&u4(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function kt(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function u4(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!la(e[n],t[n]))return!1;return!0}function la(e,t){return B2(e)?Y0(e,t):B2(t)?Y0(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Y0(e,t){return B2(t)?e.length===t.length&&e.every((n,o)=>n===t[o]):e.length===1&&e[0]===t}function da(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),o=e.split("/"),r=o[o.length-1];(r===".."||r===".")&&o.push("");let i=n.length-1,s,l;for(s=0;s1&&i--;else break;return n.slice(0,i).join("/")+"/"+o.slice(s).join("/")}const pe={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let $o=function(e){return e.pop="pop",e.push="push",e}({}),eo=function(e){return e.back="back",e.forward="forward",e.unknown="",e}({});function aa(e){if(!e)if(Qe){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),ra(e)}const ka=/^[^#]+#/;function ua(e,t){return e.replace(ka,"#")+t}function ha(e,t){const n=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-n.left-(t.left||0),top:o.top-n.top-(t.top||0)}}const En=()=>({left:window.scrollX,top:window.scrollY});function pa(e){let t;if("el"in e){const n=e.el,o=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=ha(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Q0(e,t){return(history.state?history.state.position-t:-1)+e}const Fo=new Map;function ca(e,t){Fo.set(e,t)}function wa(e){const t=Fo.get(e);return Fo.delete(e),t}function Ca(e){return typeof e=="string"||e&&typeof e=="object"}function h4(e){return typeof e=="string"||typeof e=="symbol"}let B1=function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e}({});const p4=Symbol("");B1.MATCHER_NOT_FOUND+"",B1.NAVIGATION_GUARD_REDIRECT+"",B1.NAVIGATION_ABORTED+"",B1.NAVIGATION_CANCELLED+"",B1.NAVIGATION_DUPLICATED+"";function ut(e,t){return j1(new Error,{type:e,[p4]:!0},t)}function W2(e,t){return e instanceof Error&&p4 in e&&(t==null||!!(e.type&t))}const ga=["params","query","hash"];function va(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of ga)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function fa(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let o=0;or&&Ro(r)):[o&&Ro(o)]).forEach(r=>{r!==void 0&&(t+=(t.length?"&":"")+n,r!=null&&(t+="="+r))})}return t}function ma(e){const t={};for(const n in e){const o=e[n];o!==void 0&&(t[n]=B2(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return t}const Ma=Symbol(""),J0=Symbol(""),Sn=Symbol(""),Zr=Symbol(""),No=Symbol("");function xt(){let e=[];function t(o){return e.push(o),()=>{const r=e.indexOf(o);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function ve(e,t,n,o,r,i=s=>s()){const s=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise((l,d)=>{const a=h=>{h===!1?d(ut(B1.NAVIGATION_ABORTED,{from:n,to:t})):h instanceof Error?d(h):Ca(h)?d(ut(B1.NAVIGATION_GUARD_REDIRECT,{from:t,to:h})):(s&&o.enterCallbacks[r]===s&&typeof h=="function"&&s.push(h),l())},k=i(()=>e.call(o&&o.instances[r],t,n,a));let u=Promise.resolve(k);e.length<3&&(u=u.then(a)),u.catch(h=>d(h))})}function to(e,t,n,o,r=i=>i()){const i=[];for(const s of e)for(const l in s.components){let d=s.components[l];if(!(t!=="beforeRouteEnter"&&!s.instances[l]))if(i4(d)){const a=(d.__vccOpts||d)[t];a&&i.push(ve(a,n,o,s,l,r))}else{let a=d();i.push(()=>a.then(k=>{if(!k)throw new Error(`Couldn't resolve component "${l}" at "${s.path}"`);const u=N8(k)?k.default:k;s.mods[l]=k,s.components[l]=u;const h=(u.__vccOpts||u)[t];return h&&ve(h,n,o,s,l,r)()}))}}return i}function ja(e,t){const n=[],o=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let s=0;skt(a,l))?o.push(l):n.push(l));const d=e.matched[s];d&&(t.matched.find(a=>kt(a,d))||r.push(d))}return[n,o,r]}/*! * vue-router v4.6.4 * (c) 2025 Eduardo San Martin Morote * @license MIT - */let b8=()=>location.protocol+"//"+location.host;function r4(e,t){const{pathname:n,search:o,hash:r}=t,i=e.indexOf("#");if(i>-1){let s=r.includes(e.slice(i))?e.slice(i).length:1,l=r.slice(s);return l[0]!=="/"&&(l="/"+l),R0(l,"")}return R0(n,e)+o+r}function Z8(e,t,n,o){let r=[],i=[],s=null;const l=({state:h})=>{const p=r4(e,location),C=n.value,v=t.value;let m=0;if(h){if(n.value=p,t.value=h,s&&s===C){s=null;return}m=v?h.position-v.position:0}else o(p);r.forEach(H=>{H(n.value,C,{delta:m,type:To.pop,direction:m?m>0?Jn.forward:Jn.back:Jn.unknown})})};function d(){s=n.value}function a(h){r.push(h);const p=()=>{const C=r.indexOf(h);C>-1&&r.splice(C,1)};return i.push(p),p}function k(){if(document.visibilityState==="hidden"){const{history:h}=window;if(!h.state)return;h.replaceState(j1({},h.state,{scroll:_n()}),"")}}function u(){for(const h of i)h();i=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",k),document.removeEventListener("visibilitychange",k)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",k),document.addEventListener("visibilitychange",k),{pauseListeners:d,listen:a,destroy:u}}function U0(e,t,n,o=!1,r=!1){return{back:e,current:t,forward:n,replaced:o,position:window.history.length,scroll:r?_n():null}}function _8(e){const{history:t,location:n}=window,o={value:r4(e,n)},r={value:t.state};r.value||i(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(d,a,k){const u=e.indexOf("#"),h=u>-1?(n.host&&document.querySelector("base")?e:e.slice(u))+d:b8()+e+d;try{t[k?"replaceState":"pushState"](a,"",h),r.value=a}catch(p){console.error(p),n[k?"replace":"assign"](h)}}function s(d,a){i(d,j1({},t.state,U0(r.value.back,d,r.value.forward,!0),a,{position:r.value.position}),!0),o.value=d}function l(d,a){const k=j1({},r.value,t.state,{forward:d,scroll:_n()});i(k.current,k,!0),i(d,j1({},U0(o.value,d,null),{position:k.position+1},a),!1),o.value=d}return{location:o,state:r,push:l,replace:s}}function B8(e){e=w8(e);const t=_8(e),n=Z8(e,t.state,t.location,t.replace);function o(i,s=!0){s||n.pauseListeners(),history.go(i)}const r=j1({location:"",base:e,go:o,createHref:g8.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}let Ee=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var $1=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}($1||{});const S8={type:Ee.Static,value:""},E8=/[a-zA-Z0-9_]/;function O8(e){if(!e)return[[]];if(e==="/")return[[S8]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(p){throw new Error(`ERR (${n})/"${a}": ${p}`)}let n=$1.Static,o=n;const r=[];let i;function s(){i&&r.push(i),i=[]}let l=0,d,a="",k="";function u(){a&&(n===$1.Static?i.push({type:Ee.Static,value:a}):n===$1.Param||n===$1.ParamRegExp||n===$1.ParamRegExpEnd?(i.length>1&&(d==="*"||d==="+")&&t(`A repeatable param (${a}) must be alone in its segment. eg: '/:ids+.`),i.push({type:Ee.Param,value:a,regexp:k,repeatable:d==="*"||d==="+",optional:d==="*"||d==="?"})):t("Invalid state to consume buffer"),a="")}function h(){a+=d}for(;lt.length?t.length===1&&t[0]===r2.Static+r2.Segment?1:-1:0}function i4(e,t){let n=0;const o=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const R8={strict:!1,end:!0,sensitive:!1};function $8(e,t,n){const o=T8(O8(e.path),n),r=j1(o,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function N8(e,t){const n=[],o=new Map;t=I0(R8,t);function r(u){return o.get(u)}function i(u,h,p){const C=!p,v=K0(u);v.aliasOf=p&&p.record;const m=I0(t,u),H=[v];if("alias"in u){const f=typeof u.alias=="string"?[u.alias]:u.alias;for(const x of f)H.push(K0(j1({},v,{components:p?p.record.components:v.components,path:x,aliasOf:p?p.record:v})))}let g,j;for(const f of H){const{path:x}=f;if(h&&x[0]!=="/"){const D=h.record.path,y=D[D.length-1]==="/"?"":"/";f.path=h.record.path+(x&&y+x)}if(g=$8(f,h,m),p?p.alias.push(g):(j=j||g,j!==g&&j.alias.push(g),C&&u.name&&!Y0(g)&&s(u.name)),s4(g)&&d(g),v.children){const D=v.children;for(let y=0;y{s(j)}:Nt}function s(u){if(n4(u)){const h=o.get(u);h&&(o.delete(u),n.splice(n.indexOf(h),1),h.children.forEach(s),h.alias.forEach(s))}else{const h=n.indexOf(u);h>-1&&(n.splice(h,1),u.record.name&&o.delete(u.record.name),u.children.forEach(s),u.alias.forEach(s))}}function l(){return n}function d(u){const h=U8(u,n);n.splice(h,0,u),u.record.name&&!Y0(u)&&o.set(u.record.name,u)}function a(u,h){let p,C={},v,m;if("name"in u&&u.name){if(p=o.get(u.name),!p)throw ut(B1.MATCHER_NOT_FOUND,{location:u});m=p.record.name,C=j1(G0(h.params,p.keys.filter(j=>!j.optional).concat(p.parent?p.parent.keys.filter(j=>j.optional):[]).map(j=>j.name)),u.params&&G0(u.params,p.keys.map(j=>j.name))),v=p.stringify(C)}else if(u.path!=null)v=u.path,p=n.find(j=>j.re.test(v)),p&&(C=p.parse(v),m=p.record.name);else{if(p=h.name?o.get(h.name):n.find(j=>j.re.test(h.path)),!p)throw ut(B1.MATCHER_NOT_FOUND,{location:u,currentLocation:h});m=p.record.name,C=j1({},h.params,u.params),v=p.stringify(C)}const H=[];let g=p;for(;g;)H.unshift(g.record),g=g.parent;return{name:m,path:v,params:C,matched:H,meta:q8(H)}}e.forEach(u=>i(u));function k(){n.length=0,o.clear()}return{addRoute:i,resolve:a,removeRoute:s,clearRoutes:k,getRoutes:l,getRecordMatcher:r}}function G0(e,t){const n={};for(const o of t)o in e&&(n[o]=e[o]);return n}function K0(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:F8(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function F8(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const o in e.components)t[o]=typeof n=="object"?n[o]:n;return t}function Y0(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function q8(e){return e.reduce((t,n)=>j1(t,n.meta),{})}function U8(e,t){let n=0,o=t.length;for(;n!==o;){const i=n+o>>1;i4(e,t[i])<0?o=i:n=i+1}const r=z8(e);return r&&(o=t.lastIndexOf(r,o-1)),o}function z8(e){let t=e;for(;t=t.parent;)if(s4(t)&&i4(e,t)===0)return t}function s4({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Q0(e){const t=z1(Bn),n=z1(yr),o=F(()=>{const d=v1(e.to);return t.resolve(d)}),r=F(()=>{const{matched:d}=o.value,{length:a}=d,k=d[a-1],u=n.matched;if(!k||!u.length)return-1;const h=u.findIndex(kt.bind(null,k));if(h>-1)return h;const p=X0(d[a-2]);return a>1&&X0(k)===p&&u[u.length-1].path!==p?u.findIndex(kt.bind(null,d[a-2])):h}),i=F(()=>r.value>-1&&Q8(n.params,o.value.params)),s=F(()=>r.value>-1&&r.value===n.matched.length-1&&t4(n.params,o.value.params));function l(d={}){if(Y8(d)){const a=t[v1(e.replace)?"replace":"push"](v1(e.to)).catch(Nt);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>a),a}return Promise.resolve()}return{route:o,href:F(()=>o.value.href),isActive:i,isExactActive:s,navigate:l}}function W8(e){return e.length===1?e[0]:e}const G8=b1({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Q0,setup(e,{slots:t}){const n=W1(Q0(e)),{options:o}=z1(Bn),r=F(()=>({[J0(e.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[J0(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&W8(t.default(n));return e.custom?i:e9("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),K8=G8;function Y8(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Q8(e,t){for(const n in t){const o=t[n],r=e[n];if(typeof o=="string"){if(o!==r)return!1}else if(!B2(r)||r.length!==o.length||o.some((i,s)=>i.valueOf()!==r[s].valueOf()))return!1}return!0}function X0(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const J0=(e,t,n)=>e??t??n,X8=b1({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const o=z1(Ro),r=F(()=>e.route||o.value),i=z1(q0,0),s=F(()=>{let a=v1(i);const{matched:k}=r.value;let u;for(;(u=k[a])&&!u.components;)a++;return a}),l=F(()=>r.value.matched[s.value]);Me(q0,F(()=>s.value+1)),Me(V8,l),Me(Ro,r);const d=Q();return S1(()=>[d.value,l.value,e.name],([a,k,u],[h,p,C])=>{k&&(k.instances[u]=a,p&&p!==k&&a&&a===h&&(k.leaveGuards.size||(k.leaveGuards=p.leaveGuards),k.updateGuards.size||(k.updateGuards=p.updateGuards))),a&&k&&(!p||!kt(k,p)||!h)&&(k.enterCallbacks[u]||[]).forEach(v=>v(a))},{flush:"post"}),()=>{const a=r.value,k=e.name,u=l.value,h=u&&u.components[k];if(!h)return ei(n.default,{Component:h,route:a});const p=u.props[k],C=p?p===!0?a.params:typeof p=="function"?p(a):p:null,m=e9(h,j1({},C,t,{onVnodeUnmounted:H=>{H.component.isUnmounted&&(u.instances[k]=null)},ref:d}));return ei(n.default,{Component:m,route:a})||m}}});function ei(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const J8=X8;function ea(e){const t=N8(e.routes,e),n=e.parseQuery||L8,o=e.stringifyQuery||F0,r=e.history,i=jt(),s=jt(),l=jt(),d=hr(pe);let a=pe;Qe&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const k=Qn.bind(null,V=>""+V),u=Qn.bind(null,d8),h=Qn.bind(null,t9);function p(V,N){let R,K;return n4(V)?(R=t.getRecordMatcher(V),K=N):K=V,t.addRoute(K,R)}function C(V){const N=t.getRecordMatcher(V);N&&t.removeRoute(N)}function v(){return t.getRoutes().map(V=>V.record)}function m(V){return!!t.getRecordMatcher(V)}function H(V,N){if(N=j1({},N||d.value),typeof V=="string"){const M=Xn(n,V,N.path),_=t.resolve({path:M.path},N),E=r.createHref(M.fullPath);return j1(M,_,{params:h(_.params),hash:t9(M.hash),redirectedFrom:void 0,href:E})}let R;if(V.path!=null)R=j1({},V,{path:Xn(n,V.path,N.path).path});else{const M=j1({},V.params);for(const _ in M)M[_]==null&&delete M[_];R=j1({},V,{params:u(M)}),N.params=u(N.params)}const K=t.resolve(R,N),i1=V.hash||"";K.params=k(h(K.params));const c=u8(o,j1({},V,{hash:i8(i1),path:K.path})),w=r.createHref(c);return j1({fullPath:c,hash:i1,query:o===F0?H8(V.query):V.query||{}},K,{redirectedFrom:void 0,href:w})}function g(V){return typeof V=="string"?Xn(n,V,d.value.path):j1({},V)}function j(V,N){if(a!==V)return ut(B1.NAVIGATION_CANCELLED,{from:N,to:V})}function f(V){return y(V)}function x(V){return f(j1(g(V),{replace:!0}))}function D(V,N){const R=V.matched[V.matched.length-1];if(R&&R.redirect){const{redirect:K}=R;let i1=typeof K=="function"?K(V,N):K;return typeof i1=="string"&&(i1=i1.includes("?")||i1.includes("#")?i1=g(i1):{path:i1},i1.params={}),j1({query:V.query,hash:V.hash,params:i1.path!=null?{}:V.params},i1)}}function y(V,N){const R=a=H(V),K=d.value,i1=V.state,c=V.force,w=V.replace===!0,M=D(R,K);if(M)return y(j1(g(M),{state:typeof M=="object"?j1({},i1,M.state):i1,force:c,replace:w}),N||R);const _=R;_.redirectedFrom=N;let E;return!c&&h8(o,K,R)&&(E=ut(B1.NAVIGATION_DUPLICATED,{to:_,from:K}),E1(K,K,!0,!1)),(E?Promise.resolve(E):A(_,K)).catch(B=>W2(B)?W2(B,B1.NAVIGATION_GUARD_REDIRECT)?B:p1(B):n1(B,_,K)).then(B=>{if(B){if(W2(B,B1.NAVIGATION_GUARD_REDIRECT))return y(j1({replace:w},g(B.to),{state:typeof B.to=="object"?j1({},i1,B.to.state):i1,force:c}),N||_)}else B=I(_,K,!0,w,i1);return U(_,K,B),B})}function P(V,N){const R=j(V,N);return R?Promise.reject(R):Promise.resolve()}function L(V){const N=r1.values().next().value;return N&&typeof N.runWithContext=="function"?N.runWithContext(V):V()}function A(V,N){let R;const[K,i1,c]=y8(V,N);R=eo(K.reverse(),"beforeRouteLeave",V,N);for(const M of K)M.leaveGuards.forEach(_=>{R.push(ve(_,V,N))});const w=P.bind(null,V,N);return R.push(w),t1(R).then(()=>{R=[];for(const M of i.list())R.push(ve(M,V,N));return R.push(w),t1(R)}).then(()=>{R=eo(i1,"beforeRouteUpdate",V,N);for(const M of i1)M.updateGuards.forEach(_=>{R.push(ve(_,V,N))});return R.push(w),t1(R)}).then(()=>{R=[];for(const M of c)if(M.beforeEnter)if(B2(M.beforeEnter))for(const _ of M.beforeEnter)R.push(ve(_,V,N));else R.push(ve(M.beforeEnter,V,N));return R.push(w),t1(R)}).then(()=>(V.matched.forEach(M=>M.enterCallbacks={}),R=eo(c,"beforeRouteEnter",V,N,L),R.push(w),t1(R))).then(()=>{R=[];for(const M of s.list())R.push(ve(M,V,N));return R.push(w),t1(R)}).catch(M=>W2(M,B1.NAVIGATION_CANCELLED)?M:Promise.reject(M))}function U(V,N,R){l.list().forEach(K=>L(()=>K(V,N,R)))}function I(V,N,R,K,i1){const c=j(V,N);if(c)return c;const w=N===pe,M=Qe?history.state:{};R&&(K||w?r.replace(V.fullPath,j1({scroll:w&&M&&M.scroll},i1)):r.push(V.fullPath,i1)),d.value=V,E1(V,N,R,w),p1()}let J;function l1(){J||(J=r.listen((V,N,R)=>{if(!d1.listening)return;const K=H(V),i1=D(K,d1.currentRoute.value);if(i1){y(j1(i1,{replace:!0,force:!0}),K).catch(Nt);return}a=K;const c=d.value;Qe&&m8(N0(c.fullPath,R.delta),_n()),A(K,c).catch(w=>W2(w,B1.NAVIGATION_ABORTED|B1.NAVIGATION_CANCELLED)?w:W2(w,B1.NAVIGATION_GUARD_REDIRECT)?(y(j1(g(w.to),{force:!0}),K).then(M=>{W2(M,B1.NAVIGATION_ABORTED|B1.NAVIGATION_DUPLICATED)&&!R.delta&&R.type===To.pop&&r.go(-1,!1)}).catch(Nt),Promise.reject()):(R.delta&&r.go(-R.delta,!1),n1(w,K,c))).then(w=>{w=w||I(K,c,!1),w&&(R.delta&&!W2(w,B1.NAVIGATION_CANCELLED)?r.go(-R.delta,!1):R.type===To.pop&&W2(w,B1.NAVIGATION_ABORTED|B1.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),U(K,c,w)}).catch(Nt)}))}let h1=jt(),k1=jt(),Y;function n1(V,N,R){p1(V);const K=k1.list();return K.length?K.forEach(i1=>i1(V,N,R)):console.error(V),Promise.reject(V)}function C1(){return Y&&d.value!==pe?Promise.resolve():new Promise((V,N)=>{h1.add([V,N])})}function p1(V){return Y||(Y=!V,l1(),h1.list().forEach(([N,R])=>V?R(V):N()),h1.reset()),V}function E1(V,N,R,K){const{scrollBehavior:i1}=e;if(!Qe||!i1)return Promise.resolve();const c=!R&&M8(N0(V.fullPath,0))||(K||!R)&&history.state&&history.state.scroll||null;return v2().then(()=>i1(V,N,c)).then(w=>w&&f8(w)).catch(w=>n1(w,V,N))}const Z1=V=>r.go(V);let $;const r1=new Set,d1={currentRoute:d,listening:!0,addRoute:p,removeRoute:C,clearRoutes:t.clearRoutes,hasRoute:m,getRoutes:v,resolve:H,options:e,push:f,replace:x,go:Z1,back:()=>Z1(-1),forward:()=>Z1(1),beforeEach:i.add,beforeResolve:s.add,afterEach:l.add,onError:k1.add,isReady:C1,install(V){V.component("RouterLink",K8),V.component("RouterView",J8),V.config.globalProperties.$router=d1,Object.defineProperty(V.config.globalProperties,"$route",{enumerable:!0,get:()=>v1(d)}),Qe&&!$&&d.value===pe&&($=!0,f(r.location).catch(K=>{}));const N={};for(const K in pe)Object.defineProperty(N,K,{get:()=>d.value[K],enumerable:!0});V.provide(Bn,d1),V.provide(yr,zs(N)),V.provide(Ro,d);const R=V.unmount;r1.add(V),V.unmount=function(){r1.delete(V),r1.size<1&&(a=pe,J&&J(),J=null,d.value=pe,$=!1,Y=!1),R()}}};function t1(V){return V.reduce((N,R)=>N.then(()=>L(R)),Promise.resolve())}return d1}function l4(){return z1(Bn)}function ta(e){return z1(yr)}const na="modulepreload",oa=function(e){return"/"+e},ti={},T1=function(t,n,o){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),l=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));r=Promise.allSettled(n.map(d=>{if(d=oa(d),d in ti)return;ti[d]=!0;const a=d.endsWith(".css"),k=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${k}`))return;const u=document.createElement("link");if(u.rel=a?"stylesheet":na,a||(u.as="script"),u.crossOrigin="",u.href=d,l&&u.setAttribute("nonce",l),document.head.appendChild(u),a)return new Promise((h,p)=>{u.addEventListener("load",h),u.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return r.then(s=>{for(const l of s||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function ra(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:o,onRegistered:r,onRegisteredSW:i,onRegisterError:s}=e;let l,d,a;const k=async(h=!0)=>{await d,await(a==null?void 0:a())};async function u(){if("serviceWorker"in navigator){if(l=await T1(async()=>{const{Workbox:h}=await import("./workbox-window.prod.es5-BqEJf4Xk.js");return{Workbox:h}},[]).then(({Workbox:h})=>new h("/sw.js",{scope:"/",type:"classic"})).catch(h=>{s==null||s(h)}),!l)return;a=async()=>{await(l==null?void 0:l.messageSkipWaiting())};{let h=!1;const p=()=>{h=!0,l==null||l.addEventListener("controlling",C=>{C.isUpdate&&window.location.reload()}),n==null||n()};l.addEventListener("installed",C=>{typeof C.isUpdate>"u"?typeof C.isExternal<"u"?C.isExternal?p():!h&&(o==null||o()):C.isExternal?window.location.reload():!h&&(o==null||o()):C.isUpdate||o==null||o()}),l.addEventListener("waiting",p),l.addEventListener("externalwaiting",p)}l.register({immediate:t}).then(h=>{i?i("/sw.js",h):r==null||r(h)}).catch(h=>{s==null||s(h)})}}return d=u(),k}function d4(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:o,onRegistered:r,onRegisteredSW:i,onRegisterError:s}=e,l=Q(!1),d=Q(!1);return{updateServiceWorker:ra({immediate:t,onNeedRefresh(){l.value=!0,n==null||n()},onOfflineReady(){d.value=!0,o==null||o()},onRegistered:r,onRegisteredSW:i,onRegisterError:s}),offlineReady:d,needRefresh:l}}var ni;const a4=typeof window<"u",ia=e=>typeof e=="string",$e=()=>{};a4&&((ni=window==null?void 0:window.navigator)!=null&&ni.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function $2(e){return typeof e=="function"?e():v1(e)}function k4(e,t){function n(...o){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(r).catch(i)})}return n}function sa(e,t={}){let n,o,r=$e;const i=l=>{clearTimeout(l),r(),r=$e};return l=>{const d=$2(e),a=$2(t.maxWait);return n&&i(n),d<=0||a!==void 0&&a<=0?(o&&(i(o),o=null),Promise.resolve(l())):new Promise((k,u)=>{r=t.rejectOnCancel?u:k,a&&!o&&(o=setTimeout(()=>{n&&i(n),o=null,k(l())},a)),n=setTimeout(()=>{o&&i(o),o=null,k(l())},d)})}}function la(e,t=!0,n=!0,o=!1){let r=0,i,s=!0,l=$e,d;const a=()=>{i&&(clearTimeout(i),i=void 0,l(),l=$e)};return u=>{const h=$2(e),p=Date.now()-r,C=()=>d=u();return a(),h<=0?(r=Date.now(),C()):(p>h&&(n||!s)?(r=Date.now(),C()):t&&(d=new Promise((v,m)=>{l=o?m:v,i=setTimeout(()=>{r=Date.now(),s=!0,v(C()),a()},Math.max(0,h-p))})),!n&&!i&&(i=setTimeout(()=>s=!0,h)),s=!1,d)}}function da(e){return e}function u4(e){return ir()?(_s(e),!0):!1}function h4(e,t=200,n={}){return k4(sa(t,n),e)}function pw(e,t=200,n={}){const o=Q(e.value),r=h4(()=>{o.value=e.value},t,n);return S1(e,()=>r()),o}function aa(e,t=200,n=!1,o=!0,r=!1){return k4(la(t,n,o,r),e)}function ka(e,t=!0){U2()?q2(e):t?e():v2(e)}function p4(e){var t;const n=$2(e);return(t=n==null?void 0:n.$el)!=null?t:n}const c4=a4?window:void 0;function oi(...e){let t,n,o,r;if(ia(e[0])||Array.isArray(e[0])?([n,o,r]=e,t=c4):[t,n,o,r]=e,!t)return $e;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],s=()=>{i.forEach(k=>k()),i.length=0},l=(k,u,h,p)=>(k.addEventListener(u,h,p),()=>k.removeEventListener(u,h,p)),d=S1(()=>[p4(t),$2(r)],([k,u])=>{s(),k&&i.push(...n.flatMap(h=>o.map(p=>l(k,h,p,u))))},{immediate:!0,flush:"post"}),a=()=>{d(),s()};return u4(a),a}function ua(e,t=!1){const n=Q(),o=()=>n.value=!!e();return o(),ka(o,t),n}const ri=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ii="__vueuse_ssr_handlers__";ri[ii]=ri[ii]||{};var si=Object.getOwnPropertySymbols,ha=Object.prototype.hasOwnProperty,pa=Object.prototype.propertyIsEnumerable,ca=(e,t)=>{var n={};for(var o in e)ha.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&si)for(var o of si(e))t.indexOf(o)<0&&pa.call(e,o)&&(n[o]=e[o]);return n};function wa(e,t,n={}){const o=n,{window:r=c4}=o,i=ca(o,["window"]);let s;const l=ua(()=>r&&"ResizeObserver"in r),d=()=>{s&&(s.disconnect(),s=void 0)},a=S1(()=>p4(e),u=>{d(),l.value&&r&&u&&(s=new ResizeObserver(t),s.observe(u,i))},{immediate:!0,flush:"post"}),k=()=>{d(),a()};return u4(k),{isSupported:l,stop:k}}const li=1;function Ca(e,t={}){const{throttle:n=0,idle:o=200,onStop:r=$e,onScroll:i=$e,offset:s={left:0,right:0,top:0,bottom:0},eventListenerOptions:l={capture:!1,passive:!0},behavior:d="auto"}=t,a=Q(0),k=Q(0),u=F({get(){return a.value},set(f){p(f,void 0)}}),h=F({get(){return k.value},set(f){p(void 0,f)}});function p(f,x){var D,y,P;const L=$2(e);L&&((P=L instanceof Document?document.body:L)==null||P.scrollTo({top:(D=$2(x))!=null?D:h.value,left:(y=$2(f))!=null?y:u.value,behavior:$2(d)}))}const C=Q(!1),v=W1({left:!0,right:!1,top:!0,bottom:!1}),m=W1({left:!1,right:!1,top:!1,bottom:!1}),H=f=>{C.value&&(C.value=!1,m.left=!1,m.right=!1,m.top=!1,m.bottom=!1,r(f))},g=h4(H,n+o),j=f=>{const x=f.target===document?f.target.documentElement:f.target,D=x.scrollLeft;m.left=Dk.value,v.left=D<=0+(s.left||0),v.right=D+x.clientWidth>=x.scrollWidth-(s.right||0)-li,a.value=D;let y=x.scrollTop;f.target===document&&!y&&(y=document.body.scrollTop),m.top=yk.value,v.top=y<=0+(s.top||0),v.bottom=y+x.clientHeight>=x.scrollHeight-(s.bottom||0)-li,k.value=y,C.value=!0,g(f),i(f)};return oi(e,"scroll",n?aa(j,n,!0,!1):j,l),oi(e,"scrollend",H,l),{x:u,y:h,isScrolling:C,arrivedState:v,directions:m}}var ga=Object.defineProperty,va=Object.defineProperties,fa=Object.getOwnPropertyDescriptors,di=Object.getOwnPropertySymbols,ma=Object.prototype.hasOwnProperty,Ma=Object.prototype.propertyIsEnumerable,ai=(e,t,n)=>t in e?ga(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ki=(e,t)=>{for(var n in t||(t={}))ma.call(t,n)&&ai(e,n,t[n]);if(di)for(var n of di(t))Ma.call(t,n)&&ai(e,n,t[n]);return e},ja=(e,t)=>va(e,fa(t));function cw(e,t,n={}){var o,r;const i=(o=n.direction)!=null?o:"bottom",s=W1(Ca(e,ja(ki({},n),{offset:ki({[i]:(r=n.distance)!=null?r:0},n.offset)})));S1(()=>s.arrivedState[i],async l=>{var d,a;if(l){const k=$2(e),u={height:(d=k==null?void 0:k.scrollHeight)!=null?d:0,width:(a=k==null?void 0:k.scrollWidth)!=null?a:0};await t(s),n.preserveScrollPosition&&k&&v2(()=>{k.scrollTo({top:k.scrollHeight-u.height,left:k.scrollWidth-u.width})})}})}var ui;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(ui||(ui={}));var xa=Object.defineProperty,hi=Object.getOwnPropertySymbols,Da=Object.prototype.hasOwnProperty,La=Object.prototype.propertyIsEnumerable,pi=(e,t,n)=>t in e?xa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ha=(e,t)=>{for(var n in t||(t={}))Da.call(t,n)&&pi(e,n,t[n]);if(hi)for(var n of hi(t))La.call(t,n)&&pi(e,n,t[n]);return e};const Va={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};Ha({linear:da},Va);const ya={"vuesax-linear:24-support":` + */let xa=()=>location.protocol+"//"+location.host;function c4(e,t){const{pathname:n,search:o,hash:r}=t,i=e.indexOf("#");if(i>-1){let s=r.includes(e.slice(i))?e.slice(i).length:1,l=r.slice(s);return l[0]!=="/"&&(l="/"+l),K0(l,"")}return K0(n,e)+o+r}function Da(e,t,n,o){let r=[],i=[],s=null;const l=({state:h})=>{const p=c4(e,location),C=n.value,v=t.value;let m=0;if(h){if(n.value=p,t.value=h,s&&s===C){s=null;return}m=v?h.position-v.position:0}else o(p);r.forEach(H=>{H(n.value,C,{delta:m,type:$o.pop,direction:m?m>0?eo.forward:eo.back:eo.unknown})})};function d(){s=n.value}function a(h){r.push(h);const p=()=>{const C=r.indexOf(h);C>-1&&r.splice(C,1)};return i.push(p),p}function k(){if(document.visibilityState==="hidden"){const{history:h}=window;if(!h.state)return;h.replaceState(j1({},h.state,{scroll:En()}),"")}}function u(){for(const h of i)h();i=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",k),document.removeEventListener("visibilitychange",k)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",k),document.addEventListener("visibilitychange",k),{pauseListeners:d,listen:a,destroy:u}}function ei(e,t,n,o=!1,r=!1){return{back:e,current:t,forward:n,replaced:o,position:window.history.length,scroll:r?En():null}}function La(e){const{history:t,location:n}=window,o={value:c4(e,n)},r={value:t.state};r.value||i(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(d,a,k){const u=e.indexOf("#"),h=u>-1?(n.host&&document.querySelector("base")?e:e.slice(u))+d:xa()+e+d;try{t[k?"replaceState":"pushState"](a,"",h),r.value=a}catch(p){console.error(p),n[k?"replace":"assign"](h)}}function s(d,a){i(d,j1({},t.state,ei(r.value.back,d,r.value.forward,!0),a,{position:r.value.position}),!0),o.value=d}function l(d,a){const k=j1({},r.value,t.state,{forward:d,scroll:En()});i(k.current,k,!0),i(d,j1({},ei(o.value,d,null),{position:k.position+1},a),!1),o.value=d}return{location:o,state:r,push:l,replace:s}}function Ha(e){e=aa(e);const t=La(e),n=Da(e,t.state,t.location,t.replace);function o(i,s=!0){s||n.pauseListeners(),history.go(i)}const r=j1({location:"",base:e,go:o,createHref:ua.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}let Oe=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var $1=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}($1||{});const Va={type:Oe.Static,value:""},ya=/[a-zA-Z0-9_]/;function ba(e){if(!e)return[[]];if(e==="/")return[[Va]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(p){throw new Error(`ERR (${n})/"${a}": ${p}`)}let n=$1.Static,o=n;const r=[];let i;function s(){i&&r.push(i),i=[]}let l=0,d,a="",k="";function u(){a&&(n===$1.Static?i.push({type:Oe.Static,value:a}):n===$1.Param||n===$1.ParamRegExp||n===$1.ParamRegExpEnd?(i.length>1&&(d==="*"||d==="+")&&t(`A repeatable param (${a}) must be alone in its segment. eg: '/:ids+.`),i.push({type:Oe.Param,value:a,regexp:k,repeatable:d==="*"||d==="+",optional:d==="*"||d==="?"})):t("Invalid state to consume buffer"),a="")}function h(){a+=d}for(;lt.length?t.length===1&&t[0]===r2.Static+r2.Segment?1:-1:0}function w4(e,t){let n=0;const o=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const Sa={strict:!1,end:!0,sensitive:!1};function Oa(e,t,n){const o=Ba(ba(e.path),n),r=j1(o,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function Aa(e,t){const n=[],o=new Map;t=G0(Sa,t);function r(u){return o.get(u)}function i(u,h,p){const C=!p,v=ri(u);v.aliasOf=p&&p.record;const m=G0(t,u),H=[v];if("alias"in u){const f=typeof u.alias=="string"?[u.alias]:u.alias;for(const x of f)H.push(ri(j1({},v,{components:p?p.record.components:v.components,path:x,aliasOf:p?p.record:v})))}let g,j;for(const f of H){const{path:x}=f;if(h&&x[0]!=="/"){const D=h.record.path,y=D[D.length-1]==="/"?"":"/";f.path=h.record.path+(x&&y+x)}if(g=Oa(f,h,m),p?p.alias.push(g):(j=j||g,j!==g&&j.alias.push(g),C&&u.name&&!ii(g)&&s(u.name)),C4(g)&&d(g),v.children){const D=v.children;for(let y=0;y{s(j)}:Ft}function s(u){if(h4(u)){const h=o.get(u);h&&(o.delete(u),n.splice(n.indexOf(h),1),h.children.forEach(s),h.alias.forEach(s))}else{const h=n.indexOf(u);h>-1&&(n.splice(h,1),u.record.name&&o.delete(u.record.name),u.children.forEach(s),u.alias.forEach(s))}}function l(){return n}function d(u){const h=Ia(u,n);n.splice(h,0,u),u.record.name&&!ii(u)&&o.set(u.record.name,u)}function a(u,h){let p,C={},v,m;if("name"in u&&u.name){if(p=o.get(u.name),!p)throw ut(B1.MATCHER_NOT_FOUND,{location:u});m=p.record.name,C=j1(oi(h.params,p.keys.filter(j=>!j.optional).concat(p.parent?p.parent.keys.filter(j=>j.optional):[]).map(j=>j.name)),u.params&&oi(u.params,p.keys.map(j=>j.name))),v=p.stringify(C)}else if(u.path!=null)v=u.path,p=n.find(j=>j.re.test(v)),p&&(C=p.parse(v),m=p.record.name);else{if(p=h.name?o.get(h.name):n.find(j=>j.re.test(h.path)),!p)throw ut(B1.MATCHER_NOT_FOUND,{location:u,currentLocation:h});m=p.record.name,C=j1({},h.params,u.params),v=p.stringify(C)}const H=[];let g=p;for(;g;)H.unshift(g.record),g=g.parent;return{name:m,path:v,params:C,matched:H,meta:Ta(H)}}e.forEach(u=>i(u));function k(){n.length=0,o.clear()}return{addRoute:i,resolve:a,removeRoute:s,clearRoutes:k,getRoutes:l,getRecordMatcher:r}}function oi(e,t){const n={};for(const o of t)o in e&&(n[o]=e[o]);return n}function ri(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Pa(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Pa(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const o in e.components)t[o]=typeof n=="object"?n[o]:n;return t}function ii(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Ta(e){return e.reduce((t,n)=>j1(t,n.meta),{})}function Ia(e,t){let n=0,o=t.length;for(;n!==o;){const i=n+o>>1;w4(e,t[i])<0?o=i:n=i+1}const r=Ra(e);return r&&(o=t.lastIndexOf(r,o-1)),o}function Ra(e){let t=e;for(;t=t.parent;)if(C4(t)&&w4(e,t)===0)return t}function C4({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function si(e){const t=z1(Sn),n=z1(Zr),o=N(()=>{const d=v1(e.to);return t.resolve(d)}),r=N(()=>{const{matched:d}=o.value,{length:a}=d,k=d[a-1],u=n.matched;if(!k||!u.length)return-1;const h=u.findIndex(kt.bind(null,k));if(h>-1)return h;const p=li(d[a-2]);return a>1&&li(k)===p&&u[u.length-1].path!==p?u.findIndex(kt.bind(null,d[a-2])):h}),i=N(()=>r.value>-1&&Ua(n.params,o.value.params)),s=N(()=>r.value>-1&&r.value===n.matched.length-1&&u4(n.params,o.value.params));function l(d={}){if(qa(d)){const a=t[v1(e.replace)?"replace":"push"](v1(e.to)).catch(Ft);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>a),a}return Promise.resolve()}return{route:o,href:N(()=>o.value.href),isActive:i,isExactActive:s,navigate:l}}function $a(e){return e.length===1?e[0]:e}const Fa=b1({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:si,setup(e,{slots:t}){const n=W1(si(e)),{options:o}=z1(Sn),r=N(()=>({[di(e.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[di(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&$a(t.default(n));return e.custom?i:e9("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),Na=Fa;function qa(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Ua(e,t){for(const n in t){const o=t[n],r=e[n];if(typeof o=="string"){if(o!==r)return!1}else if(!B2(r)||r.length!==o.length||o.some((i,s)=>i.valueOf()!==r[s].valueOf()))return!1}return!0}function li(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const di=(e,t,n)=>e??t??n,za=b1({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const o=z1(No),r=N(()=>e.route||o.value),i=z1(J0,0),s=N(()=>{let a=v1(i);const{matched:k}=r.value;let u;for(;(u=k[a])&&!u.components;)a++;return a}),l=N(()=>r.value.matched[s.value]);Me(J0,N(()=>s.value+1)),Me(Ma,l),Me(No,r);const d=Q();return E1(()=>[d.value,l.value,e.name],([a,k,u],[h,p,C])=>{k&&(k.instances[u]=a,p&&p!==k&&a&&a===h&&(k.leaveGuards.size||(k.leaveGuards=p.leaveGuards),k.updateGuards.size||(k.updateGuards=p.updateGuards))),a&&k&&(!p||!kt(k,p)||!h)&&(k.enterCallbacks[u]||[]).forEach(v=>v(a))},{flush:"post"}),()=>{const a=r.value,k=e.name,u=l.value,h=u&&u.components[k];if(!h)return ai(n.default,{Component:h,route:a});const p=u.props[k],C=p?p===!0?a.params:typeof p=="function"?p(a):p:null,m=e9(h,j1({},C,t,{onVnodeUnmounted:H=>{H.component.isUnmounted&&(u.instances[k]=null)},ref:d}));return ai(n.default,{Component:m,route:a})||m}}});function ai(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Wa=za;function Ga(e){const t=Aa(e.routes,e),n=e.parseQuery||fa,o=e.stringifyQuery||X0,r=e.history,i=xt(),s=xt(),l=xt(),d=hr(pe);let a=pe;Qe&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const k=Xn.bind(null,V=>""+V),u=Xn.bind(null,na),h=Xn.bind(null,t9);function p(V,F){let R,K;return h4(V)?(R=t.getRecordMatcher(V),K=F):K=V,t.addRoute(K,R)}function C(V){const F=t.getRecordMatcher(V);F&&t.removeRoute(F)}function v(){return t.getRoutes().map(V=>V.record)}function m(V){return!!t.getRecordMatcher(V)}function H(V,F){if(F=j1({},F||d.value),typeof V=="string"){const M=Jn(n,V,F.path),_=t.resolve({path:M.path},F),S=r.createHref(M.fullPath);return j1(M,_,{params:h(_.params),hash:t9(M.hash),redirectedFrom:void 0,href:S})}let R;if(V.path!=null)R=j1({},V,{path:Jn(n,V.path,F.path).path});else{const M=j1({},V.params);for(const _ in M)M[_]==null&&delete M[_];R=j1({},V,{params:u(M)}),F.params=u(F.params)}const K=t.resolve(R,F),i1=V.hash||"";K.params=k(h(K.params));const c=ia(o,j1({},V,{hash:J8(i1),path:K.path})),w=r.createHref(c);return j1({fullPath:c,hash:i1,query:o===X0?ma(V.query):V.query||{}},K,{redirectedFrom:void 0,href:w})}function g(V){return typeof V=="string"?Jn(n,V,d.value.path):j1({},V)}function j(V,F){if(a!==V)return ut(B1.NAVIGATION_CANCELLED,{from:F,to:V})}function f(V){return y(V)}function x(V){return f(j1(g(V),{replace:!0}))}function D(V,F){const R=V.matched[V.matched.length-1];if(R&&R.redirect){const{redirect:K}=R;let i1=typeof K=="function"?K(V,F):K;return typeof i1=="string"&&(i1=i1.includes("?")||i1.includes("#")?i1=g(i1):{path:i1},i1.params={}),j1({query:V.query,hash:V.hash,params:i1.path!=null?{}:V.params},i1)}}function y(V,F){const R=a=H(V),K=d.value,i1=V.state,c=V.force,w=V.replace===!0,M=D(R,K);if(M)return y(j1(g(M),{state:typeof M=="object"?j1({},i1,M.state):i1,force:c,replace:w}),F||R);const _=R;_.redirectedFrom=F;let S;return!c&&sa(o,K,R)&&(S=ut(B1.NAVIGATION_DUPLICATED,{to:_,from:K}),S1(K,K,!0,!1)),(S?Promise.resolve(S):P(_,K)).catch(B=>W2(B)?W2(B,B1.NAVIGATION_GUARD_REDIRECT)?B:p1(B):n1(B,_,K)).then(B=>{if(B){if(W2(B,B1.NAVIGATION_GUARD_REDIRECT))return y(j1({replace:w},g(B.to),{state:typeof B.to=="object"?j1({},i1,B.to.state):i1,force:c}),F||_)}else B=I(_,K,!0,w,i1);return U(_,K,B),B})}function A(V,F){const R=j(V,F);return R?Promise.reject(R):Promise.resolve()}function L(V){const F=r1.values().next().value;return F&&typeof F.runWithContext=="function"?F.runWithContext(V):V()}function P(V,F){let R;const[K,i1,c]=ja(V,F);R=to(K.reverse(),"beforeRouteLeave",V,F);for(const M of K)M.leaveGuards.forEach(_=>{R.push(ve(_,V,F))});const w=A.bind(null,V,F);return R.push(w),t1(R).then(()=>{R=[];for(const M of i.list())R.push(ve(M,V,F));return R.push(w),t1(R)}).then(()=>{R=to(i1,"beforeRouteUpdate",V,F);for(const M of i1)M.updateGuards.forEach(_=>{R.push(ve(_,V,F))});return R.push(w),t1(R)}).then(()=>{R=[];for(const M of c)if(M.beforeEnter)if(B2(M.beforeEnter))for(const _ of M.beforeEnter)R.push(ve(_,V,F));else R.push(ve(M.beforeEnter,V,F));return R.push(w),t1(R)}).then(()=>(V.matched.forEach(M=>M.enterCallbacks={}),R=to(c,"beforeRouteEnter",V,F,L),R.push(w),t1(R))).then(()=>{R=[];for(const M of s.list())R.push(ve(M,V,F));return R.push(w),t1(R)}).catch(M=>W2(M,B1.NAVIGATION_CANCELLED)?M:Promise.reject(M))}function U(V,F,R){l.list().forEach(K=>L(()=>K(V,F,R)))}function I(V,F,R,K,i1){const c=j(V,F);if(c)return c;const w=F===pe,M=Qe?history.state:{};R&&(K||w?r.replace(V.fullPath,j1({scroll:w&&M&&M.scroll},i1)):r.push(V.fullPath,i1)),d.value=V,S1(V,F,R,w),p1()}let J;function l1(){J||(J=r.listen((V,F,R)=>{if(!d1.listening)return;const K=H(V),i1=D(K,d1.currentRoute.value);if(i1){y(j1(i1,{replace:!0,force:!0}),K).catch(Ft);return}a=K;const c=d.value;Qe&&ca(Q0(c.fullPath,R.delta),En()),P(K,c).catch(w=>W2(w,B1.NAVIGATION_ABORTED|B1.NAVIGATION_CANCELLED)?w:W2(w,B1.NAVIGATION_GUARD_REDIRECT)?(y(j1(g(w.to),{force:!0}),K).then(M=>{W2(M,B1.NAVIGATION_ABORTED|B1.NAVIGATION_DUPLICATED)&&!R.delta&&R.type===$o.pop&&r.go(-1,!1)}).catch(Ft),Promise.reject()):(R.delta&&r.go(-R.delta,!1),n1(w,K,c))).then(w=>{w=w||I(K,c,!1),w&&(R.delta&&!W2(w,B1.NAVIGATION_CANCELLED)?r.go(-R.delta,!1):R.type===$o.pop&&W2(w,B1.NAVIGATION_ABORTED|B1.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),U(K,c,w)}).catch(Ft)}))}let h1=xt(),k1=xt(),Y;function n1(V,F,R){p1(V);const K=k1.list();return K.length?K.forEach(i1=>i1(V,F,R)):console.error(V),Promise.reject(V)}function C1(){return Y&&d.value!==pe?Promise.resolve():new Promise((V,F)=>{h1.add([V,F])})}function p1(V){return Y||(Y=!V,l1(),h1.list().forEach(([F,R])=>V?R(V):F()),h1.reset()),V}function S1(V,F,R,K){const{scrollBehavior:i1}=e;if(!Qe||!i1)return Promise.resolve();const c=!R&&wa(Q0(V.fullPath,0))||(K||!R)&&history.state&&history.state.scroll||null;return v2().then(()=>i1(V,F,c)).then(w=>w&&pa(w)).catch(w=>n1(w,V,F))}const Z1=V=>r.go(V);let $;const r1=new Set,d1={currentRoute:d,listening:!0,addRoute:p,removeRoute:C,clearRoutes:t.clearRoutes,hasRoute:m,getRoutes:v,resolve:H,options:e,push:f,replace:x,go:Z1,back:()=>Z1(-1),forward:()=>Z1(1),beforeEach:i.add,beforeResolve:s.add,afterEach:l.add,onError:k1.add,isReady:C1,install(V){V.component("RouterLink",Na),V.component("RouterView",Wa),V.config.globalProperties.$router=d1,Object.defineProperty(V.config.globalProperties,"$route",{enumerable:!0,get:()=>v1(d)}),Qe&&!$&&d.value===pe&&($=!0,f(r.location).catch(K=>{}));const F={};for(const K in pe)Object.defineProperty(F,K,{get:()=>d.value[K],enumerable:!0});V.provide(Sn,d1),V.provide(Zr,zs(F)),V.provide(No,d);const R=V.unmount;r1.add(V),V.unmount=function(){r1.delete(V),r1.size<1&&(a=pe,J&&J(),J=null,d.value=pe,$=!1,Y=!1),R()}}};function t1(V){return V.reduce((F,R)=>F.then(()=>L(R)),Promise.resolve())}return d1}function g4(){return z1(Sn)}function Ka(e){return z1(Zr)}const Ya="modulepreload",Qa=function(e){return"/"+e},ki={},T1=function(t,n,o){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),l=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));r=Promise.allSettled(n.map(d=>{if(d=Qa(d),d in ki)return;ki[d]=!0;const a=d.endsWith(".css"),k=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${k}`))return;const u=document.createElement("link");if(u.rel=a?"stylesheet":Ya,a||(u.as="script"),u.crossOrigin="",u.href=d,l&&u.setAttribute("nonce",l),document.head.appendChild(u),a)return new Promise((h,p)=>{u.addEventListener("load",h),u.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return r.then(s=>{for(const l of s||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function Xa(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:o,onRegistered:r,onRegisteredSW:i,onRegisterError:s}=e;let l,d,a;const k=async(h=!0)=>{await d,await(a==null?void 0:a())};async function u(){if("serviceWorker"in navigator){if(l=await T1(async()=>{const{Workbox:h}=await import("./workbox-window.prod.es5-BqEJf4Xk.js");return{Workbox:h}},[]).then(({Workbox:h})=>new h("/sw.js",{scope:"/",type:"classic"})).catch(h=>{s==null||s(h)}),!l)return;a=async()=>{await(l==null?void 0:l.messageSkipWaiting())};{let h=!1;const p=()=>{h=!0,l==null||l.addEventListener("controlling",C=>{C.isUpdate&&window.location.reload()}),n==null||n()};l.addEventListener("installed",C=>{typeof C.isUpdate>"u"?typeof C.isExternal<"u"?C.isExternal?p():!h&&(o==null||o()):C.isExternal?window.location.reload():!h&&(o==null||o()):C.isUpdate||o==null||o()}),l.addEventListener("waiting",p),l.addEventListener("externalwaiting",p)}l.register({immediate:t}).then(h=>{i?i("/sw.js",h):r==null||r(h)}).catch(h=>{s==null||s(h)})}}return d=u(),k}function v4(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:o,onRegistered:r,onRegisteredSW:i,onRegisterError:s}=e,l=Q(!1),d=Q(!1);return{updateServiceWorker:Xa({immediate:t,onNeedRefresh(){l.value=!0,n==null||n()},onOfflineReady(){d.value=!0,o==null||o()},onRegistered:r,onRegisteredSW:i,onRegisterError:s}),offlineReady:d,needRefresh:l}}var ui;const f4=typeof window<"u",Ja=e=>typeof e=="string",Fe=()=>{};f4&&((ui=window==null?void 0:window.navigator)!=null&&ui.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function $2(e){return typeof e=="function"?e():v1(e)}function m4(e,t){function n(...o){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(r).catch(i)})}return n}function e6(e,t={}){let n,o,r=Fe;const i=l=>{clearTimeout(l),r(),r=Fe};return l=>{const d=$2(e),a=$2(t.maxWait);return n&&i(n),d<=0||a!==void 0&&a<=0?(o&&(i(o),o=null),Promise.resolve(l())):new Promise((k,u)=>{r=t.rejectOnCancel?u:k,a&&!o&&(o=setTimeout(()=>{n&&i(n),o=null,k(l())},a)),n=setTimeout(()=>{o&&i(o),o=null,k(l())},d)})}}function t6(e,t=!0,n=!0,o=!1){let r=0,i,s=!0,l=Fe,d;const a=()=>{i&&(clearTimeout(i),i=void 0,l(),l=Fe)};return u=>{const h=$2(e),p=Date.now()-r,C=()=>d=u();return a(),h<=0?(r=Date.now(),C()):(p>h&&(n||!s)?(r=Date.now(),C()):t&&(d=new Promise((v,m)=>{l=o?m:v,i=setTimeout(()=>{r=Date.now(),s=!0,v(C()),a()},Math.max(0,h-p))})),!n&&!i&&(i=setTimeout(()=>s=!0,h)),s=!1,d)}}function n6(e){return e}function M4(e){return ir()?(_s(e),!0):!1}function j4(e,t=200,n={}){return m4(e6(t,n),e)}function vw(e,t=200,n={}){const o=Q(e.value),r=j4(()=>{o.value=e.value},t,n);return E1(e,()=>r()),o}function o6(e,t=200,n=!1,o=!0,r=!1){return m4(t6(t,n,o,r),e)}function r6(e,t=!0){U2()?q2(e):t?e():v2(e)}function x4(e){var t;const n=$2(e);return(t=n==null?void 0:n.$el)!=null?t:n}const D4=f4?window:void 0;function hi(...e){let t,n,o,r;if(Ja(e[0])||Array.isArray(e[0])?([n,o,r]=e,t=D4):[t,n,o,r]=e,!t)return Fe;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],s=()=>{i.forEach(k=>k()),i.length=0},l=(k,u,h,p)=>(k.addEventListener(u,h,p),()=>k.removeEventListener(u,h,p)),d=E1(()=>[x4(t),$2(r)],([k,u])=>{s(),k&&i.push(...n.flatMap(h=>o.map(p=>l(k,h,p,u))))},{immediate:!0,flush:"post"}),a=()=>{d(),s()};return M4(a),a}function i6(e,t=!1){const n=Q(),o=()=>n.value=!!e();return o(),r6(o,t),n}const pi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ci="__vueuse_ssr_handlers__";pi[ci]=pi[ci]||{};var wi=Object.getOwnPropertySymbols,s6=Object.prototype.hasOwnProperty,l6=Object.prototype.propertyIsEnumerable,d6=(e,t)=>{var n={};for(var o in e)s6.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&wi)for(var o of wi(e))t.indexOf(o)<0&&l6.call(e,o)&&(n[o]=e[o]);return n};function a6(e,t,n={}){const o=n,{window:r=D4}=o,i=d6(o,["window"]);let s;const l=i6(()=>r&&"ResizeObserver"in r),d=()=>{s&&(s.disconnect(),s=void 0)},a=E1(()=>x4(e),u=>{d(),l.value&&r&&u&&(s=new ResizeObserver(t),s.observe(u,i))},{immediate:!0,flush:"post"}),k=()=>{d(),a()};return M4(k),{isSupported:l,stop:k}}const Ci=1;function k6(e,t={}){const{throttle:n=0,idle:o=200,onStop:r=Fe,onScroll:i=Fe,offset:s={left:0,right:0,top:0,bottom:0},eventListenerOptions:l={capture:!1,passive:!0},behavior:d="auto"}=t,a=Q(0),k=Q(0),u=N({get(){return a.value},set(f){p(f,void 0)}}),h=N({get(){return k.value},set(f){p(void 0,f)}});function p(f,x){var D,y,A;const L=$2(e);L&&((A=L instanceof Document?document.body:L)==null||A.scrollTo({top:(D=$2(x))!=null?D:h.value,left:(y=$2(f))!=null?y:u.value,behavior:$2(d)}))}const C=Q(!1),v=W1({left:!0,right:!1,top:!0,bottom:!1}),m=W1({left:!1,right:!1,top:!1,bottom:!1}),H=f=>{C.value&&(C.value=!1,m.left=!1,m.right=!1,m.top=!1,m.bottom=!1,r(f))},g=j4(H,n+o),j=f=>{const x=f.target===document?f.target.documentElement:f.target,D=x.scrollLeft;m.left=Dk.value,v.left=D<=0+(s.left||0),v.right=D+x.clientWidth>=x.scrollWidth-(s.right||0)-Ci,a.value=D;let y=x.scrollTop;f.target===document&&!y&&(y=document.body.scrollTop),m.top=yk.value,v.top=y<=0+(s.top||0),v.bottom=y+x.clientHeight>=x.scrollHeight-(s.bottom||0)-Ci,k.value=y,C.value=!0,g(f),i(f)};return hi(e,"scroll",n?o6(j,n,!0,!1):j,l),hi(e,"scrollend",H,l),{x:u,y:h,isScrolling:C,arrivedState:v,directions:m}}var u6=Object.defineProperty,h6=Object.defineProperties,p6=Object.getOwnPropertyDescriptors,gi=Object.getOwnPropertySymbols,c6=Object.prototype.hasOwnProperty,w6=Object.prototype.propertyIsEnumerable,vi=(e,t,n)=>t in e?u6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fi=(e,t)=>{for(var n in t||(t={}))c6.call(t,n)&&vi(e,n,t[n]);if(gi)for(var n of gi(t))w6.call(t,n)&&vi(e,n,t[n]);return e},C6=(e,t)=>h6(e,p6(t));function fw(e,t,n={}){var o,r;const i=(o=n.direction)!=null?o:"bottom",s=W1(k6(e,C6(fi({},n),{offset:fi({[i]:(r=n.distance)!=null?r:0},n.offset)})));E1(()=>s.arrivedState[i],async l=>{var d,a;if(l){const k=$2(e),u={height:(d=k==null?void 0:k.scrollHeight)!=null?d:0,width:(a=k==null?void 0:k.scrollWidth)!=null?a:0};await t(s),n.preserveScrollPosition&&k&&v2(()=>{k.scrollTo({top:k.scrollHeight-u.height,left:k.scrollWidth-u.width})})}})}var mi;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(mi||(mi={}));var g6=Object.defineProperty,Mi=Object.getOwnPropertySymbols,v6=Object.prototype.hasOwnProperty,f6=Object.prototype.propertyIsEnumerable,ji=(e,t,n)=>t in e?g6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m6=(e,t)=>{for(var n in t||(t={}))v6.call(t,n)&&ji(e,n,t[n]);if(Mi)for(var n of Mi(t))f6.call(t,n)&&ji(e,n,t[n]);return e};const M6={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};m6({linear:n6},M6);const j6={"vuesax-linear:24-support":` @@ -6191,16 +6191,16 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomeView-BLj03X -`},ba=["innerHTML"],Za=b1({__name:"Icon",props:{icon:{},color:{default:null},size:{}},setup(e){const t=e,n=Q(),o=F(()=>ya[`${t.icon}`]);function r(){var s;if(!t.size)return;const i=(s=n.value)==null?void 0:s.children[0];i==null||i.setAttribute("width",t.size),i==null||i.setAttribute("height",t.size)}return S1(o,()=>v2(r),{immediate:!0}),(i,s)=>(W(),o1("span",{ref_key:"refIcon",ref:n,style:re({color:e.color??void 0}),class:"liman-icons flex",innerHTML:o.value},null,12,ba))}}),He=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},q1=He(Za,[["__scopeId","data-v-d43d3684"]]),br=Le("nav",{state:()=>({navBarRoutes:[{name:"home",path:"/home",icon:"vuesax-linear:home-2",label:"خانه",index:1},{name:"search",path:"/search",icon:"vuesax-linear:search-normal-1",label:"جستجو",index:2},{name:"cart",path:"/cart",icon:"vuesax-linear:bag-happy",label:"سبد خرید",index:3},{name:"ordersList",path:"/orders",icon:"vuesax-linear:receipt-text",label:"سفارشات",index:4},{name:"userPage::hasSubRoute",path:"/user",icon:"vuesax-linear:user",label:"پروفایل",index:5}],activeLink:1,showNav:!0,pageTransition:"right"}),actions:{setNavVisibility(e){this.showNav=e},setActiveLink(e){this.activeLink=e},setPgaTransition(e){this.pageTransition=e}}}),_a={class:"tabbar"},Ba={class:"tabbar__inner"},Sa=b1({__name:"Navigation",setup(e){const t=br(),n=F(()=>`calc(${-(t.activeLink-1)} * (var(--tile) + var(--gap)))`);return(o,r)=>{const i=a9("router-link");return cr((W(),o1("nav",_a,[O("div",Ba,[O("div",{class:"tabbar__indicator",style:re({transform:`translateX(${n.value})`}),"aria-hidden":"true"},null,4),(W(!0),o1(f1,null,nt(v1(t).navBarRoutes,s=>(W(),O1(i,{key:s.index,to:{name:s.name},class:F1(["tabbar__item",{"is-active":v1(t).activeLink===s.index}]),"aria-label":s.label,title:s.label},{default:e2(()=>[b(q1,{icon:s.icon,size:"22"},null,8,["icon"])]),_:2},1032,["to","class","aria-label","title"]))),128))])],512)),[[Hr,v1(t).showNav]])}}}),Ea=He(Sa,[["__scopeId","data-v-c127b61d"]]),Oa=Le("windowData",{state:()=>({width:0,pullingDown:!1}),actions:{setWidth(e){this.width=e},setPullingDown(e){this.pullingDown=e}}}),Pa=b1({__name:"MasterLayout",setup(e){const t=Oa(),n=Q(null);return gr(()=>{t.setWidth(window.innerWidth)}),wa(n,o=>{const r=o[0],{width:i}=r.contentRect;t.width!==i&&t.setWidth(i)}),(o,r)=>{const i=a9("router-view");return W(),o1("section",{ref_key:"content",ref:n},[b(i,null,{default:e2(({Component:s,route:l})=>[b(bn,{name:"page",mode:"out-in"},{default:e2(()=>[(W(),O1(Do(s),{key:l.name}))]),_:2},1024)]),_:1}),b(Ea),r[0]||(r[0]=O("div",{class:"bg-primary top-[-2rem] fixed h-[2rem] w-full z-10"},null,-1))],512)}}}),Aa={};function Ta(e,t){const n=a9("router-view");return W(),o1("div",null,[b(n)])}const Ia=He(Aa,[["render",Ta]]);function Ra(){}const Sn=Object.assign,$a=typeof window<"u",Zr=e=>e!==null&&typeof e=="object",Ne=e=>e!=null,$o=e=>typeof e=="function",Na=e=>Zr(e)&&$o(e.then)&&$o(e.catch),w4=e=>typeof e=="number"||/^\d+(\.\d+)?$/.test(e),Fa=()=>$a?/ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()):!1;function ci(e,t){const n=t.split(".");let o=e;return n.forEach(r=>{var i;o=Zr(o)&&(i=o[r])!=null?i:""}),o}const C4=null,de=[Number,String],Oe={type:Boolean,default:!0},ww=e=>({type:de,default:e}),rt=e=>({type:String,default:e});var _r=typeof window<"u";function g4(e){let t;q2(()=>{e(),v2(()=>{t=!0})}),Cr(()=>{t&&e()})}function v4(e,t,n={}){if(!_r)return;const{target:o=window,passive:r=!1,capture:i=!1}=n;let s=!1,l;const d=u=>{if(s)return;const h=v1(u);h&&!l&&(h.addEventListener(e,t,{capture:i,passive:r}),l=!0)},a=u=>{if(s)return;const h=v1(u);h&&l&&(h.removeEventListener(e,t,i),l=!1)};Dn(()=>a(o)),jn(()=>a(o)),g4(()=>d(o));let k;return _1(o)&&(k=S1(o,(u,h)=>{a(h),d(u)})),()=>{k==null||k(),a(o),s=!0}}var D9,to;function qa(){if(!D9&&(D9=Q(0),to=Q(0),_r)){const e=()=>{D9.value=window.innerWidth,to.value=window.innerHeight};e(),window.addEventListener("resize",e,{passive:!0}),window.addEventListener("orientationchange",e,{passive:!0})}return{width:D9,height:to}}var Ua=/scroll|auto|overlay/i,f4=_r?window:void 0;function za(e){return e.tagName!=="HTML"&&e.tagName!=="BODY"&&e.nodeType===1}function No(e,t=f4){let n=e;for(;n&&n!==t&&za(n);){const{overflowY:o}=window.getComputedStyle(n);if(Ua.test(o))return n;n=n.parentNode}return t}function Cw(e,t=f4){const n=Q();return q2(()=>{e.value&&(n.value=No(e.value,t))}),n}function gw(e){const t="scrollTop"in e?e.scrollTop:e.pageYOffset;return Math.max(t,0)}Fa();const Wa=e=>e.stopPropagation();function m4(e,t){(typeof e.cancelable!="boolean"||e.cancelable)&&e.preventDefault(),t&&Wa(e)}qa();function R2(e){if(Ne(e))return w4(e)?`${e}px`:String(e)}function vw(e){if(Ne(e)){if(Array.isArray(e))return{width:R2(e[0]),height:R2(e[1])};const t=R2(e);return{width:t,height:t}}}function Ga(e){const t={};return e!==void 0&&(t.zIndex=+e),t}const Ka=/-(\w)/g,M4=e=>e.replace(Ka,(t,n)=>n.toUpperCase()),{hasOwnProperty:Ya}=Object.prototype;function Qa(e,t,n){const o=t[n];Ne(o)&&(!Ya.call(e,n)||!Zr(o)?e[n]=o:e[n]=j4(Object(e[n]),o))}function j4(e,t){return Object.keys(t).forEach(n=>{Qa(e,t,n)}),e}var Xa={name:"姓名",tel:"电话",save:"保存",clear:"清空",undo:"撤销",cancel:"取消",confirm:"确认",delete:"删除",loading:"加载中...",noCoupon:"暂无优惠券",nameEmpty:"请填写姓名",addContact:"添加联系人",telInvalid:"请填写正确的电话",vanCalendar:{end:"结束",start:"开始",title:"日期选择",weekdays:["日","一","二","三","四","五","六"],monthTitle:(e,t)=>`${e}年${t}月`,rangePrompt:e=>`最多选择 ${e} 天`},vanCascader:{select:"请选择"},vanPagination:{prev:"上一页",next:"下一页"},vanPullRefresh:{pulling:"下拉即可刷新...",loosing:"释放即可刷新..."},vanSubmitBar:{label:"合计:"},vanCoupon:{unlimited:"无门槛",discount:e=>`${e}折`,condition:e=>`满${e}元可用`},vanCouponCell:{title:"优惠券",count:e=>`${e}张可用`},vanCouponList:{exchange:"兑换",close:"不使用",enable:"可用",disabled:"不可用",placeholder:"输入优惠码"},vanAddressEdit:{area:"地区",areaEmpty:"请选择地区",addressEmpty:"请填写详细地址",addressDetail:"详细地址",defaultAddress:"设为默认收货地址"},vanAddressList:{add:"新增地址"}};const wi=Q("zh-CN"),Ci=W1({"zh-CN":Xa}),Ja={messages(){return Ci[wi.value]},use(e,t){wi.value=e,this.add({[e]:t})},add(e={}){j4(Ci,e)}};var e6=Ja;function t6(e){const t=M4(e)+".";return(n,...o)=>{const r=e6.messages(),i=ci(r,t+n)||ci(r,n);return $o(i)?i(...o):i}}function Fo(e,t){return t?typeof t=="string"?` ${e}--${t}`:Array.isArray(t)?t.reduce((n,o)=>n+Fo(e,o),""):Object.keys(t).reduce((n,o)=>n+(t[o]?Fo(e,o):""),""):""}function n6(e){return(t,n)=>(t&&typeof t!="string"&&(n=t,t=""),t=t?`${e}__${t}`:e,`${t}${Fo(t,n)}`)}function h9(e){const t=`van-${e}`;return[t,n6(t),t6(t)]}const o6="van-haptics-feedback",gi=5;function r6(e,{args:t=[],done:n,canceled:o,error:r}){if(e){const i=e.apply(null,t);Na(i)?i.then(s=>{s?n():o&&o()}).catch(r||Ra):i?n():o&&o()}else n()}function En(e){return e.install=t=>{const{name:n}=e;n&&(t.component(n,e),t.component(M4(`-${n}`),e))},e}const i6=Symbol();function s6(e){const t=U2();t&&Sn(t.proxy,e)}const[l6,vi]=h9("badge"),d6={dot:Boolean,max:de,tag:rt("div"),color:String,offset:Array,content:de,showZero:Oe,position:rt("top-right")};var a6=b1({name:l6,props:d6,setup(e,{slots:t}){const n=()=>{if(t.content)return!0;const{content:l,showZero:d}=e;return Ne(l)&&l!==""&&(d||l!==0&&l!=="0")},o=()=>{const{dot:l,max:d,content:a}=e;if(!l&&n())return t.content?t.content():Ne(d)&&w4(a)&&+a>+d?`${d}+`:a},r=l=>l.startsWith("-")?l.replace("-",""):`-${l}`,i=F(()=>{const l={background:e.color};if(e.offset){const[d,a]=e.offset,{position:k}=e,[u,h]=k.split("-");t.default?(typeof a=="number"?l[u]=R2(u==="top"?a:-a):l[u]=u==="top"?R2(a):r(a),typeof d=="number"?l[h]=R2(h==="left"?d:-d):l[h]=h==="left"?R2(d):r(d)):(l.marginTop=R2(a),l.marginLeft=R2(d))}return l}),s=()=>{if(n()||e.dot)return b("div",{class:vi([e.position,{dot:e.dot,fixed:!!t.default}]),style:i.value},[o()])};return()=>{if(t.default){const{tag:l}=e;return b(l,{class:vi("wrapper")},{default:()=>[t.default(),s()]})}return s()}}});const k6=En(a6);let u6=2e3;const h6=()=>++u6,[p6]=h9("config-provider"),c6=Symbol(p6),[w6,fi]=h9("icon"),C6=e=>e==null?void 0:e.includes("/"),g6={dot:Boolean,tag:rt("i"),name:String,size:de,badge:de,color:String,badgeProps:Object,classPrefix:String};var v6=b1({name:w6,props:g6,setup(e,{slots:t}){const n=z1(c6,null),o=F(()=>e.classPrefix||(n==null?void 0:n.iconPrefix)||fi());return()=>{const{tag:r,dot:i,name:s,size:l,badge:d,color:a}=e,k=C6(s);return b(k6,Qt({dot:i,tag:r,class:[o.value,k?"":`${o.value}-${s}`],style:{color:a,fontSize:R2(l)},content:d},e.badgeProps),{default:()=>{var u;return[(u=t.default)==null?void 0:u.call(t),k&&b("img",{class:fi("image"),src:s},null)]}})}}});const f6=En(v6),m6={show:Boolean,zIndex:de,overlay:Oe,duration:de,teleport:[String,Object],lockScroll:Oe,lazyRender:Oe,beforeClose:Function,overlayProps:Object,overlayStyle:Object,overlayClass:C4,transitionAppear:Boolean,closeOnClickOverlay:Oe};function M6(e,t){return e>t?"horizontal":t>e?"vertical":""}function j6(){const e=Q(0),t=Q(0),n=Q(0),o=Q(0),r=Q(0),i=Q(0),s=Q(""),l=Q(!0),d=()=>s.value==="vertical",a=()=>s.value==="horizontal",k=()=>{n.value=0,o.value=0,r.value=0,i.value=0,s.value="",l.value=!0};return{move:p=>{const C=p.touches[0];n.value=(C.clientX<0?0:C.clientX)-e.value,o.value=C.clientY-t.value,r.value=Math.abs(n.value),i.value=Math.abs(o.value);const v=10;(!s.value||r.valuegi||i.value>gi)&&(l.value=!1)},start:p=>{k(),e.value=p.touches[0].clientX,t.value=p.touches[0].clientY},reset:k,startX:e,startY:t,deltaX:n,deltaY:o,offsetX:r,offsetY:i,direction:s,isVertical:d,isHorizontal:a,isTap:l}}let xt=0;const mi="van-overflow-hidden";function x6(e,t){const n=j6(),o="01",r="10",i=k=>{n.move(k);const u=n.deltaY.value>0?r:o;let h=No(k.target,e.value);for(;h.scrollHeight<=h.offsetHeight&&h!==e.value&&h.parentElement;)h=No(h.parentElement,e.value);const{scrollHeight:p,offsetHeight:C,scrollTop:v}=h;let m="11";v===0?m=C>=p?"00":"01":v+C>=p&&(m="10"),m!=="11"&&n.isVertical()&&!(parseInt(m,2)&parseInt(u,2))&&m4(k,!0)},s=()=>{document.addEventListener("touchstart",n.start),document.addEventListener("touchmove",i,{passive:!1}),xt||document.body.classList.add(mi),xt++},l=()=>{xt&&(document.removeEventListener("touchstart",n.start),document.removeEventListener("touchmove",i),xt--,xt||document.body.classList.remove(mi))},d=()=>t()&&s(),a=()=>t()&&l();g4(d),jn(a),Ue(a),S1(t,k=>{k?s():l()})}function x4(e){const t=Q(!1);return S1(e,n=>{n&&(t.value=n)},{immediate:!0}),n=>()=>t.value?n():null}const Mi=()=>{var e;const{scopeId:t}=((e=U2())==null?void 0:e.vnode)||{};return t?{[t]:""}:null},[D6,L6]=h9("overlay"),H6={show:Boolean,zIndex:de,duration:de,className:C4,lockScroll:Oe,lazyRender:Oe,customStyle:Object,teleport:[String,Object]};var V6=b1({name:D6,inheritAttrs:!1,props:H6,setup(e,{attrs:t,slots:n}){const o=Q(),r=x4(()=>e.show||!e.lazyRender),i=l=>{e.lockScroll&&m4(l,!0)},s=r(()=>{var l;const d=Sn(Ga(e.zIndex),e.customStyle);return Ne(e.duration)&&(d.animationDuration=`${e.duration}s`),cr(b("div",Qt({ref:o,style:d,class:[L6(),e.className]},t),[(l=n.default)==null?void 0:l.call(n)]),[[Hr,e.show]])});return v4("touchmove",i,{target:o}),()=>{const l=b(bn,{name:"van-fade",appear:!0},{default:s});return e.teleport?b(wt,{to:e.teleport},{default:()=>[l]}):l}}});const y6=En(V6),b6=Sn({},m6,{round:Boolean,position:rt("center"),closeIcon:rt("cross"),closeable:Boolean,transition:String,iconPrefix:String,closeOnPopstate:Boolean,closeIconPosition:rt("top-right"),destroyOnClose:Boolean,safeAreaInsetTop:Boolean,safeAreaInsetBottom:Boolean}),[Z6,ji]=h9("popup");var _6=b1({name:Z6,inheritAttrs:!1,props:b6,emits:["open","close","opened","closed","keydown","update:show","clickOverlay","clickCloseIcon"],setup(e,{emit:t,attrs:n,slots:o}){let r,i;const s=Q(),l=Q(),d=x4(()=>e.show||!e.lazyRender),a=F(()=>{const D={zIndex:s.value};if(Ne(e.duration)){const y=e.position==="center"?"animationDuration":"transitionDuration";D[y]=`${e.duration}s`}return D}),k=()=>{r||(r=!0,s.value=e.zIndex!==void 0?+e.zIndex:h6(),t("open"))},u=()=>{r&&r6(e.beforeClose,{done(){r=!1,t("close"),t("update:show",!1)}})},h=D=>{t("clickOverlay",D),e.closeOnClickOverlay&&u()},p=()=>{if(e.overlay){const D=Sn({show:e.show,class:e.overlayClass,zIndex:s.value,duration:e.duration,customStyle:e.overlayStyle,role:e.closeOnClickOverlay?"button":void 0,tabindex:e.closeOnClickOverlay?0:void 0},e.overlayProps);return b(y6,Qt(D,Mi(),{onClick:h}),{default:o["overlay-content"]})}},C=D=>{t("clickCloseIcon",D),u()},v=()=>{if(e.closeable)return b(f6,{role:"button",tabindex:0,name:e.closeIcon,class:[ji("close-icon",e.closeIconPosition),o6],classPrefix:e.iconPrefix,onClick:C},null)};let m;const H=()=>{m&&clearTimeout(m),m=setTimeout(()=>{t("opened")})},g=()=>t("closed"),j=D=>t("keydown",D),f=d(()=>{var D;const{destroyOnClose:y,round:P,position:L,safeAreaInsetTop:A,safeAreaInsetBottom:U,show:I}=e;if(!(!I&&y))return cr(b("div",Qt({ref:l,style:a.value,role:"dialog",tabindex:0,class:[ji({round:P,[L]:L}),{"van-safe-area-top":A,"van-safe-area-bottom":U}],onKeydown:j},n,Mi()),[(D=o.default)==null?void 0:D.call(o),v()]),[[Hr,I]])}),x=()=>{const{position:D,transition:y,transitionAppear:P}=e,L=D==="center"?"van-fade":`van-popup-slide-${D}`;return b(bn,{name:y||L,appear:P,onAfterEnter:H,onAfterLeave:g},{default:f})};return S1(()=>e.show,D=>{D&&!r&&(k(),n.tabindex===0&&v2(()=>{var y;(y=l.value)==null||y.focus()})),!D&&r&&(r=!1,t("close"))}),s6({popupRef:l}),x6(l,()=>e.show&&e.lockScroll),v4("popstate",()=>{e.closeOnPopstate&&(u(),i=!1)}),q2(()=>{e.show&&k()}),Cr(()=>{i&&(t("update:show",!0),i=!1)}),jn(()=>{e.show&&e.teleport&&(u(),i=!0)}),Me(i6,()=>e.show),()=>e.teleport?b(wt,{to:e.teleport},{default:()=>[p(),x()]}):b(f1,null,[p(),x()])}});const B6=En(_6),S6=["id"],E6=["id"],O6=["fill"],P6={class:"sa-door"},A6=["fill"],T6=["id"],I6=["id"],R6={class:"sa-coin"},$6=["fill"],N6=["fill"],F6=["id"],q6=["id"],U6={class:"sa-float"},z6={class:"sa-flame"},W6=["fill"],G6=["clip-path"],K6=b1({__name:"SheetArt",props:{name:{}},setup(e){const t=q3(),n={a:`${t}-a`,b:`${t}-b`};return(o,r)=>(W(),o1("svg",{class:F1(["sa",`sa--${e.name}`]),viewBox:"0 0 120 120",fill:"none","aria-hidden":"true"},[e.name==="logout"?(W(),o1(f1,{key:0},[O("defs",null,[O("linearGradient",{id:n.a,x1:"0",y1:"0",x2:"1",y2:"1"},[...r[0]||(r[0]=[O("stop",{offset:"0","stop-color":"#A33C55"},null,-1),O("stop",{offset:"1","stop-color":"#5E1427"},null,-1)])],8,S6),O("radialGradient",{id:n.b,cx:".35",cy:".5",r:".75"},[...r[1]||(r[1]=[O("stop",{offset:"0","stop-color":"#FFF7E6"},null,-1),O("stop",{offset:"1","stop-color":"#F4C57A"},null,-1)])],8,E6)]),r[3]||(r[3]=O("ellipse",{class:"sa-shadow",cx:"62",cy:"106",rx:"36",ry:"4",fill:"#7A1B33",opacity:".12"},null,-1)),O("rect",{x:"48",y:"18",width:"40",height:"84",rx:"5",fill:`url(#${n.b})`,stroke:"#7A1B33","stroke-width":"3"},null,8,O6),O("g",P6,[O("path",{d:"M88 18 L88 102 L69 108 L69 12 Z",fill:`url(#${n.a})`,stroke:"#5E1427","stroke-width":"2","stroke-linejoin":"round"},null,8,A6),r[2]||(r[2]=O("circle",{cx:"73.5",cy:"61",r:"2.6",fill:"#F4C57A"},null,-1))]),r[4]||(r[4]=O("g",{class:"sa-arrow","stroke-linecap":"round","stroke-linejoin":"round"},[O("path",{d:"M60 60 H22 M33 48 L21 60 L33 72",stroke:"#fff","stroke-width":"12"}),O("path",{d:"M60 60 H22 M33 48 L21 60 L33 72",stroke:"#7A1B33","stroke-width":"6"})],-1))],64)):e.name==="login"?(W(),o1(f1,{key:1},[r[5]||(r[5]=m9('',3))],64)):e.name==="order"?(W(),o1(f1,{key:2},[O("defs",null,[O("linearGradient",{id:n.a,x1:"0",y1:"0",x2:"0",y2:"1"},[...r[6]||(r[6]=[O("stop",{offset:"0","stop-color":"#EBC06A"},null,-1),O("stop",{offset:"1","stop-color":"#B5843B"},null,-1)])],8,T6),O("radialGradient",{id:n.b,cx:".38",cy:".35",r:".7"},[...r[7]||(r[7]=[O("stop",{offset:"0","stop-color":"#FFF1C7"},null,-1),O("stop",{offset:"1","stop-color":"#E2AC4A"},null,-1)])],8,I6)]),r[9]||(r[9]=O("ellipse",{class:"sa-shadow",cx:"60",cy:"108",rx:"32",ry:"4",fill:"#8D6A46",opacity:".16"},null,-1)),r[10]||(r[10]=O("path",{d:"M46 57 V40 a14 14 0 0 1 28 0 V57",stroke:"#8D6A46","stroke-width":"4.5","stroke-linecap":"round"},null,-1)),O("g",R6,[O("circle",{cx:"60",cy:"31",r:"10",fill:`url(#${n.b})`,stroke:"#B5843B","stroke-width":"2"},null,8,$6),r[8]||(r[8]=O("circle",{cx:"60",cy:"31",r:"5.5",stroke:"#B5843B","stroke-width":"1.5",opacity:".7"},null,-1))]),O("path",{d:"M30 48 H90 L85 100 a6 6 0 0 1 -6 5.5 H41 a6 6 0 0 1 -6 -5.5 Z",fill:`url(#${n.a})`},null,8,N6),r[11]||(r[11]=m9('',5))],64)):e.name==="update"?(W(),o1(f1,{key:3},[O("defs",null,[O("linearGradient",{id:n.a,x1:"0",y1:"0",x2:"0",y2:"1"},[...r[12]||(r[12]=[O("stop",{offset:"0","stop-color":"#FFD27A"},null,-1),O("stop",{offset:"1","stop-color":"#F2793B"},null,-1)])],8,F6),O("clipPath",{id:n.b},[...r[13]||(r[13]=[O("path",{d:"M60 10 C76 22 80 44 76 72 H44 C40 44 44 22 60 10 Z"},null,-1)])],8,q6)]),r[23]||(r[23]=m9('',1)),O("g",U6,[O("g",z6,[O("path",{d:"M51 77 Q60 112 69 77 Z",fill:`url(#${n.a})`},null,8,W6),r[14]||(r[14]=O("path",{d:"M55.5 77 Q60 96 64.5 77 Z",fill:"#FFF1C9"},null,-1))]),r[16]||(r[16]=O("path",{d:"M44 56 L31 76 Q31 80 35 79 L46 74 Z",fill:"#D9A441"},null,-1)),r[17]||(r[17]=O("path",{d:"M76 56 L89 76 Q89 80 85 79 L74 74 Z",fill:"#D9A441"},null,-1)),r[18]||(r[18]=O("path",{d:"M60 10 C76 22 80 44 76 72 H44 C40 44 44 22 60 10 Z",fill:"#fff"},null,-1)),O("g",{"clip-path":`url(#${n.b})`},[...r[15]||(r[15]=[O("rect",{x:"30",y:"0",width:"60",height:"31",fill:"#1C2D56"},null,-1),O("rect",{x:"30",y:"64",width:"60",height:"10",fill:"#E3E8F4"},null,-1)])],8,G6),r[19]||(r[19]=O("path",{d:"M60 10 C76 22 80 44 76 72 H44 C40 44 44 22 60 10 Z",stroke:"#1C2D56","stroke-width":"3","stroke-linejoin":"round"},null,-1)),r[20]||(r[20]=O("circle",{cx:"60",cy:"46",r:"7.5",fill:"#DCE5F7",stroke:"#1C2D56","stroke-width":"3"},null,-1)),r[21]||(r[21]=O("circle",{cx:"57.6",cy:"43.6",r:"2",fill:"#fff"},null,-1)),r[22]||(r[22]=O("rect",{x:"49",y:"71",width:"22",height:"7",rx:"2.5",fill:"#1C2D56"},null,-1))])],64)):e.name==="success"?(W(),o1(f1,{key:4},[r[24]||(r[24]=m9('',12))],64)):L1("",!0)],2))}}),Y6=He(K6,[["__scopeId","data-v-ce25a22f"]]),Q6={class:"iSheet__panel"},X6={class:"iSheet__art"},J6={class:"iSheet__title"},ek={key:0,class:"iSheet__desc"},tk={class:"iSheet__actions"},nk=90,ok=.5,D4=b1({__name:"IslandSheet",props:{show:{type:Boolean},title:{},description:{},confirmText:{},cancelText:{},art:{},tone:{},closeOnClickOverlay:{type:Boolean,default:!0}},emits:["update:show","confirm","cancel"],setup(e,{emit:t}){const n=e,o=t,r={logout:"wine",login:"navy",order:"gold",update:"navy",success:"green"},i=F(()=>n.tone??(n.art?r[n.art]:"ink")),s=Q(!1);function l(){o("update:show",!1)}function d(){s.value=!1,k.value=0}function a(){o("cancel"),l()}const k=Q(0),u=Q(!1);let h=0,p=0;const C=F(()=>k.value?{transform:`translate3d(0, ${k.value}px, 0)`}:void 0);function v(g){g.target.closest("button")||(h=g.touches[0].clientY,p=Date.now(),u.value=!0)}function m(g){if(!u.value)return;const j=g.touches[0].clientY-h;k.value=j>0?n.closeOnClickOverlay?j:j*.2:j*.12}function H(){if(!u.value)return;u.value=!1;const g=k.value/Math.max(1,Date.now()-p);n.closeOnClickOverlay&&(k.value>nk||k.value>30&&g>ok)?l():k.value=0}return(g,j)=>(W(),O1(v1(B6),{show:e.show,position:"bottom",teleport:"body",transition:"iSheet-slide","transition-appear":"",class:"iSheet","overlay-class":"iSheet__overlay","close-on-click-overlay":e.closeOnClickOverlay,"close-on-popstate":"","onUpdate:show":j[1]||(j[1]=f=>o("update:show",f)),onOpened:j[2]||(j[2]=f=>s.value=!0),onClosed:d},{default:e2(()=>[O("div",{class:F1(["iSheet__card",[`iSheet--${i.value}`,{"is-dragging":u.value,"is-ready":s.value,"is-single":!e.cancelText}]]),style:re(C.value),dir:"rtl",role:"dialog","aria-modal":"true",onTouchstartPassive:v,onTouchmovePassive:m,onTouchend:H,onTouchcancel:H},[j[3]||(j[3]=O("span",{class:"iSheet__grip","aria-hidden":"true"},null,-1)),O("div",Q6,[O("div",X6,[Ln(g.$slots,"art",{},()=>[e.art?(W(),O1(Y6,{key:0,name:e.art},null,8,["name"])):L1("",!0)])])]),O("h3",J6,M1(e.title),1),e.description?(W(),o1("p",ek,M1(e.description),1)):L1("",!0),O("div",tk,[e.cancelText?(W(),o1("button",{key:0,type:"button",class:"iSheet__btn iSheet__btn--ghost",onClick:a},M1(e.cancelText),1)):L1("",!0),O("button",{type:"button",class:"iSheet__btn iSheet__btn--primary",onClick:j[0]||(j[0]=f=>o("confirm"))},M1(e.confirmText),1)])],38)]),_:3},8,["show","close-on-click-overlay"]))}}),rk={class:"toast__tile","aria-hidden":"true"},ik={class:"toast__body"},sk={key:0,class:"toast__title"},lk={class:"toast__message"},xi=80,dk=b1({__name:"ToastCard",props:{item:{}},emits:["close"],setup(e,{emit:t}){const n=t,o=Q(!1),r=Q(!1),i=Q(0),s=Q(0);let l=0,d=0;const a=Q(!1);let k=0;const u=F(()=>{if(a.value)return{transform:`translate(${i.value}px, ${s.value}px)`,opacity:"0",transition:"transform 0.22s ease-in, opacity 0.22s ease-in"};if(!r.value)return;const v=s.value<0?s.value:s.value*.25,m=1-Math.min(Math.abs(i.value)/220,.6);return{transform:`translate(${i.value}px, ${v}px) rotate(${i.value*.03}deg)`,opacity:String(m),transition:"none"}});function h(v){o.value=!0,l=v.clientX,d=v.clientY,k=Date.now(),v.currentTarget.setPointerCapture(v.pointerId)}function p(v){o.value&&(i.value=v.clientX-l,s.value=v.clientY-d,!r.value&&Math.hypot(i.value,s.value)>6&&(r.value=!0))}function C(){if(o.value=!1,!r.value){Date.now()-k<250&&n("close");return}if(Math.abs(i.value)>xi||s.value<-36){a.value=!0,i.value=Math.abs(i.value)>xi?Math.sign(i.value)*window.innerWidth:i.value,s.value=s.value<-36?-160:s.value,r.value=!1,setTimeout(()=>n("close"),200);return}r.value=!1,i.value=0,s.value=0}return(v,m)=>(W(),o1("div",{class:F1(["toast",[`toast--${e.item.type}`,{"is-held":o.value,"is-dragging":r.value}]]),style:re(u.value),role:"status",onPointerdown:h,onPointermove:p,onPointerup:C,onPointercancel:C},[O("span",rk,[m[1]||(m[1]=O("span",{class:"toast__ripple"},null,-1)),b(q1,{icon:e.item.icon,size:"22"},null,8,["icon"])]),O("div",ik,[e.item.title?(W(),o1("div",sk,M1(e.item.title),1)):L1("",!0),O("div",lk,M1(e.item.message),1)]),e.item.duration>0?(W(),o1("span",{key:0,class:"toast__progress keep-motion",style:re({animationDuration:`${e.item.duration}ms`}),onAnimationend:m[0]||(m[0]=H=>n("close"))},null,36)):L1("",!0)],38))}}),ak=He(dk,[["__scopeId","data-v-172a25f4"]]),kk=3200,Di=3,uk={success:"vuesax-linear:tick-circle",error:"vuesax-linear:close-circle",info:"vuesax-linear:info-circle",warning:"vuesax-linear:warning-2"},Pe=W1({items:[]});let hk=1;function Dt(e,t,n={}){const o=hk++;return Pe.items.push({id:o,type:e,message:t,title:n.title,icon:n.icon??uk[e],duration:n.duration??kk}),Pe.items.length>Di&&Pe.items.splice(0,Pe.items.length-Di),o}function pk(e){const t=Pe.items.findIndex(n=>n.id===e);t!==-1&&Pe.items.splice(t,1)}const L4={show:Dt,dismiss:pk,success:(e,t)=>Dt("success",e,t),error:(e,t)=>Dt("error",e,t),info:(e,t)=>Dt("info",e,t),warning:(e,t)=>Dt("warning",e,t)};function ck(){return{toasts:Pe.items,...L4}}const wk={class:"toast-host"},Ck=b1({__name:"ToastHost",setup(e){const{toasts:t,dismiss:n}=ck();return(o,r)=>(W(),O1(wt,{to:"body"},[O("div",wk,[b(R5,{name:"toast"},{default:e2(()=>[(W(!0),o1(f1,null,nt(v1(t),i=>(W(),O1(ak,{key:i.id,item:i,onClose:s=>v1(n)(i.id)},null,8,["item","onClose"]))),128))]),_:1})])]))}}),gk=["src","alt"],vk={key:0,class:"gs__counter"},Li=.18,fk=6,mk=b1({__name:"GallerySlider",props:s0({slides:{},alt:{},fit:{default:"cover"},showCounter:{type:Boolean,default:!1}},{index:{default:0},indexModifiers:{}}),emits:s0(["tap"],["update:index"]),setup(e,{emit:t}){const n=e,o=dd(e,"index"),r=t,i=F(()=>n.fit==="contain"?"gs__img--contain":"gs__img--cover"),s=Q(null),l=Q(!1),d=Q(0);let a=null,k=0,u=0;function h(f){var D;if(n.slides.length<2||a!==null)return;const x=s.value;x&&(a=f.pointerId,k=f.clientX,u=x.getBoundingClientRect().width||1,d.value=0,l.value=!0,(D=x.setPointerCapture)==null||D.call(x,f.pointerId))}function p(f){!l.value||f.pointerId!==a||(d.value=f.clientX-k)}function C(){if(!l.value)return;const f=d.value,x=f/u;l.value=!1,a=null,d.value=0,x<=-Li&&o.value=Li&&o.value>0&&o.value--,Math.abs(f)<=fk&&r("tap")}function v(f){f.pointerId===a&&C()}function m(f){f.pointerId===a&&(l.value=!1,a=null,d.value=0)}function H(){}function g(f){o.value=f}const j=F(()=>{const f=-o.value*100,x=u?d.value/u*100:0;return{transform:`translate3d(${f+x}%, 0, 0)`,transition:l.value?"none":void 0}});return Ue(()=>{if(a!==null&&s.value)try{s.value.releasePointerCapture(a)}catch{}}),(f,x)=>(W(),o1("div",{ref_key:"root",ref:s,class:F1(["gs",{"is-dragging":l.value}]),onPointerdown:h,onPointermove:p,onPointerup:v,onPointercancel:m,onClick:H},[O("div",{class:"gs__track",style:re(j.value)},[(W(!0),o1(f1,null,nt(e.slides,D=>(W(),o1("div",{key:D,class:"gs__cell"},[O("img",{src:D,alt:e.alt,class:F1(["gs__img",i.value]),draggable:"false"},null,10,gk)]))),128))],4),e.showCounter&&e.slides.length>1?(W(),o1("div",vk,M1(o.value+1)+"/"+M1(e.slides.length),1)):L1("",!0),Ln(f.$slots,"dots",{index:o.value,go:g},void 0,!0)],34))}}),Hi=He(mk,[["__scopeId","data-v-0e0334e8"]]),Mk="/img/montzar-logo.png";function ae(e){"@babel/helpers - typeof";return ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ae(e)}function jk(e,t){if(ae(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(ae(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xk(e){var t=jk(e,"string");return ae(t)=="symbol"?t:t+""}function U1(e,t,n){return(t=xk(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function u1(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return typeof e=="function"?e(t):e??n}function p9(){for(var e=[],t=0;te.length)&&(t=e.length);for(var n=0,o=Array(t);n0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,o={},r=/;(?![^(]*\))/g,i=/:(.+)/;return ae(t)==="object"?t:(t.split(r).forEach(function(s){if(s){var l=s.split(i);if(l.length>1){var d=n?V4(l[0].trim()):l[0].trim();o[d]=l[1].trim()}}}),o)},fw=function(t,n){return t[n]!==void 0},B9=function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,o=Array.isArray(t)?t:[t],r=[];return o.forEach(function(i){Array.isArray(i)?r.push.apply(r,tn(e(i,n))):i&&i.type===f1?r.push.apply(r,tn(e(i.children,n))):i&&a2(i)?n&&!_4(i)?r.push(i):n||r.push(i):Jk(i)&&r.push(i)}),r},ou=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"default",o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(a2(t))return t.type===f1?n==="default"?B9(t.children):[]:t.children&&t.children[n]?B9(t.children[n](o)):[];var r=t.$slots[n]&&t.$slots[n](o);return B9(r)},mw=function(t){for(var n,o=(t==null||(n=t.vnode)===null||n===void 0?void 0:n.el)||t&&(t.$el||t);o&&!o.tagName;)o=o.nextSibling;return o},Mw=function(t){var n={};if(t.$&&t.$.vnode){var o=t.$.vnode.props||{};Object.keys(t.$props).forEach(function(l){var d=t.$props[l],a=Bk(l);(d!==void 0||a in o)&&(n[l]=d)})}else if(a2(t)&&ae(t.type)==="object"){var r=t.props||{},i={};Object.keys(r).forEach(function(l){i[V4(l)]=r[l]});var s=t.type.props||{};Object.keys(s).forEach(function(l){var d=Ek(s,i,l,i[l]);(d!==void 0||l in i)&&(n[l]=d)})}return n},ru=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"default",o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=void 0;if(t.$){var s=t[n];if(s!==void 0)return typeof s=="function"&&r?s(o):s;i=t.$slots[n],i=r&&i?i(o):i}else if(a2(t)){var l=t.props&&t.props[n];if(l!==void 0&&t.props!==null)return typeof l=="function"&&r?l(o):l;t.type===f1?i=t.children:t.children&&t.children[n]&&(i=t.children[n],i=r&&i?i(o):i)}return Array.isArray(i)&&(i=B9(i),i=i.length===1?i[0]:i,i=i.length===0?void 0:i),i};function jw(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n={};return e.$?n=u1(u1({},n),e.$attrs):n=u1(u1({},n),e.props),tu(n)[t?"onEvents":"events"]}function xw(e,t){var n=(a2(e)?e.props:e.$attrs)||{},o=n.style||{};return typeof o=="string"&&(o=nu(o,t)),o}function _4(e){return e&&(e.type===R1||e.type===f1&&e.children.length===0||e.type===k9&&e.children.trim()==="")}function B4(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[];return e.forEach(function(n){Array.isArray(n)?t.push.apply(t,tn(n)):(n==null?void 0:n.type)===f1?t.push.apply(t,tn(B4(n.children))):t.push(n)}),t.filter(function(n){return!_4(n)})}function Dw(e){return Array.isArray(e)&&e.length===1&&(e=e[0]),e&&e.__v_isVNode&&ae(e.type)!=="symbol"}function Lw(e,t){var n,o,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"default";return(n=t[r])!==null&&n!==void 0?n:(o=e[r])===null||o===void 0?void 0:o.call(e)}var iu=function(){for(var t=arguments.length,n=new Array(t),o=0;o=0||(r[n]=e[n]);return r}function Bi(e){return((t=e)!=null&&typeof t=="object"&&Array.isArray(t)===!1)==1&&Object.prototype.toString.call(e)==="[object Object]";var t}var $4=Object.prototype,N4=$4.toString,ku=$4.hasOwnProperty,F4=/^\s*function (\w+)/;function Si(e){var t,n=(t=e==null?void 0:e.type)!==null&&t!==void 0?t:e;if(n){var o=n.toString().match(F4);return o?o[1]:""}return""}var qe=function(e){var t,n;return Bi(e)!==!1&&typeof(t=e.constructor)=="function"&&Bi(n=t.prototype)!==!1&&n.hasOwnProperty("isPrototypeOf")!==!1},uu=function(e){return e},C2=uu,n9=function(e,t){return ku.call(e,t)},hu=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},ht=Array.isArray||function(e){return N4.call(e)==="[object Array]"},pt=function(e){return N4.call(e)==="[object Function]"},rn=function(e){return qe(e)&&n9(e,"_vueTypes_name")},q4=function(e){return qe(e)&&(n9(e,"type")||["_vueTypes_name","validator","default","required"].some(function(t){return n9(e,t)}))};function Sr(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function ze(e,t,n){var o,r=!0,i="";o=qe(e)?e:{type:e};var s=rn(o)?o._vueTypes_name+" - ":"";if(q4(o)&&o.type!==null){if(o.type===void 0||o.type===!0||!o.required&&t===void 0)return r;ht(o.type)?(r=o.type.some(function(u){return ze(u,t)===!0}),i=o.type.map(function(u){return Si(u)}).join(" or ")):r=(i=Si(o))==="Array"?ht(t):i==="Object"?qe(t):i==="String"||i==="Number"||i==="Boolean"||i==="Function"?function(u){if(u==null)return"";var h=u.constructor.toString().match(F4);return h?h[1]:""}(t)===i:t instanceof o.type}if(!r){var l=s+'value "'+t+'" should be of type "'+i+'"';return l}if(n9(o,"validator")&&pt(o.validator)){var d=C2,a=[];if(C2=function(u){a.push(u)},r=o.validator(t),C2=d,!r){var k=(a.length>1?"* ":"")+a.join(` -* `);return a.length=0,k}}return r}function f2(e,t){var n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get:function(){return this.required=!0,this}},def:{value:function(r){return r!==void 0||this.default?pt(r)||ze(this,r)===!0?(this.default=ht(r)?function(){return[].concat(r)}:qe(r)?function(){return Object.assign({},r)}:r,this):(C2(this._vueTypes_name+' - invalid default value: "'+r+'"'),this):this}}}),o=n.validator;return pt(o)&&(n.validator=Sr(o,n)),n}function F2(e,t){var n=f2(e,t);return Object.defineProperty(n,"validate",{value:function(o){return pt(this.validator)&&C2(this._vueTypes_name+` - calling .validate() will overwrite the current custom validator function. Validator info: -`+JSON.stringify(this)),this.validator=Sr(o,this),this}})}function Ei(e,t,n){var o,r,i=(o=t,r={},Object.getOwnPropertyNames(o).forEach(function(u){r[u]=Object.getOwnPropertyDescriptor(o,u)}),Object.defineProperties({},r));if(i._vueTypes_name=e,!qe(n))return i;var s,l,d=n.validator,a=R4(n,["validator"]);if(pt(d)){var k=i.validator;k&&(k=(l=(s=k).__original)!==null&&l!==void 0?l:s),i.validator=Sr(k?function(u){return k.call(this,u)&&d.call(this,u)}:d,i)}return Object.assign(i,a)}function On(e){return e.replace(/^(?!\s*$)/gm," ")}var pu=function(){return F2("any",{})},cu=function(){return F2("function",{type:Function})},wu=function(){return F2("boolean",{type:Boolean})},Cu=function(){return F2("string",{type:String})},gu=function(){return F2("number",{type:Number})},vu=function(){return F2("array",{type:Array})},fu=function(){return F2("object",{type:Object})},mu=function(){return f2("integer",{type:Number,validator:function(e){return hu(e)}})},Mu=function(){return f2("symbol",{validator:function(e){return typeof e=="symbol"}})};function ju(e,t){if(t===void 0&&(t="custom validation failed"),typeof e!="function")throw new TypeError("[VueTypes error]: You must provide a function as argument");return f2(e.name||"<>",{validator:function(n){var o=e(n);return o||C2(this._vueTypes_name+" - "+t),o}})}function xu(e){if(!ht(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");var t='oneOf - value should be one of "'+e.join('", "')+'".',n=e.reduce(function(o,r){if(r!=null){var i=r.constructor;o.indexOf(i)===-1&&o.push(i)}return o},[]);return f2("oneOf",{type:n.length>0?n:void 0,validator:function(o){var r=e.indexOf(o)!==-1;return r||C2(t),r}})}function Du(e){if(!ht(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");for(var t=!1,n=[],o=0;oj6[`${t.icon}`]);function r(){var s;if(!t.size)return;const i=(s=n.value)==null?void 0:s.children[0];i==null||i.setAttribute("width",t.size),i==null||i.setAttribute("height",t.size)}return E1(o,()=>v2(r),{immediate:!0}),(i,s)=>(W(),o1("span",{ref_key:"refIcon",ref:n,style:re({color:e.color??void 0}),class:"liman-icons flex",innerHTML:o.value},null,12,x6))}}),He=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},q1=He(D6,[["__scopeId","data-v-d43d3684"]]),_r=Le("nav",{state:()=>({navBarRoutes:[{name:"home",path:"/home",icon:"vuesax-linear:home-2",label:"خانه",index:1},{name:"search",path:"/search",icon:"vuesax-linear:search-normal-1",label:"جستجو",index:2},{name:"cart",path:"/cart",icon:"vuesax-linear:bag-happy",label:"سبد خرید",index:3},{name:"ordersList",path:"/orders",icon:"vuesax-linear:receipt-text",label:"سفارشات",index:4},{name:"userPage::hasSubRoute",path:"/user",icon:"vuesax-linear:user",label:"پروفایل",index:5}],activeLink:1,showNav:!0,pageTransition:"right"}),actions:{setNavVisibility(e){this.showNav=e},setActiveLink(e){this.activeLink=e},setPgaTransition(e){this.pageTransition=e}}}),L6={class:"tabbar"},H6={class:"tabbar__inner"},V6=b1({__name:"Navigation",setup(e){const t=_r(),n=N(()=>`calc(${-(t.activeLink-1)} * (var(--tile) + var(--gap)))`);return(o,r)=>{const i=a9("router-link");return cr((W(),o1("nav",L6,[O("div",H6,[O("div",{class:"tabbar__indicator",style:re({transform:`translateX(${n.value})`}),"aria-hidden":"true"},null,4),(W(!0),o1(f1,null,nt(v1(t).navBarRoutes,s=>(W(),O1(i,{key:s.index,to:{name:s.name},class:N1(["tabbar__item",{"is-active":v1(t).activeLink===s.index}]),"aria-label":s.label,title:s.label},{default:e2(()=>[b(q1,{icon:s.icon,size:"22"},null,8,["icon"])]),_:2},1032,["to","class","aria-label","title"]))),128))])],512)),[[Hr,v1(t).showNav]])}}}),y6=He(V6,[["__scopeId","data-v-c127b61d"]]),b6=Le("windowData",{state:()=>({width:0,pullingDown:!1}),actions:{setWidth(e){this.width=e},setPullingDown(e){this.pullingDown=e}}}),Z6=b1({__name:"MasterLayout",setup(e){const t=b6(),n=Q(null);return gr(()=>{t.setWidth(window.innerWidth)}),a6(n,o=>{const r=o[0],{width:i}=r.contentRect;t.width!==i&&t.setWidth(i)}),(o,r)=>{const i=a9("router-view");return W(),o1("section",{ref_key:"content",ref:n},[b(i,null,{default:e2(({Component:s,route:l})=>[b(bn,{name:"page",mode:"out-in"},{default:e2(()=>[(W(),O1(Do(s),{key:l.name}))]),_:2},1024)]),_:1}),b(y6),r[0]||(r[0]=O("div",{class:"bg-primary top-[-2rem] fixed h-[2rem] w-full z-10"},null,-1))],512)}}}),_6={};function B6(e,t){const n=a9("router-view");return W(),o1("div",null,[b(n)])}const E6=He(_6,[["render",B6]]),S6=["id"],O6=["id"],A6=["fill"],P6={class:"sa-door"},T6=["fill"],I6=["id"],R6=["id"],$6={class:"sa-coin"},F6=["fill"],N6=["fill"],q6=["id"],U6=["id"],z6={class:"sa-float"},W6={class:"sa-flame"},G6=["fill"],K6=["clip-path"],Y6=b1({__name:"SheetArt",props:{name:{}},setup(e){const t=U3(),n={a:`${t}-a`,b:`${t}-b`};return(o,r)=>(W(),o1("svg",{class:N1(["sa",`sa--${e.name}`]),viewBox:"0 0 120 120",fill:"none","aria-hidden":"true"},[e.name==="logout"?(W(),o1(f1,{key:0},[O("defs",null,[O("linearGradient",{id:n.a,x1:"0",y1:"0",x2:"1",y2:"1"},[...r[0]||(r[0]=[O("stop",{offset:"0","stop-color":"#A33C55"},null,-1),O("stop",{offset:"1","stop-color":"#5E1427"},null,-1)])],8,S6),O("radialGradient",{id:n.b,cx:".35",cy:".5",r:".75"},[...r[1]||(r[1]=[O("stop",{offset:"0","stop-color":"#FFF7E6"},null,-1),O("stop",{offset:"1","stop-color":"#F4C57A"},null,-1)])],8,O6)]),r[3]||(r[3]=O("ellipse",{class:"sa-shadow",cx:"62",cy:"106",rx:"36",ry:"4",fill:"#7A1B33",opacity:".12"},null,-1)),O("rect",{x:"48",y:"18",width:"40",height:"84",rx:"5",fill:`url(#${n.b})`,stroke:"#7A1B33","stroke-width":"3"},null,8,A6),O("g",P6,[O("path",{d:"M88 18 L88 102 L69 108 L69 12 Z",fill:`url(#${n.a})`,stroke:"#5E1427","stroke-width":"2","stroke-linejoin":"round"},null,8,T6),r[2]||(r[2]=O("circle",{cx:"73.5",cy:"61",r:"2.6",fill:"#F4C57A"},null,-1))]),r[4]||(r[4]=O("g",{class:"sa-arrow","stroke-linecap":"round","stroke-linejoin":"round"},[O("path",{d:"M60 60 H22 M33 48 L21 60 L33 72",stroke:"#fff","stroke-width":"12"}),O("path",{d:"M60 60 H22 M33 48 L21 60 L33 72",stroke:"#7A1B33","stroke-width":"6"})],-1))],64)):e.name==="login"?(W(),o1(f1,{key:1},[r[5]||(r[5]=m9('',3))],64)):e.name==="order"?(W(),o1(f1,{key:2},[O("defs",null,[O("linearGradient",{id:n.a,x1:"0",y1:"0",x2:"0",y2:"1"},[...r[6]||(r[6]=[O("stop",{offset:"0","stop-color":"#EBC06A"},null,-1),O("stop",{offset:"1","stop-color":"#B5843B"},null,-1)])],8,I6),O("radialGradient",{id:n.b,cx:".38",cy:".35",r:".7"},[...r[7]||(r[7]=[O("stop",{offset:"0","stop-color":"#FFF1C7"},null,-1),O("stop",{offset:"1","stop-color":"#E2AC4A"},null,-1)])],8,R6)]),r[9]||(r[9]=O("ellipse",{class:"sa-shadow",cx:"60",cy:"108",rx:"32",ry:"4",fill:"#8D6A46",opacity:".16"},null,-1)),r[10]||(r[10]=O("path",{d:"M46 57 V40 a14 14 0 0 1 28 0 V57",stroke:"#8D6A46","stroke-width":"4.5","stroke-linecap":"round"},null,-1)),O("g",$6,[O("circle",{cx:"60",cy:"31",r:"10",fill:`url(#${n.b})`,stroke:"#B5843B","stroke-width":"2"},null,8,F6),r[8]||(r[8]=O("circle",{cx:"60",cy:"31",r:"5.5",stroke:"#B5843B","stroke-width":"1.5",opacity:".7"},null,-1))]),O("path",{d:"M30 48 H90 L85 100 a6 6 0 0 1 -6 5.5 H41 a6 6 0 0 1 -6 -5.5 Z",fill:`url(#${n.a})`},null,8,N6),r[11]||(r[11]=m9('',5))],64)):e.name==="update"?(W(),o1(f1,{key:3},[O("defs",null,[O("linearGradient",{id:n.a,x1:"0",y1:"0",x2:"0",y2:"1"},[...r[12]||(r[12]=[O("stop",{offset:"0","stop-color":"#FFD27A"},null,-1),O("stop",{offset:"1","stop-color":"#F2793B"},null,-1)])],8,q6),O("clipPath",{id:n.b},[...r[13]||(r[13]=[O("path",{d:"M60 10 C76 22 80 44 76 72 H44 C40 44 44 22 60 10 Z"},null,-1)])],8,U6)]),r[23]||(r[23]=m9('',1)),O("g",z6,[O("g",W6,[O("path",{d:"M51 77 Q60 112 69 77 Z",fill:`url(#${n.a})`},null,8,G6),r[14]||(r[14]=O("path",{d:"M55.5 77 Q60 96 64.5 77 Z",fill:"#FFF1C9"},null,-1))]),r[16]||(r[16]=O("path",{d:"M44 56 L31 76 Q31 80 35 79 L46 74 Z",fill:"#D9A441"},null,-1)),r[17]||(r[17]=O("path",{d:"M76 56 L89 76 Q89 80 85 79 L74 74 Z",fill:"#D9A441"},null,-1)),r[18]||(r[18]=O("path",{d:"M60 10 C76 22 80 44 76 72 H44 C40 44 44 22 60 10 Z",fill:"#fff"},null,-1)),O("g",{"clip-path":`url(#${n.b})`},[...r[15]||(r[15]=[O("rect",{x:"30",y:"0",width:"60",height:"31",fill:"#1C2D56"},null,-1),O("rect",{x:"30",y:"64",width:"60",height:"10",fill:"#E3E8F4"},null,-1)])],8,K6),r[19]||(r[19]=O("path",{d:"M60 10 C76 22 80 44 76 72 H44 C40 44 44 22 60 10 Z",stroke:"#1C2D56","stroke-width":"3","stroke-linejoin":"round"},null,-1)),r[20]||(r[20]=O("circle",{cx:"60",cy:"46",r:"7.5",fill:"#DCE5F7",stroke:"#1C2D56","stroke-width":"3"},null,-1)),r[21]||(r[21]=O("circle",{cx:"57.6",cy:"43.6",r:"2",fill:"#fff"},null,-1)),r[22]||(r[22]=O("rect",{x:"49",y:"71",width:"22",height:"7",rx:"2.5",fill:"#1C2D56"},null,-1))])],64)):e.name==="success"?(W(),o1(f1,{key:4},[r[24]||(r[24]=m9('',12))],64)):L1("",!0)],2))}}),Q6=He(Y6,[["__scopeId","data-v-ce25a22f"]]),X6={class:"iSheet__panel"},J6={class:"iSheet__art"},ek={class:"iSheet__title"},tk={key:0,class:"iSheet__desc"},nk={class:"iSheet__actions"},ok=90,rk=.5,L4=b1({__name:"IslandSheet",props:{show:{type:Boolean},title:{},description:{},confirmText:{},cancelText:{},art:{},tone:{},closeOnClickOverlay:{type:Boolean,default:!0}},emits:["update:show","confirm","cancel"],setup(e,{emit:t}){const n=e,o=t,r={logout:"wine",login:"navy",order:"gold",update:"navy",success:"green"},i=N(()=>n.tone??(n.art?r[n.art]:"ink")),s=Q(!1);function l(){o("update:show",!1)}function d(){s.value=!1,k.value=0}function a(){o("cancel"),l()}const k=Q(0),u=Q(!1);let h=0,p=0;const C=N(()=>k.value?{transform:`translate3d(0, ${k.value}px, 0)`}:void 0);function v(g){g.target.closest("button")||(h=g.touches[0].clientY,p=Date.now(),u.value=!0)}function m(g){if(!u.value)return;const j=g.touches[0].clientY-h;k.value=j>0?n.closeOnClickOverlay?j:j*.2:j*.12}function H(){if(!u.value)return;u.value=!1;const g=k.value/Math.max(1,Date.now()-p);n.closeOnClickOverlay&&(k.value>ok||k.value>30&&g>rk)?l():k.value=0}return(g,j)=>(W(),O1(v1($8),{show:e.show,position:"bottom",teleport:"body",transition:"iSheet-slide","transition-appear":"",class:"iSheet","overlay-class":"iSheet__overlay","close-on-click-overlay":e.closeOnClickOverlay,"close-on-popstate":"","onUpdate:show":j[1]||(j[1]=f=>o("update:show",f)),onOpened:j[2]||(j[2]=f=>s.value=!0),onClosed:d},{default:e2(()=>[O("div",{class:N1(["iSheet__card",[`iSheet--${i.value}`,{"is-dragging":u.value,"is-ready":s.value,"is-single":!e.cancelText}]]),style:re(C.value),dir:"rtl",role:"dialog","aria-modal":"true",onTouchstartPassive:v,onTouchmovePassive:m,onTouchend:H,onTouchcancel:H},[j[3]||(j[3]=O("span",{class:"iSheet__grip","aria-hidden":"true"},null,-1)),O("div",X6,[O("div",J6,[Ln(g.$slots,"art",{},()=>[e.art?(W(),O1(Q6,{key:0,name:e.art},null,8,["name"])):L1("",!0)])])]),O("h3",ek,M1(e.title),1),e.description?(W(),o1("p",tk,M1(e.description),1)):L1("",!0),O("div",nk,[e.cancelText?(W(),o1("button",{key:0,type:"button",class:"iSheet__btn iSheet__btn--ghost",onClick:a},M1(e.cancelText),1)):L1("",!0),O("button",{type:"button",class:"iSheet__btn iSheet__btn--primary",onClick:j[0]||(j[0]=f=>o("confirm"))},M1(e.confirmText),1)])],38)]),_:3},8,["show","close-on-click-overlay"]))}}),ik={class:"toast__tile","aria-hidden":"true"},sk={class:"toast__body"},lk={key:0,class:"toast__title"},dk={class:"toast__message"},xi=80,ak=b1({__name:"ToastCard",props:{item:{}},emits:["close"],setup(e,{emit:t}){const n=t,o=Q(!1),r=Q(!1),i=Q(0),s=Q(0);let l=0,d=0;const a=Q(!1);let k=0;const u=N(()=>{if(a.value)return{transform:`translate(${i.value}px, ${s.value}px)`,opacity:"0",transition:"transform 0.22s ease-in, opacity 0.22s ease-in"};if(!r.value)return;const v=s.value<0?s.value:s.value*.25,m=1-Math.min(Math.abs(i.value)/220,.6);return{transform:`translate(${i.value}px, ${v}px) rotate(${i.value*.03}deg)`,opacity:String(m),transition:"none"}});function h(v){o.value=!0,l=v.clientX,d=v.clientY,k=Date.now(),v.currentTarget.setPointerCapture(v.pointerId)}function p(v){o.value&&(i.value=v.clientX-l,s.value=v.clientY-d,!r.value&&Math.hypot(i.value,s.value)>6&&(r.value=!0))}function C(){if(o.value=!1,!r.value){Date.now()-k<250&&n("close");return}if(Math.abs(i.value)>xi||s.value<-36){a.value=!0,i.value=Math.abs(i.value)>xi?Math.sign(i.value)*window.innerWidth:i.value,s.value=s.value<-36?-160:s.value,r.value=!1,setTimeout(()=>n("close"),200);return}r.value=!1,i.value=0,s.value=0}return(v,m)=>(W(),o1("div",{class:N1(["toast",[`toast--${e.item.type}`,{"is-held":o.value,"is-dragging":r.value}]]),style:re(u.value),role:"status",onPointerdown:h,onPointermove:p,onPointerup:C,onPointercancel:C},[O("span",ik,[m[1]||(m[1]=O("span",{class:"toast__ripple"},null,-1)),b(q1,{icon:e.item.icon,size:"22"},null,8,["icon"])]),O("div",sk,[e.item.title?(W(),o1("div",lk,M1(e.item.title),1)):L1("",!0),O("div",dk,M1(e.item.message),1)]),e.item.duration>0?(W(),o1("span",{key:0,class:"toast__progress keep-motion",style:re({animationDuration:`${e.item.duration}ms`}),onAnimationend:m[0]||(m[0]=H=>n("close"))},null,36)):L1("",!0)],38))}}),kk=He(ak,[["__scopeId","data-v-172a25f4"]]),uk=3200,Di=3,hk={success:"vuesax-linear:tick-circle",error:"vuesax-linear:close-circle",info:"vuesax-linear:info-circle",warning:"vuesax-linear:warning-2"},Ae=W1({items:[]});let pk=1;function Dt(e,t,n={}){const o=pk++;return Ae.items.push({id:o,type:e,message:t,title:n.title,icon:n.icon??hk[e],duration:n.duration??uk}),Ae.items.length>Di&&Ae.items.splice(0,Ae.items.length-Di),o}function ck(e){const t=Ae.items.findIndex(n=>n.id===e);t!==-1&&Ae.items.splice(t,1)}const H4={show:Dt,dismiss:ck,success:(e,t)=>Dt("success",e,t),error:(e,t)=>Dt("error",e,t),info:(e,t)=>Dt("info",e,t),warning:(e,t)=>Dt("warning",e,t)};function wk(){return{toasts:Ae.items,...H4}}const Ck={class:"toast-host"},gk=b1({__name:"ToastHost",setup(e){const{toasts:t,dismiss:n}=wk();return(o,r)=>(W(),O1(wt,{to:"body"},[O("div",Ck,[b(R5,{name:"toast"},{default:e2(()=>[(W(!0),o1(f1,null,nt(v1(t),i=>(W(),O1(kk,{key:i.id,item:i,onClose:s=>v1(n)(i.id)},null,8,["item","onClose"]))),128))]),_:1})])]))}}),vk=["src","alt"],fk={key:0,class:"gs__counter"},Li=.18,mk=6,Mk=b1({__name:"GallerySlider",props:s0({slides:{},alt:{},fit:{default:"cover"},showCounter:{type:Boolean,default:!1}},{index:{default:0},indexModifiers:{}}),emits:s0(["tap"],["update:index"]),setup(e,{emit:t}){const n=e,o=ad(e,"index"),r=t,i=N(()=>n.fit==="contain"?"gs__img--contain":"gs__img--cover"),s=Q(null),l=Q(!1),d=Q(0);let a=null,k=0,u=0;function h(f){var D;if(n.slides.length<2||a!==null)return;const x=s.value;x&&(a=f.pointerId,k=f.clientX,u=x.getBoundingClientRect().width||1,d.value=0,l.value=!0,(D=x.setPointerCapture)==null||D.call(x,f.pointerId))}function p(f){!l.value||f.pointerId!==a||(d.value=f.clientX-k)}function C(){if(!l.value)return;const f=d.value,x=f/u;l.value=!1,a=null,d.value=0,x<=-Li&&o.value=Li&&o.value>0&&o.value--,Math.abs(f)<=mk&&r("tap")}function v(f){f.pointerId===a&&C()}function m(f){f.pointerId===a&&(l.value=!1,a=null,d.value=0)}function H(){}function g(f){o.value=f}const j=N(()=>{const f=-o.value*100,x=u?d.value/u*100:0;return{transform:`translate3d(${f+x}%, 0, 0)`,transition:l.value?"none":void 0}});return Ue(()=>{if(a!==null&&s.value)try{s.value.releasePointerCapture(a)}catch{}}),(f,x)=>(W(),o1("div",{ref_key:"root",ref:s,class:N1(["gs",{"is-dragging":l.value}]),onPointerdown:h,onPointermove:p,onPointerup:v,onPointercancel:m,onClick:H},[O("div",{class:"gs__track",style:re(j.value)},[(W(!0),o1(f1,null,nt(e.slides,D=>(W(),o1("div",{key:D,class:"gs__cell"},[O("img",{src:D,alt:e.alt,class:N1(["gs__img",i.value]),draggable:"false"},null,10,vk)]))),128))],4),e.showCounter&&e.slides.length>1?(W(),o1("div",fk,M1(o.value+1)+"/"+M1(e.slides.length),1)):L1("",!0),Ln(f.$slots,"dots",{index:o.value,go:g},void 0,!0)],34))}}),Hi=He(Mk,[["__scopeId","data-v-0e0334e8"]]),jk="/img/montzar-logo.png";function ae(e){"@babel/helpers - typeof";return ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ae(e)}function xk(e,t){if(ae(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(ae(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dk(e){var t=xk(e,"string");return ae(t)=="symbol"?t:t+""}function U1(e,t,n){return(t=Dk(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function u1(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return typeof e=="function"?e(t):e??n}function p9(){for(var e=[],t=0;te.length)&&(t=e.length);for(var n=0,o=Array(t);n0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,o={},r=/;(?![^(]*\))/g,i=/:(.+)/;return ae(t)==="object"?t:(t.split(r).forEach(function(s){if(s){var l=s.split(i);if(l.length>1){var d=n?y4(l[0].trim()):l[0].trim();o[d]=l[1].trim()}}}),o)},mw=function(t,n){return t[n]!==void 0},B9=function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,o=Array.isArray(t)?t:[t],r=[];return o.forEach(function(i){Array.isArray(i)?r.push.apply(r,tn(e(i,n))):i&&i.type===f1?r.push.apply(r,tn(e(i.children,n))):i&&a2(i)?n&&!B4(i)?r.push(i):n||r.push(i):eu(i)&&r.push(i)}),r},ru=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"default",o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(a2(t))return t.type===f1?n==="default"?B9(t.children):[]:t.children&&t.children[n]?B9(t.children[n](o)):[];var r=t.$slots[n]&&t.$slots[n](o);return B9(r)},Mw=function(t){for(var n,o=(t==null||(n=t.vnode)===null||n===void 0?void 0:n.el)||t&&(t.$el||t);o&&!o.tagName;)o=o.nextSibling;return o},jw=function(t){var n={};if(t.$&&t.$.vnode){var o=t.$.vnode.props||{};Object.keys(t.$props).forEach(function(l){var d=t.$props[l],a=Ek(l);(d!==void 0||a in o)&&(n[l]=d)})}else if(a2(t)&&ae(t.type)==="object"){var r=t.props||{},i={};Object.keys(r).forEach(function(l){i[y4(l)]=r[l]});var s=t.type.props||{};Object.keys(s).forEach(function(l){var d=Ok(s,i,l,i[l]);(d!==void 0||l in i)&&(n[l]=d)})}return n},iu=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"default",o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=void 0;if(t.$){var s=t[n];if(s!==void 0)return typeof s=="function"&&r?s(o):s;i=t.$slots[n],i=r&&i?i(o):i}else if(a2(t)){var l=t.props&&t.props[n];if(l!==void 0&&t.props!==null)return typeof l=="function"&&r?l(o):l;t.type===f1?i=t.children:t.children&&t.children[n]&&(i=t.children[n],i=r&&i?i(o):i)}return Array.isArray(i)&&(i=B9(i),i=i.length===1?i[0]:i,i=i.length===0?void 0:i),i};function xw(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n={};return e.$?n=u1(u1({},n),e.$attrs):n=u1(u1({},n),e.props),nu(n)[t?"onEvents":"events"]}function Dw(e,t){var n=(a2(e)?e.props:e.$attrs)||{},o=n.style||{};return typeof o=="string"&&(o=ou(o,t)),o}function B4(e){return e&&(e.type===R1||e.type===f1&&e.children.length===0||e.type===k9&&e.children.trim()==="")}function E4(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[];return e.forEach(function(n){Array.isArray(n)?t.push.apply(t,tn(n)):(n==null?void 0:n.type)===f1?t.push.apply(t,tn(E4(n.children))):t.push(n)}),t.filter(function(n){return!B4(n)})}function Lw(e){return Array.isArray(e)&&e.length===1&&(e=e[0]),e&&e.__v_isVNode&&ae(e.type)!=="symbol"}function Hw(e,t){var n,o,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"default";return(n=t[r])!==null&&n!==void 0?n:(o=e[r])===null||o===void 0?void 0:o.call(e)}var su=function(){for(var t=arguments.length,n=new Array(t),o=0;o=0||(r[n]=e[n]);return r}function Bi(e){return((t=e)!=null&&typeof t=="object"&&Array.isArray(t)===!1)==1&&Object.prototype.toString.call(e)==="[object Object]";var t}var F4=Object.prototype,N4=F4.toString,uu=F4.hasOwnProperty,q4=/^\s*function (\w+)/;function Ei(e){var t,n=(t=e==null?void 0:e.type)!==null&&t!==void 0?t:e;if(n){var o=n.toString().match(q4);return o?o[1]:""}return""}var qe=function(e){var t,n;return Bi(e)!==!1&&typeof(t=e.constructor)=="function"&&Bi(n=t.prototype)!==!1&&n.hasOwnProperty("isPrototypeOf")!==!1},hu=function(e){return e},C2=hu,n9=function(e,t){return uu.call(e,t)},pu=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},ht=Array.isArray||function(e){return N4.call(e)==="[object Array]"},pt=function(e){return N4.call(e)==="[object Function]"},rn=function(e){return qe(e)&&n9(e,"_vueTypes_name")},U4=function(e){return qe(e)&&(n9(e,"type")||["_vueTypes_name","validator","default","required"].some(function(t){return n9(e,t)}))};function Er(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function ze(e,t,n){var o,r=!0,i="";o=qe(e)?e:{type:e};var s=rn(o)?o._vueTypes_name+" - ":"";if(U4(o)&&o.type!==null){if(o.type===void 0||o.type===!0||!o.required&&t===void 0)return r;ht(o.type)?(r=o.type.some(function(u){return ze(u,t)===!0}),i=o.type.map(function(u){return Ei(u)}).join(" or ")):r=(i=Ei(o))==="Array"?ht(t):i==="Object"?qe(t):i==="String"||i==="Number"||i==="Boolean"||i==="Function"?function(u){if(u==null)return"";var h=u.constructor.toString().match(q4);return h?h[1]:""}(t)===i:t instanceof o.type}if(!r){var l=s+'value "'+t+'" should be of type "'+i+'"';return l}if(n9(o,"validator")&&pt(o.validator)){var d=C2,a=[];if(C2=function(u){a.push(u)},r=o.validator(t),C2=d,!r){var k=(a.length>1?"* ":"")+a.join(` +* `);return a.length=0,k}}return r}function f2(e,t){var n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get:function(){return this.required=!0,this}},def:{value:function(r){return r!==void 0||this.default?pt(r)||ze(this,r)===!0?(this.default=ht(r)?function(){return[].concat(r)}:qe(r)?function(){return Object.assign({},r)}:r,this):(C2(this._vueTypes_name+' - invalid default value: "'+r+'"'),this):this}}}),o=n.validator;return pt(o)&&(n.validator=Er(o,n)),n}function N2(e,t){var n=f2(e,t);return Object.defineProperty(n,"validate",{value:function(o){return pt(this.validator)&&C2(this._vueTypes_name+` - calling .validate() will overwrite the current custom validator function. Validator info: +`+JSON.stringify(this)),this.validator=Er(o,this),this}})}function Si(e,t,n){var o,r,i=(o=t,r={},Object.getOwnPropertyNames(o).forEach(function(u){r[u]=Object.getOwnPropertyDescriptor(o,u)}),Object.defineProperties({},r));if(i._vueTypes_name=e,!qe(n))return i;var s,l,d=n.validator,a=$4(n,["validator"]);if(pt(d)){var k=i.validator;k&&(k=(l=(s=k).__original)!==null&&l!==void 0?l:s),i.validator=Er(k?function(u){return k.call(this,u)&&d.call(this,u)}:d,i)}return Object.assign(i,a)}function On(e){return e.replace(/^(?!\s*$)/gm," ")}var cu=function(){return N2("any",{})},wu=function(){return N2("function",{type:Function})},Cu=function(){return N2("boolean",{type:Boolean})},gu=function(){return N2("string",{type:String})},vu=function(){return N2("number",{type:Number})},fu=function(){return N2("array",{type:Array})},mu=function(){return N2("object",{type:Object})},Mu=function(){return f2("integer",{type:Number,validator:function(e){return pu(e)}})},ju=function(){return f2("symbol",{validator:function(e){return typeof e=="symbol"}})};function xu(e,t){if(t===void 0&&(t="custom validation failed"),typeof e!="function")throw new TypeError("[VueTypes error]: You must provide a function as argument");return f2(e.name||"<>",{validator:function(n){var o=e(n);return o||C2(this._vueTypes_name+" - "+t),o}})}function Du(e){if(!ht(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");var t='oneOf - value should be one of "'+e.join('", "')+'".',n=e.reduce(function(o,r){if(r!=null){var i=r.constructor;o.indexOf(i)===-1&&o.push(i)}return o},[]);return f2("oneOf",{type:n.length>0?n:void 0,validator:function(o){var r=e.indexOf(o)!==-1;return r||C2(t),r}})}function Lu(e){if(!ht(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");for(var t=!1,n=[],o=0;o0&&n.some(function(d){return s.indexOf(d)===-1})){var l=n.filter(function(d){return s.indexOf(d)===-1});return C2(l.length===1?'shape - required property "'+l[0]+'" is not defined.':'shape - required properties "'+l.join('", "')+'" are not defined.'),!1}return s.every(function(d){if(t.indexOf(d)===-1)return i._vueTypes_isLoose===!0||(C2('shape - shape definition does not include a "'+d+'" property. Allowed keys: "'+t.join('", "')+'".'),!1);var a=ze(e[d],r[d]);return typeof a=="string"&&C2('shape - "'+d+`" property validation error: - `+On(a)),a===!0})}});return Object.defineProperty(o,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(o,"loose",{get:function(){return this._vueTypes_isLoose=!0,this}}),o}var A2=function(){function e(){}return e.extend=function(t){var n=this;if(ht(t))return t.forEach(function(u){return n.extend(u)}),this;var o=t.name,r=t.validate,i=r!==void 0&&r,s=t.getter,l=s!==void 0&&s,d=R4(t,["name","validate","getter"]);if(n9(this,o))throw new TypeError('[VueTypes error]: Type "'+o+'" already defined');var a,k=d.type;return rn(k)?(delete d.type,Object.defineProperty(this,o,l?{get:function(){return Ei(o,k,d)}}:{value:function(){var u,h=Ei(o,k,d);return h.validator&&(h.validator=(u=h.validator).bind.apply(u,[h].concat([].slice.call(arguments)))),h}})):(a=l?{get:function(){var u=Object.assign({},d);return i?F2(o,u):f2(o,u)},enumerable:!0}:{value:function(){var u,h,p=Object.assign({},d);return u=i?F2(o,p):f2(o,p),p.validator&&(u.validator=(h=p.validator).bind.apply(h,[u].concat([].slice.call(arguments)))),u},enumerable:!0},Object.defineProperty(this,o,a))},T4(e,null,[{key:"any",get:function(){return pu()}},{key:"func",get:function(){return cu().def(this.defaults.func)}},{key:"bool",get:function(){return wu().def(this.defaults.bool)}},{key:"string",get:function(){return Cu().def(this.defaults.string)}},{key:"number",get:function(){return gu().def(this.defaults.number)}},{key:"array",get:function(){return vu().def(this.defaults.array)}},{key:"object",get:function(){return fu().def(this.defaults.object)}},{key:"integer",get:function(){return mu().def(this.defaults.integer)}},{key:"symbol",get:function(){return Mu()}}]),e}();function U4(e){var t;return e===void 0&&(e={func:function(){},bool:!0,string:"",number:0,array:function(){return[]},object:function(){return{}},integer:0}),(t=function(n){function o(){return n.apply(this,arguments)||this}return I4(o,n),T4(o,null,[{key:"sensibleDefaults",get:function(){return S9({},this.defaults)},set:function(r){this.defaults=r!==!1?S9({},r!==!0?r:e):{}}}]),o}(A2)).defaults=S9({},e),t}A2.defaults={},A2.custom=ju,A2.oneOf=xu,A2.instanceOf=Hu,A2.oneOfType=Du,A2.arrayOf=Lu,A2.objectOf=Vu,A2.shape=yu,A2.utils={validate:function(e,t){return ze(t,e)===!0},toType:function(e,t,n){return n===void 0&&(n=!1),n?F2(e,t):f2(e,t)}};(function(e){function t(){return e.apply(this,arguments)||this}return I4(t,e),t})(U4());var o9=U4({func:void 0,bool:void 0,string:void 0,number:void 0,array:void 0,object:void 0,integer:void 0});o9.extend([{name:"looseBool",getter:!0,type:Boolean,default:void 0},{name:"style",getter:!0,type:[String,Object],default:void 0},{name:"VueNode",getter:!0,type:null}]);function Vw(e){return e.default=void 0,e}var bu=["image","description","imageStyle","class"],z4=b(P4,null,null),W4=b(A4,null,null),Ct=function(t,n){var o,r=n.slots,i=r===void 0?{}:r,s=n.attrs,l=Pn("empty",t),d=l.direction,a=l.prefixCls,k=a.value,u=u1(u1({},t),s),h=u.image,p=h===void 0?z4:h,C=u.description,v=C===void 0?((o=i.description)===null||o===void 0?void 0:o.call(i))||void 0:C,m=u.imageStyle,H=u.class,g=H===void 0?"":H,j=Br(u,bu);return b(O4,{componentName:"Empty",children:function(x){var D,y=typeof v<"u"?v:x.description,P=typeof y=="string"?y:"empty",L=null;return typeof p=="string"?L=b("img",{alt:P,src:p},null):L=p,b("div",u1({class:p9(k,g,(D={},U1(D,"".concat(k,"-normal"),p===W4),U1(D,"".concat(k,"-rtl"),d.value==="rtl"),D))},j),[b("div",{class:"".concat(k,"-image"),style:m},[L]),y&&b("p",{class:"".concat(k,"-description")},[y]),i.default&&b("div",{class:"".concat(k,"-footer")},[B4(i.default())])])}},null)};Ct.displayName="AEmpty";Ct.PRESENTED_IMAGE_DEFAULT=z4;Ct.PRESENTED_IMAGE_SIMPLE=W4;Ct.inheritAttrs=!1;Ct.props={prefixCls:String,image:o9.any,description:o9.any,imageStyle:{type:Object,default:void 0}};const Ht=S4(Ct);var Zu=function(t){var n=Pn("empty",t),o=n.prefixCls,r=function(s){switch(s){case"Table":case"List":return b(Ht,{image:Ht.PRESENTED_IMAGE_SIMPLE},null);case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return b(Ht,{image:Ht.PRESENTED_IMAGE_SIMPLE,class:"".concat(o.value,"-small")},null);default:return b(Ht,null,null)}};return r(t.componentName)};function G4(e){return b(Zu,{componentName:e},null)}var Oi={};function _u(e,t){}function Bu(e,t,n){!t&&!Oi[n]&&(Oi[n]=!0)}function K4(e,t){Bu(_u,e,t)}const Su=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";K4(e,"[antdv: ".concat(t,"] ").concat(n))};var Uo="internalMark",E9=b1({compatConfig:{MODE:3},name:"ALocaleProvider",props:{locale:{type:Object},ANT_MARK__:String},setup:function(t,n){var o=n.slots;Su(t.ANT_MARK__===Uo,"LocaleProvider","`LocaleProvider` is deprecated. Please use `locale` with `ConfigProvider` instead");var r=W1({antLocale:u1(u1({},t.locale),{},{exist:!0}),ANT_MARK__:Uo});return Me("localeData",r),S1(function(){return t.locale},function(){r.antLocale=u1(u1({},t.locale),{},{exist:!0})},{immediate:!0}),function(){var i;return(i=o.default)===null||i===void 0?void 0:i.call(o)}}});E9.install=function(e){return e.component(E9.name,E9),e};const Eu=S4(E9);iu("bottomLeft","bottomRight","topLeft","topRight");var yw=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=u1(t?{name:t,appear:!0,enterFromClass:"".concat(t,"-enter ").concat(t,"-enter-prepare"),enterActiveClass:"".concat(t,"-enter ").concat(t,"-enter-prepare"),enterToClass:"".concat(t,"-enter ").concat(t,"-enter-active"),leaveFromClass:" ".concat(t,"-leave"),leaveActiveClass:"".concat(t,"-leave ").concat(t,"-leave-active"),leaveToClass:"".concat(t,"-leave ").concat(t,"-leave-active")}:{css:!1},n);return o},Ou=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=u1(t?{name:t,appear:!0,appearActiveClass:"".concat(t),appearToClass:"".concat(t,"-appear ").concat(t,"-appear-active"),enterFromClass:"".concat(t,"-appear ").concat(t,"-enter ").concat(t,"-appear-prepare ").concat(t,"-enter-prepare"),enterActiveClass:"".concat(t),enterToClass:"".concat(t,"-enter ").concat(t,"-appear ").concat(t,"-appear-active ").concat(t,"-enter-active"),leaveActiveClass:"".concat(t," ").concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-active")}:{css:!1},n);return o};const Pu=b1({name:"Notice",inheritAttrs:!1,props:["prefixCls","duration","updateMark","noticeKey","closeIcon","closable","props","onClick","onClose","holder","visible"],setup:function(t,n){var o=n.attrs,r=n.slots,i,s=!1,l=F(function(){return t.duration===void 0?4.5:t.duration}),d=function(){l.value&&!s&&(i=setTimeout(function(){k()},l.value*1e3))},a=function(){i&&(clearTimeout(i),i=null)},k=function(p){p&&p.stopPropagation(),a();var C=t.onClose,v=t.noticeKey;C&&C(v)},u=function(){a(),d()};return q2(function(){d()}),Dn(function(){s=!0,a()}),S1([l,function(){return t.updateMark},function(){return t.visible}],function(h,p){var C=bi(h,3),v=C[0],m=C[1],H=C[2],g=bi(p,3),j=g[0],f=g[1],x=g[2];(v!==j||m!==f||H!==x&&x)&&u()},{flush:"post"}),function(){var h,p,C=t.prefixCls,v=t.closable,m=t.closeIcon,H=m===void 0?(h=r.closeIcon)===null||h===void 0?void 0:h.call(r):m,g=t.onClick,j=t.holder,f=o.class,x=o.style,D="".concat(C,"-notice"),y=Object.keys(o).reduce(function(L,A){return(A.substr(0,5)==="data-"||A.substr(0,5)==="aria-"||A==="role")&&(L[A]=o[A]),L},{}),P=b("div",u1({class:p9(D,f,U1({},"".concat(D,"-closable"),v)),style:x,onMouseenter:a,onMouseleave:d,onClick:g},y),[b("div",{class:"".concat(D,"-content")},[(p=r.default)===null||p===void 0?void 0:p.call(r)]),v?b("a",{tabindex:0,onClick:k,class:"".concat(D,"-close")},[H||b("span",{class:"".concat(D,"-close-x")},null)]):null]);return j?b(wt,{to:j},{default:function(){return P}}):P}}});var Au=["name","getContainer","appContext","prefixCls","rootPrefixCls","transitionName","hasTransitionName"],Pi=0,Tu=Date.now();function Ai(){var e=Pi;return Pi+=1,"rcNotification_".concat(Tu,"_").concat(e)}var sn=b1({name:"Notification",inheritAttrs:!1,props:["prefixCls","transitionName","animation","maxCount","closeIcon"],setup:function(t,n){var o=n.attrs,r=n.expose,i=n.slots,s=new Map,l=Q([]),d=F(function(){var u=t.prefixCls,h=t.animation,p=h===void 0?"fade":h,C=t.transitionName;return!C&&p&&(C="".concat(u,"-").concat(p)),Ou(C)}),a=function(h,p){var C=h.key||Ai(),v=u1(u1({},h),{},{key:C}),m=t.maxCount,H=l.value.map(function(j){return j.notice.key}).indexOf(C),g=l.value.concat();H!==-1?g.splice(H,1,{notice:v,holderCallback:p}):(m&&l.value.length>=m&&(v.key=g[0].notice.key,v.updateMark=Ai(),v.userPassKey=C,g.shift()),g.push({notice:v,holderCallback:p})),l.value=g},k=function(h){l.value=l.value.filter(function(p){var C=p.notice,v=C.key,m=C.userPassKey,H=m||v;return H!==h})};return r({add:a,remove:k,notices:l}),function(){var u,h,p=t.prefixCls,C=t.closeIcon,v=C===void 0?(u=i.closeIcon)===null||u===void 0?void 0:u.call(i,{prefixCls:p}):C,m=l.value.map(function(g,j){var f=g.notice,x=g.holderCallback,D=j===l.value.length-1?f.updateMark:void 0,y=f.key,P=f.userPassKey,L=f.content,A=u1(u1(u1({prefixCls:p,closeIcon:typeof v=="function"?v({prefixCls:p}):v},f),f.props),{},{key:y,noticeKey:P||y,updateMark:D,onClose:function(I){var J;k(I),(J=f.onClose)===null||J===void 0||J.call(f)},onClick:f.onClick});return x?b("div",{key:y,class:"".concat(p,"-hook-holder"),ref:function(I){typeof y>"u"||(I?(s.set(y,I),x(I,A)):s.delete(y))}},null):b(Pu,A,{default:function(){return[typeof L=="function"?L({prefixCls:p}):L]}})}),H=(h={},U1(h,p,1),U1(h,o.class,!!o.class),h);return b("div",{class:H,style:o.style||{top:"65px",left:"50%"}},[b(R5,u1({tag:"div"},d.value),{default:function(){return[m]}})])}}});sn.newInstance=function(t,n){var o=t||{},r=o.name,i=r===void 0?"notification":r,s=o.getContainer,l=o.appContext,d=o.prefixCls,a=o.rootPrefixCls,k=o.transitionName,u=o.hasTransitionName,h=Br(o,Au),p=document.createElement("div");if(s){var C=s();C.appendChild(p)}else document.body.appendChild(p);var v=b1({compatConfig:{MODE:3},name:"NotificationWrapper",setup:function(g,j){var f=j.attrs,x=Q();return q2(function(){n({notice:function(y){var P;(P=x.value)===null||P===void 0||P.add(y)},removeNotice:function(y){var P;(P=x.value)===null||P===void 0||P.remove(y)},destroy:function(){E0(null,p),p.parentNode&&p.parentNode.removeChild(p)},component:x})}),function(){var D=p2,y=D.getPrefixCls(i,d),P=D.getRootPrefixCls(a,y),L=u?k:"".concat(P,"-").concat(k);return b(qt,u1(u1({},D),{},{notUpdateGlobalConfig:!0,prefixCls:P}),{default:function(){return[b(sn,u1(u1({ref:x},f),{},{prefixCls:y,transitionName:L}),null)]}})}}}),m=b(v,h);m.appContext=l||m.appContext,E0(m,p)};var Iu={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};function X1(e,t){Ru(e)&&(e="100%");var n=$u(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function L9(e){return Math.min(1,Math.max(0,e))}function Ru(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function $u(e){return typeof e=="string"&&e.indexOf("%")!==-1}function Y4(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function H9(e){return e<=1?"".concat(Number(e)*100,"%"):e}function Ae(e){return e.length===1?"0"+e:String(e)}function Nu(e,t,n){return{r:X1(e,255)*255,g:X1(t,255)*255,b:X1(n,255)*255}}function Ti(e,t,n){e=X1(e,255),t=X1(t,255),n=X1(n,255);var o=Math.max(e,t,n),r=Math.min(e,t,n),i=0,s=0,l=(o+r)/2;if(o===r)s=0,i=0;else{var d=o-r;switch(s=l>.5?d/(2-o-r):d/(o+r),o){case e:i=(t-n)/d+(t1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Fu(e,t,n){var o,r,i;if(e=X1(e,360),t=X1(t,100),n=X1(n,100),t===0)r=n,i=n,o=n;else{var s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;o=no(l,s,e+1/3),r=no(l,s,e),i=no(l,s,e-1/3)}return{r:o*255,g:r*255,b:i*255}}function zo(e,t,n){e=X1(e,255),t=X1(t,255),n=X1(n,255);var o=Math.max(e,t,n),r=Math.min(e,t,n),i=0,s=o,l=o-r,d=o===0?0:l/o;if(o===r)i=0;else{switch(o){case e:i=(t-n)/l+(t>16,g:(e&65280)>>8,b:e&255}}var Go={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Xe(e){var t={r:0,g:0,b:0},n=1,o=null,r=null,i=null,s=!1,l=!1;return typeof e=="string"&&(e=Yu(e)),typeof e=="object"&&(G2(e.r)&&G2(e.g)&&G2(e.b)?(t=Nu(e.r,e.g,e.b),s=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):G2(e.h)&&G2(e.s)&&G2(e.v)?(o=H9(e.s),r=H9(e.v),t=qu(e.h,o,r),s=!0,l="hsv"):G2(e.h)&&G2(e.s)&&G2(e.l)&&(o=H9(e.s),i=H9(e.l),t=Fu(e.h,o,i),s=!0,l="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=Y4(n),{ok:s,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var Gu="[-\\+]?\\d+%?",Ku="[-\\+]?\\d*\\.\\d+%?",fe="(?:".concat(Ku,")|(?:").concat(Gu,")"),oo="[\\s|\\(]+(".concat(fe,")[,|\\s]+(").concat(fe,")[,|\\s]+(").concat(fe,")\\s*\\)?"),ro="[\\s|\\(]+(".concat(fe,")[,|\\s]+(").concat(fe,")[,|\\s]+(").concat(fe,")[,|\\s]+(").concat(fe,")\\s*\\)?"),D2={CSS_UNIT:new RegExp(fe),rgb:new RegExp("rgb"+oo),rgba:new RegExp("rgba"+ro),hsl:new RegExp("hsl"+oo),hsla:new RegExp("hsla"+ro),hsv:new RegExp("hsv"+oo),hsva:new RegExp("hsva"+ro),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Yu(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(Go[e])e=Go[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=D2.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=D2.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=D2.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=D2.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=D2.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=D2.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=D2.hex8.exec(e),n?{r:h2(n[1]),g:h2(n[2]),b:h2(n[3]),a:Ii(n[4]),format:t?"name":"hex8"}:(n=D2.hex6.exec(e),n?{r:h2(n[1]),g:h2(n[2]),b:h2(n[3]),format:t?"name":"hex"}:(n=D2.hex4.exec(e),n?{r:h2(n[1]+n[1]),g:h2(n[2]+n[2]),b:h2(n[3]+n[3]),a:Ii(n[4]+n[4]),format:t?"name":"hex8"}:(n=D2.hex3.exec(e),n?{r:h2(n[1]+n[1]),g:h2(n[2]+n[2]),b:h2(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function G2(e){return!!D2.CSS_UNIT.exec(String(e))}var io=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var o;if(t instanceof e)return t;typeof t=="number"&&(t=Wu(t)),this.originalInput=t;var r=Xe(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(o=n.format)!==null&&o!==void 0?o:r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,o,r,i=t.r/255,s=t.g/255,l=t.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),s<=.03928?o=s/12.92:o=Math.pow((s+.055)/1.055,2.4),l<=.03928?r=l/12.92:r=Math.pow((l+.055)/1.055,2.4),.2126*n+.7152*o+.0722*r},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=Y4(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=zo(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=zo(this.r,this.g,this.b),n=Math.round(t.h*360),o=Math.round(t.s*100),r=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(o,"%, ").concat(r,"%)"):"hsva(".concat(n,", ").concat(o,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=Ti(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=Ti(this.r,this.g,this.b),n=Math.round(t.h*360),o=Math.round(t.s*100),r=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(o,"%, ").concat(r,"%)"):"hsla(".concat(n,", ").concat(o,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),Wo(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),Uu(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),o=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(o,")"):"rgba(".concat(t,", ").concat(n,", ").concat(o,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(X1(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(X1(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+Wo(this.r,this.g,this.b,!1),n=0,o=Object.entries(Go);n=0,i=!n&&r&&(t.startsWith("hex")||t==="name");return i?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(o=this.toRgbString()),t==="prgb"&&(o=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(o=this.toHexString()),t==="hex3"&&(o=this.toHexString(!0)),t==="hex4"&&(o=this.toHex8String(!0)),t==="hex8"&&(o=this.toHex8String()),t==="name"&&(o=this.toName()),t==="hsl"&&(o=this.toHslString()),t==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=L9(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=L9(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=L9(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=L9(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),o=(n.h+t)%360;return n.h=o<0?360+o:o,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var o=this.toRgb(),r=new e(t).toRgb(),i=n/100,s={r:(r.r-o.r)*i+o.r,g:(r.g-o.g)*i+o.g,b:(r.b-o.b)*i+o.b,a:(r.a-o.a)*i+o.a};return new e(s)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var o=this.toHsl(),r=360/n,i=[this];for(o.h=(o.h-(r*t>>1)+720)%360;--t;)o.h=(o.h+r)%360,i.push(new e(o));return i},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),o=n.h,r=n.s,i=n.v,s=[],l=1/t;t--;)s.push(new e({h:o,s:r,v:i})),i=(i+l)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),o=new e(t).toRgb(),r=n.a+o.a*(1-n.a);return new e({r:(n.r*n.a+o.r*o.a*(1-n.a))/r,g:(n.g*n.a+o.g*o.a*(1-n.a))/r,b:(n.b*n.a+o.b*o.a*(1-n.a))/r,a:r})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),o=n.h,r=[this],i=360/t,s=1;s=60&&Math.round(e.h)<=240?o=n?Math.round(e.h)-V9*t:Math.round(e.h)+V9*t:o=n?Math.round(e.h)+V9*t:Math.round(e.h)-V9*t,o<0?o+=360:o>=360&&(o-=360),o}function Fi(e,t,n){if(e.h===0&&e.s===0)return e.s;var o;return n?o=e.s-Ri*t:t===X4?o=e.s+Ri:o=e.s+Qu*t,o>1&&(o=1),n&&t===Q4&&o>.1&&(o=.1),o<.06&&(o=.06),Number(o.toFixed(2))}function qi(e,t,n){var o;return n?o=e.v+Xu*t:o=e.v-Ju*t,o>1&&(o=1),Number(o.toFixed(2))}function r9(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],o=Xe(e),r=Q4;r>0;r-=1){var i=$i(o),s=y9(Xe({h:Ni(i,r,!0),s:Fi(i,r,!0),v:qi(i,r,!0)}));n.push(s)}n.push(y9(o));for(var l=1;l<=X4;l+=1){var d=$i(o),a=y9(Xe({h:Ni(d,l),s:Fi(d,l),v:qi(d,l)}));n.push(a)}return t.theme==="dark"?eh.map(function(k){var u=k.index,h=k.opacity,p=y9(th(Xe(t.backgroundColor||"#141414"),Xe(n[u]),h*100));return p}):n}var so={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},lo={},ao={};Object.keys(so).forEach(function(e){lo[e]=r9(so[e]),lo[e].primary=lo[e][5],ao[e]=r9(so[e],{theme:"dark",backgroundColor:"#141414"}),ao[e].primary=ao[e][5]});var Ui=[],Vt=[],nh="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function oh(){var e=document.createElement("style");return e.setAttribute("type","text/css"),e}function rh(e,t){if(t=t||{},e===void 0)throw new Error(nh);var n=t.prepend===!0?"prepend":"append",o=t.container!==void 0?t.container:document.querySelector("head"),r=Ui.indexOf(o);r===-1&&(r=Ui.push(o)-1,Vt[r]={});var i;return Vt[r]!==void 0&&Vt[r][n]!==void 0?i=Vt[r][n]:(i=Vt[r][n]=oh(),n==="prepend"?o.insertBefore(i,o.childNodes[0]):o.appendChild(i)),e.charCodeAt(0)===65279&&(e=e.substr(1,e.length)),i.styleSheet?i.styleSheet.cssText+=e:i.textContent+=e,i}function zi(e){for(var t=1;t0&&n.some(function(d){return s.indexOf(d)===-1})){var l=n.filter(function(d){return s.indexOf(d)===-1});return C2(l.length===1?'shape - required property "'+l[0]+'" is not defined.':'shape - required properties "'+l.join('", "')+'" are not defined.'),!1}return s.every(function(d){if(t.indexOf(d)===-1)return i._vueTypes_isLoose===!0||(C2('shape - shape definition does not include a "'+d+'" property. Allowed keys: "'+t.join('", "')+'".'),!1);var a=ze(e[d],r[d]);return typeof a=="string"&&C2('shape - "'+d+`" property validation error: + `+On(a)),a===!0})}});return Object.defineProperty(o,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(o,"loose",{get:function(){return this._vueTypes_isLoose=!0,this}}),o}var P2=function(){function e(){}return e.extend=function(t){var n=this;if(ht(t))return t.forEach(function(u){return n.extend(u)}),this;var o=t.name,r=t.validate,i=r!==void 0&&r,s=t.getter,l=s!==void 0&&s,d=$4(t,["name","validate","getter"]);if(n9(this,o))throw new TypeError('[VueTypes error]: Type "'+o+'" already defined');var a,k=d.type;return rn(k)?(delete d.type,Object.defineProperty(this,o,l?{get:function(){return Si(o,k,d)}}:{value:function(){var u,h=Si(o,k,d);return h.validator&&(h.validator=(u=h.validator).bind.apply(u,[h].concat([].slice.call(arguments)))),h}})):(a=l?{get:function(){var u=Object.assign({},d);return i?N2(o,u):f2(o,u)},enumerable:!0}:{value:function(){var u,h,p=Object.assign({},d);return u=i?N2(o,p):f2(o,p),p.validator&&(u.validator=(h=p.validator).bind.apply(h,[u].concat([].slice.call(arguments)))),u},enumerable:!0},Object.defineProperty(this,o,a))},I4(e,null,[{key:"any",get:function(){return cu()}},{key:"func",get:function(){return wu().def(this.defaults.func)}},{key:"bool",get:function(){return Cu().def(this.defaults.bool)}},{key:"string",get:function(){return gu().def(this.defaults.string)}},{key:"number",get:function(){return vu().def(this.defaults.number)}},{key:"array",get:function(){return fu().def(this.defaults.array)}},{key:"object",get:function(){return mu().def(this.defaults.object)}},{key:"integer",get:function(){return Mu().def(this.defaults.integer)}},{key:"symbol",get:function(){return ju()}}]),e}();function z4(e){var t;return e===void 0&&(e={func:function(){},bool:!0,string:"",number:0,array:function(){return[]},object:function(){return{}},integer:0}),(t=function(n){function o(){return n.apply(this,arguments)||this}return R4(o,n),I4(o,null,[{key:"sensibleDefaults",get:function(){return E9({},this.defaults)},set:function(r){this.defaults=r!==!1?E9({},r!==!0?r:e):{}}}]),o}(P2)).defaults=E9({},e),t}P2.defaults={},P2.custom=xu,P2.oneOf=Du,P2.instanceOf=Vu,P2.oneOfType=Lu,P2.arrayOf=Hu,P2.objectOf=yu,P2.shape=bu,P2.utils={validate:function(e,t){return ze(t,e)===!0},toType:function(e,t,n){return n===void 0&&(n=!1),n?N2(e,t):f2(e,t)}};(function(e){function t(){return e.apply(this,arguments)||this}return R4(t,e),t})(z4());var o9=z4({func:void 0,bool:void 0,string:void 0,number:void 0,array:void 0,object:void 0,integer:void 0});o9.extend([{name:"looseBool",getter:!0,type:Boolean,default:void 0},{name:"style",getter:!0,type:[String,Object],default:void 0},{name:"VueNode",getter:!0,type:null}]);function yw(e){return e.default=void 0,e}var Zu=["image","description","imageStyle","class"],W4=b(P4,null,null),G4=b(T4,null,null),Ct=function(t,n){var o,r=n.slots,i=r===void 0?{}:r,s=n.attrs,l=An("empty",t),d=l.direction,a=l.prefixCls,k=a.value,u=u1(u1({},t),s),h=u.image,p=h===void 0?W4:h,C=u.description,v=C===void 0?((o=i.description)===null||o===void 0?void 0:o.call(i))||void 0:C,m=u.imageStyle,H=u.class,g=H===void 0?"":H,j=Br(u,Zu);return b(A4,{componentName:"Empty",children:function(x){var D,y=typeof v<"u"?v:x.description,A=typeof y=="string"?y:"empty",L=null;return typeof p=="string"?L=b("img",{alt:A,src:p},null):L=p,b("div",u1({class:p9(k,g,(D={},U1(D,"".concat(k,"-normal"),p===G4),U1(D,"".concat(k,"-rtl"),d.value==="rtl"),D))},j),[b("div",{class:"".concat(k,"-image"),style:m},[L]),y&&b("p",{class:"".concat(k,"-description")},[y]),i.default&&b("div",{class:"".concat(k,"-footer")},[E4(i.default())])])}},null)};Ct.displayName="AEmpty";Ct.PRESENTED_IMAGE_DEFAULT=W4;Ct.PRESENTED_IMAGE_SIMPLE=G4;Ct.inheritAttrs=!1;Ct.props={prefixCls:String,image:o9.any,description:o9.any,imageStyle:{type:Object,default:void 0}};const Ht=S4(Ct);var _u=function(t){var n=An("empty",t),o=n.prefixCls,r=function(s){switch(s){case"Table":case"List":return b(Ht,{image:Ht.PRESENTED_IMAGE_SIMPLE},null);case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return b(Ht,{image:Ht.PRESENTED_IMAGE_SIMPLE,class:"".concat(o.value,"-small")},null);default:return b(Ht,null,null)}};return r(t.componentName)};function K4(e){return b(_u,{componentName:e},null)}var Oi={};function Bu(e,t){}function Eu(e,t,n){!t&&!Oi[n]&&(Oi[n]=!0)}function Y4(e,t){Eu(Bu,e,t)}const Su=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";Y4(e,"[antdv: ".concat(t,"] ").concat(n))};var Uo="internalMark",S9=b1({compatConfig:{MODE:3},name:"ALocaleProvider",props:{locale:{type:Object},ANT_MARK__:String},setup:function(t,n){var o=n.slots;Su(t.ANT_MARK__===Uo,"LocaleProvider","`LocaleProvider` is deprecated. Please use `locale` with `ConfigProvider` instead");var r=W1({antLocale:u1(u1({},t.locale),{},{exist:!0}),ANT_MARK__:Uo});return Me("localeData",r),E1(function(){return t.locale},function(){r.antLocale=u1(u1({},t.locale),{},{exist:!0})},{immediate:!0}),function(){var i;return(i=o.default)===null||i===void 0?void 0:i.call(o)}}});S9.install=function(e){return e.component(S9.name,S9),e};const Ou=S4(S9);su("bottomLeft","bottomRight","topLeft","topRight");var bw=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=u1(t?{name:t,appear:!0,enterFromClass:"".concat(t,"-enter ").concat(t,"-enter-prepare"),enterActiveClass:"".concat(t,"-enter ").concat(t,"-enter-prepare"),enterToClass:"".concat(t,"-enter ").concat(t,"-enter-active"),leaveFromClass:" ".concat(t,"-leave"),leaveActiveClass:"".concat(t,"-leave ").concat(t,"-leave-active"),leaveToClass:"".concat(t,"-leave ").concat(t,"-leave-active")}:{css:!1},n);return o},Au=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=u1(t?{name:t,appear:!0,appearActiveClass:"".concat(t),appearToClass:"".concat(t,"-appear ").concat(t,"-appear-active"),enterFromClass:"".concat(t,"-appear ").concat(t,"-enter ").concat(t,"-appear-prepare ").concat(t,"-enter-prepare"),enterActiveClass:"".concat(t),enterToClass:"".concat(t,"-enter ").concat(t,"-appear ").concat(t,"-appear-active ").concat(t,"-enter-active"),leaveActiveClass:"".concat(t," ").concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-active")}:{css:!1},n);return o};const Pu=b1({name:"Notice",inheritAttrs:!1,props:["prefixCls","duration","updateMark","noticeKey","closeIcon","closable","props","onClick","onClose","holder","visible"],setup:function(t,n){var o=n.attrs,r=n.slots,i,s=!1,l=N(function(){return t.duration===void 0?4.5:t.duration}),d=function(){l.value&&!s&&(i=setTimeout(function(){k()},l.value*1e3))},a=function(){i&&(clearTimeout(i),i=null)},k=function(p){p&&p.stopPropagation(),a();var C=t.onClose,v=t.noticeKey;C&&C(v)},u=function(){a(),d()};return q2(function(){d()}),Dn(function(){s=!0,a()}),E1([l,function(){return t.updateMark},function(){return t.visible}],function(h,p){var C=bi(h,3),v=C[0],m=C[1],H=C[2],g=bi(p,3),j=g[0],f=g[1],x=g[2];(v!==j||m!==f||H!==x&&x)&&u()},{flush:"post"}),function(){var h,p,C=t.prefixCls,v=t.closable,m=t.closeIcon,H=m===void 0?(h=r.closeIcon)===null||h===void 0?void 0:h.call(r):m,g=t.onClick,j=t.holder,f=o.class,x=o.style,D="".concat(C,"-notice"),y=Object.keys(o).reduce(function(L,P){return(P.substr(0,5)==="data-"||P.substr(0,5)==="aria-"||P==="role")&&(L[P]=o[P]),L},{}),A=b("div",u1({class:p9(D,f,U1({},"".concat(D,"-closable"),v)),style:x,onMouseenter:a,onMouseleave:d,onClick:g},y),[b("div",{class:"".concat(D,"-content")},[(p=r.default)===null||p===void 0?void 0:p.call(r)]),v?b("a",{tabindex:0,onClick:k,class:"".concat(D,"-close")},[H||b("span",{class:"".concat(D,"-close-x")},null)]):null]);return j?b(wt,{to:j},{default:function(){return A}}):A}}});var Tu=["name","getContainer","appContext","prefixCls","rootPrefixCls","transitionName","hasTransitionName"],Ai=0,Iu=Date.now();function Pi(){var e=Ai;return Ai+=1,"rcNotification_".concat(Iu,"_").concat(e)}var sn=b1({name:"Notification",inheritAttrs:!1,props:["prefixCls","transitionName","animation","maxCount","closeIcon"],setup:function(t,n){var o=n.attrs,r=n.expose,i=n.slots,s=new Map,l=Q([]),d=N(function(){var u=t.prefixCls,h=t.animation,p=h===void 0?"fade":h,C=t.transitionName;return!C&&p&&(C="".concat(u,"-").concat(p)),Au(C)}),a=function(h,p){var C=h.key||Pi(),v=u1(u1({},h),{},{key:C}),m=t.maxCount,H=l.value.map(function(j){return j.notice.key}).indexOf(C),g=l.value.concat();H!==-1?g.splice(H,1,{notice:v,holderCallback:p}):(m&&l.value.length>=m&&(v.key=g[0].notice.key,v.updateMark=Pi(),v.userPassKey=C,g.shift()),g.push({notice:v,holderCallback:p})),l.value=g},k=function(h){l.value=l.value.filter(function(p){var C=p.notice,v=C.key,m=C.userPassKey,H=m||v;return H!==h})};return r({add:a,remove:k,notices:l}),function(){var u,h,p=t.prefixCls,C=t.closeIcon,v=C===void 0?(u=i.closeIcon)===null||u===void 0?void 0:u.call(i,{prefixCls:p}):C,m=l.value.map(function(g,j){var f=g.notice,x=g.holderCallback,D=j===l.value.length-1?f.updateMark:void 0,y=f.key,A=f.userPassKey,L=f.content,P=u1(u1(u1({prefixCls:p,closeIcon:typeof v=="function"?v({prefixCls:p}):v},f),f.props),{},{key:y,noticeKey:A||y,updateMark:D,onClose:function(I){var J;k(I),(J=f.onClose)===null||J===void 0||J.call(f)},onClick:f.onClick});return x?b("div",{key:y,class:"".concat(p,"-hook-holder"),ref:function(I){typeof y>"u"||(I?(s.set(y,I),x(I,P)):s.delete(y))}},null):b(Pu,P,{default:function(){return[typeof L=="function"?L({prefixCls:p}):L]}})}),H=(h={},U1(h,p,1),U1(h,o.class,!!o.class),h);return b("div",{class:H,style:o.style||{top:"65px",left:"50%"}},[b(R5,u1({tag:"div"},d.value),{default:function(){return[m]}})])}}});sn.newInstance=function(t,n){var o=t||{},r=o.name,i=r===void 0?"notification":r,s=o.getContainer,l=o.appContext,d=o.prefixCls,a=o.rootPrefixCls,k=o.transitionName,u=o.hasTransitionName,h=Br(o,Tu),p=document.createElement("div");if(s){var C=s();C.appendChild(p)}else document.body.appendChild(p);var v=b1({compatConfig:{MODE:3},name:"NotificationWrapper",setup:function(g,j){var f=j.attrs,x=Q();return q2(function(){n({notice:function(y){var A;(A=x.value)===null||A===void 0||A.add(y)},removeNotice:function(y){var A;(A=x.value)===null||A===void 0||A.remove(y)},destroy:function(){S0(null,p),p.parentNode&&p.parentNode.removeChild(p)},component:x})}),function(){var D=p2,y=D.getPrefixCls(i,d),A=D.getRootPrefixCls(a,y),L=u?k:"".concat(A,"-").concat(k);return b(qt,u1(u1({},D),{},{notUpdateGlobalConfig:!0,prefixCls:A}),{default:function(){return[b(sn,u1(u1({ref:x},f),{},{prefixCls:y,transitionName:L}),null)]}})}}}),m=b(v,h);m.appContext=l||m.appContext,S0(m,p)};var Ru={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};function X1(e,t){$u(e)&&(e="100%");var n=Fu(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function L9(e){return Math.min(1,Math.max(0,e))}function $u(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Fu(e){return typeof e=="string"&&e.indexOf("%")!==-1}function Q4(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function H9(e){return e<=1?"".concat(Number(e)*100,"%"):e}function Pe(e){return e.length===1?"0"+e:String(e)}function Nu(e,t,n){return{r:X1(e,255)*255,g:X1(t,255)*255,b:X1(n,255)*255}}function Ti(e,t,n){e=X1(e,255),t=X1(t,255),n=X1(n,255);var o=Math.max(e,t,n),r=Math.min(e,t,n),i=0,s=0,l=(o+r)/2;if(o===r)s=0,i=0;else{var d=o-r;switch(s=l>.5?d/(2-o-r):d/(o+r),o){case e:i=(t-n)/d+(t1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function qu(e,t,n){var o,r,i;if(e=X1(e,360),t=X1(t,100),n=X1(n,100),t===0)r=n,i=n,o=n;else{var s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;o=no(l,s,e+1/3),r=no(l,s,e),i=no(l,s,e-1/3)}return{r:o*255,g:r*255,b:i*255}}function zo(e,t,n){e=X1(e,255),t=X1(t,255),n=X1(n,255);var o=Math.max(e,t,n),r=Math.min(e,t,n),i=0,s=o,l=o-r,d=o===0?0:l/o;if(o===r)i=0;else{switch(o){case e:i=(t-n)/l+(t>16,g:(e&65280)>>8,b:e&255}}var Go={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Xe(e){var t={r:0,g:0,b:0},n=1,o=null,r=null,i=null,s=!1,l=!1;return typeof e=="string"&&(e=Qu(e)),typeof e=="object"&&(G2(e.r)&&G2(e.g)&&G2(e.b)?(t=Nu(e.r,e.g,e.b),s=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):G2(e.h)&&G2(e.s)&&G2(e.v)?(o=H9(e.s),r=H9(e.v),t=Uu(e.h,o,r),s=!0,l="hsv"):G2(e.h)&&G2(e.s)&&G2(e.l)&&(o=H9(e.s),i=H9(e.l),t=qu(e.h,o,i),s=!0,l="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=Q4(n),{ok:s,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var Ku="[-\\+]?\\d+%?",Yu="[-\\+]?\\d*\\.\\d+%?",fe="(?:".concat(Yu,")|(?:").concat(Ku,")"),oo="[\\s|\\(]+(".concat(fe,")[,|\\s]+(").concat(fe,")[,|\\s]+(").concat(fe,")\\s*\\)?"),ro="[\\s|\\(]+(".concat(fe,")[,|\\s]+(").concat(fe,")[,|\\s]+(").concat(fe,")[,|\\s]+(").concat(fe,")\\s*\\)?"),D2={CSS_UNIT:new RegExp(fe),rgb:new RegExp("rgb"+oo),rgba:new RegExp("rgba"+ro),hsl:new RegExp("hsl"+oo),hsla:new RegExp("hsla"+ro),hsv:new RegExp("hsv"+oo),hsva:new RegExp("hsva"+ro),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Qu(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(Go[e])e=Go[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=D2.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=D2.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=D2.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=D2.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=D2.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=D2.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=D2.hex8.exec(e),n?{r:h2(n[1]),g:h2(n[2]),b:h2(n[3]),a:Ii(n[4]),format:t?"name":"hex8"}:(n=D2.hex6.exec(e),n?{r:h2(n[1]),g:h2(n[2]),b:h2(n[3]),format:t?"name":"hex"}:(n=D2.hex4.exec(e),n?{r:h2(n[1]+n[1]),g:h2(n[2]+n[2]),b:h2(n[3]+n[3]),a:Ii(n[4]+n[4]),format:t?"name":"hex8"}:(n=D2.hex3.exec(e),n?{r:h2(n[1]+n[1]),g:h2(n[2]+n[2]),b:h2(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function G2(e){return!!D2.CSS_UNIT.exec(String(e))}var io=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var o;if(t instanceof e)return t;typeof t=="number"&&(t=Gu(t)),this.originalInput=t;var r=Xe(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(o=n.format)!==null&&o!==void 0?o:r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,o,r,i=t.r/255,s=t.g/255,l=t.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),s<=.03928?o=s/12.92:o=Math.pow((s+.055)/1.055,2.4),l<=.03928?r=l/12.92:r=Math.pow((l+.055)/1.055,2.4),.2126*n+.7152*o+.0722*r},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=Q4(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=zo(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=zo(this.r,this.g,this.b),n=Math.round(t.h*360),o=Math.round(t.s*100),r=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(o,"%, ").concat(r,"%)"):"hsva(".concat(n,", ").concat(o,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=Ti(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=Ti(this.r,this.g,this.b),n=Math.round(t.h*360),o=Math.round(t.s*100),r=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(o,"%, ").concat(r,"%)"):"hsla(".concat(n,", ").concat(o,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),Wo(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),zu(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),o=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(o,")"):"rgba(".concat(t,", ").concat(n,", ").concat(o,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(X1(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(X1(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+Wo(this.r,this.g,this.b,!1),n=0,o=Object.entries(Go);n=0,i=!n&&r&&(t.startsWith("hex")||t==="name");return i?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(o=this.toRgbString()),t==="prgb"&&(o=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(o=this.toHexString()),t==="hex3"&&(o=this.toHexString(!0)),t==="hex4"&&(o=this.toHex8String(!0)),t==="hex8"&&(o=this.toHex8String()),t==="name"&&(o=this.toName()),t==="hsl"&&(o=this.toHslString()),t==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=L9(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=L9(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=L9(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=L9(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),o=(n.h+t)%360;return n.h=o<0?360+o:o,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var o=this.toRgb(),r=new e(t).toRgb(),i=n/100,s={r:(r.r-o.r)*i+o.r,g:(r.g-o.g)*i+o.g,b:(r.b-o.b)*i+o.b,a:(r.a-o.a)*i+o.a};return new e(s)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var o=this.toHsl(),r=360/n,i=[this];for(o.h=(o.h-(r*t>>1)+720)%360;--t;)o.h=(o.h+r)%360,i.push(new e(o));return i},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),o=n.h,r=n.s,i=n.v,s=[],l=1/t;t--;)s.push(new e({h:o,s:r,v:i})),i=(i+l)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),o=new e(t).toRgb(),r=n.a+o.a*(1-n.a);return new e({r:(n.r*n.a+o.r*o.a*(1-n.a))/r,g:(n.g*n.a+o.g*o.a*(1-n.a))/r,b:(n.b*n.a+o.b*o.a*(1-n.a))/r,a:r})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),o=n.h,r=[this],i=360/t,s=1;s=60&&Math.round(e.h)<=240?o=n?Math.round(e.h)-V9*t:Math.round(e.h)+V9*t:o=n?Math.round(e.h)+V9*t:Math.round(e.h)-V9*t,o<0?o+=360:o>=360&&(o-=360),o}function Ni(e,t,n){if(e.h===0&&e.s===0)return e.s;var o;return n?o=e.s-Ri*t:t===J4?o=e.s+Ri:o=e.s+Xu*t,o>1&&(o=1),n&&t===X4&&o>.1&&(o=.1),o<.06&&(o=.06),Number(o.toFixed(2))}function qi(e,t,n){var o;return n?o=e.v+Ju*t:o=e.v-eh*t,o>1&&(o=1),Number(o.toFixed(2))}function r9(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],o=Xe(e),r=X4;r>0;r-=1){var i=$i(o),s=y9(Xe({h:Fi(i,r,!0),s:Ni(i,r,!0),v:qi(i,r,!0)}));n.push(s)}n.push(y9(o));for(var l=1;l<=J4;l+=1){var d=$i(o),a=y9(Xe({h:Fi(d,l),s:Ni(d,l),v:qi(d,l)}));n.push(a)}return t.theme==="dark"?th.map(function(k){var u=k.index,h=k.opacity,p=y9(nh(Xe(t.backgroundColor||"#141414"),Xe(n[u]),h*100));return p}):n}var so={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},lo={},ao={};Object.keys(so).forEach(function(e){lo[e]=r9(so[e]),lo[e].primary=lo[e][5],ao[e]=r9(so[e],{theme:"dark",backgroundColor:"#141414"}),ao[e].primary=ao[e][5]});var Ui=[],Vt=[],oh="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function rh(){var e=document.createElement("style");return e.setAttribute("type","text/css"),e}function ih(e,t){if(t=t||{},e===void 0)throw new Error(oh);var n=t.prepend===!0?"prepend":"append",o=t.container!==void 0?t.container:document.querySelector("head"),r=Ui.indexOf(o);r===-1&&(r=Ui.push(o)-1,Vt[r]={});var i;return Vt[r]!==void 0&&Vt[r][n]!==void 0?i=Vt[r][n]:(i=Vt[r][n]=rh(),n==="prepend"?o.insertBefore(i,o.childNodes[0]):o.appendChild(i)),e.charCodeAt(0)===65279&&(e=e.substr(1,e.length)),i.styleSheet?i.styleSheet.cssText+=e:i.textContent+=e,i}function zi(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:sh;v2(function(){Gi||(typeof window<"u"&&window.document&&window.document.documentElement&&rh(t,{prepend:!0}),Gi=!0)})},dh=["icon","primaryColor","secondaryColor"];function ah(e,t){if(e==null)return{};var n=kh(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function kh(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i=0)&&(n[r]=e[r]);return n}function O9(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,o=new Array(t);ne.length)&&(t=e.length);for(var n=0,o=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function Vh(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i=0)&&(n[r]=e[r]);return n}tl("#1890ff");var l2=function(t,n){var o,r=Qi({},t,n.attrs),i=r.class,s=r.icon,l=r.spin,d=r.rotate,a=r.tabindex,k=r.twoToneColor,u=r.onClick,h=Hh(r,mh),p=(o={anticon:!0},Yo(o,"anticon-".concat(s.name),!!s.name),Yo(o,i,i),o),C=l===""||l||s.name==="loading"?"anticon-spin":"",v=a;v===void 0&&u&&(v=-1,h.tabindex=v);var m=d?{msTransform:"rotate(".concat(d,"deg)"),transform:"rotate(".concat(d,"deg)")}:void 0,H=el(k),g=Mh(H,2),j=g[0],f=g[1];return b("span",Qi({role:"img","aria-label":s.name},h,{onClick:u,class:p}),[b(Ve,{class:C,icon:s,primaryColor:j,secondaryColor:f,style:m},null)])};l2.props={spin:Boolean,rotate:Number,icon:Object,twoToneColor:String};l2.displayName="AntdIcon";l2.inheritAttrs=!1;l2.getTwoToneColor=fh;l2.setTwoToneColor=tl;function Xi(e){for(var t=1;t3?(C1=Z1===n1)&&(U=p1[(A=p1[4])?5:(A=3,3)],p1[4]=p1[5]=o):p1[0]<=E1&&((C1=Y<2&&E1n1||n1>Z1)&&(p1[4]=Y,p1[5]=n1,h1.n=Z1,A=0))}if(C1||Y>1)return a;throw l1=!0,n1}return function(Y,n1,C1){if(I>1)throw TypeError("Generator is already running");for(l1&&n1===1&&k1(n1,C1),A=n1,U=C1;(r=A<2?o:U)||!l1;){L||(A?A<3?(A>1&&(h1.n=-1),k1(A,U)):h1.n=U:h1.v=U);try{if(I=2,L){if(A||(Y="next"),r=L[Y]){if(!(r=r.call(L,U)))throw TypeError("iterator result is not an object");if(!r.done)return r;U=r.value,A<2&&(A=0)}else A===1&&(r=L.return)&&r.call(L),A<2&&(U=TypeError("The iterator does not provide a '"+Y+"' method"),A=1);L=o}else if((r=(l1=h1.n<0)?U:D.call(y,h1))!==a)break}catch(p1){L=o,A=1,U=p1}finally{I=1}}return{value:r,done:l1}}}(m,g,j),!0),x}var a={};function k(){}function u(){}function h(){}r=Object.getPrototypeOf;var p=[][s]?r(r([][s]())):(t(r={},s,function(){return this}),r),C=h.prototype=k.prototype=Object.create(p);function v(m){return Object.setPrototypeOf?Object.setPrototypeOf(m,h):(m.__proto__=h,t(m,l,"GeneratorFunction")),m.prototype=Object.create(C),m}return u.prototype=h,t(C,"constructor",h),t(h,"constructor",u),u.displayName="GeneratorFunction",t(h,l,"GeneratorFunction"),t(C),t(C,l,"Generator"),t(C,s,function(){return this}),t(C,"toString",function(){return"[object Generator]"}),(e.exports=n=function(){return{w:d,m:v}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(pl);var Cl=pl.exports,gl={exports:{}},vl={exports:{}},fl={exports:{}};(function(e){var t=hl,n=wl;function o(r,i){function s(d,a,k,u){try{var h=r[d](a),p=h.value;return p instanceof t?i.resolve(p.v).then(function(C){s("next",C,k,u)},function(C){s("throw",C,k,u)}):i.resolve(p).then(function(C){h.value=C,k(h)},function(C){return s("throw",C,k,u)})}catch(C){u(C)}}var l;this.next||(n(o.prototype),n(o.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(d,a,k){function u(){return new i(function(h,p){s(d,k,h,p)})}return l=l?l.then(u,u):u()},!0)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports})(fl);var ml=fl.exports;(function(e){var t=Cl,n=ml;function o(r,i,s,l,d){return new n(t().w(r,i,s,l),d||Promise)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports})(vl);var Ml=vl.exports;(function(e){var t=Ml;function n(o,r,i,s,l){var d=t(o,r,i,s,l);return d.next().then(function(a){return a.done?a.value:d.next()})}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(gl);var zh=gl.exports,jl={exports:{}};(function(e){function t(n){var o=Object(n),r=[];for(var i in o)r.unshift(i);return function s(){for(;r.length;)if((i=r.pop())in o)return s.value=i,s.done=!1,s;return s.done=!0,s}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(jl);var Wh=jl.exports,xl={exports:{}},Dl={exports:{}};(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Dl);var Gh=Dl.exports;(function(e){var t=Gh.default;function n(o){if(o!=null){var r=o[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],i=0;if(r)return r.call(o);if(typeof o.next=="function")return o;if(!isNaN(o.length))return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}}}throw new TypeError(t(o)+" is not iterable")}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(xl);var Kh=xl.exports;(function(e){var t=hl,n=Cl,o=zh,r=Ml,i=ml,s=Wh,l=Kh;function d(){var a=n(),k=a.m(d),u=(Object.getPrototypeOf?Object.getPrototypeOf(k):k.__proto__).constructor;function h(v){var m=typeof v=="function"&&v.constructor;return!!m&&(m===u||(m.displayName||m.name)==="GeneratorFunction")}var p={throw:1,return:2,break:3,continue:3};function C(v){var m,H;return function(g){m||(m={stop:function(){return H(g.a,2)},catch:function(){return g.v},abrupt:function(f,x){return H(g.a,p[f],x)},delegateYield:function(f,x,D){return m.resultName=x,H(g.d,l(f),D)},finish:function(f){return H(g.f,f)}},H=function(f,x,D){g.p=m.prev,g.n=m.next;try{return f(x,D)}finally{m.next=g.n}}),m.resultName&&(m[m.resultName]=g.v,m.resultName=void 0),m.sent=g.v,m.next=g.n;try{return v.call(this,m)}finally{g.p=m.prev,g.n=m.next}}}return(e.exports=d=function(){return{wrap:function(H,g,j,f){return a.w(C(H),g,j,f&&f.reverse())},isGeneratorFunction:h,mark:a.m,awrap:function(H,g){return new t(H,g)},AsyncIterator:i,async:function(H,g,j,f,x){return(h(g)?r:o)(C(H),g,j,f,x)},keys:s,values:l}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=d,e.exports.__esModule=!0,e.exports.default=e.exports})(kl);var Yh=kl.exports,P9=Yh(),Qh=P9;try{regeneratorRuntime=P9}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=P9:Function("r","regeneratorRuntime = r")(P9)}const Zw=Uh(Qh);var Xh={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"};function os(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:Hl,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vl,o;switch(e){case"topLeft":o={left:"0px",top:t,bottom:"auto"};break;case"topRight":o={right:"0px",top:t,bottom:"auto"};break;case"bottomLeft":o={left:"0px",top:"auto",bottom:n};break;default:o={right:"0px",top:"auto",bottom:n};break}return o}function kp(e,t){var n=e.prefixCls,o=e.placement,r=o===void 0?yl:o,i=e.getContainer,s=i===void 0?bl:i,l=e.top,d=e.bottom,a=e.closeIcon,k=a===void 0?Zl:a,u=e.appContext,h=Dp(),p=h.getPrefixCls,C=p("notification",n||Qo),v="".concat(C,"-").concat(r,"-").concat(Xo),m=Se[v];if(m){Promise.resolve(m).then(function(g){t(g)});return}var H=p9("".concat(C,"-").concat(r),U1({},"".concat(C,"-rtl"),Xo===!0));sn.newInstance({name:"notification",prefixCls:n||Qo,class:H,style:ap(r,l,d),appContext:u,getContainer:s,closeIcon:function(j){var f=j.prefixCls,x=b("span",{class:"".concat(f,"-close-x")},[Et(k,{},b(Fr,{class:"".concat(f,"-close-icon")},null))]);return x},maxCount:_l,hasTransitionName:!0},function(g){Se[v]=g,t(g)})}var up={success:Ir,info:Rr,error:$r,warning:Nr};function hp(e){var t=e.icon,n=e.type,o=e.description,r=e.message,i=e.btn,s=e.duration===void 0?Ll:e.duration;kp(e,function(l){l.notice({content:function(a){var k=a.prefixCls,u="".concat(k,"-notice"),h=null;if(t)h=function(){return b("span",{class:"".concat(u,"-icon")},[Et(t)])};else if(n){var p=up[n];h=function(){return b(p,{class:"".concat(u,"-icon ").concat(u,"-icon-").concat(n)},null)}}return b("div",{class:h?"".concat(u,"-with-icon"):""},[h&&h(),b("div",{class:"".concat(u,"-message")},[!o&&h?b("span",{class:"".concat(u,"-message-single-line-auto-margin")},null):null,Et(r)]),b("div",{class:"".concat(u,"-description")},[Et(o)]),i?b("span",{class:"".concat(u,"-btn")},[Et(i)]):null])},duration:s,closable:!0,onClose:e.onClose,onClick:e.onClick,key:e.key,style:e.style||{},class:e.class})})}var i9={open:hp,close:function(t){Object.keys(Se).forEach(function(n){return Promise.resolve(Se[n]).then(function(o){o.removeNotice(t)})})},config:dp,destroy:function(){Object.keys(Se).forEach(function(t){Promise.resolve(Se[t]).then(function(n){n.destroy()}),delete Se[t]})}},pp=["success","info","warning","error"];pp.forEach(function(e){i9[e]=function(t){return i9.open(u1(u1({},t),{},{type:e}))}});i9.warn=i9.warning;function Bl(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var cp="vc-util-key";function Sl(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):cp}function qr(e){if(e.attachTo)return e.attachTo;var t=document.querySelector("head");return t||document.body}function ds(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Bl())return null;var o=document.createElement("style");if((t=n.csp)!==null&&t!==void 0&&t.nonce){var r;o.nonce=(r=n.csp)===null||r===void 0?void 0:r.nonce}o.innerHTML=e;var i=qr(n),s=i.firstChild;return n.prepend&&i.prepend?i.prepend(o):n.prepend&&s?i.insertBefore(o,s):i.appendChild(o),o}var Jo=new Map;function wp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=qr(t);return Array.from(Jo.get(n).children).find(function(o){return o.tagName==="STYLE"&&o.getAttribute(Sl(t))===e})}function Cp(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=qr(n);if(!Jo.has(o)){var r=ds("",n),i=r.parentNode;Jo.set(o,i),i.removeChild(r)}var s=wp(t,n);if(s){var l,d;if((l=n.csp)!==null&&l!==void 0&&l.nonce&&s.nonce!==((d=n.csp)===null||d===void 0?void 0:d.nonce)){var a;s.nonce=(a=n.csp)===null||a===void 0?void 0:a.nonce}return s.innerHTML!==e&&(s.innerHTML=e),s}var k=ds(e,n);return k.setAttribute(Sl(n),t),k}const gp=function(e,t,n){K4(e,"[ant-design-vue: ".concat(t,"] ").concat(n))};var vp="-ant-".concat(Date.now(),"-").concat(Math.random());function fp(e,t){var n={},o=function(k,u){var h=k.clone();return h=(u==null?void 0:u(h))||h,h.toRgbString()},r=function(k,u){var h=new io(k),p=r9(h.toRgbString());n["".concat(u,"-color")]=o(h),n["".concat(u,"-color-disabled")]=p[1],n["".concat(u,"-color-hover")]=p[4],n["".concat(u,"-color-active")]=p[6],n["".concat(u,"-color-outline")]=h.clone().setAlpha(.2).toRgbString(),n["".concat(u,"-color-deprecated-bg")]=p[1],n["".concat(u,"-color-deprecated-border")]=p[3]};if(t.primaryColor){r(t.primaryColor,"primary");var i=new io(t.primaryColor),s=r9(i.toRgbString());s.forEach(function(a,k){n["primary-".concat(k+1)]=a}),n["primary-color-deprecated-l-35"]=o(i,function(a){return a.lighten(35)}),n["primary-color-deprecated-l-20"]=o(i,function(a){return a.lighten(20)}),n["primary-color-deprecated-t-20"]=o(i,function(a){return a.tint(20)}),n["primary-color-deprecated-t-50"]=o(i,function(a){return a.tint(50)}),n["primary-color-deprecated-f-12"]=o(i,function(a){return a.setAlpha(a.getAlpha()*.12)});var l=new io(s[0]);n["primary-color-active-deprecated-f-30"]=o(l,function(a){return a.setAlpha(a.getAlpha()*.3)}),n["primary-color-active-deprecated-d-02"]=o(l,function(a){return a.darken(2)})}t.successColor&&r(t.successColor,"success"),t.warningColor&&r(t.warningColor,"warning"),t.errorColor&&r(t.errorColor,"error"),t.infoColor&&r(t.infoColor,"info");var d=Object.keys(n).map(function(a){return"--".concat(e,"-").concat(a,": ").concat(n[a],";")});Bl()?Cp(` +`,Gi=!1,dh=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lh;v2(function(){Gi||(typeof window<"u"&&window.document&&window.document.documentElement&&ih(t,{prepend:!0}),Gi=!0)})},ah=["icon","primaryColor","secondaryColor"];function kh(e,t){if(e==null)return{};var n=uh(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function uh(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i=0)&&(n[r]=e[r]);return n}function O9(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,o=new Array(t);ne.length)&&(t=e.length);for(var n=0,o=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function yh(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i=0)&&(n[r]=e[r]);return n}nl("#1890ff");var l2=function(t,n){var o,r=Qi({},t,n.attrs),i=r.class,s=r.icon,l=r.spin,d=r.rotate,a=r.tabindex,k=r.twoToneColor,u=r.onClick,h=Vh(r,Mh),p=(o={anticon:!0},Yo(o,"anticon-".concat(s.name),!!s.name),Yo(o,i,i),o),C=l===""||l||s.name==="loading"?"anticon-spin":"",v=a;v===void 0&&u&&(v=-1,h.tabindex=v);var m=d?{msTransform:"rotate(".concat(d,"deg)"),transform:"rotate(".concat(d,"deg)")}:void 0,H=tl(k),g=jh(H,2),j=g[0],f=g[1];return b("span",Qi({role:"img","aria-label":s.name},h,{onClick:u,class:p}),[b(Ve,{class:C,icon:s,primaryColor:j,secondaryColor:f,style:m},null)])};l2.props={spin:Boolean,rotate:Number,icon:Object,twoToneColor:String};l2.displayName="AntdIcon";l2.inheritAttrs=!1;l2.getTwoToneColor=mh;l2.setTwoToneColor=nl;function Xi(e){for(var t=1;t3?(C1=Z1===n1)&&(U=p1[(P=p1[4])?5:(P=3,3)],p1[4]=p1[5]=o):p1[0]<=S1&&((C1=Y<2&&S1n1||n1>Z1)&&(p1[4]=Y,p1[5]=n1,h1.n=Z1,P=0))}if(C1||Y>1)return a;throw l1=!0,n1}return function(Y,n1,C1){if(I>1)throw TypeError("Generator is already running");for(l1&&n1===1&&k1(n1,C1),P=n1,U=C1;(r=P<2?o:U)||!l1;){L||(P?P<3?(P>1&&(h1.n=-1),k1(P,U)):h1.n=U:h1.v=U);try{if(I=2,L){if(P||(Y="next"),r=L[Y]){if(!(r=r.call(L,U)))throw TypeError("iterator result is not an object");if(!r.done)return r;U=r.value,P<2&&(P=0)}else P===1&&(r=L.return)&&r.call(L),P<2&&(U=TypeError("The iterator does not provide a '"+Y+"' method"),P=1);L=o}else if((r=(l1=h1.n<0)?U:D.call(y,h1))!==a)break}catch(p1){L=o,P=1,U=p1}finally{I=1}}return{value:r,done:l1}}}(m,g,j),!0),x}var a={};function k(){}function u(){}function h(){}r=Object.getPrototypeOf;var p=[][s]?r(r([][s]())):(t(r={},s,function(){return this}),r),C=h.prototype=k.prototype=Object.create(p);function v(m){return Object.setPrototypeOf?Object.setPrototypeOf(m,h):(m.__proto__=h,t(m,l,"GeneratorFunction")),m.prototype=Object.create(C),m}return u.prototype=h,t(C,"constructor",h),t(h,"constructor",u),u.displayName="GeneratorFunction",t(h,l,"GeneratorFunction"),t(C),t(C,l,"Generator"),t(C,s,function(){return this}),t(C,"toString",function(){return"[object Generator]"}),(e.exports=n=function(){return{w:d,m:v}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(cl);var gl=cl.exports,vl={exports:{}},fl={exports:{}},ml={exports:{}};(function(e){var t=pl,n=Cl;function o(r,i){function s(d,a,k,u){try{var h=r[d](a),p=h.value;return p instanceof t?i.resolve(p.v).then(function(C){s("next",C,k,u)},function(C){s("throw",C,k,u)}):i.resolve(p).then(function(C){h.value=C,k(h)},function(C){return s("throw",C,k,u)})}catch(C){u(C)}}var l;this.next||(n(o.prototype),n(o.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(d,a,k){function u(){return new i(function(h,p){s(d,k,h,p)})}return l=l?l.then(u,u):u()},!0)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports})(ml);var Ml=ml.exports;(function(e){var t=gl,n=Ml;function o(r,i,s,l,d){return new n(t().w(r,i,s,l),d||Promise)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports})(fl);var jl=fl.exports;(function(e){var t=jl;function n(o,r,i,s,l){var d=t(o,r,i,s,l);return d.next().then(function(a){return a.done?a.value:d.next()})}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(vl);var Wh=vl.exports,xl={exports:{}};(function(e){function t(n){var o=Object(n),r=[];for(var i in o)r.unshift(i);return function s(){for(;r.length;)if((i=r.pop())in o)return s.value=i,s.done=!1,s;return s.done=!0,s}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(xl);var Gh=xl.exports,Dl={exports:{}},Ll={exports:{}};(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Ll);var Kh=Ll.exports;(function(e){var t=Kh.default;function n(o){if(o!=null){var r=o[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],i=0;if(r)return r.call(o);if(typeof o.next=="function")return o;if(!isNaN(o.length))return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}}}throw new TypeError(t(o)+" is not iterable")}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Dl);var Yh=Dl.exports;(function(e){var t=pl,n=gl,o=Wh,r=jl,i=Ml,s=Gh,l=Yh;function d(){var a=n(),k=a.m(d),u=(Object.getPrototypeOf?Object.getPrototypeOf(k):k.__proto__).constructor;function h(v){var m=typeof v=="function"&&v.constructor;return!!m&&(m===u||(m.displayName||m.name)==="GeneratorFunction")}var p={throw:1,return:2,break:3,continue:3};function C(v){var m,H;return function(g){m||(m={stop:function(){return H(g.a,2)},catch:function(){return g.v},abrupt:function(f,x){return H(g.a,p[f],x)},delegateYield:function(f,x,D){return m.resultName=x,H(g.d,l(f),D)},finish:function(f){return H(g.f,f)}},H=function(f,x,D){g.p=m.prev,g.n=m.next;try{return f(x,D)}finally{m.next=g.n}}),m.resultName&&(m[m.resultName]=g.v,m.resultName=void 0),m.sent=g.v,m.next=g.n;try{return v.call(this,m)}finally{g.p=m.prev,g.n=m.next}}}return(e.exports=d=function(){return{wrap:function(H,g,j,f){return a.w(C(H),g,j,f&&f.reverse())},isGeneratorFunction:h,mark:a.m,awrap:function(H,g){return new t(H,g)},AsyncIterator:i,async:function(H,g,j,f,x){return(h(g)?r:o)(C(H),g,j,f,x)},keys:s,values:l}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=d,e.exports.__esModule=!0,e.exports.default=e.exports})(ul);var Qh=ul.exports,A9=Qh(),Xh=A9;try{regeneratorRuntime=A9}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=A9:Function("r","regeneratorRuntime = r")(A9)}const _w=zh(Xh);var Jh={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"};function os(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:Vl,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:yl,o;switch(e){case"topLeft":o={left:"0px",top:t,bottom:"auto"};break;case"topRight":o={right:"0px",top:t,bottom:"auto"};break;case"bottomLeft":o={left:"0px",top:"auto",bottom:n};break;default:o={right:"0px",top:"auto",bottom:n};break}return o}function up(e,t){var n=e.prefixCls,o=e.placement,r=o===void 0?bl:o,i=e.getContainer,s=i===void 0?Zl:i,l=e.top,d=e.bottom,a=e.closeIcon,k=a===void 0?_l:a,u=e.appContext,h=Lp(),p=h.getPrefixCls,C=p("notification",n||Qo),v="".concat(C,"-").concat(r,"-").concat(Xo),m=Ee[v];if(m){Promise.resolve(m).then(function(g){t(g)});return}var H=p9("".concat(C,"-").concat(r),U1({},"".concat(C,"-rtl"),Xo===!0));sn.newInstance({name:"notification",prefixCls:n||Qo,class:H,style:kp(r,l,d),appContext:u,getContainer:s,closeIcon:function(j){var f=j.prefixCls,x=b("span",{class:"".concat(f,"-close-x")},[St(k,{},b(Nr,{class:"".concat(f,"-close-icon")},null))]);return x},maxCount:Bl,hasTransitionName:!0},function(g){Ee[v]=g,t(g)})}var hp={success:Ir,info:Rr,error:$r,warning:Fr};function pp(e){var t=e.icon,n=e.type,o=e.description,r=e.message,i=e.btn,s=e.duration===void 0?Hl:e.duration;up(e,function(l){l.notice({content:function(a){var k=a.prefixCls,u="".concat(k,"-notice"),h=null;if(t)h=function(){return b("span",{class:"".concat(u,"-icon")},[St(t)])};else if(n){var p=hp[n];h=function(){return b(p,{class:"".concat(u,"-icon ").concat(u,"-icon-").concat(n)},null)}}return b("div",{class:h?"".concat(u,"-with-icon"):""},[h&&h(),b("div",{class:"".concat(u,"-message")},[!o&&h?b("span",{class:"".concat(u,"-message-single-line-auto-margin")},null):null,St(r)]),b("div",{class:"".concat(u,"-description")},[St(o)]),i?b("span",{class:"".concat(u,"-btn")},[St(i)]):null])},duration:s,closable:!0,onClose:e.onClose,onClick:e.onClick,key:e.key,style:e.style||{},class:e.class})})}var i9={open:pp,close:function(t){Object.keys(Ee).forEach(function(n){return Promise.resolve(Ee[n]).then(function(o){o.removeNotice(t)})})},config:ap,destroy:function(){Object.keys(Ee).forEach(function(t){Promise.resolve(Ee[t]).then(function(n){n.destroy()}),delete Ee[t]})}},cp=["success","info","warning","error"];cp.forEach(function(e){i9[e]=function(t){return i9.open(u1(u1({},t),{},{type:e}))}});i9.warn=i9.warning;function El(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var wp="vc-util-key";function Sl(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):wp}function qr(e){if(e.attachTo)return e.attachTo;var t=document.querySelector("head");return t||document.body}function ds(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!El())return null;var o=document.createElement("style");if((t=n.csp)!==null&&t!==void 0&&t.nonce){var r;o.nonce=(r=n.csp)===null||r===void 0?void 0:r.nonce}o.innerHTML=e;var i=qr(n),s=i.firstChild;return n.prepend&&i.prepend?i.prepend(o):n.prepend&&s?i.insertBefore(o,s):i.appendChild(o),o}var Jo=new Map;function Cp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=qr(t);return Array.from(Jo.get(n).children).find(function(o){return o.tagName==="STYLE"&&o.getAttribute(Sl(t))===e})}function gp(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=qr(n);if(!Jo.has(o)){var r=ds("",n),i=r.parentNode;Jo.set(o,i),i.removeChild(r)}var s=Cp(t,n);if(s){var l,d;if((l=n.csp)!==null&&l!==void 0&&l.nonce&&s.nonce!==((d=n.csp)===null||d===void 0?void 0:d.nonce)){var a;s.nonce=(a=n.csp)===null||a===void 0?void 0:a.nonce}return s.innerHTML!==e&&(s.innerHTML=e),s}var k=ds(e,n);return k.setAttribute(Sl(n),t),k}const vp=function(e,t,n){Y4(e,"[ant-design-vue: ".concat(t,"] ").concat(n))};var fp="-ant-".concat(Date.now(),"-").concat(Math.random());function mp(e,t){var n={},o=function(k,u){var h=k.clone();return h=(u==null?void 0:u(h))||h,h.toRgbString()},r=function(k,u){var h=new io(k),p=r9(h.toRgbString());n["".concat(u,"-color")]=o(h),n["".concat(u,"-color-disabled")]=p[1],n["".concat(u,"-color-hover")]=p[4],n["".concat(u,"-color-active")]=p[6],n["".concat(u,"-color-outline")]=h.clone().setAlpha(.2).toRgbString(),n["".concat(u,"-color-deprecated-bg")]=p[1],n["".concat(u,"-color-deprecated-border")]=p[3]};if(t.primaryColor){r(t.primaryColor,"primary");var i=new io(t.primaryColor),s=r9(i.toRgbString());s.forEach(function(a,k){n["primary-".concat(k+1)]=a}),n["primary-color-deprecated-l-35"]=o(i,function(a){return a.lighten(35)}),n["primary-color-deprecated-l-20"]=o(i,function(a){return a.lighten(20)}),n["primary-color-deprecated-t-20"]=o(i,function(a){return a.tint(20)}),n["primary-color-deprecated-t-50"]=o(i,function(a){return a.tint(50)}),n["primary-color-deprecated-f-12"]=o(i,function(a){return a.setAlpha(a.getAlpha()*.12)});var l=new io(s[0]);n["primary-color-active-deprecated-f-30"]=o(l,function(a){return a.setAlpha(a.getAlpha()*.3)}),n["primary-color-active-deprecated-d-02"]=o(l,function(a){return a.darken(2)})}t.successColor&&r(t.successColor,"success"),t.warningColor&&r(t.warningColor,"warning"),t.errorColor&&r(t.errorColor,"error"),t.infoColor&&r(t.infoColor,"info");var d=Object.keys(n).map(function(a){return"--".concat(e,"-").concat(a,": ").concat(n[a],";")});El()?gp(` :root { `.concat(d.join(` `),` } - `),"".concat(vp,"-dynamic-theme")):gp(!1,"ConfigProvider","SSR do not support dynamic theme with css variables.")}var El=Symbol("GlobalFormContextKey"),mp=function(t){Me(El,t)},_w=function(){return z1(El,{validateMessages:F(function(){})})},Mp=function(){return{getTargetContainer:{type:Function},getPopupContainer:{type:Function},prefixCls:String,getPrefixCls:{type:Function},renderEmpty:{type:Function},transformCellText:{type:Function},csp:{type:Object,default:void 0},input:{type:Object},autoInsertSpaceInButton:{type:Boolean,default:void 0},locale:{type:Object,default:void 0},pageHeader:{type:Object},componentSize:{type:String},direction:{type:String},space:{type:Object},virtual:{type:Boolean,default:void 0},dropdownMatchSelectWidth:{type:[Number,Boolean],default:!0},form:{type:Object,default:void 0},notUpdateGlobalConfig:Boolean}},jp="ant";function it(){return p2.prefixCls||jp}var er=W1({}),Ol=W1({}),p2=W1({});vn(function(){Fe(p2,er,Ol),p2.prefixCls=it(),p2.getPrefixCls=function(e,t){return t||(e?"".concat(p2.prefixCls,"-").concat(e):p2.prefixCls)},p2.getRootPrefixCls=function(e,t){return e||(p2.prefixCls?p2.prefixCls:t&&t.includes("-")?t.replace(/^(.*)-[^-]*$/,"$1"):it())}});var ko,xp=function(t){ko&&ko(),ko=vn(function(){Fe(Ol,W1(t)),Fe(p2,W1(t))}),t.theme&&fp(it(),t.theme)},Dp=function(){return{getPrefixCls:function(n,o){return o||(n?"".concat(it(),"-").concat(n):it())},getRootPrefixCls:function(n,o){return n||(p2.prefixCls?p2.prefixCls:o&&o.includes("-")?o.replace(/^(.*)-[^-]*$/,"$1"):it())}}},qt=b1({compatConfig:{MODE:3},name:"AConfigProvider",inheritAttrs:!1,props:Mp(),setup:function(t,n){var o=n.slots,r=function(u,h){var p=t.prefixCls,C=p===void 0?"ant":p;return u?"".concat(C,"-").concat(u):C},i=function(u){var h=t.renderEmpty||o.renderEmpty||G4;return h(u)},s=function(u,h){var p=t.prefixCls;if(h)return h;var C=p||r("");return u?"".concat(C,"-").concat(u):C},l=W1(u1(u1({},t),{},{getPrefixCls:s,renderEmpty:i}));Object.keys(t).forEach(function(k){S1(function(){return t[k]},function(){l[k]=t[k]})}),t.notUpdateGlobalConfig||(Fe(er,l),S1(l,function(){Fe(er,l)}));var d=F(function(){var k={};if(t.locale){var u,h;k=((u=t.locale.Form)===null||u===void 0?void 0:u.defaultValidateMessages)||((h=on.Form)===null||h===void 0?void 0:h.defaultValidateMessages)||{}}return t.form&&t.form.validateMessages&&(k=u1(u1({},k),t.form.validateMessages)),k});mp({validateMessages:d}),Me("configProvider",l);var a=function(u){var h;return b(Eu,{locale:t.locale||u,ANT_MARK__:Uo},{default:function(){return[(h=o.default)===null||h===void 0?void 0:h.call(o)]}})};return vn(function(){t.direction&&(ln.config({rtl:t.direction==="rtl"}),i9.config({rtl:t.direction==="rtl"}))}),function(){return b(O4,{children:function(u,h,p){return a(p)}},null)}}}),Pl=W1({getPrefixCls:function(t,n){return n||(t?"ant-".concat(t):"ant")},renderEmpty:G4,direction:"ltr"});qt.config=xp;qt.install=function(e){e.component(qt.name,qt)};const Pn=function(e,t){var n=z1("configProvider",Pl),o=F(function(){return n.getPrefixCls(e,t.prefixCls)}),r=F(function(){var g;return(g=t.direction)!==null&&g!==void 0?g:n.direction}),i=F(function(){return n.getPrefixCls()}),s=F(function(){return n.autoInsertSpaceInButton}),l=F(function(){return n.renderEmpty}),d=F(function(){return n.space}),a=F(function(){return n.pageHeader}),k=F(function(){return n.form}),u=F(function(){return t.getTargetContainer||n.getTargetContainer}),h=F(function(){return t.getPopupContainer||n.getPopupContainer}),p=F(function(){var g;return(g=t.dropdownMatchSelectWidth)!==null&&g!==void 0?g:n.dropdownMatchSelectWidth}),C=F(function(){return(t.virtual===void 0?n.virtual!==!1:t.virtual!==!1)&&p.value!==!1}),v=F(function(){return t.size||n.componentSize}),m=F(function(){var g;return t.autocomplete||((g=n.input)===null||g===void 0?void 0:g.autocomplete)}),H=F(function(){return n.csp});return{configProvider:n,prefixCls:o,direction:r,size:v,getTargetContainer:u,getPopupContainer:h,space:d,pageHeader:a,form:k,autoInsertSpaceInButton:s,renderEmpty:l,virtual:C,dropdownMatchSelectWidth:p,rootPrefixCls:i,getPrefixCls:n.getPrefixCls,autocomplete:m,csp:H}};function tr(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Lp="[object Symbol]";function Hp(e){return typeof e=="symbol"||Xk(e)&&Qk(e)==Lp}var Vp=/\s/;function yp(e){for(var t=e.length;t--&&Vp.test(e.charAt(t)););return t}var bp=/^\s+/;function Zp(e){return e&&e.slice(0,yp(e)+1).replace(bp,"")}var as=NaN,_p=/^[-+]0x[0-9a-f]+$/i,Bp=/^0b[01]+$/i,Sp=/^0o[0-7]+$/i,Ep=parseInt;function ks(e){if(typeof e=="number")return e;if(Hp(e))return as;if(tr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=tr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Zp(e);var n=Bp.test(e);return n||Sp.test(e)?Ep(e.slice(2),n?2:8):_p.test(e)?as:+e}var uo=function(){return b4.Date.now()},Op="Expected a function",Pp=Math.max,Ap=Math.min;function Tp(e,t,n){var o,r,i,s,l,d,a=0,k=!1,u=!1,h=!0;if(typeof e!="function")throw new TypeError(Op);t=ks(t)||0,tr(n)&&(k=!!n.leading,u="maxWait"in n,i=u?Pp(ks(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h);function p(D){var y=o,P=r;return o=r=void 0,a=D,s=e.apply(P,y),s}function C(D){return a=D,l=setTimeout(H,t),k?p(D):s}function v(D){var y=D-d,P=D-a,L=t-y;return u?Ap(L,i-P):L}function m(D){var y=D-d,P=D-a;return d===void 0||y>=t||y<0||u&&P>=i}function H(){var D=uo();if(m(D))return g(D);l=setTimeout(H,v(D))}function g(D){return l=void 0,h&&o?p(D):(o=r=void 0,s)}function j(){l!==void 0&&clearTimeout(l),a=0,o=d=r=l=void 0}function f(){return l===void 0?s:g(uo())}function x(){var D=uo(),y=m(D);if(o=arguments,r=this,d=D,y){if(l===void 0)return C(d);if(u)return clearTimeout(l),l=setTimeout(H,t),p(d)}return l===void 0&&(l=setTimeout(H,t)),s}return x.cancel=j,x.flush=f,x}var Ip=["class","style"],Rp=function(){return{prefixCls:String,spinning:{type:Boolean,default:void 0},size:String,wrapperClassName:String,tip:o9.any,delay:Number,indicator:o9.any}},A9=null;function $p(e,t){return!!e&&!!t&&!isNaN(Number(t))}function Np(e){var t=e.indicator;A9=typeof t=="function"?t:function(){return b(t,null,null)}}const Ut=b1({compatConfig:{MODE:3},name:"ASpin",inheritAttrs:!1,props:eu(Rp(),{size:"default",spinning:!0,wrapperClassName:""}),setup:function(){return{originalUpdateSpinning:null,configProvider:z1("configProvider",Pl)}},data:function(){var t=this.spinning,n=this.delay,o=$p(t,n);return{sSpinning:t&&!o}},created:function(){this.originalUpdateSpinning=this.updateSpinning,this.debouncifyUpdateSpinning(this.$props)},mounted:function(){this.updateSpinning()},updated:function(){var t=this;v2(function(){t.debouncifyUpdateSpinning(),t.updateSpinning()})},beforeUnmount:function(){this.cancelExistingSpin()},methods:{debouncifyUpdateSpinning:function(t){var n=t||this.$props,o=n.delay;o&&(this.cancelExistingSpin(),this.updateSpinning=Tp(this.originalUpdateSpinning,o))},updateSpinning:function(){var t=this.spinning,n=this.sSpinning;n!==t&&(this.sSpinning=t)},cancelExistingSpin:function(){var t=this.updateSpinning;t&&t.cancel&&t.cancel()},renderIndicator:function(t){var n="".concat(t,"-dot"),o=ru(this,"indicator");return o===null?null:(Array.isArray(o)&&(o=o.length===1?o[0]:o),a2(o)?_2(o,{class:n}):A9&&a2(A9())?_2(A9(),{class:n}):b("span",{class:"".concat(n," ").concat(t,"-dot-spin")},[b("i",{class:"".concat(t,"-dot-item")},null),b("i",{class:"".concat(t,"-dot-item")},null),b("i",{class:"".concat(t,"-dot-item")},null),b("i",{class:"".concat(t,"-dot-item")},null)]))}},render:function(){var t,n,o,r=this.$props,i=r.size,s=r.prefixCls,l=r.tip,d=l===void 0?(t=(n=this.$slots).tip)===null||t===void 0?void 0:t.call(n):l,a=r.wrapperClassName,k=this.$attrs,u=k.class,h=k.style,p=Br(k,Ip),C=this.configProvider,v=C.getPrefixCls,m=C.direction,H=v("spin",s),g=this.sSpinning,j=(o={},U1(o,H,!0),U1(o,"".concat(H,"-sm"),i==="small"),U1(o,"".concat(H,"-lg"),i==="large"),U1(o,"".concat(H,"-spinning"),g),U1(o,"".concat(H,"-show-text"),!!d),U1(o,"".concat(H,"-rtl"),m==="rtl"),U1(o,u,!!u),o),f=b("div",u1(u1({},p),{},{style:h,class:j}),[this.renderIndicator(H),d?b("div",{class:"".concat(H,"-text")},[d]):null]),x=ou(this);if(x&&x.length){var D,y=(D={},U1(D,"".concat(H,"-container"),!0),U1(D,"".concat(H,"-blur"),g),D);return b("div",{class:["".concat(H,"-nested-loading"),a]},[g&&b("div",{key:"loading"},[f]),b("div",{class:y,key:"container"},[x])])}return f}});Ut.setDefaultIndicator=Np;Ut.install=function(e){return e.component(Ut.name,Ut),e};const Fp={key:0,src:Mk,alt:"Montzar",class:"spinner-brand",width:"48",height:"48"},qp={key:1,class:"loading keep-motion"},Up=b1({__name:"Spinner",props:{tip:{},size:{default:"large"},cls:{},delay:{},spinning:{type:Boolean},indicator:{type:Boolean},fixed:{type:Boolean,default:!0}},setup(e){return(t,n)=>(W(),O1(v1(Ut),{spinning:e.spinning,tip:e.tip,size:e.size,delay:e.delay,class:F1(e.fixed?"!max-h-screen !fixed":"")},{indicator:e2(()=>[e.indicator?(W(),o1("div",qp,[...n[0]||(n[0]=[O("div",{class:"effect-1 effects"},null,-1),O("div",{class:"effect-2 effects"},null,-1),O("div",{class:"effect-3 effects"},null,-1)])])):(W(),o1("img",Fp))]),default:e2(()=>[O("div",{class:F1(e.cls)},[Ln(t.$slots,"default")],2)]),_:3},8,["spinning","tip","size","delay","class"]))}});function Al(e){return(e.qty??0)>0||!!e.isPreOrder}function zp(e){if(!e||e.length===0)return null;const t=e.filter(Al);return(t.length?t:e).reduce((o,r)=>parseFloat(r.defaultWagePercent){var m,H;return(H=(m=n.value.images)==null?void 0:m[0])==null?void 0:H.url}),r=F(()=>n.value.id),i=F(()=>n.value.title),s=F(()=>n.value.variants),l=Q(t??zp(v1(s))),d=F(()=>l.value?parseFloat(l.value.rashWeightGrams):0),a=F(()=>l.value?parseFloat(l.value.defaultWagePercent):null),k=Q(null),u=F(()=>{var m;return((m=l.value)==null?void 0:m.qty)??0}),h=F(()=>{var m;return((m=l.value)==null?void 0:m.isPreOrder)??!1}),p=F(()=>u.value>0||h.value),C=F(()=>n.value.productCode??null);return{product:n,image:o,id:r,title:i,productCode:C,variants:s,selectedVariant:l,min_gram:d,wage:a,hasDiscountWage:k,qty:u,isPreOrder:h,is_exist:p,has_warranty:Q(!1)}}const Tl="/api",Gp="gold-bank:token";let Re=null;function Kp(e){Re=e}class Il extends Error{constructor(t){super(`API ${t} rejected the session (401)`),this.name="UnauthorizedError"}}function Rl(){try{return localStorage.getItem(Gp)}catch{return null}}async function K1(e,t){const n=Rl(),o=await fetch(`${Tl}${e}`,{...t,headers:{"Content-Type":"application/json",...n?{Authorization:`Bearer ${n}`}:{},...t==null?void 0:t.headers}});if(o.status===401)throw Re==null||Re(),new Il(e);if(!o.ok){const r=await o.text();throw new Error(`API ${e} failed (${o.status}): ${r}`)}return o.json()}const Ur={listProducts:()=>K1("/catalog/products"),requestOtp:e=>K1("/customer/auth/request-otp",{method:"POST",body:JSON.stringify({username:e})}),verifyOtp:(e,t)=>K1("/customer/auth/verify-otp",{method:"POST",body:JSON.stringify({username:e,password:t})}),getMe:()=>K1("/customer/me"),getMyOrders:()=>K1("/customer/me/orders"),getMyLedgerEntries:()=>K1("/customer/me/ledger-entries"),createOrder:e=>K1("/orders",{method:"POST",body:JSON.stringify(e)}),getLatestGoldPrice:(e=750)=>K1(`/pricing/latest?karatPerMille=${e}`),getHomeSlider:()=>K1("/home/slider"),getExpertIdentity:()=>K1("/expert/whoami"),getExpertCustomers:e=>K1("/expert/my-customers",{method:"POST",body:JSON.stringify({search:e??null})}),getExpertChildOrders:(e=1,t)=>K1("/expert/child-orders",{method:"POST",body:JSON.stringify({page:e,search:t??null})}),uploadDocument:async(e,t)=>{const n=new FormData;n.append("file",e),n.append("purpose",t);const o=Rl(),r=await fetch(`${Tl}/customer/me/documents`,{method:"POST",headers:o?{Authorization:`Bearer ${o}`}:{},body:n});if(r.status===401)throw Re==null||Re(),new Il("/customer/me/documents");if(!r.ok)throw new Error(`آپلود فایل ناموفق بود (${r.status})`);return r.json()},completeProfile:e=>K1("/customer/me/complete-profile",{method:"POST",body:JSON.stringify(e)}),getReport:(e=1)=>K1(`/customer/me/report?page=${e}`),getReportDetailList:(e=1)=>K1(`/customer/me/report/detail?page=${e}`),getReportBalances:()=>K1("/customer/me/report/balances"),getReportDocument:e=>K1(`/customer/me/report/${encodeURIComponent(e)}`)},Yp=600;function Qp(e,t){const n=Q(!1),o=Q(!!t),r=Q(!1),i=Q(t??null);return{loading:n,flag:o,notFound:r,productRef:i,load:async()=>{const l=i.value!==null;l?await new Promise(d=>setTimeout(d,Yp)):n.value=!0;try{const a=(await Ur.listProducts()).find(k=>k.id===e)??null;l?a&&JSON.stringify(a)!==JSON.stringify(i.value)&&(i.value=a):(i.value=a,r.value=!a),o.value=!0}catch(d){console.log(d)}finally{n.value=!1}}}}const Xp=Le("favorites",{state:()=>({ids:[]}),actions:{toggle(e){const t=this.ids.indexOf(e);t===-1?this.ids.push(e):this.ids.splice(t,1)},isFavorite(e){return this.ids.includes(e)}}}),us=()=>({colors:[],brands:[],ciny_id:[],limit_percent:[],limit_gram:[],has_discount:!1,text:void 0,cats:void 0,page:0}),Jp=Le("filters",{state:()=>({query:us()}),actions:{reset(){this.query=us()}}}),$l="appCart";function ec(){try{const e=localStorage.getItem($l);return e?JSON.parse(e):[]}catch{return[]}}function yt(e){localStorage.setItem($l,JSON.stringify(e))}const tc=Le("cart",{state:()=>({items:ec()}),actions:{async init(){try{const e=await Ur.listProducts(),t=[];for(const n of this.items){const o=e.find(i=>i.id===n.pid),r=o==null?void 0:o.variants.find(i=>i.id===n.vid);o&&r&&t.push({...n,product:o})}this.items=t,yt(this.items)}catch(e){console.log(e)}},addToCart(e){var o,r;const t=(r=(o=e.product)==null?void 0:o.variants)==null?void 0:r.find(i=>i.id===e.vid);if(!t||!((t.qty??0)>0||t.isPreOrder))return!1;const n=this.find_index(e);return n===-1?this.items.push({...e,qty:this.capQty(e.qty,t)}):(this.items[n].product=e.product,this.items[n].qty=this.capQty(e.qty,t)),yt(this.items),!0},capQty(e,t){const n=Math.max(1,Math.floor(e)||1);if(t.isPreOrder)return n;const o=t.qty??0;return o>0?Math.min(n,o):n},maxQty(e){const t=this.find_index(e);if(t===-1)return null;const n=this.variant(this.items[t]);return!n||n.isPreOrder?null:(n.qty??0)>0?n.qty:null},remove(e){const t=this.find_index(e);t>-1&&this.items.splice(t,1),yt(this.items)},updateFeild(e,t,n,o){if(!this.isInCart(n))return!1;const r=t??this.find_index(n);if(o==="qty"){const i=this.variant(this.items[r]);e=i?this.capQty(Number(e),i):Math.max(1,Number(e)||1)}return this.items[r][o]=e,yt(this.items),!0},find_index(e){return this.items.findIndex(t=>t.pid===e.pid&&t.vid===e.vid)},isInCart(e){return this.find_index(e)>-1},variant(e){return e.product.variants.find(t=>t.id===e.vid)},total(){return this.items.reduce((e,t)=>{const n=this.variant(t);return e+(n?parseFloat(n.rashWeightGrams)*t.qty:0)},0).toFixed(2)},clear(){this.items=[],yt(this.items)}}});function nc(){return localStorage.getItem("appToken")}const oc={class:"pd__controls"},rc={class:"pd__headerTitle"},ic={class:"pd__controlsEnd"},sc={key:0,class:"pd__roundBadge"},lc={class:"pd__gallery"},dc={key:0,class:"pd__rail"},ac=["aria-label","onClick"],kc={key:1,class:"pd__stage pd__stage--empty"},uc={key:2,class:"pd__expand","aria-hidden":"true"},hc={class:"pd__scroll"},pc={class:"pd__sheet"},cc={class:"pd__eyebrow"},wc={class:"pd__eyebrowText"},Cc={class:"pd__head"},gc={class:"pd__headMain"},vc={class:"pd__title"},fc={key:0,class:"pd__code"},mc={class:"pd__figures"},Mc={class:"pd__figure"},jc={class:"pd__figureValue"},xc={key:0,class:"pd__figure pd__figure--accent"},Dc={class:"pd__figureValue"},Lc={key:0,class:"pd__chips no-scrollbar"},Hc=["disabled","onClick"],Vc={key:1,class:"pd__block"},yc={class:"pd__block"},bc={class:"pd__specs"},Zc={class:"pd__spec"},_c={key:0,class:"pd__spec"},Bc={key:1,class:"pd__spec"},Sc={key:2,class:"pd__spec"},Ec={key:3,class:"pd__spec"},Oc={class:"pd__bar"},Pc={key:0,class:"pd__qty"},Ac={class:"pd__qtyValue"},Tc=["aria-label"],Ic={class:"pd__pillText"},Rc=["disabled"],$c={key:0,class:"pd__previewCounter"},Nc={key:1,class:"pd__previewThumbs no-scrollbar"},Fc=["aria-label","onClick"],qc=["src","alt"],Uc=56,zc=b1({__name:"SingleProduct",props:{id:{},initial:{}},emits:["closeDrawer"],setup(e,{emit:t}){const n=e,o=t,r=l4(),i=Xp(),s=Jp(),l=tc(),d=()=>{o("closeDrawer"),r.currentRoute.value.name==="singleProduct"&&r.back()},a=Q(!1),k=Q(0),u=Q(!1),h=Q(null),p=Q(!1);function C(){var T;const S=h.value;if(!S)return;const Z=((T=S.querySelector(".pd__gallery"))==null?void 0:T.clientHeight)??0;p.value=S.scrollTop>Math.max(Z-Uc,0)}const v=Qp(n.id,n.initial),m=v.loading,H=v.flag,g={id:n.id,title:"",description:null,variants:[],images:[],category:null,brand:null,collections:[]},j=F(()=>Wp(v.productRef.value??g)),f=F(()=>j.value.id.value),x=F(()=>j.value.title.value),D=F(()=>j.value.productCode.value),y=F(()=>j.value.variants.value),P=F({get:()=>j.value.selectedVariant.value,set:S=>j.value.selectedVariant.value=S}),L=F(()=>j.value.min_gram.value),A=F(()=>j.value.wage.value),U=F(()=>j.value.qty.value),I=F(()=>j.value.isPreOrder.value),J=F(()=>j.value.is_exist.value),l1=F(()=>{var S;return((S=v.productRef.value)==null?void 0:S.description)??""}),h1=F(()=>l1.value.length>120),k1=F(()=>{var S,Z;return((Z=(S=v.productRef.value)==null?void 0:S.category)==null?void 0:Z.id)??""}),Y=F(()=>{var S,Z;return((Z=(S=v.productRef.value)==null?void 0:S.category)==null?void 0:Z.title)??""}),n1=F(()=>{var S,Z;return((Z=(S=v.productRef.value)==null?void 0:S.brand)==null?void 0:Z.title)??""}),C1=F(()=>{var S;return(((S=v.productRef.value)==null?void 0:S.images.length)??0)>0}),p1=F(()=>{var S;return((S=v.productRef.value)==null?void 0:S.images.map(Z=>Z.url))??[]});S1(p1,S=>{k.value>S.length-1&&(k.value=0)});const E1=Q(!1);function Z1(){C1.value&&(E1.value=!0,document.body.style.overflow="hidden")}function $(){E1.value=!1,document.body.style.overflow=""}const r1=F(()=>{const S=A.value;return S==null?"":S%1===0?String(S):S.toFixed(2)}),d1=F(()=>U.value>0?`${U.value} عدد موجود`:I.value?"پیش‌سفارش":"ناموجود"),t1=F(()=>U.value>0?"is-in":I.value?"is-pre":"is-out"),V=F(()=>{var S,Z;return{vid:((S=P.value)==null?void 0:S.id)??"",note:null,pid:((Z=v.productRef.value)==null?void 0:Z.id)??n.id,product:v.productRef.value??g,qty:1}}),N=F(()=>l.isInCart(V.value)),R=F(()=>l.find_index(V.value)),K=F(()=>R.value>-1?l.items[R.value].qty:0),i1=F(()=>l.maxQty(V.value)),c=F(()=>i1.value===null||K.value{c.value&&l.updateFeild(K.value+1,R.value,V.value,"qty")},M=()=>{if(K.value<=1){l.remove(V.value);return}l.updateFeild(K.value-1,R.value,V.value,"qty")},_=S=>Al(S),E=()=>{l.addToCart(V.value)&&L4.success("محصول با موفقیت به سبد خرید افزوده شد",{title:"ثبت سفارش"})},B=S=>{S.stopPropagation(),i.toggle(n.id)},q=()=>{k1.value&&(s.query.cats=[k1.value],o("closeDrawer"),r.push({name:"search"}))};return gr(async()=>{await v.load()}),Ue(()=>{E1.value&&(document.body.style.overflow="")}),(S,Z)=>{const T=a9("router-link");return v1(H)&&v1(v).productRef.value?(W(),O1(Up,{key:0,spinning:v1(m),tip:"درحال دریافت اطلاعات"},{default:e2(()=>[O("article",{class:"pd",ref_key:"scroller",ref:h,onScrollPassive:C},[O("header",{class:F1(["pd__header",{"is-solid":p.value}])},[O("div",oc,[O("button",{type:"button",class:"pd__round","aria-label":"بازگشت",onClick:d},[b(q1,{icon:"vuesax-linear:arrow-right-1",size:"18"})]),O("h2",rc,M1(x.value),1),O("div",ic,[O("button",{type:"button",class:F1(["pd__round",{"is-on":v1(i).isFavorite(f.value)}]),"aria-label":"علاقه‌مندی",onClick:B},[b(q1,{icon:v1(i).isFavorite(f.value)?"vuesax-linear:heart-fill":"vuesax-linear:heart",size:"18"},null,8,["icon"])],2),b(T,{class:"pd__round",to:{name:"cart"},"aria-label":"سبد خرید"},{default:e2(()=>[b(q1,{icon:"vuesax-linear:bag-2",size:"18"}),v1(l).items.length?(W(),o1("span",sc,M1(v1(l).items.length),1)):L1("",!0)]),_:1})])])],2),O("div",lc,[C1.value?(W(),O1(Hi,{key:0,index:k.value,"onUpdate:index":Z[0]||(Z[0]=G=>k.value=G),slides:p1.value,alt:x.value,class:"pd__stage",onTap:Z1},{dots:e2(({index:G,go:z})=>[p1.value.length>1?(W(),o1("div",dc,[(W(!0),o1(f1,null,nt(p1.value,(e1,s1)=>(W(),o1("button",{key:e1,type:"button",class:F1(["pd__railDot",{"is-on":s1===G}]),"aria-label":`تصویر ${s1+1}`,onClick:B0(c1=>z(s1),["stop"])},null,10,ac))),128))])):L1("",!0)]),_:1},8,["index","slides","alt"])):(W(),o1("div",kc,[b(q1,{icon:"vuesax-linear:diamonds",size:"27"})])),C1.value?(W(),o1("span",uc,[b(q1,{icon:"vuesax-linear:maximize-4",size:"15"})])):L1("",!0)]),O("div",hc,[O("div",pc,[Z[16]||(Z[16]=O("div",{class:"pd__grip","aria-hidden":"true"},null,-1)),O("div",cc,[O("span",wc,M1(Y.value||"محصول"),1),O("span",{class:F1(["pd__stock",t1.value])},[Z[6]||(Z[6]=O("span",{class:"pd__stockDot","aria-hidden":"true"},null,-1)),K2(" "+M1(d1.value),1)],2)]),O("header",Cc,[O("div",gc,[O("h1",vc,M1(x.value),1),D.value?(W(),o1("p",fc,M1(D.value),1)):L1("",!0)]),O("div",mc,[O("div",Mc,[O("span",jc,M1(L.value),1),Z[7]||(Z[7]=O("span",{class:"pd__figureLabel"},"گرم",-1))]),A.value!=null?(W(),o1("div",xc,[O("span",Dc,M1(r1.value)+"٪",1),Z[8]||(Z[8]=O("span",{class:"pd__figureLabel"},"اجرت",-1))])):L1("",!0)])]),y.value&&y.value.length>1?(W(),o1("section",Lc,[(W(!0),o1(f1,null,nt(y.value,G=>{var z;return W(),o1("button",{key:G.id,type:"button",class:F1(["pd__chip",{"is-on":((z=P.value)==null?void 0:z.id)===G.id,"is-out":!_(G)}]),disabled:!_(G),onClick:e1=>P.value=G},M1(G.title),11,Hc)}),128))])):L1("",!0),l1.value?(W(),o1("section",Vc,[Z[9]||(Z[9]=O("h2",{class:"pd__blockTitle"},"توضیحات",-1)),O("p",{class:F1(["pd__body",{"is-clamped":!u.value}])},M1(l1.value),3),h1.value?(W(),o1("button",{key:0,type:"button",class:"pd__more",onClick:Z[1]||(Z[1]=G=>u.value=!u.value)},M1(u.value?"بستن":"ادامه مطلب"),1)):L1("",!0)])):L1("",!0),O("section",yc,[Z[15]||(Z[15]=O("h2",{class:"pd__blockTitle"},"مشخصات",-1)),O("dl",bc,[O("div",Zc,[O("dt",null,[b(q1,{icon:"vuesax-linear:weight",size:"15"}),Z[10]||(Z[10]=K2(" وزن",-1))]),O("dd",null,M1(L.value)+" گرم",1)]),A.value!=null?(W(),o1("div",_c,[O("dt",null,[b(q1,{icon:"vuesax-linear:percentage-square",size:"15"}),Z[11]||(Z[11]=K2(" اجرت",-1))]),O("dd",null,M1(r1.value)+"٪",1)])):L1("",!0),P.value?(W(),o1("div",Bc,[O("dt",null,[b(q1,{icon:"vuesax-linear:diamonds",size:"15"}),Z[12]||(Z[12]=K2(" تنوع",-1))]),O("dd",null,M1(P.value.title),1)])):L1("",!0),Y.value?(W(),o1("div",Sc,[O("dt",null,[b(q1,{icon:"vuesax-linear:category",size:"15"}),Z[13]||(Z[13]=K2(" دسته‌بندی",-1))]),O("dd",null,M1(Y.value),1)])):L1("",!0),n1.value?(W(),o1("div",Ec,[O("dt",null,[b(q1,{icon:"vuesax-linear:shop",size:"15"}),Z[14]||(Z[14]=K2(" برند",-1))]),O("dd",null,M1(n1.value),1)])):L1("",!0)])])])]),O("div",Oc,[N.value?(W(),o1("div",Pc,[O("button",{type:"button",class:"pd__qtyBtn","aria-label":"افزایش",onClick:w},[b(q1,{icon:"vuesax-linear:add",size:"15"})]),O("span",Ac,M1(K.value),1),O("button",{type:"button",class:"pd__qtyBtn","aria-label":K.value===1?"حذف":"کاهش",onClick:M},[b(q1,{icon:K.value===1?"vuesax-linear:trash":"vuesax-linear:minus",size:"15"},null,8,["icon"])],8,Tc)])):Y.value?(W(),o1("button",{key:1,type:"button",class:"pd__pill",onClick:q},[b(q1,{icon:"vuesax-linear:category",size:"17"}),O("span",Ic,M1(Y.value),1)])):L1("",!0),N.value?(W(),O1(T,{key:3,class:"pd__cta",to:{name:"cart"}},{default:e2(()=>[b(q1,{icon:"vuesax-linear:bag-2",size:"17"}),Z[17]||(Z[17]=K2(" مشاهده سبد خرید ",-1))]),_:1})):(W(),o1("button",{key:2,type:"button",class:"pd__cta",disabled:!J.value,onClick:Z[2]||(Z[2]=G=>v1(nc)()?E():a.value=!0)},[J.value?(W(),O1(q1,{key:0,icon:"vuesax-linear:bag-2",size:"17"})):L1("",!0),K2(" "+M1(J.value?"افزودن به سفارش":"ناموجود"),1)],8,Rc))])],544),(W(),O1(wt,{to:"body"},[b(bn,{name:"pd-preview"},{default:e2(()=>[E1.value?(W(),o1("div",{key:0,class:"pd__preview",onClick:B0($,["self"])},[O("button",{type:"button",class:"pd__previewClose","aria-label":"بستن",onClick:$},[b(q1,{icon:"vuesax-linear:add",size:"20"})]),p1.value.length>1?(W(),o1("div",$c,M1(k.value+1)+" / "+M1(p1.value.length),1)):L1("",!0),b(Hi,{index:k.value,"onUpdate:index":Z[3]||(Z[3]=G=>k.value=G),slides:p1.value,alt:x.value,class:"pd__previewStage",fit:"contain"},null,8,["index","slides","alt"]),p1.value.length>1?(W(),o1("div",Nc,[(W(!0),o1(f1,null,nt(p1.value,(G,z)=>(W(),o1("button",{key:G,type:"button",class:F1(["pd__previewThumb",{"is-on":z===k.value}]),"aria-label":`تصویر ${z+1}`,onClick:e1=>k.value=z},[O("img",{src:G,alt:`${x.value} ${z+1}`,draggable:"false"},null,8,qc)],10,Fc))),128))])):L1("",!0)])):L1("",!0)]),_:1})])),b(D4,{show:a.value,"onUpdate:show":Z[4]||(Z[4]=G=>a.value=G),art:"login",title:"ابتدا وارد حساب کاربری شوید",description:"برای دسترسی به تمامی امکانات نرم افزار منتزر، گزینه ورود/ثبت نام را لمس کنید و در صورت نداشتن حساب کاربری، ثبت نام نمایید.","confirm-text":"ورود/ثبت نام","cancel-text":"بیخیال",onConfirm:Z[5]||(Z[5]=G=>v1(r).push({name:"login"}))},null,8,["show"])]),_:1},8,["spinning"])):L1("",!0)}}}),Nl=He(zc,[["__scopeId","data-v-3162e70f"]]),Wc=Object.freeze(Object.defineProperty({__proto__:null,default:Nl},Symbol.toStringTag,{value:"Module"})),T9=hr(null);let I9=null;typeof document<"u"&&document.addEventListener("pointerdown",e=>{I9=e.target instanceof Element?e.target:null},{capture:!0,passive:!0});function Bw(e,t){const n=(I9==null?void 0:I9.closest("[data-product-origin]"))??null;T9.value={product:e,origin:t??n}}const Gc=["src"],Ke=420,bt=300,hs=300,ps=220,ho="cubic-bezier(0.32, 0.72, 0, 1)",Kc="cubic-bezier(0.22, 1, 0.36, 1)",cs=.9,ws="inset(0px 0px 0px 0px round 0px)",Yc=b1({__name:"ProductMorph",setup(e){const t=ta(),n=hr(null),o=Q(null),r=Q(!1),i=Q(!1),s=Q(null),l=Q(null),d=Q(null),a=Q(null);function k($=.82,r1=7,d1=32){const t1=Math.sqrt(1-$*$),V=[];for(let N=0;N<=d1;N++){const R=N/d1*r1,K=N===d1?1:1-Math.exp(-$*R)*(Math.cos(t1*R)+$/t1*Math.sin(t1*R));V.push(String(+K.toFixed(4)))}return`linear(${V.join(", ")})`}const h=typeof CSS<"u"&&CSS.supports("animation-timing-function","linear(0, 1)")?k():"cubic-bezier(0.22, 1, 0.36, 1)",p=()=>document.documentElement.classList.contains("motion-reduced")||typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function C($,r1,d1){const t1=$.getBoundingClientRect(),V=getComputedStyle($),N=parseFloat(V.paddingLeft)||0,R=parseFloat(V.paddingRight)||0,K=parseFloat(V.paddingTop)||0,i1=parseFloat(V.paddingBottom)||0,c=t1.left+N,w=t1.top+K,M=t1.width-N-R,_=t1.height-K-i1;if(V.objectFit!=="contain"&&V.objectFit!=="scale-down")return{x:c,y:w,w:M,h:_};let E=Math.min(M/r1,_/d1);return V.objectFit==="scale-down"&&(E=Math.min(E,1)),{x:c+(M-r1*E)/2,y:w+(_-d1*E)/2,w:r1*E,h:d1*E}}function v($,r1){const d1=document.documentElement.clientWidth,t1=window.innerHeight;return`inset(${$.top}px ${d1-$.right}px ${t1-$.bottom}px ${$.left}px round ${r1})`}function m($){return $.width>0&&$.height>0&&$.bottom>0&&$.top0}function g($,r1){return($.currentSrc||$.src)===(r1.currentSrc||r1.src)}function j(){var t1;const $=(t1=d.value)==null?void 0:t1.querySelector(".pd__stage");if(!$)return null;const r1=$.getBoundingClientRect(),d1=$.querySelectorAll("img");for(const V of d1){const N=V.getBoundingClientRect(),R=N.left+N.width/2;if(R>r1.left&&R`translate(${t1.x-r1.x}px, ${t1.y-r1.y}px) scale(${t1.w/r1.w}, ${t1.h/r1.h})`;return[{transform:d1($)},{transform:d1(r1)}]}function P($,r1){$.style.left=`${r1.x}px`,$.style.top=`${r1.y}px`,$.style.width=`${r1.w}px`,$.style.height=`${r1.h}px`}let L=0,A=[],U="idle",I=[];function J($){$&&($.style.opacity="0",I.push($))}function l1(){I.forEach($=>$.style.opacity=""),I=[]}function h1(){A.forEach($=>$.cancel()),A=[]}async function k1($){A=$,await Promise.all($.map(r1=>r1.finished.catch(()=>{})))}function Y($){document.documentElement.style.overflow=$?"hidden":""}async function n1($){var R;const r1=++L;h1(),l1(),i.value=!1,r.value=!0,U="opening";const d1=f($.origin),t1=(R=$.origin)==null?void 0:R.getBoundingClientRect(),V=!p()&&!!$.origin&&!!t1&&m(t1);if(o.value=V&&H(d1)?d1.currentSrc||d1.src:null,n.value=$,await v2(),r1!==L||!d.value||!s.value)return;let N;V&&t1&&$.origin?N=C1($.origin,t1,d1):p()?N=[d.value.animate({opacity:[0,1]},{duration:160,easing:"ease-out",fill:"both"}),s.value.animate({opacity:[0,1]},{duration:160,easing:"ease-out",fill:"both"})]:N=[d.value.animate({transform:["translateY(6%)","none"],opacity:[0,1]},{duration:hs,easing:Kc,fill:"both"}),s.value.animate({opacity:[0,1]},{duration:hs,easing:"ease-out",fill:"both"})],await k1(N),r1===L&&(h1(),l1(),o.value=null,r.value=!1,U="open",Y(!0))}function C1($,r1,d1){const t1=d.value,V=l.value,N=s.value,{pageBg:R,cardBg:K,radius:i1}=x($),c=j(),w=a.value;let M=null;if(w&&H(d1)&&c&&g(d1,c)){const E=d1.naturalWidth,B=d1.naturalHeight,q=C(c,E,B);q.w>0&&q.h>0&&(M={from:C(d1,E,B),to:q})}t1.style.transformOrigin=D(r1);const _=[V.animate({clipPath:[v(r1,i1),ws],backgroundColor:[K,R]},{duration:Ke,easing:h,fill:"both"}),N.animate({opacity:[0,1]},{duration:Ke*.6,easing:"ease-out",fill:"both"}),t1.animate({transform:[`scale(${cs})`,"none"]},{duration:Ke,easing:h,fill:"both"}),t1.animate({opacity:[0,1]},{duration:Ke*.55,delay:Ke*.1,easing:"cubic-bezier(0.3, 0, 0.2, 1)",fill:"both"})];return w&&M&&c?(P(w,M.to),J(c),_.push(w.animate(y(M.from,M.to),{duration:Ke,easing:h,fill:"both"}))):o.value=null,_}async function p1(){if(!n.value||U==="closing")return;const $=++L,r1=U==="opening";U="closing",i.value=!0,r.value=!0;let d1;r1&&A.length?(A.forEach(t1=>t1.reverse()),d1=A):(h1(),l1(),d1=await E1()),await k1(d1),$===L&&Z1()}async function E1(){var E;const $=d.value,r1=l.value,d1=s.value;if(!$||!r1||!d1)return[];if(p())return[$.animate({opacity:[1,0]},{duration:140,easing:"ease-in",fill:"forwards"}),d1.animate({opacity:[1,0]},{duration:140,easing:"ease-in",fill:"forwards"})];const t1=((E=n.value)==null?void 0:E.origin)??null,V=t1!=null&&t1.isConnected?t1.getBoundingClientRect():null;if(!t1||!V||!m(V))return[$.animate({transform:["none","translateY(6%)"],opacity:[1,0]},{duration:ps,easing:"cubic-bezier(0.4, 0, 1, 1)",fill:"forwards"}),d1.animate({opacity:[1,0]},{duration:ps,easing:"ease-in",fill:"forwards"})];const{pageBg:N,cardBg:R,radius:K}=x(t1),i1=f(t1),c=j();let w=null;if(H(i1)&&c&&g(i1,c)&&m(c.getBoundingClientRect())){const B=i1.naturalWidth,q=i1.naturalHeight,S=C(c,B,q);S.w>0&&S.h>0&&(w={from:S,to:C(i1,B,q)})}w&&i1&&(o.value=i1.currentSrc||i1.src,await v2()),$.style.transformOrigin=D(V);const M=[r1.animate([{clipPath:ws,backgroundColor:N,opacity:1},{opacity:1,offset:.7},{clipPath:v(V,K),backgroundColor:R,opacity:0}],{duration:bt,easing:ho,fill:"forwards"}),$.animate({transform:["none",`scale(${cs})`]},{duration:bt,easing:ho,fill:"forwards"}),$.animate({opacity:[1,0]},{duration:bt*.45,easing:"ease-in",fill:"forwards"}),d1.animate({opacity:[1,0]},{duration:bt,easing:"ease-out",fill:"forwards"})],_=a.value;return _&&w&&c&&(P(_,w.from),J(c),M.push(_.animate(y(w.to,w.from).reverse(),{duration:bt,easing:ho,fill:"forwards"}))),M}function Z1(){h1(),l1(),o.value=null,r.value=!1,i.value=!1,U="idle",n.value=null,Y(!1),T9.value&&(T9.value=null)}return S1(T9,$=>{$?n1($):n.value&&p1()}),S1(()=>t.fullPath,()=>{n.value&&(++L,Z1())}),Ue(()=>{h1(),l1(),Y(!1)}),($,r1)=>(W(),O1(wt,{to:"body"},[n.value?(W(),o1("div",{key:0,class:F1(["pm",{"is-moving":r.value,"is-closing":i.value}]),dir:"rtl"},[O("div",{ref_key:"veil",ref:s,class:"pm__veil","aria-hidden":"true"},null,512),O("div",{ref_key:"shape",ref:l,class:"pm__shape","aria-hidden":"true"},null,512),O("div",{ref_key:"sheet",ref:d,class:"pm__sheet no-scrollbar"},[(W(),O1(Nl,{id:n.value.product.id,key:n.value.product.id,initial:n.value.product,onCloseDrawer:p1},null,8,["id","initial"]))],512),o.value?(W(),o1("img",{key:0,ref_key:"ghost",ref:a,class:"pm__ghost",src:o.value,alt:"","aria-hidden":"true",decoding:"sync"},null,8,Gc)):L1("",!0)],2)):L1("",!0)]))}}),Qc=He(Yc,[["__scopeId","data-v-4b2262f9"]]);function Xc(){const{offlineReady:e,needRefresh:t,updateServiceWorker:n}=d4(),o=async()=>{await n(),e.value=!1,t.value=!1};vn(async()=>(v1(e)||v1(t))&&await o())}const Jc="0.0.1",po={version:Jc},ew=b1({__name:"App",setup(e){const t=l4(),{updateServiceWorker:n}=d4(),o=F(()=>t.currentRoute.value.meta&&t.currentRoute.value.meta.layout==="FullPage"?Ia:Pa),r=Q(!1);function i(){const l=localStorage.getItem("version");l?l!==po.version&&(r.value=!0):localStorage.setItem("version",po.version)}function s(){localStorage.setItem("version",po.version),n(),window.location.reload()}return q2(()=>{Xc(),i()}),(l,d)=>{const a=a9("router-view");return W(),o1("div",null,[(W(),O1(Do(o.value),{class:"relative"},{default:e2(()=>[b(a,null,{default:e2(({Component:k,route:u})=>[(W(),O1(z3,null,[(W(),O1(Hd,null,{default:e2(()=>[(W(),O1(Do(k),{key:u.name}))]),_:2},1024))],1024))]),_:1})]),_:1})),b(D4,{show:r.value,"onUpdate:show":d[0]||(d[0]=k=>r.value=k),art:"update",title:"نسخه جدید منتزر منتشر شد!",description:"برای استفاده از آخرین امکانات و بهبودها، برنامه را به روز رسانی کنید.","confirm-text":"به روز رسانی","cancel-text":"بعداً",onConfirm:d[1]||(d[1]=k=>s())},null,8,["show"]),b(Qc),b(Ck)])}}}),co="gold-bank:token",wo="gold-bank:customerId",Co="gold-bank:mobile",Cs="appToken",b9="gold-bank:isSalesExpert",Fl=Le("session",{state:()=>({token:localStorage.getItem(co),customerId:localStorage.getItem(wo),mobile:localStorage.getItem(Co),isSalesExpert:localStorage.getItem(b9)==="1"}),getters:{isLoggedIn:e=>!!e.token},actions:{login(e,t,n){this.token=e,this.customerId=t,this.mobile=n,localStorage.setItem(co,e),localStorage.setItem(wo,t),localStorage.setItem(Co,n),localStorage.setItem(Cs,e)},setSalesExpert(e){this.isSalesExpert=e,e?localStorage.setItem(b9,"1"):localStorage.removeItem(b9)},logout(){this.token=null,this.customerId=null,this.mobile=null,this.isSalesExpert=!1,localStorage.removeItem(b9),localStorage.removeItem(co),localStorage.removeItem(wo),localStorage.removeItem(Co),localStorage.removeItem(Cs)}}}),tw=Le("transition",{state:()=>({transitionFlag:!0,transitionEnded:!0,headerHeight:0}),actions:{setTransitionFlag(e){this.transitionFlag=e},setTransitionEnded(e){this.transitionEnded=e},setHeaderHeight(e){this.headerHeight=e}}}),s9=ea({history:B8(),scrollBehavior(e,t,n){return n||{top:0}},routes:[{path:"/home",name:"home",component:()=>T1(()=>import("./HomeView-BLj03XEk.js"),__vite__mapDeps([0,1,2,3,4,5]))},{path:"/product/:id",name:"singleProduct",component:()=>T1(()=>Promise.resolve().then(()=>Wc),void 0),props:!0,meta:{layout:"FullPage"}},{path:"/newest",name:"newestProduct",component:()=>T1(()=>import("./NewestView--pb6tWn4.js"),__vite__mapDeps([6,7,8,9,10,11,12,13])),meta:{layout:"FullPage"}},{path:"/cart",name:"cart",component:()=>T1(()=>import("./CartView-DyEDwwD2.js"),__vite__mapDeps([14,7,8,15,16,17,18,4,19,20,21]))},{path:"/login",name:"login",component:()=>T1(()=>import("./LoginRegisterView-CFYOzXdH.js"),__vite__mapDeps([22,7,8,19,20,17,18,23])),meta:{layout:"FullPage"}},{path:"/user",name:"userPage::hasSubRoute",component:()=>T1(()=>import("./DashboardView-B0WNzWOb.js"),__vite__mapDeps([24,1,2,3,4,25]))},{path:"/orders",name:"ordersList",component:()=>T1(()=>import("./OrdersView-BcT-EgU-.js"),__vite__mapDeps([26,7,8,27,28,2,15,16,17,18,4,29])),meta:{requiresAuth:!0}},{path:"/transactions",name:"transactionsList",component:()=>T1(()=>import("./TransactionsView-BaIYETDv.js"),__vite__mapDeps([30,7,8,9,10,2,15,16,17,18,31])),meta:{requiresAuth:!0}},{path:"/profile",name:"profileData",component:()=>T1(()=>import("./ProfileView-Bcb3A35W.js"),__vite__mapDeps([32,7,8,9,10,33])),meta:{requiresAuth:!0}},{path:"/favorites",name:"favoritesList",component:()=>T1(()=>import("./FavoritesView-CiVaZUZb.js"),__vite__mapDeps([34,7,8,9,10,11,12,35])),meta:{requiresAuth:!0}},{path:"/settings/appearance",name:"appearanceSettings",component:()=>T1(()=>import("./AppearanceView-ckFSThyi.js"),__vite__mapDeps([36,7,8,37]))},{path:"/ChildOrder",name:"ChildOrder",component:()=>T1(()=>import("./ChildOrdersView-qV6oiil_.js"),__vite__mapDeps([38,7,8,27,28,2,15,16,17,18,4,39])),meta:{title:"سفارش مشتریان",layout:"FullPage",requiresAuth:!0,requiresExpert:!0}},{path:"/customerChoice",name:"customerChoice",component:()=>T1(()=>import("./CustomerChoiceView-Yt6glUHR.js"),__vite__mapDeps([40,7,8,27,28,15,16,17,18,4,41])),meta:{title:"انتخاب مشتری",layout:"FullPage",requiresAuth:!0,requiresExpert:!0}},{path:"/complete_profile",name:"completeProfile",component:()=>T1(()=>import("./CompleteProfileView-h4pf7JXN.js"),__vite__mapDeps([42,7,8,43])),meta:{title:"تکمیل پروفایل",layout:"FullPage",requiresAuth:!0,requiresIncompleteProfile:!0}},{path:"/report",name:"report",component:()=>T1(()=>import("./ReportView-NtWL-hNL.js"),__vite__mapDeps([44,7,8,2,15,16,17,18,4,45])),meta:{title:"گزارش",layout:"FullPage",requiresAuth:!0}},{path:"/report/detail",name:"reportDetail",component:()=>T1(()=>import("./ReportView-NtWL-hNL.js"),__vite__mapDeps([44,7,8,2,15,16,17,18,4,45])),meta:{title:"جزئیات حساب",layout:"FullPage",requiresAuth:!0}},{path:"/notifications",name:"notifications",component:()=>T1(()=>import("./NotificationsView-QOE6v-gp.js"),__vite__mapDeps([46,7,8,47]))},{path:"/search",name:"search",component:()=>T1(()=>import("./SearchView-uJ2hiU7a.js"),__vite__mapDeps([48,7,8,27,28,16,18,20,11,12,4,49]))},{path:"/collection/:id?",name:"collection",component:()=>T1(()=>import("./CollectionView-C1GrIPCU.js"),__vite__mapDeps([50,7,8,9,10,11,12,51]))},{path:"/",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});s9.beforeEach(async e=>{const t=Fl(),n=br();if(e.name==="login"&&t.isLoggedIn)return{name:"home"};if(e.meta.requiresAuth&&!t.isLoggedIn)return{name:"login",query:{redirect:e.fullPath}};if(e.meta.requiresExpert&&!t.isSalesExpert)return{name:"userPage::hasSubRoute"};if(e.meta.requiresIncompleteProfile&&t.isLoggedIn)try{const o=await Ur.getMe();if(o.verificationStep==="VERIFIED"||o.verificationStep==="STEP_TWO_SUBMITTED")return{name:"home"}}catch{}e.name==="singleProduct"?n.setPgaTransition("slideDown"):n.setPgaTransition(void 0)});s9.afterEach(e=>{const t=br(),n=tw();n.setTransitionFlag(!1),n.setTransitionEnded(!1),setTimeout(()=>{n.setTransitionFlag(!0)},100);const o=t.navBarRoutes.find(r=>e.name===r.name);o?(t.setActiveLink(o.index),t.setNavVisibility(!0)):t.setNavVisibility(!1)});const ql="gold-bank:appearance",gs=()=>typeof matchMedia<"u"?matchMedia("(prefers-color-scheme: dark)"):null,nw=()=>typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null;function ow(){var t;const e={theme:"system",reduceMotion:!!((t=nw())!=null&&t.matches)};try{const n=localStorage.getItem(ql);if(!n)return e;const o=JSON.parse(n);return{theme:o.theme==="light"||o.theme==="dark"||o.theme==="system"?o.theme:e.theme,reduceMotion:typeof o.reduceMotion=="boolean"?o.reduceMotion:e.reduceMotion}}catch{return e}}function rw(e){try{localStorage.setItem(ql,JSON.stringify(e))}catch{}}const iw="#15171A";let vs=null;const sw=Le("appearance",{state:()=>{var e;return{...ow(),systemDark:!!((e=gs())!=null&&e.matches)}},getters:{resolvedTheme:e=>e.theme==="system"?e.systemDark?"dark":"light":e.theme,isReducedMotion:e=>e.reduceMotion},actions:{init(){var t;const e=gs();(t=e==null?void 0:e.addEventListener)==null||t.call(e,"change",n=>{this.systemDark=n.matches,this.theme==="system"&&this.apply()}),this.apply(!1)},setTheme(e){e!==this.theme&&(this.theme=e,this.save(),this.apply())},setReduceMotion(e){e!==this.reduceMotion&&(this.reduceMotion=e,this.save(),this.apply(!1))},save(){rw({theme:this.theme,reduceMotion:this.reduceMotion})},apply(e=!0){const t=document.documentElement,n=this.resolvedTheme==="dark";e&&t.classList.add("theme-switching"),t.classList.toggle("theme-dark",n),t.classList.toggle("van-theme-dark",n),t.classList.toggle("motion-reduced",this.reduceMotion);const o=document.querySelector('meta[name="theme-color"]');o&&(vs??(vs=o.getAttribute("data-light")??o.getAttribute("content")),o.setAttribute("content",n?iw:vs??"")),e&&requestAnimationFrame(()=>requestAnimationFrame(()=>t.classList.remove("theme-switching")))}}}),lw={class:"px-[16px] max-w-screen-md m-auto relative no-scrollbar"},dw=b1({__name:"Container",props:{padding:{}},setup(e){return(t,n)=>(W(),o1("main",lw,[Ln(t.$slots,"default")]))}}),fs="data:image/svg+xml,%3csvg%20width='12'%20height='9'%20viewBox='0%200%2012%209'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6%209C5.91177%205.77359%203.66177%204.75472%200%204.5C3.57353%204.37264%205.91177%203.18396%206%200C6.08824%203.22642%208.38235%204.4151%2012%204.5C8.38235%204.75472%206.08824%205.77359%206%209Z'%20fill='%238D6A46'/%3e%3c/svg%3e",c9=b7(ew);c9.use(B7());sw().init();c9.use(s9);Kp(()=>{Fl().logout(),s9.currentRoute.value.name!=="login"&&s9.push({name:"login"})});c9.use(G7,{loading:fs,error:fs});c9.component("container",dw);c9.mount("#app");export{mw as $,Bw as A,a9 as B,l4 as C,tw as D,Ht as E,f1 as F,cw as G,Ln as H,q1 as I,Up as J,W1 as K,gr as L,tc as M,K2 as N,Fl as O,D4 as P,S1 as Q,uw as R,ta as S,Hr as T,L4 as U,bn as V,Xk as W,Qk as X,vr as Y,Dn as Z,He as _,Ue as a,Vw as a$,Fe as a0,u1 as a1,U2 as a2,Ok as a3,Ik as a4,y4 as a5,Ak as a6,l2 as a7,U1 as a8,z1 as a9,R5 as aA,Pr as aB,Or as aC,Ar as aD,hr as aE,_u as aF,B4 as aG,w1 as aH,Tp as aI,_w as aJ,Su as aK,Br as aL,Xp as aM,B0 as aN,bw as aO,Uh as aP,S4 as aQ,Lw as aR,Fr as aS,yw as aT,aw as aU,Mw as aV,ou as aW,jw as aX,fw as aY,ru as aZ,xw as a_,Pn as aa,o9 as ab,Er as ac,vn as ad,gp as ae,B9 as af,eu as ag,ae as ah,k9 as ai,Hp as aj,nn as ak,ks as al,Bl as am,Me as an,iu as ao,p9 as ap,tr as aq,b4 as ar,tn as as,Zw as at,Dw as au,_2 as av,Hw as aw,bi as ax,on as ay,Ou as az,O as b,Cr as b0,B6 as b1,$k as b2,pw as b3,b0 as b4,hw as b5,de as b6,R2 as b7,rt as b8,h9 as b9,Sn as ba,vw as bb,En as bc,Cw as bd,v4 as be,m4 as bf,ww as bg,gw as bh,j6 as bi,wt as bj,o1 as c,b1 as d,L1 as e,W as f,Q as g,F as h,F1 as i,O1 as j,Wp as k,kw as l,v1 as m,re as n,q2 as o,b as p,Le as q,nt as r,Ur as s,M1 as t,sw as u,Jp as v,cr as w,v2 as x,Mk as y,e2 as z}; + `),"".concat(fp,"-dynamic-theme")):vp(!1,"ConfigProvider","SSR do not support dynamic theme with css variables.")}var Ol=Symbol("GlobalFormContextKey"),Mp=function(t){Me(Ol,t)},Bw=function(){return z1(Ol,{validateMessages:N(function(){})})},jp=function(){return{getTargetContainer:{type:Function},getPopupContainer:{type:Function},prefixCls:String,getPrefixCls:{type:Function},renderEmpty:{type:Function},transformCellText:{type:Function},csp:{type:Object,default:void 0},input:{type:Object},autoInsertSpaceInButton:{type:Boolean,default:void 0},locale:{type:Object,default:void 0},pageHeader:{type:Object},componentSize:{type:String},direction:{type:String},space:{type:Object},virtual:{type:Boolean,default:void 0},dropdownMatchSelectWidth:{type:[Number,Boolean],default:!0},form:{type:Object,default:void 0},notUpdateGlobalConfig:Boolean}},xp="ant";function it(){return p2.prefixCls||xp}var er=W1({}),Al=W1({}),p2=W1({});vn(function(){Ne(p2,er,Al),p2.prefixCls=it(),p2.getPrefixCls=function(e,t){return t||(e?"".concat(p2.prefixCls,"-").concat(e):p2.prefixCls)},p2.getRootPrefixCls=function(e,t){return e||(p2.prefixCls?p2.prefixCls:t&&t.includes("-")?t.replace(/^(.*)-[^-]*$/,"$1"):it())}});var ko,Dp=function(t){ko&&ko(),ko=vn(function(){Ne(Al,W1(t)),Ne(p2,W1(t))}),t.theme&&mp(it(),t.theme)},Lp=function(){return{getPrefixCls:function(n,o){return o||(n?"".concat(it(),"-").concat(n):it())},getRootPrefixCls:function(n,o){return n||(p2.prefixCls?p2.prefixCls:o&&o.includes("-")?o.replace(/^(.*)-[^-]*$/,"$1"):it())}}},qt=b1({compatConfig:{MODE:3},name:"AConfigProvider",inheritAttrs:!1,props:jp(),setup:function(t,n){var o=n.slots,r=function(u,h){var p=t.prefixCls,C=p===void 0?"ant":p;return u?"".concat(C,"-").concat(u):C},i=function(u){var h=t.renderEmpty||o.renderEmpty||K4;return h(u)},s=function(u,h){var p=t.prefixCls;if(h)return h;var C=p||r("");return u?"".concat(C,"-").concat(u):C},l=W1(u1(u1({},t),{},{getPrefixCls:s,renderEmpty:i}));Object.keys(t).forEach(function(k){E1(function(){return t[k]},function(){l[k]=t[k]})}),t.notUpdateGlobalConfig||(Ne(er,l),E1(l,function(){Ne(er,l)}));var d=N(function(){var k={};if(t.locale){var u,h;k=((u=t.locale.Form)===null||u===void 0?void 0:u.defaultValidateMessages)||((h=on.Form)===null||h===void 0?void 0:h.defaultValidateMessages)||{}}return t.form&&t.form.validateMessages&&(k=u1(u1({},k),t.form.validateMessages)),k});Mp({validateMessages:d}),Me("configProvider",l);var a=function(u){var h;return b(Ou,{locale:t.locale||u,ANT_MARK__:Uo},{default:function(){return[(h=o.default)===null||h===void 0?void 0:h.call(o)]}})};return vn(function(){t.direction&&(ln.config({rtl:t.direction==="rtl"}),i9.config({rtl:t.direction==="rtl"}))}),function(){return b(A4,{children:function(u,h,p){return a(p)}},null)}}}),Pl=W1({getPrefixCls:function(t,n){return n||(t?"ant-".concat(t):"ant")},renderEmpty:K4,direction:"ltr"});qt.config=Dp;qt.install=function(e){e.component(qt.name,qt)};const An=function(e,t){var n=z1("configProvider",Pl),o=N(function(){return n.getPrefixCls(e,t.prefixCls)}),r=N(function(){var g;return(g=t.direction)!==null&&g!==void 0?g:n.direction}),i=N(function(){return n.getPrefixCls()}),s=N(function(){return n.autoInsertSpaceInButton}),l=N(function(){return n.renderEmpty}),d=N(function(){return n.space}),a=N(function(){return n.pageHeader}),k=N(function(){return n.form}),u=N(function(){return t.getTargetContainer||n.getTargetContainer}),h=N(function(){return t.getPopupContainer||n.getPopupContainer}),p=N(function(){var g;return(g=t.dropdownMatchSelectWidth)!==null&&g!==void 0?g:n.dropdownMatchSelectWidth}),C=N(function(){return(t.virtual===void 0?n.virtual!==!1:t.virtual!==!1)&&p.value!==!1}),v=N(function(){return t.size||n.componentSize}),m=N(function(){var g;return t.autocomplete||((g=n.input)===null||g===void 0?void 0:g.autocomplete)}),H=N(function(){return n.csp});return{configProvider:n,prefixCls:o,direction:r,size:v,getTargetContainer:u,getPopupContainer:h,space:d,pageHeader:a,form:k,autoInsertSpaceInButton:s,renderEmpty:l,virtual:C,dropdownMatchSelectWidth:p,rootPrefixCls:i,getPrefixCls:n.getPrefixCls,autocomplete:m,csp:H}};function tr(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Hp="[object Symbol]";function Vp(e){return typeof e=="symbol"||Jk(e)&&Xk(e)==Hp}var yp=/\s/;function bp(e){for(var t=e.length;t--&&yp.test(e.charAt(t)););return t}var Zp=/^\s+/;function _p(e){return e&&e.slice(0,bp(e)+1).replace(Zp,"")}var as=NaN,Bp=/^[-+]0x[0-9a-f]+$/i,Ep=/^0b[01]+$/i,Sp=/^0o[0-7]+$/i,Op=parseInt;function ks(e){if(typeof e=="number")return e;if(Vp(e))return as;if(tr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=tr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=_p(e);var n=Ep.test(e);return n||Sp.test(e)?Op(e.slice(2),n?2:8):Bp.test(e)?as:+e}var uo=function(){return Z4.Date.now()},Ap="Expected a function",Pp=Math.max,Tp=Math.min;function Ip(e,t,n){var o,r,i,s,l,d,a=0,k=!1,u=!1,h=!0;if(typeof e!="function")throw new TypeError(Ap);t=ks(t)||0,tr(n)&&(k=!!n.leading,u="maxWait"in n,i=u?Pp(ks(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h);function p(D){var y=o,A=r;return o=r=void 0,a=D,s=e.apply(A,y),s}function C(D){return a=D,l=setTimeout(H,t),k?p(D):s}function v(D){var y=D-d,A=D-a,L=t-y;return u?Tp(L,i-A):L}function m(D){var y=D-d,A=D-a;return d===void 0||y>=t||y<0||u&&A>=i}function H(){var D=uo();if(m(D))return g(D);l=setTimeout(H,v(D))}function g(D){return l=void 0,h&&o?p(D):(o=r=void 0,s)}function j(){l!==void 0&&clearTimeout(l),a=0,o=d=r=l=void 0}function f(){return l===void 0?s:g(uo())}function x(){var D=uo(),y=m(D);if(o=arguments,r=this,d=D,y){if(l===void 0)return C(d);if(u)return clearTimeout(l),l=setTimeout(H,t),p(d)}return l===void 0&&(l=setTimeout(H,t)),s}return x.cancel=j,x.flush=f,x}var Rp=["class","style"],$p=function(){return{prefixCls:String,spinning:{type:Boolean,default:void 0},size:String,wrapperClassName:String,tip:o9.any,delay:Number,indicator:o9.any}},P9=null;function Fp(e,t){return!!e&&!!t&&!isNaN(Number(t))}function Np(e){var t=e.indicator;P9=typeof t=="function"?t:function(){return b(t,null,null)}}const Ut=b1({compatConfig:{MODE:3},name:"ASpin",inheritAttrs:!1,props:tu($p(),{size:"default",spinning:!0,wrapperClassName:""}),setup:function(){return{originalUpdateSpinning:null,configProvider:z1("configProvider",Pl)}},data:function(){var t=this.spinning,n=this.delay,o=Fp(t,n);return{sSpinning:t&&!o}},created:function(){this.originalUpdateSpinning=this.updateSpinning,this.debouncifyUpdateSpinning(this.$props)},mounted:function(){this.updateSpinning()},updated:function(){var t=this;v2(function(){t.debouncifyUpdateSpinning(),t.updateSpinning()})},beforeUnmount:function(){this.cancelExistingSpin()},methods:{debouncifyUpdateSpinning:function(t){var n=t||this.$props,o=n.delay;o&&(this.cancelExistingSpin(),this.updateSpinning=Ip(this.originalUpdateSpinning,o))},updateSpinning:function(){var t=this.spinning,n=this.sSpinning;n!==t&&(this.sSpinning=t)},cancelExistingSpin:function(){var t=this.updateSpinning;t&&t.cancel&&t.cancel()},renderIndicator:function(t){var n="".concat(t,"-dot"),o=iu(this,"indicator");return o===null?null:(Array.isArray(o)&&(o=o.length===1?o[0]:o),a2(o)?_2(o,{class:n}):P9&&a2(P9())?_2(P9(),{class:n}):b("span",{class:"".concat(n," ").concat(t,"-dot-spin")},[b("i",{class:"".concat(t,"-dot-item")},null),b("i",{class:"".concat(t,"-dot-item")},null),b("i",{class:"".concat(t,"-dot-item")},null),b("i",{class:"".concat(t,"-dot-item")},null)]))}},render:function(){var t,n,o,r=this.$props,i=r.size,s=r.prefixCls,l=r.tip,d=l===void 0?(t=(n=this.$slots).tip)===null||t===void 0?void 0:t.call(n):l,a=r.wrapperClassName,k=this.$attrs,u=k.class,h=k.style,p=Br(k,Rp),C=this.configProvider,v=C.getPrefixCls,m=C.direction,H=v("spin",s),g=this.sSpinning,j=(o={},U1(o,H,!0),U1(o,"".concat(H,"-sm"),i==="small"),U1(o,"".concat(H,"-lg"),i==="large"),U1(o,"".concat(H,"-spinning"),g),U1(o,"".concat(H,"-show-text"),!!d),U1(o,"".concat(H,"-rtl"),m==="rtl"),U1(o,u,!!u),o),f=b("div",u1(u1({},p),{},{style:h,class:j}),[this.renderIndicator(H),d?b("div",{class:"".concat(H,"-text")},[d]):null]),x=ru(this);if(x&&x.length){var D,y=(D={},U1(D,"".concat(H,"-container"),!0),U1(D,"".concat(H,"-blur"),g),D);return b("div",{class:["".concat(H,"-nested-loading"),a]},[g&&b("div",{key:"loading"},[f]),b("div",{class:y,key:"container"},[x])])}return f}});Ut.setDefaultIndicator=Np;Ut.install=function(e){return e.component(Ut.name,Ut),e};const qp={key:0,src:jk,alt:"Montzar",class:"spinner-brand",width:"48",height:"48"},Up={key:1,class:"loading keep-motion"},zp=b1({__name:"Spinner",props:{tip:{},size:{default:"large"},cls:{},delay:{},spinning:{type:Boolean},indicator:{type:Boolean},fixed:{type:Boolean,default:!0}},setup(e){return(t,n)=>(W(),O1(v1(Ut),{spinning:e.spinning,tip:e.tip,size:e.size,delay:e.delay,class:N1(e.fixed?"!max-h-screen !fixed":"")},{indicator:e2(()=>[e.indicator?(W(),o1("div",Up,[...n[0]||(n[0]=[O("div",{class:"effect-1 effects"},null,-1),O("div",{class:"effect-2 effects"},null,-1),O("div",{class:"effect-3 effects"},null,-1)])])):(W(),o1("img",qp))]),default:e2(()=>[O("div",{class:N1(e.cls)},[Ln(t.$slots,"default")],2)]),_:3},8,["spinning","tip","size","delay","class"]))}});function Tl(e){return(e.qty??0)>0||!!e.isPreOrder}function Wp(e){if(!e||e.length===0)return null;const t=e.filter(Tl);return(t.length?t:e).reduce((o,r)=>parseFloat(r.defaultWagePercent){var m,H;return(H=(m=n.value.images)==null?void 0:m[0])==null?void 0:H.url}),r=N(()=>n.value.id),i=N(()=>n.value.title),s=N(()=>n.value.variants),l=Q(t??Wp(v1(s))),d=N(()=>l.value?parseFloat(l.value.rashWeightGrams):0),a=N(()=>l.value?parseFloat(l.value.defaultWagePercent):null),k=Q(null),u=N(()=>{var m;return((m=l.value)==null?void 0:m.qty)??0}),h=N(()=>{var m;return((m=l.value)==null?void 0:m.isPreOrder)??!1}),p=N(()=>u.value>0||h.value),C=N(()=>n.value.productCode??null);return{product:n,image:o,id:r,title:i,productCode:C,variants:s,selectedVariant:l,min_gram:d,wage:a,hasDiscountWage:k,qty:u,isPreOrder:h,is_exist:p,has_warranty:Q(!1)}}const Il="/api",Kp="gold-bank:token";let Re=null;function Yp(e){Re=e}class Rl extends Error{constructor(t){super(`API ${t} rejected the session (401)`),this.name="UnauthorizedError"}}function $l(){try{return localStorage.getItem(Kp)}catch{return null}}async function K1(e,t){const n=$l(),o=await fetch(`${Il}${e}`,{...t,headers:{"Content-Type":"application/json",...n?{Authorization:`Bearer ${n}`}:{},...t==null?void 0:t.headers}});if(o.status===401)throw Re==null||Re(),new Rl(e);if(!o.ok){const r=await o.text();throw new Error(`API ${e} failed (${o.status}): ${r}`)}return o.json()}const Ur={listProducts:()=>K1("/catalog/products"),requestOtp:e=>K1("/customer/auth/request-otp",{method:"POST",body:JSON.stringify({username:e})}),verifyOtp:(e,t)=>K1("/customer/auth/verify-otp",{method:"POST",body:JSON.stringify({username:e,password:t})}),getMe:()=>K1("/customer/me"),getMyOrders:()=>K1("/customer/me/orders"),getMyLedgerEntries:()=>K1("/customer/me/ledger-entries"),createOrder:e=>K1("/orders",{method:"POST",body:JSON.stringify(e)}),getLatestGoldPrice:(e=750)=>K1(`/pricing/latest?karatPerMille=${e}`),getHomeSlider:()=>K1("/home/slider"),getExpertIdentity:()=>K1("/expert/whoami"),getExpertCustomers:e=>K1("/expert/my-customers",{method:"POST",body:JSON.stringify({search:e??null})}),getExpertChildOrders:(e=1,t)=>K1("/expert/child-orders",{method:"POST",body:JSON.stringify({page:e,search:t??null})}),uploadDocument:async(e,t)=>{const n=new FormData;n.append("file",e),n.append("purpose",t);const o=$l(),r=await fetch(`${Il}/customer/me/documents`,{method:"POST",headers:o?{Authorization:`Bearer ${o}`}:{},body:n});if(r.status===401)throw Re==null||Re(),new Rl("/customer/me/documents");if(!r.ok)throw new Error(`آپلود فایل ناموفق بود (${r.status})`);return r.json()},completeProfile:e=>K1("/customer/me/complete-profile",{method:"POST",body:JSON.stringify(e)}),getReport:(e=1)=>K1(`/customer/me/report?page=${e}`),getReportDetailList:(e=1)=>K1(`/customer/me/report/detail?page=${e}`),getReportBalances:()=>K1("/customer/me/report/balances"),getReportDocument:e=>K1(`/customer/me/report/${encodeURIComponent(e)}`)},Qp=600;function Xp(e,t){const n=Q(!1),o=Q(!!t),r=Q(!1),i=Q(t??null);return{loading:n,flag:o,notFound:r,productRef:i,load:async()=>{const l=i.value!==null;l?await new Promise(d=>setTimeout(d,Qp)):n.value=!0;try{const a=(await Ur.listProducts()).find(k=>k.id===e)??null;l?a&&JSON.stringify(a)!==JSON.stringify(i.value)&&(i.value=a):(i.value=a,r.value=!a),o.value=!0}catch(d){console.log(d)}finally{n.value=!1}}}}const Jp=Le("favorites",{state:()=>({ids:[]}),actions:{toggle(e){const t=this.ids.indexOf(e);t===-1?this.ids.push(e):this.ids.splice(t,1)},isFavorite(e){return this.ids.includes(e)}}}),us=()=>({colors:[],brands:[],ciny_id:[],limit_percent:[],limit_gram:[],has_discount:!1,text:void 0,cats:void 0,page:0}),ec=Le("filters",{state:()=>({query:us()}),actions:{reset(){this.query=us()}}}),Fl="appCart";function tc(){try{const e=localStorage.getItem(Fl);return e?JSON.parse(e):[]}catch{return[]}}function yt(e){localStorage.setItem(Fl,JSON.stringify(e))}const nc=Le("cart",{state:()=>({items:tc()}),actions:{async init(){try{const e=await Ur.listProducts(),t=[];for(const n of this.items){const o=e.find(i=>i.id===n.pid),r=o==null?void 0:o.variants.find(i=>i.id===n.vid);o&&r&&t.push({...n,product:o})}this.items=t,yt(this.items)}catch(e){console.log(e)}},addToCart(e){var o,r;const t=(r=(o=e.product)==null?void 0:o.variants)==null?void 0:r.find(i=>i.id===e.vid);if(!t||!((t.qty??0)>0||t.isPreOrder))return!1;const n=this.find_index(e);return n===-1?this.items.push({...e,qty:this.capQty(e.qty,t)}):(this.items[n].product=e.product,this.items[n].qty=this.capQty(e.qty,t)),yt(this.items),!0},capQty(e,t){const n=Math.max(1,Math.floor(e)||1);if(t.isPreOrder)return n;const o=t.qty??0;return o>0?Math.min(n,o):n},maxQty(e){const t=this.find_index(e);if(t===-1)return null;const n=this.variant(this.items[t]);return!n||n.isPreOrder?null:(n.qty??0)>0?n.qty:null},remove(e){const t=this.find_index(e);t>-1&&this.items.splice(t,1),yt(this.items)},updateFeild(e,t,n,o){if(!this.isInCart(n))return!1;const r=t??this.find_index(n);if(o==="qty"){const i=this.variant(this.items[r]);e=i?this.capQty(Number(e),i):Math.max(1,Number(e)||1)}return this.items[r][o]=e,yt(this.items),!0},find_index(e){return this.items.findIndex(t=>t.pid===e.pid&&t.vid===e.vid)},isInCart(e){return this.find_index(e)>-1},variant(e){return e.product.variants.find(t=>t.id===e.vid)},total(){return this.items.reduce((e,t)=>{const n=this.variant(t);return e+(n?parseFloat(n.rashWeightGrams)*t.qty:0)},0).toFixed(2)},clear(){this.items=[],yt(this.items)}}});function oc(){return localStorage.getItem("appToken")}const rc={class:"pd__controls"},ic={class:"pd__headerTitle"},sc={class:"pd__controlsEnd"},lc={key:0,class:"pd__roundBadge"},dc={class:"pd__gallery"},ac={key:0,class:"pd__rail"},kc=["aria-label","onClick"],uc={key:1,class:"pd__stage pd__stage--empty"},hc={key:2,class:"pd__expand","aria-hidden":"true"},pc={class:"pd__scroll"},cc={class:"pd__sheet"},wc={class:"pd__eyebrow"},Cc={class:"pd__eyebrowText"},gc={class:"pd__head"},vc={class:"pd__headMain"},fc={class:"pd__title"},mc={key:0,class:"pd__code"},Mc={class:"pd__figures"},jc={class:"pd__figure"},xc={class:"pd__figureValue"},Dc={key:0,class:"pd__figure pd__figure--accent"},Lc={class:"pd__figureValue"},Hc={key:0,class:"pd__chips no-scrollbar"},Vc=["disabled","onClick"],yc={key:1,class:"pd__block"},bc={class:"pd__block"},Zc={class:"pd__specs"},_c={class:"pd__spec"},Bc={key:0,class:"pd__spec"},Ec={key:1,class:"pd__spec"},Sc={key:2,class:"pd__spec"},Oc={key:3,class:"pd__spec"},Ac={class:"pd__bar"},Pc={key:0,class:"pd__qty"},Tc={class:"pd__qtyValue"},Ic=["aria-label"],Rc={class:"pd__pillText"},$c=["disabled"],Fc={key:0,class:"pd__previewCounter"},Nc={key:1,class:"pd__previewThumbs no-scrollbar"},qc=["aria-label","onClick"],Uc=["src","alt"],zc=56,Wc=b1({__name:"SingleProduct",props:{id:{},initial:{}},emits:["closeDrawer"],setup(e,{emit:t}){const n=e,o=t,r=g4(),i=Jp(),s=ec(),l=nc(),d=()=>{o("closeDrawer"),r.currentRoute.value.name==="singleProduct"&&r.back()},a=Q(!1),k=Q(0),u=Q(!1),h=Q(null),p=Q(!1);function C(){var T;const E=h.value;if(!E)return;const Z=((T=E.querySelector(".pd__gallery"))==null?void 0:T.clientHeight)??0;p.value=E.scrollTop>Math.max(Z-zc,0)}const v=Xp(n.id,n.initial),m=v.loading,H=v.flag,g={id:n.id,title:"",description:null,variants:[],images:[],category:null,brand:null,collections:[]},j=N(()=>Gp(v.productRef.value??g)),f=N(()=>j.value.id.value),x=N(()=>j.value.title.value),D=N(()=>j.value.productCode.value),y=N(()=>j.value.variants.value),A=N({get:()=>j.value.selectedVariant.value,set:E=>j.value.selectedVariant.value=E}),L=N(()=>j.value.min_gram.value),P=N(()=>j.value.wage.value),U=N(()=>j.value.qty.value),I=N(()=>j.value.isPreOrder.value),J=N(()=>j.value.is_exist.value),l1=N(()=>{var E;return((E=v.productRef.value)==null?void 0:E.description)??""}),h1=N(()=>l1.value.length>120),k1=N(()=>{var E,Z;return((Z=(E=v.productRef.value)==null?void 0:E.category)==null?void 0:Z.id)??""}),Y=N(()=>{var E,Z;return((Z=(E=v.productRef.value)==null?void 0:E.category)==null?void 0:Z.title)??""}),n1=N(()=>{var E,Z;return((Z=(E=v.productRef.value)==null?void 0:E.brand)==null?void 0:Z.title)??""}),C1=N(()=>{var E;return(((E=v.productRef.value)==null?void 0:E.images.length)??0)>0}),p1=N(()=>{var E;return((E=v.productRef.value)==null?void 0:E.images.map(Z=>Z.url))??[]});E1(p1,E=>{k.value>E.length-1&&(k.value=0)});const S1=Q(!1);function Z1(){C1.value&&(S1.value=!0,document.body.style.overflow="hidden")}function $(){S1.value=!1,document.body.style.overflow=""}const r1=N(()=>{const E=P.value;return E==null?"":E%1===0?String(E):E.toFixed(2)}),d1=N(()=>U.value>0?`${U.value} عدد موجود`:I.value?"پیش‌سفارش":"ناموجود"),t1=N(()=>U.value>0?"is-in":I.value?"is-pre":"is-out"),V=N(()=>{var E,Z;return{vid:((E=A.value)==null?void 0:E.id)??"",note:null,pid:((Z=v.productRef.value)==null?void 0:Z.id)??n.id,product:v.productRef.value??g,qty:1}}),F=N(()=>l.isInCart(V.value)),R=N(()=>l.find_index(V.value)),K=N(()=>R.value>-1?l.items[R.value].qty:0),i1=N(()=>l.maxQty(V.value)),c=N(()=>i1.value===null||K.value{c.value&&l.updateFeild(K.value+1,R.value,V.value,"qty")},M=()=>{if(K.value<=1){l.remove(V.value);return}l.updateFeild(K.value-1,R.value,V.value,"qty")},_=E=>Tl(E),S=()=>{l.addToCart(V.value)&&H4.success("محصول با موفقیت به سبد خرید افزوده شد",{title:"ثبت سفارش"})},B=E=>{E.stopPropagation(),i.toggle(n.id)},q=()=>{k1.value&&(s.query.cats=[k1.value],o("closeDrawer"),r.push({name:"search"}))};return gr(async()=>{await v.load()}),Ue(()=>{S1.value&&(document.body.style.overflow="")}),(E,Z)=>{const T=a9("router-link");return v1(H)&&v1(v).productRef.value?(W(),O1(zp,{key:0,spinning:v1(m),tip:"درحال دریافت اطلاعات"},{default:e2(()=>[O("article",{class:"pd",ref_key:"scroller",ref:h,onScrollPassive:C},[O("header",{class:N1(["pd__header",{"is-solid":p.value}])},[O("div",rc,[O("button",{type:"button",class:"pd__round","aria-label":"بازگشت",onClick:d},[b(q1,{icon:"vuesax-linear:arrow-right-1",size:"18"})]),O("h2",ic,M1(x.value),1),O("div",sc,[O("button",{type:"button",class:N1(["pd__round",{"is-on":v1(i).isFavorite(f.value)}]),"aria-label":"علاقه‌مندی",onClick:B},[b(q1,{icon:v1(i).isFavorite(f.value)?"vuesax-linear:heart-fill":"vuesax-linear:heart",size:"18"},null,8,["icon"])],2),b(T,{class:"pd__round",to:{name:"cart"},"aria-label":"سبد خرید"},{default:e2(()=>[b(q1,{icon:"vuesax-linear:bag-2",size:"18"}),v1(l).items.length?(W(),o1("span",lc,M1(v1(l).items.length),1)):L1("",!0)]),_:1})])])],2),O("div",dc,[C1.value?(W(),O1(Hi,{key:0,index:k.value,"onUpdate:index":Z[0]||(Z[0]=G=>k.value=G),slides:p1.value,alt:x.value,class:"pd__stage",onTap:Z1},{dots:e2(({index:G,go:z})=>[p1.value.length>1?(W(),o1("div",ac,[(W(!0),o1(f1,null,nt(p1.value,(e1,s1)=>(W(),o1("button",{key:e1,type:"button",class:N1(["pd__railDot",{"is-on":s1===G}]),"aria-label":`تصویر ${s1+1}`,onClick:B0(c1=>z(s1),["stop"])},null,10,kc))),128))])):L1("",!0)]),_:1},8,["index","slides","alt"])):(W(),o1("div",uc,[b(q1,{icon:"vuesax-linear:diamonds",size:"27"})])),C1.value?(W(),o1("span",hc,[b(q1,{icon:"vuesax-linear:maximize-4",size:"15"})])):L1("",!0)]),O("div",pc,[O("div",cc,[Z[16]||(Z[16]=O("div",{class:"pd__grip","aria-hidden":"true"},null,-1)),O("div",wc,[O("span",Cc,M1(Y.value||"محصول"),1),O("span",{class:N1(["pd__stock",t1.value])},[Z[6]||(Z[6]=O("span",{class:"pd__stockDot","aria-hidden":"true"},null,-1)),K2(" "+M1(d1.value),1)],2)]),O("header",gc,[O("div",vc,[O("h1",fc,M1(x.value),1),D.value?(W(),o1("p",mc,M1(D.value),1)):L1("",!0)]),O("div",Mc,[O("div",jc,[O("span",xc,M1(L.value),1),Z[7]||(Z[7]=O("span",{class:"pd__figureLabel"},"گرم",-1))]),P.value!=null?(W(),o1("div",Dc,[O("span",Lc,M1(r1.value)+"٪",1),Z[8]||(Z[8]=O("span",{class:"pd__figureLabel"},"اجرت",-1))])):L1("",!0)])]),y.value&&y.value.length>1?(W(),o1("section",Hc,[(W(!0),o1(f1,null,nt(y.value,G=>{var z;return W(),o1("button",{key:G.id,type:"button",class:N1(["pd__chip",{"is-on":((z=A.value)==null?void 0:z.id)===G.id,"is-out":!_(G)}]),disabled:!_(G),onClick:e1=>A.value=G},M1(G.title),11,Vc)}),128))])):L1("",!0),l1.value?(W(),o1("section",yc,[Z[9]||(Z[9]=O("h2",{class:"pd__blockTitle"},"توضیحات",-1)),O("p",{class:N1(["pd__body",{"is-clamped":!u.value}])},M1(l1.value),3),h1.value?(W(),o1("button",{key:0,type:"button",class:"pd__more",onClick:Z[1]||(Z[1]=G=>u.value=!u.value)},M1(u.value?"بستن":"ادامه مطلب"),1)):L1("",!0)])):L1("",!0),O("section",bc,[Z[15]||(Z[15]=O("h2",{class:"pd__blockTitle"},"مشخصات",-1)),O("dl",Zc,[O("div",_c,[O("dt",null,[b(q1,{icon:"vuesax-linear:weight",size:"15"}),Z[10]||(Z[10]=K2(" وزن",-1))]),O("dd",null,M1(L.value)+" گرم",1)]),P.value!=null?(W(),o1("div",Bc,[O("dt",null,[b(q1,{icon:"vuesax-linear:percentage-square",size:"15"}),Z[11]||(Z[11]=K2(" اجرت",-1))]),O("dd",null,M1(r1.value)+"٪",1)])):L1("",!0),A.value?(W(),o1("div",Ec,[O("dt",null,[b(q1,{icon:"vuesax-linear:diamonds",size:"15"}),Z[12]||(Z[12]=K2(" تنوع",-1))]),O("dd",null,M1(A.value.title),1)])):L1("",!0),Y.value?(W(),o1("div",Sc,[O("dt",null,[b(q1,{icon:"vuesax-linear:category",size:"15"}),Z[13]||(Z[13]=K2(" دسته‌بندی",-1))]),O("dd",null,M1(Y.value),1)])):L1("",!0),n1.value?(W(),o1("div",Oc,[O("dt",null,[b(q1,{icon:"vuesax-linear:shop",size:"15"}),Z[14]||(Z[14]=K2(" برند",-1))]),O("dd",null,M1(n1.value),1)])):L1("",!0)])])])]),O("div",Ac,[F.value?(W(),o1("div",Pc,[O("button",{type:"button",class:"pd__qtyBtn","aria-label":"افزایش",onClick:w},[b(q1,{icon:"vuesax-linear:add",size:"15"})]),O("span",Tc,M1(K.value),1),O("button",{type:"button",class:"pd__qtyBtn","aria-label":K.value===1?"حذف":"کاهش",onClick:M},[b(q1,{icon:K.value===1?"vuesax-linear:trash":"vuesax-linear:minus",size:"15"},null,8,["icon"])],8,Ic)])):Y.value?(W(),o1("button",{key:1,type:"button",class:"pd__pill",onClick:q},[b(q1,{icon:"vuesax-linear:category",size:"17"}),O("span",Rc,M1(Y.value),1)])):L1("",!0),F.value?(W(),O1(T,{key:3,class:"pd__cta",to:{name:"cart"}},{default:e2(()=>[b(q1,{icon:"vuesax-linear:bag-2",size:"17"}),Z[17]||(Z[17]=K2(" مشاهده سبد خرید ",-1))]),_:1})):(W(),o1("button",{key:2,type:"button",class:"pd__cta",disabled:!J.value,onClick:Z[2]||(Z[2]=G=>v1(oc)()?S():a.value=!0)},[J.value?(W(),O1(q1,{key:0,icon:"vuesax-linear:bag-2",size:"17"})):L1("",!0),K2(" "+M1(J.value?"افزودن به سفارش":"ناموجود"),1)],8,$c))])],544),(W(),O1(wt,{to:"body"},[b(bn,{name:"pd-preview"},{default:e2(()=>[S1.value?(W(),o1("div",{key:0,class:"pd__preview",onClick:B0($,["self"])},[O("button",{type:"button",class:"pd__previewClose","aria-label":"بستن",onClick:$},[b(q1,{icon:"vuesax-linear:add",size:"20"})]),p1.value.length>1?(W(),o1("div",Fc,M1(k.value+1)+" / "+M1(p1.value.length),1)):L1("",!0),b(Hi,{index:k.value,"onUpdate:index":Z[3]||(Z[3]=G=>k.value=G),slides:p1.value,alt:x.value,class:"pd__previewStage",fit:"contain"},null,8,["index","slides","alt"]),p1.value.length>1?(W(),o1("div",Nc,[(W(!0),o1(f1,null,nt(p1.value,(G,z)=>(W(),o1("button",{key:G,type:"button",class:N1(["pd__previewThumb",{"is-on":z===k.value}]),"aria-label":`تصویر ${z+1}`,onClick:e1=>k.value=z},[O("img",{src:G,alt:`${x.value} ${z+1}`,draggable:"false"},null,8,Uc)],10,qc))),128))])):L1("",!0)])):L1("",!0)]),_:1})])),b(L4,{show:a.value,"onUpdate:show":Z[4]||(Z[4]=G=>a.value=G),art:"login",title:"ابتدا وارد حساب کاربری شوید",description:"برای دسترسی به تمامی امکانات نرم افزار منتزر، گزینه ورود/ثبت نام را لمس کنید و در صورت نداشتن حساب کاربری، ثبت نام نمایید.","confirm-text":"ورود/ثبت نام","cancel-text":"بیخیال",onConfirm:Z[5]||(Z[5]=G=>v1(r).push({name:"login"}))},null,8,["show"])]),_:1},8,["spinning"])):L1("",!0)}}}),Nl=He(Wc,[["__scopeId","data-v-3162e70f"]]),Gc=Object.freeze(Object.defineProperty({__proto__:null,default:Nl},Symbol.toStringTag,{value:"Module"})),T9=hr(null);let I9=null;typeof document<"u"&&document.addEventListener("pointerdown",e=>{I9=e.target instanceof Element?e.target:null},{capture:!0,passive:!0});function Ew(e,t){const n=(I9==null?void 0:I9.closest("[data-product-origin]"))??null;T9.value={product:e,origin:t??n}}const Kc=["src"],Ke=420,bt=300,hs=300,ps=220,ho="cubic-bezier(0.32, 0.72, 0, 1)",Yc="cubic-bezier(0.22, 1, 0.36, 1)",cs=.9,ws="inset(0px 0px 0px 0px round 0px)",Qc=b1({__name:"ProductMorph",setup(e){const t=Ka(),n=hr(null),o=Q(null),r=Q(!1),i=Q(!1),s=Q(null),l=Q(null),d=Q(null),a=Q(null);function k($=.82,r1=7,d1=32){const t1=Math.sqrt(1-$*$),V=[];for(let F=0;F<=d1;F++){const R=F/d1*r1,K=F===d1?1:1-Math.exp(-$*R)*(Math.cos(t1*R)+$/t1*Math.sin(t1*R));V.push(String(+K.toFixed(4)))}return`linear(${V.join(", ")})`}const h=typeof CSS<"u"&&CSS.supports("animation-timing-function","linear(0, 1)")?k():"cubic-bezier(0.22, 1, 0.36, 1)",p=()=>document.documentElement.classList.contains("motion-reduced")||typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function C($,r1,d1){const t1=$.getBoundingClientRect(),V=getComputedStyle($),F=parseFloat(V.paddingLeft)||0,R=parseFloat(V.paddingRight)||0,K=parseFloat(V.paddingTop)||0,i1=parseFloat(V.paddingBottom)||0,c=t1.left+F,w=t1.top+K,M=t1.width-F-R,_=t1.height-K-i1;if(V.objectFit!=="contain"&&V.objectFit!=="scale-down")return{x:c,y:w,w:M,h:_};let S=Math.min(M/r1,_/d1);return V.objectFit==="scale-down"&&(S=Math.min(S,1)),{x:c+(M-r1*S)/2,y:w+(_-d1*S)/2,w:r1*S,h:d1*S}}function v($,r1){const d1=document.documentElement.clientWidth,t1=window.innerHeight;return`inset(${$.top}px ${d1-$.right}px ${t1-$.bottom}px ${$.left}px round ${r1})`}function m($){return $.width>0&&$.height>0&&$.bottom>0&&$.top0}function g($,r1){return($.currentSrc||$.src)===(r1.currentSrc||r1.src)}function j(){var t1;const $=(t1=d.value)==null?void 0:t1.querySelector(".pd__stage");if(!$)return null;const r1=$.getBoundingClientRect(),d1=$.querySelectorAll("img");for(const V of d1){const F=V.getBoundingClientRect(),R=F.left+F.width/2;if(R>r1.left&&R`translate(${t1.x-r1.x}px, ${t1.y-r1.y}px) scale(${t1.w/r1.w}, ${t1.h/r1.h})`;return[{transform:d1($)},{transform:d1(r1)}]}function A($,r1){$.style.left=`${r1.x}px`,$.style.top=`${r1.y}px`,$.style.width=`${r1.w}px`,$.style.height=`${r1.h}px`}let L=0,P=[],U="idle",I=[];function J($){$&&($.style.opacity="0",I.push($))}function l1(){I.forEach($=>$.style.opacity=""),I=[]}function h1(){P.forEach($=>$.cancel()),P=[]}async function k1($){P=$,await Promise.all($.map(r1=>r1.finished.catch(()=>{})))}function Y($){document.documentElement.style.overflow=$?"hidden":""}async function n1($){var R;const r1=++L;h1(),l1(),i.value=!1,r.value=!0,U="opening";const d1=f($.origin),t1=(R=$.origin)==null?void 0:R.getBoundingClientRect(),V=!p()&&!!$.origin&&!!t1&&m(t1);if(o.value=V&&H(d1)?d1.currentSrc||d1.src:null,n.value=$,await v2(),r1!==L||!d.value||!s.value)return;let F;V&&t1&&$.origin?F=C1($.origin,t1,d1):p()?F=[d.value.animate({opacity:[0,1]},{duration:160,easing:"ease-out",fill:"both"}),s.value.animate({opacity:[0,1]},{duration:160,easing:"ease-out",fill:"both"})]:F=[d.value.animate({transform:["translateY(6%)","none"],opacity:[0,1]},{duration:hs,easing:Yc,fill:"both"}),s.value.animate({opacity:[0,1]},{duration:hs,easing:"ease-out",fill:"both"})],await k1(F),r1===L&&(h1(),l1(),o.value=null,r.value=!1,U="open",Y(!0))}function C1($,r1,d1){const t1=d.value,V=l.value,F=s.value,{pageBg:R,cardBg:K,radius:i1}=x($),c=j(),w=a.value;let M=null;if(w&&H(d1)&&c&&g(d1,c)){const S=d1.naturalWidth,B=d1.naturalHeight,q=C(c,S,B);q.w>0&&q.h>0&&(M={from:C(d1,S,B),to:q})}t1.style.transformOrigin=D(r1);const _=[V.animate({clipPath:[v(r1,i1),ws],backgroundColor:[K,R]},{duration:Ke,easing:h,fill:"both"}),F.animate({opacity:[0,1]},{duration:Ke*.6,easing:"ease-out",fill:"both"}),t1.animate({transform:[`scale(${cs})`,"none"]},{duration:Ke,easing:h,fill:"both"}),t1.animate({opacity:[0,1]},{duration:Ke*.55,delay:Ke*.1,easing:"cubic-bezier(0.3, 0, 0.2, 1)",fill:"both"})];return w&&M&&c?(A(w,M.to),J(c),_.push(w.animate(y(M.from,M.to),{duration:Ke,easing:h,fill:"both"}))):o.value=null,_}async function p1(){if(!n.value||U==="closing")return;const $=++L,r1=U==="opening";U="closing",i.value=!0,r.value=!0;let d1;r1&&P.length?(P.forEach(t1=>t1.reverse()),d1=P):(h1(),l1(),d1=await S1()),await k1(d1),$===L&&Z1()}async function S1(){var S;const $=d.value,r1=l.value,d1=s.value;if(!$||!r1||!d1)return[];if(p())return[$.animate({opacity:[1,0]},{duration:140,easing:"ease-in",fill:"forwards"}),d1.animate({opacity:[1,0]},{duration:140,easing:"ease-in",fill:"forwards"})];const t1=((S=n.value)==null?void 0:S.origin)??null,V=t1!=null&&t1.isConnected?t1.getBoundingClientRect():null;if(!t1||!V||!m(V))return[$.animate({transform:["none","translateY(6%)"],opacity:[1,0]},{duration:ps,easing:"cubic-bezier(0.4, 0, 1, 1)",fill:"forwards"}),d1.animate({opacity:[1,0]},{duration:ps,easing:"ease-in",fill:"forwards"})];const{pageBg:F,cardBg:R,radius:K}=x(t1),i1=f(t1),c=j();let w=null;if(H(i1)&&c&&g(i1,c)&&m(c.getBoundingClientRect())){const B=i1.naturalWidth,q=i1.naturalHeight,E=C(c,B,q);E.w>0&&E.h>0&&(w={from:E,to:C(i1,B,q)})}w&&i1&&(o.value=i1.currentSrc||i1.src,await v2()),$.style.transformOrigin=D(V);const M=[r1.animate([{clipPath:ws,backgroundColor:F,opacity:1},{opacity:1,offset:.7},{clipPath:v(V,K),backgroundColor:R,opacity:0}],{duration:bt,easing:ho,fill:"forwards"}),$.animate({transform:["none",`scale(${cs})`]},{duration:bt,easing:ho,fill:"forwards"}),$.animate({opacity:[1,0]},{duration:bt*.45,easing:"ease-in",fill:"forwards"}),d1.animate({opacity:[1,0]},{duration:bt,easing:"ease-out",fill:"forwards"})],_=a.value;return _&&w&&c&&(A(_,w.from),J(c),M.push(_.animate(y(w.to,w.from).reverse(),{duration:bt,easing:ho,fill:"forwards"}))),M}function Z1(){h1(),l1(),o.value=null,r.value=!1,i.value=!1,U="idle",n.value=null,Y(!1),T9.value&&(T9.value=null)}return E1(T9,$=>{$?n1($):n.value&&p1()}),E1(()=>t.fullPath,()=>{n.value&&(++L,Z1())}),Ue(()=>{h1(),l1(),Y(!1)}),($,r1)=>(W(),O1(wt,{to:"body"},[n.value?(W(),o1("div",{key:0,class:N1(["pm",{"is-moving":r.value,"is-closing":i.value}]),dir:"rtl"},[O("div",{ref_key:"veil",ref:s,class:"pm__veil","aria-hidden":"true"},null,512),O("div",{ref_key:"shape",ref:l,class:"pm__shape","aria-hidden":"true"},null,512),O("div",{ref_key:"sheet",ref:d,class:"pm__sheet no-scrollbar"},[(W(),O1(Nl,{id:n.value.product.id,key:n.value.product.id,initial:n.value.product,onCloseDrawer:p1},null,8,["id","initial"]))],512),o.value?(W(),o1("img",{key:0,ref_key:"ghost",ref:a,class:"pm__ghost",src:o.value,alt:"","aria-hidden":"true",decoding:"sync"},null,8,Kc)):L1("",!0)],2)):L1("",!0)]))}}),Xc=He(Qc,[["__scopeId","data-v-4b2262f9"]]);function Jc(){const{offlineReady:e,needRefresh:t,updateServiceWorker:n}=v4(),o=async()=>{await n(),e.value=!1,t.value=!1};vn(async()=>(v1(e)||v1(t))&&await o())}const ew="0.0.1",po={version:ew},tw=b1({__name:"App",setup(e){const t=g4(),{updateServiceWorker:n}=v4(),o=N(()=>t.currentRoute.value.meta&&t.currentRoute.value.meta.layout==="FullPage"?E6:Z6),r=Q(!1);function i(){const l=localStorage.getItem("version");l?l!==po.version&&(r.value=!0):localStorage.setItem("version",po.version)}function s(){localStorage.setItem("version",po.version),n(),window.location.reload()}return q2(()=>{Jc(),i()}),(l,d)=>{const a=a9("router-view");return W(),o1("div",null,[(W(),O1(Do(o.value),{class:"relative"},{default:e2(()=>[b(a,null,{default:e2(({Component:k,route:u})=>[(W(),O1(W3,null,[(W(),O1(Vd,null,{default:e2(()=>[(W(),O1(Do(k),{key:u.name}))]),_:2},1024))],1024))]),_:1})]),_:1})),b(L4,{show:r.value,"onUpdate:show":d[0]||(d[0]=k=>r.value=k),art:"update",title:"نسخه جدید منتزر منتشر شد!",description:"برای استفاده از آخرین امکانات و بهبودها، برنامه را به روز رسانی کنید.","confirm-text":"به روز رسانی","cancel-text":"بعداً",onConfirm:d[1]||(d[1]=k=>s())},null,8,["show"]),b(Xc),b(gk)])}}}),co="gold-bank:token",wo="gold-bank:customerId",Co="gold-bank:mobile",Cs="appToken",b9="gold-bank:isSalesExpert",ql=Le("session",{state:()=>({token:localStorage.getItem(co),customerId:localStorage.getItem(wo),mobile:localStorage.getItem(Co),isSalesExpert:localStorage.getItem(b9)==="1"}),getters:{isLoggedIn:e=>!!e.token},actions:{login(e,t,n){this.token=e,this.customerId=t,this.mobile=n,localStorage.setItem(co,e),localStorage.setItem(wo,t),localStorage.setItem(Co,n),localStorage.setItem(Cs,e)},setSalesExpert(e){this.isSalesExpert=e,e?localStorage.setItem(b9,"1"):localStorage.removeItem(b9)},logout(){this.token=null,this.customerId=null,this.mobile=null,this.isSalesExpert=!1,localStorage.removeItem(b9),localStorage.removeItem(co),localStorage.removeItem(wo),localStorage.removeItem(Co),localStorage.removeItem(Cs)}}}),nw=Le("transition",{state:()=>({transitionFlag:!0,transitionEnded:!0,headerHeight:0}),actions:{setTransitionFlag(e){this.transitionFlag=e},setTransitionEnded(e){this.transitionEnded=e},setHeaderHeight(e){this.headerHeight=e}}}),s9=Ga({history:Ha(),scrollBehavior(e,t,n){return n||{top:0}},routes:[{path:"/home",name:"home",component:()=>T1(()=>import("./HomeView-C0cpdx4l.js"),__vite__mapDeps([0,1,2,3,4,5]))},{path:"/product/:id",name:"singleProduct",component:()=>T1(()=>Promise.resolve().then(()=>Gc),void 0),props:!0,meta:{layout:"FullPage"}},{path:"/newest",name:"newestProduct",component:()=>T1(()=>import("./NewestView-BG4MNUeW.js"),__vite__mapDeps([6,7,8,9,10,11,12,13])),meta:{layout:"FullPage"}},{path:"/cart",name:"cart",component:()=>T1(()=>import("./CartView-MDu3XibQ.js"),__vite__mapDeps([14,7,8,15,16,17,18,4,19,20,21]))},{path:"/login",name:"login",component:()=>T1(()=>import("./LoginRegisterView-GyFoinkN.js"),__vite__mapDeps([22,7,8,19,20,17,18,23])),meta:{layout:"FullPage"}},{path:"/user",name:"userPage::hasSubRoute",component:()=>T1(()=>import("./DashboardView-BRB4XUhz.js"),__vite__mapDeps([24,1,2,3,4,25]))},{path:"/orders",name:"ordersList",component:()=>T1(()=>import("./OrdersView-C8fvzMFb.js"),__vite__mapDeps([26,7,8,27,28,2,15,16,17,18,4,29])),meta:{requiresAuth:!0}},{path:"/transactions",name:"transactionsList",component:()=>T1(()=>import("./TransactionsView-CUA8xQcy.js"),__vite__mapDeps([30,7,8,9,10,2,15,16,17,18,31])),meta:{requiresAuth:!0}},{path:"/profile",name:"profileData",component:()=>T1(()=>import("./ProfileView-qElFZKrE.js"),__vite__mapDeps([32,7,8,9,10,33])),meta:{requiresAuth:!0}},{path:"/favorites",name:"favoritesList",component:()=>T1(()=>import("./FavoritesView-DxHQrp9E.js"),__vite__mapDeps([34,7,8,9,10,11,12,35])),meta:{requiresAuth:!0}},{path:"/settings/appearance",name:"appearanceSettings",component:()=>T1(()=>import("./AppearanceView-B0bKuyHr.js"),__vite__mapDeps([36,7,8,37]))},{path:"/ChildOrder",name:"ChildOrder",component:()=>T1(()=>import("./ChildOrdersView-CTHMBAuv.js"),__vite__mapDeps([38,7,8,27,28,2,15,16,17,18,4,39])),meta:{title:"سفارش مشتریان",layout:"FullPage",requiresAuth:!0,requiresExpert:!0}},{path:"/customerChoice",name:"customerChoice",component:()=>T1(()=>import("./CustomerChoiceView-D-JqOITb.js"),__vite__mapDeps([40,7,8,27,28,15,16,17,18,4,41])),meta:{title:"انتخاب مشتری",layout:"FullPage",requiresAuth:!0,requiresExpert:!0}},{path:"/complete_profile",name:"completeProfile",component:()=>T1(()=>import("./CompleteProfileView-CxdqhMlz.js"),__vite__mapDeps([42,7,8,43])),meta:{title:"تکمیل پروفایل",layout:"FullPage",requiresAuth:!0,requiresIncompleteProfile:!0}},{path:"/report",name:"report",component:()=>T1(()=>import("./ReportView-ooq-YW_N.js"),__vite__mapDeps([44,7,8,2,15,16,17,18,4,45])),meta:{title:"گزارش",layout:"FullPage",requiresAuth:!0}},{path:"/report/detail",name:"reportDetail",component:()=>T1(()=>import("./ReportView-ooq-YW_N.js"),__vite__mapDeps([44,7,8,2,15,16,17,18,4,45])),meta:{title:"جزئیات حساب",layout:"FullPage",requiresAuth:!0}},{path:"/notifications",name:"notifications",component:()=>T1(()=>import("./NotificationsView-BuhDQ6dh.js"),__vite__mapDeps([46,7,8,47]))},{path:"/search",name:"search",component:()=>T1(()=>import("./SearchView-DNae1fsD.js"),__vite__mapDeps([48,7,8,27,28,16,18,20,11,12,4,49]))},{path:"/collection/:id?",name:"collection",component:()=>T1(()=>import("./CollectionView-CjJy961h.js"),__vite__mapDeps([50,7,8,9,10,11,12,51]))},{path:"/",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});s9.beforeEach(async e=>{const t=ql(),n=_r();if(e.name==="login"&&t.isLoggedIn)return{name:"home"};if(e.meta.requiresAuth&&!t.isLoggedIn)return{name:"login",query:{redirect:e.fullPath}};if(e.meta.requiresExpert&&!t.isSalesExpert)return{name:"userPage::hasSubRoute"};if(e.meta.requiresIncompleteProfile&&t.isLoggedIn)try{const o=await Ur.getMe();if(o.verificationStep==="VERIFIED"||o.verificationStep==="STEP_TWO_SUBMITTED")return{name:"home"}}catch{}e.name==="singleProduct"?n.setPgaTransition("slideDown"):n.setPgaTransition(void 0)});s9.afterEach(e=>{const t=_r(),n=nw();n.setTransitionFlag(!1),n.setTransitionEnded(!1),setTimeout(()=>{n.setTransitionFlag(!0)},100);const o=t.navBarRoutes.find(r=>e.name===r.name);o?(t.setActiveLink(o.index),t.setNavVisibility(!0)):t.setNavVisibility(!1)});const Ul="gold-bank:appearance",gs=()=>typeof matchMedia<"u"?matchMedia("(prefers-color-scheme: dark)"):null,ow=()=>typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null;function rw(){var t;const e={theme:"system",reduceMotion:!!((t=ow())!=null&&t.matches)};try{const n=localStorage.getItem(Ul);if(!n)return e;const o=JSON.parse(n);return{theme:o.theme==="light"||o.theme==="dark"||o.theme==="system"?o.theme:e.theme,reduceMotion:typeof o.reduceMotion=="boolean"?o.reduceMotion:e.reduceMotion}}catch{return e}}function iw(e){try{localStorage.setItem(Ul,JSON.stringify(e))}catch{}}const sw="#15171A";let vs=null;const lw=Le("appearance",{state:()=>{var e;return{...rw(),systemDark:!!((e=gs())!=null&&e.matches)}},getters:{resolvedTheme:e=>e.theme==="system"?e.systemDark?"dark":"light":e.theme,isReducedMotion:e=>e.reduceMotion},actions:{init(){var t;const e=gs();(t=e==null?void 0:e.addEventListener)==null||t.call(e,"change",n=>{this.systemDark=n.matches,this.theme==="system"&&this.apply()}),this.apply(!1)},setTheme(e){e!==this.theme&&(this.theme=e,this.save(),this.apply())},setReduceMotion(e){e!==this.reduceMotion&&(this.reduceMotion=e,this.save(),this.apply(!1))},save(){iw({theme:this.theme,reduceMotion:this.reduceMotion})},apply(e=!0){const t=document.documentElement,n=this.resolvedTheme==="dark";e&&t.classList.add("theme-switching"),t.classList.toggle("theme-dark",n),t.classList.toggle("van-theme-dark",n),t.classList.toggle("motion-reduced",this.reduceMotion);const o=document.querySelector('meta[name="theme-color"]');o&&(vs??(vs=o.getAttribute("data-light")??o.getAttribute("content")),o.setAttribute("content",n?sw:vs??"")),e&&requestAnimationFrame(()=>requestAnimationFrame(()=>t.classList.remove("theme-switching")))}}}),dw={class:"px-[16px] max-w-screen-md m-auto relative no-scrollbar"},aw=b1({__name:"Container",props:{padding:{}},setup(e){return(t,n)=>(W(),o1("main",dw,[Ln(t.$slots,"default")]))}}),fs="data:image/svg+xml,%3csvg%20width='12'%20height='9'%20viewBox='0%200%2012%209'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6%209C5.91177%205.77359%203.66177%204.75472%200%204.5C3.57353%204.37264%205.91177%203.18396%206%200C6.08824%203.22642%208.38235%204.4151%2012%204.5C8.38235%204.75472%206.08824%205.77359%206%209Z'%20fill='%238D6A46'/%3e%3c/svg%3e";o4.use("fa-IR",F8);const c9=Z7(tw);c9.use(E7());lw().init();c9.use(s9);Yp(()=>{ql().logout(),s9.currentRoute.value.name!=="login"&&s9.push({name:"login"})});c9.use(K7,{loading:fs,error:fs});c9.component("container",aw);c9.mount("#app");export{Mw as $,Ew as A,a9 as B,g4 as C,nw as D,Ht as E,f1 as F,fw as G,Ln as H,q1 as I,zp as J,W1 as K,gr as L,nc as M,K2 as N,ql as O,L4 as P,E1 as Q,hw as R,Ka as S,Hr as T,H4 as U,bn as V,Jk as W,Xk as X,vr as Y,Dn as Z,He as _,Ue as a,yw as a$,Ne as a0,u1 as a1,U2 as a2,Ak as a3,Rk as a4,b4 as a5,Tk as a6,l2 as a7,U1 as a8,z1 as a9,R5 as aA,Ar as aB,Or as aC,Pr as aD,hr as aE,Bu as aF,E4 as aG,w1 as aH,Ip as aI,Bw as aJ,Su as aK,Br as aL,Jp as aM,B0 as aN,Zw as aO,zh as aP,S4 as aQ,Hw as aR,Nr as aS,bw as aT,kw as aU,jw as aV,ru as aW,xw as aX,mw as aY,iu as aZ,Dw as a_,An as aa,o9 as ab,Sr as ac,vn as ad,vp as ae,B9 as af,tu as ag,ae as ah,k9 as ai,Vp as aj,nn as ak,ks as al,El as am,Me as an,su as ao,p9 as ap,tr as aq,Z4 as ar,tn as as,_w as at,Lw as au,_2 as av,Vw as aw,bi as ax,on as ay,Au as az,O as b,Cr as b0,$8 as b1,Fk as b2,vw as b3,b0 as b4,pw as b5,de as b6,R2 as b7,rt as b8,h9 as b9,_n as ba,gw as bb,Bn as bc,ww as bd,X5 as be,e4 as bf,cw as bg,Cw as bh,_8 as bi,wt as bj,o1 as c,b1 as d,L1 as e,W as f,Q as g,N as h,N1 as i,O1 as j,Gp as k,uw as l,v1 as m,re as n,q2 as o,b as p,Le as q,nt as r,Ur as s,M1 as t,lw as u,ec as v,cr as w,v2 as x,jk as y,e2 as z}; diff --git a/apps/user-app-v2/dist/assets/index-7kdFQ8tV.js b/apps/user-app-v2/dist/assets/index-UkXhTnpw.js similarity index 99% rename from apps/user-app-v2/dist/assets/index-7kdFQ8tV.js rename to apps/user-app-v2/dist/assets/index-UkXhTnpw.js index 2ab5125..040ac7b 100644 --- a/apps/user-app-v2/dist/assets/index-7kdFQ8tV.js +++ b/apps/user-app-v2/dist/assets/index-UkXhTnpw.js @@ -1,4 +1,4 @@ -import{W as ft,X as pa,d as te,o as Oe,Y as hr,Z as ba,Q as de,$ as It,a0 as ze,a1 as _,a2 as Ue,K as pr,a3 as ya,a4 as xa,a5 as wa,a6 as Ca,p as z,a7 as Zt,a8 as T,h as R,a9 as ct,aa as fe,x as le,a as Ne,ab as X,ac as Mt,V as Fa,ad as dt,ae as Aa,af as br,ag as yr,g as H,ah as ve,ai as Sa,aj as Yt,ak as Me,al as Ea,am as Oa,an as Xt,ao as Ee,ap as J,aq as vt,ar as Pa,as as ie,at as xe,au as xr,av as Ta,aw as _a,ax as jt,F as We,ay as $a,az as Ia,aA as Ma,aB as wr,aC as ja,aD as Na,aE as Cr,aF as Ra,aG as Fr,aH as Nt,m as we,aI as za,aJ as Ba,aK as it,w as Ar,aL as Sr}from"./index-BWyw3RAx.js";import{o as qa,i as La,a as Pe,M as Er,g as Va,e as ka,b as Da,c as Wa,d as Or,f as Pr,k as gt,h as Tr,j as Qt,l as Ga,m as _r,s as Ua,n as Ha,U as mn,p as Jt,q as $r,r as lt,t as Ka,S as Ir,u as Za,_ as mt,v as Mr,w as Ya,x as Xa,y as hn,z as jr,A as en,F as Rt,B as Fe}from"./FormItemContext-Bxnh5gKQ.js";import{_ as Qa,a as Ja,o as be}from"./classCallCheck-Ou87VTNv.js";import{w as he}from"./raf-nDFcuFT6.js";var tn=qa(Object.getPrototypeOf,Object),ei="[object Object]",ti=Function.prototype,ni=Object.prototype,Nr=ti.toString,ri=ni.hasOwnProperty,ai=Nr.call(Object);function Rr(t){if(!ft(t)||pa(t)!=ei)return!1;var e=tn(t);if(e===null)return!0;var n=ri.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Nr.call(n)==ai}const ii=te({compatConfig:{MODE:3},name:"ResizeObserver",props:{disabled:Boolean,onResize:Function},emits:["resize"],setup:function(e,n){var r=n.slots,a=pr({width:0,height:0,offsetHeight:0,offsetWidth:0}),i=null,o=null,u=function(){o&&(o.disconnect(),o=null)},l=function(S){var s=e.onResize,m=S[0].target,f=m.getBoundingClientRect(),p=f.width,c=f.height,A=m.offsetWidth,v=m.offsetHeight,d=Math.floor(p),b=Math.floor(c);if(a.width!==d||a.height!==b||a.offsetWidth!==A||a.offsetHeight!==v){var g={width:d,height:b,offsetWidth:A,offsetHeight:v};ze(a,g),s&&Promise.resolve().then(function(){s(_(_({},g),{},{offsetWidth:A,offsetHeight:v}),m)})}},C=Ue(),y=function(){var S=e.disabled;if(S){u();return}var s=It(C),m=s!==i;m&&(u(),i=s),!o&&s&&(o=new La(l),o.observe(s))};return Oe(function(){y()}),hr(function(){y()}),ba(function(){u()}),de(function(){return e.disabled},function(){y()},{flush:"post"}),function(){var x;return(x=r.default)===null||x===void 0?void 0:x.call(r)[0]}}});function oi(t){return ya(t)||xa(t)||wa(t)||Ca()}function ui(t){t.target.composing=!0}function pn(t){t.target.composing&&(t.target.composing=!1,li(t.target,"input"))}function li(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function yt(t,e,n,r){t.addEventListener(e,n,r)}var zr={created:function(e,n){(!n.modifiers||!n.modifiers.lazy)&&(yt(e,"compositionstart",ui),yt(e,"compositionend",pn),yt(e,"change",pn))}},si={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"};function bn(t){for(var e=1;e=1},subscribe:function(e){return Ce.size||this.register(),xt+=1,Ce.set(xt,e),e(Qe),xt},unsubscribe:function(e){Ce.delete(e),Ce.size||this.unregister()},unregister:function(){var e=this;Object.keys(Xe).forEach(function(n){var r=Xe[n],a=e.matchHandlers[r];a==null||a.mql.removeListener(a==null?void 0:a.listener)}),Ce.clear()},register:function(){var e=this;Object.keys(Xe).forEach(function(n){var r=Xe[n],a=function(u){var l=u.matches;e.dispatch(_(_({},Qe),{},T({},n,l)))},i=window.matchMedia(r);i.addListener(a),e.matchHandlers[r]={mql:i,listener:a},a(i)})}},ci=Symbol("SizeProvider"),di=function(e){var n=e?R(function(){return e.size}):ct(ci,R(function(){return"default"}));return n},wt={transitionstart:{transition:"transitionstart",WebkitTransition:"webkitTransitionStart",MozTransition:"mozTransitionStart",OTransition:"oTransitionStart",msTransition:"MSTransitionStart"},animationstart:{animation:"animationstart",WebkitAnimation:"webkitAnimationStart",MozAnimation:"mozAnimationStart",OAnimation:"oAnimationStart",msAnimation:"MSAnimationStart"}},Ct={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},$e=[],Ie=[];function vi(){var t=document.createElement("div"),e=t.style;"AnimationEvent"in window||(delete wt.animationstart.animation,delete Ct.animationend.animation),"TransitionEvent"in window||(delete wt.transitionstart.transition,delete Ct.transitionend.transition);function n(r,a){for(var i in r)if(r.hasOwnProperty(i)){var o=r[i];for(var u in o)if(u in e){a.push(o[u]);break}}}n(wt,$e),n(Ct,Ie)}typeof window<"u"&&typeof document<"u"&&vi();function wn(t,e,n){t.addEventListener(e,n,!1)}function Cn(t,e,n){t.removeEventListener(e,n,!1)}var Je={startEvents:$e,addStartEventListener:function(e,n){if($e.length===0){setTimeout(n,0);return}$e.forEach(function(r){wn(e,r,n)})},removeStartEventListener:function(e,n){$e.length!==0&&$e.forEach(function(r){Cn(e,r,n)})},endEvents:Ie,addEndEventListener:function(e,n){if(Ie.length===0){setTimeout(n,0);return}Ie.forEach(function(r){wn(e,r,n)})},removeEndEventListener:function(e,n){Ie.length!==0&&Ie.forEach(function(r){Cn(e,r,n)})}},pe;function Fn(t){return!t||t.offsetParent===null}function gi(t){var e=(t||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\.\d]*)?\)/);return e&&e[1]&&e[2]&&e[3]?!(e[1]===e[2]&&e[2]===e[3]):!0}const mi=te({compatConfig:{MODE:3},name:"Wave",props:{insertExtraNode:Boolean,disabled:Boolean},setup:function(e,n){var r=n.slots,a=n.expose,i=Ue(),o=fe("",e),u=o.csp,l=o.prefixCls;a({csp:u});var C=null,y=null,x=null,S=!1,s=null,m=!1,f=function(g){if(!m){var F=It(i);!g||g.target!==F||S||v(F)}},p=function(g){!g||g.animationName!=="fadeEffect"||v(g.target)},c=function(){var g=e.insertExtraNode;return g?"".concat(l.value,"-click-animating"):"".concat(l.value,"-click-animating-without-extra-node")},A=function(g,F){var I=e.insertExtraNode,O=e.disabled;if(!(O||!g||Fn(g)||g.className.indexOf("-leave")>=0)){s=document.createElement("div"),s.className="".concat(l.value,"-click-animating-node");var M=c();if(g.removeAttribute(M),g.setAttribute(M,"true"),pe=pe||document.createElement("style"),F&&F!=="#ffffff"&&F!=="rgb(255, 255, 255)"&&gi(F)&&!/rgba\(\d*, \d*, \d*, 0\)/.test(F)&&F!=="transparent"){var q;(q=u.value)!==null&&q!==void 0&&q.nonce&&(pe.nonce=u.value.nonce),s.style.borderColor=F,pe.innerHTML=` +import{W as ft,X as pa,d as te,o as Oe,Y as hr,Z as ba,Q as de,$ as It,a0 as ze,a1 as _,a2 as Ue,K as pr,a3 as ya,a4 as xa,a5 as wa,a6 as Ca,p as z,a7 as Zt,a8 as T,h as R,a9 as ct,aa as fe,x as le,a as Ne,ab as X,ac as Mt,V as Fa,ad as dt,ae as Aa,af as br,ag as yr,g as H,ah as ve,ai as Sa,aj as Yt,ak as Me,al as Ea,am as Oa,an as Xt,ao as Ee,ap as J,aq as vt,ar as Pa,as as ie,at as xe,au as xr,av as Ta,aw as _a,ax as jt,F as We,ay as $a,az as Ia,aA as Ma,aB as wr,aC as ja,aD as Na,aE as Cr,aF as Ra,aG as Fr,aH as Nt,m as we,aI as za,aJ as Ba,aK as it,w as Ar,aL as Sr}from"./index-Dp9sxvBv.js";import{o as qa,i as La,a as Pe,M as Er,g as Va,e as ka,b as Da,c as Wa,d as Or,f as Pr,k as gt,h as Tr,j as Qt,l as Ga,m as _r,s as Ua,n as Ha,U as mn,p as Jt,q as $r,r as lt,t as Ka,S as Ir,u as Za,_ as mt,v as Mr,w as Ya,x as Xa,y as hn,z as jr,A as en,F as Rt,B as Fe}from"./FormItemContext-C33n6IMx.js";import{_ as Qa,a as Ja,o as be}from"./classCallCheck-BTVV3tFI.js";import{w as he}from"./raf-nDFcuFT6.js";var tn=qa(Object.getPrototypeOf,Object),ei="[object Object]",ti=Function.prototype,ni=Object.prototype,Nr=ti.toString,ri=ni.hasOwnProperty,ai=Nr.call(Object);function Rr(t){if(!ft(t)||pa(t)!=ei)return!1;var e=tn(t);if(e===null)return!0;var n=ri.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Nr.call(n)==ai}const ii=te({compatConfig:{MODE:3},name:"ResizeObserver",props:{disabled:Boolean,onResize:Function},emits:["resize"],setup:function(e,n){var r=n.slots,a=pr({width:0,height:0,offsetHeight:0,offsetWidth:0}),i=null,o=null,u=function(){o&&(o.disconnect(),o=null)},l=function(S){var s=e.onResize,m=S[0].target,f=m.getBoundingClientRect(),p=f.width,c=f.height,A=m.offsetWidth,v=m.offsetHeight,d=Math.floor(p),b=Math.floor(c);if(a.width!==d||a.height!==b||a.offsetWidth!==A||a.offsetHeight!==v){var g={width:d,height:b,offsetWidth:A,offsetHeight:v};ze(a,g),s&&Promise.resolve().then(function(){s(_(_({},g),{},{offsetWidth:A,offsetHeight:v}),m)})}},C=Ue(),y=function(){var S=e.disabled;if(S){u();return}var s=It(C),m=s!==i;m&&(u(),i=s),!o&&s&&(o=new La(l),o.observe(s))};return Oe(function(){y()}),hr(function(){y()}),ba(function(){u()}),de(function(){return e.disabled},function(){y()},{flush:"post"}),function(){var x;return(x=r.default)===null||x===void 0?void 0:x.call(r)[0]}}});function oi(t){return ya(t)||xa(t)||wa(t)||Ca()}function ui(t){t.target.composing=!0}function pn(t){t.target.composing&&(t.target.composing=!1,li(t.target,"input"))}function li(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function yt(t,e,n,r){t.addEventListener(e,n,r)}var zr={created:function(e,n){(!n.modifiers||!n.modifiers.lazy)&&(yt(e,"compositionstart",ui),yt(e,"compositionend",pn),yt(e,"change",pn))}},si={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"};function bn(t){for(var e=1;e=1},subscribe:function(e){return Ce.size||this.register(),xt+=1,Ce.set(xt,e),e(Qe),xt},unsubscribe:function(e){Ce.delete(e),Ce.size||this.unregister()},unregister:function(){var e=this;Object.keys(Xe).forEach(function(n){var r=Xe[n],a=e.matchHandlers[r];a==null||a.mql.removeListener(a==null?void 0:a.listener)}),Ce.clear()},register:function(){var e=this;Object.keys(Xe).forEach(function(n){var r=Xe[n],a=function(u){var l=u.matches;e.dispatch(_(_({},Qe),{},T({},n,l)))},i=window.matchMedia(r);i.addListener(a),e.matchHandlers[r]={mql:i,listener:a},a(i)})}},ci=Symbol("SizeProvider"),di=function(e){var n=e?R(function(){return e.size}):ct(ci,R(function(){return"default"}));return n},wt={transitionstart:{transition:"transitionstart",WebkitTransition:"webkitTransitionStart",MozTransition:"mozTransitionStart",OTransition:"oTransitionStart",msTransition:"MSTransitionStart"},animationstart:{animation:"animationstart",WebkitAnimation:"webkitAnimationStart",MozAnimation:"mozAnimationStart",OAnimation:"oAnimationStart",msAnimation:"MSAnimationStart"}},Ct={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},$e=[],Ie=[];function vi(){var t=document.createElement("div"),e=t.style;"AnimationEvent"in window||(delete wt.animationstart.animation,delete Ct.animationend.animation),"TransitionEvent"in window||(delete wt.transitionstart.transition,delete Ct.transitionend.transition);function n(r,a){for(var i in r)if(r.hasOwnProperty(i)){var o=r[i];for(var u in o)if(u in e){a.push(o[u]);break}}}n(wt,$e),n(Ct,Ie)}typeof window<"u"&&typeof document<"u"&&vi();function wn(t,e,n){t.addEventListener(e,n,!1)}function Cn(t,e,n){t.removeEventListener(e,n,!1)}var Je={startEvents:$e,addStartEventListener:function(e,n){if($e.length===0){setTimeout(n,0);return}$e.forEach(function(r){wn(e,r,n)})},removeStartEventListener:function(e,n){$e.length!==0&&$e.forEach(function(r){Cn(e,r,n)})},endEvents:Ie,addEndEventListener:function(e,n){if(Ie.length===0){setTimeout(n,0);return}Ie.forEach(function(r){wn(e,r,n)})},removeEndEventListener:function(e,n){Ie.length!==0&&Ie.forEach(function(r){Cn(e,r,n)})}},pe;function Fn(t){return!t||t.offsetParent===null}function gi(t){var e=(t||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\.\d]*)?\)/);return e&&e[1]&&e[2]&&e[3]?!(e[1]===e[2]&&e[2]===e[3]):!0}const mi=te({compatConfig:{MODE:3},name:"Wave",props:{insertExtraNode:Boolean,disabled:Boolean},setup:function(e,n){var r=n.slots,a=n.expose,i=Ue(),o=fe("",e),u=o.csp,l=o.prefixCls;a({csp:u});var C=null,y=null,x=null,S=!1,s=null,m=!1,f=function(g){if(!m){var F=It(i);!g||g.target!==F||S||v(F)}},p=function(g){!g||g.animationName!=="fadeEffect"||v(g.target)},c=function(){var g=e.insertExtraNode;return g?"".concat(l.value,"-click-animating"):"".concat(l.value,"-click-animating-without-extra-node")},A=function(g,F){var I=e.insertExtraNode,O=e.disabled;if(!(O||!g||Fn(g)||g.className.indexOf("-leave")>=0)){s=document.createElement("div"),s.className="".concat(l.value,"-click-animating-node");var M=c();if(g.removeAttribute(M),g.setAttribute(M,"true"),pe=pe||document.createElement("style"),F&&F!=="#ffffff"&&F!=="rgb(255, 255, 255)"&&gi(F)&&!/rgba\(\d*, \d*, \d*, 0\)/.test(F)&&F!=="transparent"){var q;(q=u.value)!==null&&q!==void 0&&q.nonce&&(pe.nonce=u.value.nonce),s.style.borderColor=F,pe.innerHTML=` [`.concat(l.value,"-click-animating-without-extra-node='true']::after, .").concat(l.value,`-click-animating-node { --antd-wave-shadow-color: `).concat(F,`; }`),document.body.contains(pe)||document.body.appendChild(pe)}I&&g.appendChild(s),Je.addStartEventListener(g,f),Je.addEndEventListener(g,p)}},v=function(g){if(!(!g||g===s||!(g instanceof Element))){var F=e.insertExtraNode,I=c();g.setAttribute(I,"false"),pe&&(pe.innerHTML=""),F&&s&&g.contains(s)&&g.removeChild(s),Je.removeStartEventListener(g,f),Je.removeEndEventListener(g,p)}},d=function(g){if(!(!g||!g.getAttribute||g.getAttribute("disabled")||g.className.indexOf("disabled")>=0)){var F=function(O){if(!(O.target.tagName==="INPUT"||Fn(O.target))){v(g);var M=getComputedStyle(g).getPropertyValue("border-top-color")||getComputedStyle(g).getPropertyValue("border-color")||getComputedStyle(g).getPropertyValue("background-color");y=setTimeout(function(){return A(g,M)},0),he.cancel(x),S=!0,x=he(function(){S=!1},10)}};return g.addEventListener("click",F,!0),{cancel:function(){g.removeEventListener("click",F,!0)}}}};return Oe(function(){le(function(){var b=It(i);b.nodeType===1&&(C=d(b))})}),Ne(function(){C&&C.cancel(),clearTimeout(y),m=!0}),function(){var b;return(b=r.default)===null||b===void 0?void 0:b.call(r)[0]}}});var hi=function(){return{prefixCls:String,type:String,htmlType:{type:String,default:"button"},shape:{type:String},size:{type:String},loading:{type:[Boolean,Object],default:function(){return!1}},disabled:{type:Boolean,default:void 0},ghost:{type:Boolean,default:void 0},block:{type:Boolean,default:void 0},danger:{type:Boolean,default:void 0},icon:X.any,href:String,target:String,title:String,onClick:{type:Function},onMousedown:{type:Function}}},An=function(e){e&&(e.style.width="0px",e.style.opacity="0",e.style.transform="scale(0)")},Sn=function(e){le(function(){e&&(e.style.width="".concat(e.scrollWidth,"px"),e.style.opacity="1",e.style.transform="scale(1)")})},En=function(e){e&&e.style&&(e.style.width=null,e.style.opacity=null,e.style.transform=null)};const pi=te({compatConfig:{MODE:3},name:"LoadingIcon",props:{prefixCls:String,loading:[Boolean,Object],existIcon:Boolean},setup:function(e){return function(){var n=e.existIcon,r=e.prefixCls,a=e.loading;if(n)return z("span",{class:"".concat(r,"-loading-icon")},[z(Mt,null,null)]);var i=!!a;return z(Fa,{name:"".concat(r,"-loading-icon-motion"),onBeforeEnter:An,onEnter:Sn,onAfterEnter:En,onBeforeLeave:Sn,onLeave:function(u){setTimeout(function(){An(u)})},onAfterLeave:En},{default:function(){return[i?z("span",{class:"".concat(r,"-loading-icon")},[z(Mt,null,null)]):null]}})}}});var On=/^[\u4e00-\u9fa5]{2}$/,Pn=On.test.bind(On);function et(t){return t==="text"||t==="link"}const qe=te({compatConfig:{MODE:3},name:"AButton",inheritAttrs:!1,__ANT_BUTTON:!0,props:yr(hi(),{type:"default"}),slots:["icon"],setup:function(e,n){var r=n.slots,a=n.attrs,i=n.emit,o=n.expose,u=fe("btn",e),l=u.prefixCls,C=u.autoInsertSpaceInButton,y=u.direction,x=u.size,S=H(null),s=H(void 0),m=!1,f=H(!1),p=H(!1),c=R(function(){return C.value!==!1}),A=R(function(){return ve(e.loading)==="object"&&e.loading.delay?e.loading.delay||!0:!!e.loading});de(A,function(O){clearTimeout(s.value),typeof A.value=="number"?s.value=setTimeout(function(){f.value=O},A.value):f.value=O},{immediate:!0});var v=R(function(){var O,M=e.type,q=e.shape,L=q===void 0?"default":q,j=e.ghost,W=e.block,B=e.danger,P=l.value,E={large:"lg",small:"sm",middle:void 0},w=x.value,h=w&&E[w]||"";return O={},T(O,"".concat(P),!0),T(O,"".concat(P,"-").concat(M),M),T(O,"".concat(P,"-").concat(L),L!=="default"&&L),T(O,"".concat(P,"-").concat(h),h),T(O,"".concat(P,"-loading"),f.value),T(O,"".concat(P,"-background-ghost"),j&&!et(M)),T(O,"".concat(P,"-two-chinese-chars"),p.value&&c.value),T(O,"".concat(P,"-block"),W),T(O,"".concat(P,"-dangerous"),!!B),T(O,"".concat(P,"-rtl"),y.value==="rtl"),O}),d=function(){var M=S.value;if(!(!M||C.value===!1)){var q=M.textContent;m&&Pn(q)?p.value||(p.value=!0):p.value&&(p.value=!1)}},b=function(M){if(f.value||e.disabled){M.preventDefault();return}i("click",M)},g=function(M,q){var L=q?" ":"";if(M.type===Sa){var j=M.children.trim();return Pn(j)&&(j=j.split("").join(L)),z("span",null,[j])}return M};dt(function(){Aa(!(e.ghost&&et(e.type)),"Button","`link` or `text` button can't be a `ghost` button.")}),Oe(d),hr(d),Ne(function(){s.value&&clearTimeout(s.value)});var F=function(){var M;(M=S.value)===null||M===void 0||M.focus()},I=function(){var M;(M=S.value)===null||M===void 0||M.blur()};return o({focus:F,blur:I}),function(){var O,M,q=e.icon,L=q===void 0?(O=r.icon)===null||O===void 0?void 0:O.call(r):q,j=br((M=r.default)===null||M===void 0?void 0:M.call(r));m=j.length===1&&!L&&!et(e.type);var W=e.type,B=e.htmlType,P=e.disabled,E=e.href,w=e.title,h=e.target,$=e.onMousedown,N=f.value?"loading":L,V=_(_({},a),{},{title:w,disabled:P,class:[v.value,a.class,T({},"".concat(l.value,"-icon-only"),j.length===0&&!!N)],onClick:b,onMousedown:$});P||delete V.disabled;var D=L&&!f.value?L:z(pi,{existIcon:!!L,prefixCls:l.value,loading:!!f.value},null),U=j.map(function(Z){return g(Z,m&&c.value)});if(E!==void 0)return z("a",_(_({},V),{},{href:E,target:h,ref:S}),[D,U]);var K=z("button",_(_({},V),{},{ref:S,type:B}),[D,U]);return et(W)?K:z(mi,{ref:"wave",disabled:!!f.value},{default:function(){return[K]}})}}});var bi=Qa(function t(e){Ja(this,t),this.error=new Error("unreachable case: ".concat(JSON.stringify(e)))}),yi=function(){return{prefixCls:String,size:{type:String}}};const zt=te({compatConfig:{MODE:3},name:"AButtonGroup",props:yi(),setup:function(e,n){var r=n.slots,a=fe("btn-group",e),i=a.prefixCls,o=a.direction,u=R(function(){var l,C=e.size,y="";switch(C){case"large":y="lg";break;case"small":y="sm";break;case"middle":case void 0:break;default:console.warn(new bi(C).error)}return l={},T(l,"".concat(i.value),!0),T(l,"".concat(i.value,"-").concat(y),y),T(l,"".concat(i.value,"-rtl"),o.value==="rtl"),l});return function(){var l;return z("div",{class:u.value},[br((l=r.default)===null||l===void 0?void 0:l.call(r))])}}});qe.Group=zt;qe.install=function(t){return t.component(qe.name,qe),t.component(zt.name,zt),t};function Br(t,e,n,r){for(var a=t.length,i=n+-1;++i-1}function qr(t,e){if(t.classList)return t.classList.contains(e);var n=t.className;return" ".concat(n," ").indexOf(" ".concat(e," "))>-1}function Tn(t,e){t.classList?t.classList.add(e):qr(t,e)||(t.className="".concat(t.className," ").concat(e))}function _n(t,e){if(t.classList)t.classList.remove(e);else if(qr(t,e)){var n=t.className;t.className=" ".concat(n," ").replace(" ".concat(e," ")," ")}}var Ai=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"ant-motion-collapse",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return{name:e,appear:n,css:!0,onBeforeEnter:function(a){a.style.height="0px",a.style.opacity="0",Tn(a,e)},onEnter:function(a){le(function(){a.style.height="".concat(a.scrollHeight,"px"),a.style.opacity="1"})},onAfterEnter:function(a){a&&(_n(a,e),a.style.height=null,a.style.opacity=null)},onBeforeLeave:function(a){Tn(a,e),a.style.height="".concat(a.offsetHeight,"px"),a.style.opacity=null},onLeave:function(a){setTimeout(function(){a.style.height="0px",a.style.opacity="0"})},onAfterLeave:function(a){a&&(_n(a,e),a.style&&(a.style.height=null,a.style.opacity=null))}}};function rn(t,e){for(var n=-1,r=t==null?0:t.length,a=Array(r);++na?0:a+e),n=n>a?a:n,n<0&&(n+=a),a=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(a);++r0){if(++e>=Yi)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Wr=Ji(Zi);function eo(t){return Wr(Dr(t,void 0,Ui),t+"")}var to=function(){return Oa()&&window.document.documentElement},tt,no=function(){if(!to())return!1;if(tt!==void 0)return tt;var e=document.createElement("div");return e.style.display="flex",e.style.flexDirection="column",e.style.rowGap="1px",e.appendChild(document.createElement("div")),e.appendChild(document.createElement("div")),document.body.appendChild(e),tt=e.scrollHeight===1,document.body.removeChild(e),tt};const ro=function(){var t=H(!1);return Oe(function(){t.value=no()}),t};var Gr=Symbol("rowContextKey"),ao=function(e){Xt(Gr,e)},io=function(){return ct(Gr,{gutter:R(function(){}),wrap:R(function(){}),supportFlexGap:R(function(){})})};Ee("top","middle","bottom","stretch");Ee("start","end","center","space-around","space-between");var oo=function(){return{align:String,justify:String,prefixCls:String,gutter:{type:[Number,Array,Object],default:0},wrap:{type:Boolean,default:void 0}}},uo=te({compatConfig:{MODE:3},name:"ARow",props:oo(),setup:function(e,n){var r=n.slots,a=fe("row",e),i=a.prefixCls,o=a.direction,u,l=H({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0,xxxl:!0}),C=ro();Oe(function(){u=xn.subscribe(function(s){var m=e.gutter||0;(!Array.isArray(m)&&ve(m)==="object"||Array.isArray(m)&&(ve(m[0])==="object"||ve(m[1])==="object"))&&(l.value=s)})}),Ne(function(){xn.unsubscribe(u)});var y=R(function(){var s=[0,0],m=e.gutter,f=m===void 0?0:m,p=Array.isArray(f)?f:[f,0];return p.forEach(function(c,A){if(ve(c)==="object")for(var v=0;v0?"".concat(s[0]/-2,"px"):void 0,p=s[1]>0?"".concat(s[1]/-2,"px"):void 0;return f&&(m.marginLeft=f,m.marginRight=f),C.value?m.rowGap="".concat(s[1],"px"):p&&(m.marginTop=p,m.marginBottom=p),m});return function(){var s;return z("div",{class:x.value,style:S.value},[(s=r.default)===null||s===void 0?void 0:s.call(r)])}}});function lo(t){return typeof t=="number"?"".concat(t," ").concat(t," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(t)?"0 0 ".concat(t):t}var so=function(){return{span:[String,Number],order:[String,Number],offset:[String,Number],push:[String,Number],pull:[String,Number],xs:{type:[String,Number,Object],default:void 0},sm:{type:[String,Number,Object],default:void 0},md:{type:[String,Number,Object],default:void 0},lg:{type:[String,Number,Object],default:void 0},xl:{type:[String,Number,Object],default:void 0},xxl:{type:[String,Number,Object],default:void 0},xxxl:{type:[String,Number,Object],default:void 0},prefixCls:String,flex:[String,Number]}};const Ur=te({compatConfig:{MODE:3},name:"ACol",props:so(),setup:function(e,n){var r=n.slots,a=io(),i=a.gutter,o=a.supportFlexGap,u=a.wrap,l=fe("col",e),C=l.prefixCls,y=l.direction,x=R(function(){var s,m=e.span,f=e.order,p=e.offset,c=e.push,A=e.pull,v=C.value,d={};return["xs","sm","md","lg","xl","xxl","xxxl"].forEach(function(b){var g,F={},I=e[b];typeof I=="number"?F.span=I:ve(I)==="object"&&(F=I||{}),d=_(_({},d),{},(g={},T(g,"".concat(v,"-").concat(b,"-").concat(F.span),F.span!==void 0),T(g,"".concat(v,"-").concat(b,"-order-").concat(F.order),F.order||F.order===0),T(g,"".concat(v,"-").concat(b,"-offset-").concat(F.offset),F.offset||F.offset===0),T(g,"".concat(v,"-").concat(b,"-push-").concat(F.push),F.push||F.push===0),T(g,"".concat(v,"-").concat(b,"-pull-").concat(F.pull),F.pull||F.pull===0),T(g,"".concat(v,"-rtl"),y.value==="rtl"),g))}),J(v,(s={},T(s,"".concat(v,"-").concat(m),m!==void 0),T(s,"".concat(v,"-order-").concat(f),f),T(s,"".concat(v,"-offset-").concat(p),p),T(s,"".concat(v,"-push-").concat(c),c),T(s,"".concat(v,"-pull-").concat(A),A),s),d)}),S=R(function(){var s=e.flex,m=i.value,f={};if(m&&m[0]>0){var p="".concat(m[0]/2,"px");f.paddingLeft=p,f.paddingRight=p}if(m&&m[1]>0&&!o.value){var c="".concat(m[1]/2,"px");f.paddingTop=c,f.paddingBottom=c}return s&&(f.flex=lo(s),u.value===!1&&!f.minWidth&&(f.minWidth=0)),f});return function(){var s;return z("div",{class:x.value,style:S.value},[(s=r.default)===null||s===void 0?void 0:s.call(r)])}}});function fo(t,e){for(var n=-1,r=t==null?0:t.length;++n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ut(t,e,n){return Nu()?ut=Reflect.construct.bind():ut=function(a,i,o){var u=[null];u.push.apply(u,i);var l=Function.bind.apply(a,u),C=new l;return o&&Ge(C,o.prototype),C},ut.apply(null,arguments)}function Ru(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function qt(t){var e=typeof Map=="function"?new Map:void 0;return qt=function(r){if(r===null||!Ru(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,a)}function a(){return ut(r,arguments,Bt(this).constructor)}return a.prototype=Object.create(r.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),Ge(a,r)},qt(t)}var zu=/%[sdj%]/g,Bu=function(){};function Lt(t){if(!t||!t.length)return null;var e={};return t.forEach(function(n){var r=n.field;e[r]=e[r]||[],e[r].push(n)}),e}function se(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r=i)return u;switch(u){case"%s":return String(n[a++]);case"%d":return Number(n[a++]);case"%j":try{return JSON.stringify(n[a++])}catch{return"[Circular]"}break;default:return u}});return o}return t}function qu(t){return t==="string"||t==="url"||t==="hex"||t==="email"||t==="date"||t==="pattern"}function ee(t,e){return!!(t==null||e==="array"&&Array.isArray(t)&&!t.length||qu(e)&&typeof t=="string"&&!t)}function Lu(t,e,n){var r=[],a=0,i=t.length;function o(u){r.push.apply(r,u||[]),a++,a===i&&n(r)}t.forEach(function(u){e(u,o)})}function Wn(t,e,n){var r=0,a=t.length;function i(o){if(o&&o.length){n(o);return}var u=r;r=r+1,u"u")return 0;if(s||me===void 0){var e=document.createElement("div");e.style.width="100%",e.style.height="200px";var n=document.createElement("div"),o=n.style;o.position="absolute",o.top="0",o.left="0",o.pointerEvents="none",o.visibility="hidden",o.width="200px",o.height="150px",o.overflow="hidden",n.appendChild(e),document.body.appendChild(n);var a=e.offsetWidth;n.style.overflow="scroll";var d=e.offsetWidth;a===d&&(d=n.clientWidth),document.body.removeChild(n),me=a-d}return me}var Ve=function(){return{prefixCls:String,width:h.oneOfType([h.string,h.number]),height:h.oneOfType([h.string,h.number]),style:{type:Object,default:void 0},class:String,placement:{type:String},wrapperClassName:String,level:{type:[String,Array]},levelMove:{type:[Number,Function,Array]},duration:String,ease:String,showMask:{type:Boolean,default:void 0},maskClosable:{type:Boolean,default:void 0},maskStyle:{type:Object,default:void 0},afterVisibleChange:Function,keyboard:{type:Boolean,default:void 0},contentWrapperStyle:{type:Object,default:void 0},autofocus:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0}}},lt=function(){return k(k({},Ve()),{},{forceRender:{type:Boolean,default:void 0},getContainer:h.oneOfType([h.string,h.func,h.object,h.looseBool])})},it=function(){return k(k({},Ve()),{},{getContainer:Function,getOpenCount:Function,scrollLocker:h.any,switchScrollingEffect:Function})};function ct(s){return Array.isArray(s)?s:[s]}var He={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},st=Object.keys(He).filter(function(s){if(typeof document>"u")return!1;var e=document.getElementsByTagName("html")[0];return s in(e?e.style:{})})[0],Pe=He[st];function Oe(s,e,n,o){s.addEventListener?s.addEventListener(e,n,o):s.attachEvent&&s.attachEvent("on".concat(e),n)}function xe(s,e,n,o){s.removeEventListener?s.removeEventListener(e,n,o):s.attachEvent&&s.detachEvent("on".concat(e),n)}function ut(s,e){var n=typeof s=="function"?s(e):s;return Array.isArray(n)?n.length===2?n:[n[0],n[1]]:[n]}var Te=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},he=!(typeof window<"u"&&window.document&&window.document.createElement),dt=function s(e,n,o,a){if(!n||n===document||n instanceof Document)return!1;if(n===e.parentNode)return!0;var d=Math.max(Math.abs(o),Math.abs(a))===Math.abs(a),y=Math.max(Math.abs(o),Math.abs(a))===Math.abs(o),C=n.scrollHeight-n.clientHeight,r=n.scrollWidth-n.clientWidth,c=document.defaultView.getComputedStyle(n),S=c.overflowY==="auto"||c.overflowY==="scroll",D=c.overflowX==="auto"||c.overflowX==="scroll",L=C&&S,B=r&&D;return d&&(!L||L&&(n.scrollTop>=C&&a<0||n.scrollTop<=0&&a>0))||y&&(!B||B&&(n.scrollLeft>=r&&o<0||n.scrollLeft<=0&&o>0))?s(e,n.parentNode,o,a):!1},ft=["width","height","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","keyboard","getOpenCount","scrollLocker","contentWrapperStyle","style","class"],ee={},De=se({compatConfig:{MODE:3},inheritAttrs:!1,props:it(),emits:["close","handleClick","change"],setup:function(e,n){var o=n.emit,a=n.slots,d=Re({startPos:{x:null,y:null}}),y,C=V(),r=V(),c=V(),S=V(),D=V(),L=[],B="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),P=!he&&nt?{passive:!1}:!1;Ce(function(){ae(function(){var l=e.open,t=e.getContainer,i=e.showMask,v=e.autofocus,m=t==null?void 0:t();if(T(e),l&&(m&&m.parentNode===document.body&&(ee[B]=l),Z(),ae(function(){v&&b()}),i)){var w;(w=e.scrollLocker)===null||w===void 0||w.lock()}})}),G(function(){return e.level},function(){T(e)},{flush:"post"}),G(function(){return e.open},function(){var l=e.open,t=e.getContainer,i=e.scrollLocker,v=e.showMask,m=e.autofocus,w=t==null?void 0:t();w&&w.parentNode===document.body&&(ee[B]=!!l),Z(),l?(m&&b(),v&&(i==null||i.lock())):i==null||i.unLock()},{flush:"post"}),_e(function(){var l,t=e.open;delete ee[B],t&&(oe(!1),document.body.style.touchAction=""),(l=e.scrollLocker)===null||l===void 0||l.unLock()}),G(function(){return e.placement},function(l){l&&(D.value=null)});var b=function(){var t,i;(t=r.value)===null||t===void 0||(i=t.focus)===null||i===void 0||i.call(t)},O=function(t){t.touches.length>1||(d.startPos={x:t.touches[0].clientX,y:t.touches[0].clientY})},A=function(t){if(!(t.changedTouches.length>1)){var i=t.currentTarget,v=t.changedTouches[0].clientX-d.startPos.x,m=t.changedTouches[0].clientY-d.startPos.y;(i===c.value||i===S.value||i===D.value&&dt(i,t.target,v,m))&&t.cancelable&&t.preventDefault()}},j=function l(t){var i=t.target;xe(i,Pe,l),i.style.transition=""},_=function(t){o("close",t)},X=function(t){t.keyCode===tt.ESC&&(t.stopPropagation(),_(t))},U=function(t){var i=e.open,v=e.afterVisibleChange;t.target===C.value&&t.propertyName.match(/transform$/)&&(r.value.style.transition="",!i&&x()&&(document.body.style.overflowX="",c.value&&(c.value.style.left="",c.value.style.width="")),v&&v(!!i))},R=te(function(){var l=e.placement,t=l==="left"||l==="right",i="translate".concat(t?"X":"Y");return{isHorizontal:t,placementName:i}}),Z=function(){var t=e.open,i=e.width,v=e.height,m=R.value,w=m.isHorizontal,p=m.placementName,N=D.value?D.value.getBoundingClientRect()[w?"width":"height"]:0,$=(w?i:v)||N;ue(t,p,$)},oe=function(t,i,v,m){var w=e.placement,p=e.levelMove,N=e.duration,$=e.ease,F=e.showMask;L.forEach(function(q){q.style.transition="transform ".concat(N," ").concat($),Oe(q,Pe,j);var Y=t?v:0;if(p){var re=ut(p,{target:q,open:t});Y=t?re[0]:re[1]||0}var le=typeof Y=="number"?"".concat(Y,"px"):Y,K=w==="left"||w==="top"?le:"-".concat(le);K=F&&w==="right"&&m?"calc(".concat(K," + ").concat(m,"px)"):K,q.style.transform=Y?"".concat(i,"(").concat(K,")"):""})},ue=function(t,i,v){if(!he){var m=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?pe(!0):0;oe(t,i,v,m),g(m)}o("change",t)},g=function(t){var i=e.getContainer,v=e.showMask,m=e.open,w=i==null?void 0:i();if(w&&w.parentNode===document.body&&v){var p=["touchstart"],N=[document.body,c.value,S.value,D.value];m&&document.body.style.overflow!=="hidden"?(t&&u(t),document.body.style.touchAction="none",N.forEach(function($,F){$&&Oe($,p[F]||"touchmove",F?A:O,P)})):x()&&(document.body.style.touchAction="",t&&f(t),N.forEach(function($,F){$&&xe($,p[F]||"touchmove",F?A:O,P)}))}},u=function(t){var i=e.placement,v=e.duration,m=e.ease,w="width ".concat(v," ").concat(m),p="transform ".concat(v," ").concat(m);switch(r.value.style.transition="none",i){case"right":r.value.style.transform="translateX(-".concat(t,"px)");break;case"top":case"bottom":r.value.style.width="calc(100% - ".concat(t,"px)"),r.value.style.transform="translateZ(0)";break}clearTimeout(y),y=setTimeout(function(){r.value&&(r.value.style.transition="".concat(p,",").concat(w),r.value.style.width="",r.value.style.transform="")})},f=function(t){var i=e.placement,v=e.duration,m=e.ease;r.value.style.transition="none";var w,p="width ".concat(v," ").concat(m),N="transform ".concat(v," ").concat(m);switch(i){case"left":{r.value.style.width="100%",p="width 0s ".concat(m," ").concat(v);break}case"right":{r.value.style.transform="translateX(".concat(t,"px)"),r.value.style.width="100%",p="width 0s ".concat(m," ").concat(v),c.value&&(c.value.style.left="-".concat(t,"px"),c.value.style.width="calc(100% + ".concat(t,"px)"));break}case"top":case"bottom":{r.value.style.width="calc(100% + ".concat(t,"px)"),r.value.style.height="100%",r.value.style.transform="translateZ(0)",w="height 0s ".concat(m," ").concat(v);break}}clearTimeout(y),y=setTimeout(function(){r.value&&(r.value.style.transition="".concat(N,",").concat(w?"".concat(w,","):"").concat(p),r.value.style.transform="",r.value.style.width="",r.value.style.height="")})},x=function(){return!Object.keys(ee).some(function(t){return ee[t]})},T=function(t){var i=t.level,v=t.getContainer;if(!he){var m=v==null?void 0:v(),w=m?m.parentNode:null;if(L=[],i==="all"){var p=w?Array.prototype.slice.call(w.children):[];p.forEach(function(N){N.nodeName!=="SCRIPT"&&N.nodeName!=="STYLE"&&N.nodeName!=="LINK"&&N!==m&&L.push(N)})}else i&&ct(i).forEach(function(N){document.querySelectorAll(N).forEach(function($){L.push($)})})}},M=function(t){o("handleClick",t)},I=V(!1);return G(r,function(){ae(function(){I.value=!0})}),function(){var l,t,i,v=e.width,m=e.height,w=e.open,p=e.prefixCls,N=e.placement;e.level,e.levelMove,e.ease,e.duration,e.getContainer,e.onChange,e.afterVisibleChange;var $=e.showMask,F=e.maskClosable,q=e.maskStyle,Y=e.keyboard;e.getOpenCount,e.scrollLocker;var re=e.contentWrapperStyle,le=e.style,K=e.class,je=ce(e,ft),de=w&&I.value,Ie=be(p,(l={},W(l,"".concat(p,"-").concat(N),!0),W(l,"".concat(p,"-open"),de),W(l,K,!!K),W(l,"no-mask",!$),l)),Fe=R.value.placementName,ze=N==="left"||N==="top"?"-100%":"100%",ke=de?"":"".concat(Fe,"(").concat(ze,")");return E("div",k(k({},Ae(je,["switchScrollingEffect","autofocus"])),{},{tabindex:-1,class:Ie,style:le,ref:r,onKeydown:de&&Y?X:void 0,onTransitionend:U}),[$&&E("div",{class:"".concat(p,"-mask"),onClick:F?_:void 0,style:q,ref:c},null),E("div",{class:"".concat(p,"-content-wrapper"),style:k({transform:ke,msTransform:ke,width:Te(v)?"".concat(v,"px"):v,height:Te(m)?"".concat(m,"px"):m},re),ref:C},[E("div",{class:"".concat(p,"-content"),ref:D},[(t=a.default)===null||t===void 0?void 0:t.call(a)]),a.handler?E("div",{onClick:M,ref:S},[(i=a.handler)===null||i===void 0?void 0:i.call(a)]):null])])}}});function J(s){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.element,o=n===void 0?document.body:n,a={},d=Object.keys(s);return d.forEach(function(y){a[y]=o.style[y]}),d.forEach(function(y){o.style[y]=s[y]}),a}function vt(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var ye={};const Me=function(s){if(!(!vt()&&!s)){var e="ant-scrolling-effect",n=new RegExp("".concat(e),"g"),o=document.body.className;if(s){if(!n.test(o))return;J(ye),ye={},document.body.className=o.replace(n,"").trim();return}var a=pe();if(a&&(ye=J({position:"relative",width:"calc(100% - ".concat(a,"px)")}),!n.test(o))){var d="".concat(o," ").concat(e);document.body.className=d.trim()}}};var H=[],We="ant-scrolling-effect",ge=new RegExp("".concat(We),"g"),mt=0,we=new Map,ht=ot(function s(e){var n=this;rt(this,s),W(this,"getContainer",function(){var o;return(o=n.options)===null||o===void 0?void 0:o.container}),W(this,"reLock",function(o){var a=H.find(function(d){var y=d.target;return y===n.lockTarget});a&&n.unLock(),n.options=o,a&&(a.options=o,n.lock())}),W(this,"lock",function(){var o;if(!H.some(function(r){var c=r.target;return c===n.lockTarget})){if(H.some(function(r){var c,S=r.options;return(S==null?void 0:S.container)===((c=n.options)===null||c===void 0?void 0:c.container)})){H=[].concat(Se(H),[{target:n.lockTarget,options:n.options}]);return}var a=0,d=((o=n.options)===null||o===void 0?void 0:o.container)||document.body;(d===document.body&&window.innerWidth-document.documentElement.clientWidth>0||d.scrollHeight>d.clientHeight)&&(a=pe());var y=d.className;if(H.filter(function(r){var c,S=r.options;return(S==null?void 0:S.container)===((c=n.options)===null||c===void 0?void 0:c.container)}).length===0&&we.set(d,J({width:a!==0?"calc(100% - ".concat(a,"px)"):void 0,overflow:"hidden",overflowX:"hidden",overflowY:"hidden"},{element:d})),!ge.test(y)){var C="".concat(y," ").concat(We);d.className=C.trim()}H=[].concat(Se(H),[{target:n.lockTarget,options:n.options}])}}),W(this,"unLock",function(){var o,a=H.find(function(C){var r=C.target;return r===n.lockTarget});if(H=H.filter(function(C){var r=C.target;return r!==n.lockTarget}),!(!a||H.some(function(C){var r,c=C.options;return(c==null?void 0:c.container)===((r=a.options)===null||r===void 0?void 0:r.container)}))){var d=((o=n.options)===null||o===void 0?void 0:o.container)||document.body,y=d.className;ge.test(y)&&(J(we.get(d),{element:d}),we.delete(d),d.className=d.className.replace(ge,"").trim())}}),this.lockTarget=mt++,this.options=e}),z=0,ne=Ze(),ie={},Q=function(e){if(!ne)return null;if(e){if(typeof e=="string")return document.querySelectorAll(e)[0];if(typeof e=="function")return e();if(Ue(e)==="object"&&e instanceof window.HTMLElement)return e}return document.body};const yt=se({compatConfig:{MODE:3},name:"PortalWrapper",inheritAttrs:!1,props:{wrapperClassName:String,forceRender:{type:Boolean,default:void 0},getContainer:h.any,visible:{type:Boolean,default:void 0}},setup:function(e,n){var o=n.slots,a=V(),d=V(),y=V(),C=new ht({container:Q(e.getContainer)}),r=function(){var b,O;(b=a.value)===null||b===void 0||(O=b.parentNode)===null||O===void 0||O.removeChild(a.value)},c=function(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(b||a.value&&!a.value.parentNode){var O=Q(e.getContainer);return O?(O.appendChild(a.value),!0):!1}return!0},S=function(){return ne?(a.value||(a.value=document.createElement("div"),c(!0)),D(),a.value):null},D=function(){var b=e.wrapperClassName;a.value&&b&&b!==a.value.className&&(a.value.className=b)};Xe(function(){D(),c()});var L=function(){z===1&&!Object.keys(ie).length?(Me(),ie=J({overflow:"hidden",overflowX:"hidden",overflowY:"hidden"})):z||(J(ie),ie={},Me(!0))},B=Ke();return Ce(function(){var P=!1;G([function(){return e.visible},function(){return e.getContainer}],function(b,O){var A=Ne(b,2),j=A[0],_=A[1],X=Ne(O,2),U=X[0],R=X[1];if(ne&&Q(e.getContainer)===document.body&&(j&&!U?z+=1:P&&(z-=1)),P){var Z=typeof _=="function"&&typeof R=="function";(Z?_.toString()!==R.toString():_!==R)&&r(),j&&j!==U&&ne&&Q(_)!==C.getContainer()&&C.reLock({container:Q(_)})}P=!0},{immediate:!0,flush:"post"}),ae(function(){c()||(y.value=Ee(function(){B.update()}))})}),Ye(function(){var P=e.visible,b=e.getContainer;ne&&Q(b)===document.body&&(z=P&&z?z-1:z),r(),Ee.cancel(y.value)}),function(){var P=e.forceRender,b=e.visible,O=null,A={getOpenCount:function(){return z},getContainer:S,switchScrollingEffect:L,scrollLocker:C};return(P||b||d.value)&&(O=E(at,{getContainer:S,ref:d},{default:function(){var _;return(_=o.default)===null||_===void 0?void 0:_.call(o,A)}})),O}}});var gt=["afterVisibleChange","getContainer","wrapperClassName","forceRender"],wt=["visible","afterClose"],bt=se({compatConfig:{MODE:3},inheritAttrs:!1,props:$e(lt(),{prefixCls:"drawer",placement:"left",getContainer:"body",level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",afterVisibleChange:function(){},showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",keyboard:!0,forceRender:!1,autofocus:!0}),emits:["handleClick","close"],slots:["handler"],setup:function(e,n){var o=n.emit,a=n.slots,d=V(null),y=function(c){o("handleClick",c)},C=function(c){o("close",c)};return function(){e.afterVisibleChange;var r=e.getContainer,c=e.wrapperClassName,S=e.forceRender,D=ce(e,gt),L=null;if(!r)return E("div",{class:c,ref:d},[E(De,k(k({},D),{},{open:e.open,getContainer:function(){return d.value},onClose:C,onHandleClick:y}),a)]);var B=!!a.handler||S;return(B||e.open||d.value)&&(L=E(yt,{visible:e.open,forceRender:B,getContainer:r,wrapperClassName:c},{default:function(b){var O=b.visible,A=b.afterClose,j=ce(b,wt);return E(De,k(k(k({ref:d},D),j),{},{open:O!==void 0?O:e.open,afterVisibleChange:A!==void 0?A:e.afterVisibleChange,onClose:C,onHandleClick:y}),a)}})),L}}}),Ct=["width","height","visible","placement","mask","wrapClassName","class"],pt=Be("top","right","bottom","left");Be("default","large");var Le={distance:180},kt=function(){return{autofocus:{type:Boolean,default:void 0},closable:{type:Boolean,default:void 0},closeIcon:h.any,destroyOnClose:{type:Boolean,default:void 0},forceRender:{type:Boolean,default:void 0},getContainer:h.any,maskClosable:{type:Boolean,default:void 0},mask:{type:Boolean,default:void 0},maskStyle:{type:Object,default:void 0},wrapStyle:{type:Object,default:void 0},style:{type:Object,default:void 0},class:h.any,wrapClassName:String,size:{type:String},drawerStyle:{type:Object,default:void 0},headerStyle:{type:Object,default:void 0},bodyStyle:{type:Object,default:void 0},contentWrapperStyle:{type:Object,default:void 0},title:h.any,visible:{type:Boolean,default:void 0},width:h.oneOfType([h.string,h.number]),height:h.oneOfType([h.string,h.number]),zIndex:Number,prefixCls:String,push:h.oneOfType([h.looseBool,{type:Object}]),placement:h.oneOf(pt),keyboard:{type:Boolean,default:void 0},extra:h.any,footer:h.any,footerStyle:{type:Object,default:void 0},level:h.any,levelMove:{type:[Number,Array,Function]},handle:h.any,afterVisibleChange:Function,onAfterVisibleChange:Function,"onUpdate:visible":Function,onClose:Function}},St=se({compatConfig:{MODE:3},name:"ADrawer",inheritAttrs:!1,props:$e(kt(),{closable:!0,placement:"right",maskClosable:!0,mask:!0,level:null,keyboard:!0,push:Le}),slots:["closeIcon","title","extra","footer","handle"],setup:function(e,n){var o=n.emit,a=n.slots,d=n.attrs,y=V(!1),C=V(!1),r=V(null),c=Qe("parentDrawerOpts",null),S=Ge("drawer",e),D=S.prefixCls;fe(!e.afterVisibleChange,"Drawer","`afterVisibleChange` prop is deprecated, please use `@afterVisibleChange` event instead"),fe(e.wrapStyle===void 0,"Drawer","`wrapStyle` prop is deprecated, please use `style` instead"),fe(e.wrapClassName===void 0,"Drawer","`wrapClassName` prop is deprecated, please use `class` instead");var L=function(){y.value=!0},B=function(){y.value=!1,ae(function(){P()})};et("parentDrawerOpts",{setPush:L,setPull:B}),Ce(function(){var g=e.visible;g&&c&&c.setPush()}),_e(function(){c&&c.setPull()}),G(function(){return e.visible},function(g){c&&(g?c.setPush():c.setPull())},{flush:"post"});var P=function(){var u,f;(u=r.value)===null||u===void 0||(f=u.domFocus)===null||f===void 0||f.call(u)},b=function(u){o("update:visible",!1),o("close",u)},O=function(u){var f;(f=e.afterVisibleChange)===null||f===void 0||f.call(e,u),o("afterVisibleChange",u)},A=te(function(){return e.destroyOnClose&&!e.visible}),j=function(){var u=A.value;u&&(e.visible||(C.value=!0))},_=te(function(){var g=e.push,u=e.placement,f;return typeof g=="boolean"?f=g?Le.distance:0:f=g.distance,f=parseFloat(String(f||0)),u==="left"||u==="right"?"translateX(".concat(u==="left"?f:-f,"px)"):u==="top"||u==="bottom"?"translateY(".concat(u==="top"?f:-f,"px)"):null}),X=te(function(){var g=e.visible,u=e.mask,f=e.placement,x=e.size,T=x===void 0?"default":x,M=e.width,I=e.height;if(!g&&!u)return{};var l={};if(f==="left"||f==="right"){var t=T==="large"?736:378;l.width=typeof M>"u"?t:M,l.width=typeof l.width=="string"?l.width:"".concat(l.width,"px")}else{var i=T==="large"?736:378;l.height=typeof I>"u"?i:I,l.height=typeof l.height=="string"?l.height:"".concat(l.height,"px")}return l}),U=te(function(){var g=e.zIndex,u=e.wrapStyle,f=e.mask,x=e.style,T=f?{}:X.value;return k(k(k({zIndex:g,transform:y.value?_.value:void 0},T),u),x)}),R=function(u){var f=e.closable,x=e.headerStyle,T=ve(a,e,"extra"),M=ve(a,e,"title");return!M&&!f?null:E("div",{class:be("".concat(u,"-header"),W({},"".concat(u,"-header-close-only"),f&&!M&&!T)),style:x},[E("div",{class:"".concat(u,"-header-title")},[Z(u),M&&E("div",{class:"".concat(u,"-title")},[M])]),T&&E("div",{class:"".concat(u,"-extra")},[T])])},Z=function(u){var f,x=e.closable,T=a.closeIcon?(f=a.closeIcon)===null||f===void 0?void 0:f.call(a):e.closeIcon;return x&&E("button",{key:"closer",onClick:b,"aria-label":"Close",class:"".concat(u,"-close")},[T===void 0?E(Je,null,null):T])},oe=function(u){var f;if(C.value&&!e.visible)return null;C.value=!1;var x=e.bodyStyle,T=e.drawerStyle,M={},I=A.value;return I&&(M.opacity=0,M.transition="opacity .3s"),E("div",{class:"".concat(u,"-wrapper-body"),style:k(k({},M),T),onTransitionend:j},[R(u),E("div",{key:"body",class:"".concat(u,"-body"),style:x},[(f=a.default)===null||f===void 0?void 0:f.call(a)]),ue(u)])},ue=function(u){var f=ve(a,e,"footer");if(!f)return null;var x="".concat(u,"-footer");return E("div",{class:x,style:e.footerStyle},[f])};return function(){var g;e.width,e.height;var u=e.visible,f=e.placement,x=e.mask,T=e.wrapClassName,M=e.class,I=ce(e,Ct),l=x?X.value:{},t=x?"":"no-mask",i=k(k(k(k({},d),Ae(I,["size","closeIcon","closable","destroyOnClose","drawerStyle","headerStyle","bodyStyle","title","push","wrapStyle","onAfterVisibleChange","onClose","onUpdate:visible"])),l),{},{onClose:b,afterVisibleChange:O,handler:!1,prefixCls:D.value,open:u,showMask:x,placement:f,class:be((g={},W(g,M,M),W(g,T,!!T),W(g,t,!!t),g)),style:U.value,ref:r});return E(bt,i,{handler:e.handle?function(){return e.handle}:a.handle,default:function(){return oe(D.value)}})}}});const xt=qe(St);export{xt as D}; +import{a1 as k,ab as h,d as se,o as Ce,x as ae,Q as G,Z as _e,aL as ce,ap as be,a8 as W,p as E,g as V,h as te,K as Re,as as Se,Y as Xe,ax as Ne,a as Ye,a2 as Ke,ah as Ue,am as Ze,ag as $e,aQ as qe,ao as Be,a9 as Qe,aa as Ge,ae as fe,aR as ve,aS as Je,an as et}from"./index-Dp9sxvBv.js";import{K as tt,s as nt,P as at}from"./KeyCode-DAs3W-5E.js";import{o as Ae,_ as ot,a as rt}from"./classCallCheck-BTVV3tFI.js";import{w as Ee}from"./raf-nDFcuFT6.js";var me;function pe(s){if(typeof document>"u")return 0;if(s||me===void 0){var e=document.createElement("div");e.style.width="100%",e.style.height="200px";var n=document.createElement("div"),o=n.style;o.position="absolute",o.top="0",o.left="0",o.pointerEvents="none",o.visibility="hidden",o.width="200px",o.height="150px",o.overflow="hidden",n.appendChild(e),document.body.appendChild(n);var a=e.offsetWidth;n.style.overflow="scroll";var d=e.offsetWidth;a===d&&(d=n.clientWidth),document.body.removeChild(n),me=a-d}return me}var Ve=function(){return{prefixCls:String,width:h.oneOfType([h.string,h.number]),height:h.oneOfType([h.string,h.number]),style:{type:Object,default:void 0},class:String,placement:{type:String},wrapperClassName:String,level:{type:[String,Array]},levelMove:{type:[Number,Function,Array]},duration:String,ease:String,showMask:{type:Boolean,default:void 0},maskClosable:{type:Boolean,default:void 0},maskStyle:{type:Object,default:void 0},afterVisibleChange:Function,keyboard:{type:Boolean,default:void 0},contentWrapperStyle:{type:Object,default:void 0},autofocus:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0}}},lt=function(){return k(k({},Ve()),{},{forceRender:{type:Boolean,default:void 0},getContainer:h.oneOfType([h.string,h.func,h.object,h.looseBool])})},it=function(){return k(k({},Ve()),{},{getContainer:Function,getOpenCount:Function,scrollLocker:h.any,switchScrollingEffect:Function})};function ct(s){return Array.isArray(s)?s:[s]}var He={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},st=Object.keys(He).filter(function(s){if(typeof document>"u")return!1;var e=document.getElementsByTagName("html")[0];return s in(e?e.style:{})})[0],Pe=He[st];function Oe(s,e,n,o){s.addEventListener?s.addEventListener(e,n,o):s.attachEvent&&s.attachEvent("on".concat(e),n)}function xe(s,e,n,o){s.removeEventListener?s.removeEventListener(e,n,o):s.attachEvent&&s.detachEvent("on".concat(e),n)}function ut(s,e){var n=typeof s=="function"?s(e):s;return Array.isArray(n)?n.length===2?n:[n[0],n[1]]:[n]}var Te=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},he=!(typeof window<"u"&&window.document&&window.document.createElement),dt=function s(e,n,o,a){if(!n||n===document||n instanceof Document)return!1;if(n===e.parentNode)return!0;var d=Math.max(Math.abs(o),Math.abs(a))===Math.abs(a),y=Math.max(Math.abs(o),Math.abs(a))===Math.abs(o),C=n.scrollHeight-n.clientHeight,r=n.scrollWidth-n.clientWidth,c=document.defaultView.getComputedStyle(n),S=c.overflowY==="auto"||c.overflowY==="scroll",D=c.overflowX==="auto"||c.overflowX==="scroll",L=C&&S,B=r&&D;return d&&(!L||L&&(n.scrollTop>=C&&a<0||n.scrollTop<=0&&a>0))||y&&(!B||B&&(n.scrollLeft>=r&&o<0||n.scrollLeft<=0&&o>0))?s(e,n.parentNode,o,a):!1},ft=["width","height","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","keyboard","getOpenCount","scrollLocker","contentWrapperStyle","style","class"],ee={},De=se({compatConfig:{MODE:3},inheritAttrs:!1,props:it(),emits:["close","handleClick","change"],setup:function(e,n){var o=n.emit,a=n.slots,d=Re({startPos:{x:null,y:null}}),y,C=V(),r=V(),c=V(),S=V(),D=V(),L=[],B="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),P=!he&&nt?{passive:!1}:!1;Ce(function(){ae(function(){var l=e.open,t=e.getContainer,i=e.showMask,v=e.autofocus,m=t==null?void 0:t();if(T(e),l&&(m&&m.parentNode===document.body&&(ee[B]=l),Z(),ae(function(){v&&b()}),i)){var w;(w=e.scrollLocker)===null||w===void 0||w.lock()}})}),G(function(){return e.level},function(){T(e)},{flush:"post"}),G(function(){return e.open},function(){var l=e.open,t=e.getContainer,i=e.scrollLocker,v=e.showMask,m=e.autofocus,w=t==null?void 0:t();w&&w.parentNode===document.body&&(ee[B]=!!l),Z(),l?(m&&b(),v&&(i==null||i.lock())):i==null||i.unLock()},{flush:"post"}),_e(function(){var l,t=e.open;delete ee[B],t&&(oe(!1),document.body.style.touchAction=""),(l=e.scrollLocker)===null||l===void 0||l.unLock()}),G(function(){return e.placement},function(l){l&&(D.value=null)});var b=function(){var t,i;(t=r.value)===null||t===void 0||(i=t.focus)===null||i===void 0||i.call(t)},O=function(t){t.touches.length>1||(d.startPos={x:t.touches[0].clientX,y:t.touches[0].clientY})},A=function(t){if(!(t.changedTouches.length>1)){var i=t.currentTarget,v=t.changedTouches[0].clientX-d.startPos.x,m=t.changedTouches[0].clientY-d.startPos.y;(i===c.value||i===S.value||i===D.value&&dt(i,t.target,v,m))&&t.cancelable&&t.preventDefault()}},j=function l(t){var i=t.target;xe(i,Pe,l),i.style.transition=""},_=function(t){o("close",t)},X=function(t){t.keyCode===tt.ESC&&(t.stopPropagation(),_(t))},U=function(t){var i=e.open,v=e.afterVisibleChange;t.target===C.value&&t.propertyName.match(/transform$/)&&(r.value.style.transition="",!i&&x()&&(document.body.style.overflowX="",c.value&&(c.value.style.left="",c.value.style.width="")),v&&v(!!i))},R=te(function(){var l=e.placement,t=l==="left"||l==="right",i="translate".concat(t?"X":"Y");return{isHorizontal:t,placementName:i}}),Z=function(){var t=e.open,i=e.width,v=e.height,m=R.value,w=m.isHorizontal,p=m.placementName,N=D.value?D.value.getBoundingClientRect()[w?"width":"height"]:0,$=(w?i:v)||N;ue(t,p,$)},oe=function(t,i,v,m){var w=e.placement,p=e.levelMove,N=e.duration,$=e.ease,F=e.showMask;L.forEach(function(q){q.style.transition="transform ".concat(N," ").concat($),Oe(q,Pe,j);var Y=t?v:0;if(p){var re=ut(p,{target:q,open:t});Y=t?re[0]:re[1]||0}var le=typeof Y=="number"?"".concat(Y,"px"):Y,K=w==="left"||w==="top"?le:"-".concat(le);K=F&&w==="right"&&m?"calc(".concat(K," + ").concat(m,"px)"):K,q.style.transform=Y?"".concat(i,"(").concat(K,")"):""})},ue=function(t,i,v){if(!he){var m=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?pe(!0):0;oe(t,i,v,m),g(m)}o("change",t)},g=function(t){var i=e.getContainer,v=e.showMask,m=e.open,w=i==null?void 0:i();if(w&&w.parentNode===document.body&&v){var p=["touchstart"],N=[document.body,c.value,S.value,D.value];m&&document.body.style.overflow!=="hidden"?(t&&u(t),document.body.style.touchAction="none",N.forEach(function($,F){$&&Oe($,p[F]||"touchmove",F?A:O,P)})):x()&&(document.body.style.touchAction="",t&&f(t),N.forEach(function($,F){$&&xe($,p[F]||"touchmove",F?A:O,P)}))}},u=function(t){var i=e.placement,v=e.duration,m=e.ease,w="width ".concat(v," ").concat(m),p="transform ".concat(v," ").concat(m);switch(r.value.style.transition="none",i){case"right":r.value.style.transform="translateX(-".concat(t,"px)");break;case"top":case"bottom":r.value.style.width="calc(100% - ".concat(t,"px)"),r.value.style.transform="translateZ(0)";break}clearTimeout(y),y=setTimeout(function(){r.value&&(r.value.style.transition="".concat(p,",").concat(w),r.value.style.width="",r.value.style.transform="")})},f=function(t){var i=e.placement,v=e.duration,m=e.ease;r.value.style.transition="none";var w,p="width ".concat(v," ").concat(m),N="transform ".concat(v," ").concat(m);switch(i){case"left":{r.value.style.width="100%",p="width 0s ".concat(m," ").concat(v);break}case"right":{r.value.style.transform="translateX(".concat(t,"px)"),r.value.style.width="100%",p="width 0s ".concat(m," ").concat(v),c.value&&(c.value.style.left="-".concat(t,"px"),c.value.style.width="calc(100% + ".concat(t,"px)"));break}case"top":case"bottom":{r.value.style.width="calc(100% + ".concat(t,"px)"),r.value.style.height="100%",r.value.style.transform="translateZ(0)",w="height 0s ".concat(m," ").concat(v);break}}clearTimeout(y),y=setTimeout(function(){r.value&&(r.value.style.transition="".concat(N,",").concat(w?"".concat(w,","):"").concat(p),r.value.style.transform="",r.value.style.width="",r.value.style.height="")})},x=function(){return!Object.keys(ee).some(function(t){return ee[t]})},T=function(t){var i=t.level,v=t.getContainer;if(!he){var m=v==null?void 0:v(),w=m?m.parentNode:null;if(L=[],i==="all"){var p=w?Array.prototype.slice.call(w.children):[];p.forEach(function(N){N.nodeName!=="SCRIPT"&&N.nodeName!=="STYLE"&&N.nodeName!=="LINK"&&N!==m&&L.push(N)})}else i&&ct(i).forEach(function(N){document.querySelectorAll(N).forEach(function($){L.push($)})})}},M=function(t){o("handleClick",t)},I=V(!1);return G(r,function(){ae(function(){I.value=!0})}),function(){var l,t,i,v=e.width,m=e.height,w=e.open,p=e.prefixCls,N=e.placement;e.level,e.levelMove,e.ease,e.duration,e.getContainer,e.onChange,e.afterVisibleChange;var $=e.showMask,F=e.maskClosable,q=e.maskStyle,Y=e.keyboard;e.getOpenCount,e.scrollLocker;var re=e.contentWrapperStyle,le=e.style,K=e.class,je=ce(e,ft),de=w&&I.value,Ie=be(p,(l={},W(l,"".concat(p,"-").concat(N),!0),W(l,"".concat(p,"-open"),de),W(l,K,!!K),W(l,"no-mask",!$),l)),Fe=R.value.placementName,ze=N==="left"||N==="top"?"-100%":"100%",ke=de?"":"".concat(Fe,"(").concat(ze,")");return E("div",k(k({},Ae(je,["switchScrollingEffect","autofocus"])),{},{tabindex:-1,class:Ie,style:le,ref:r,onKeydown:de&&Y?X:void 0,onTransitionend:U}),[$&&E("div",{class:"".concat(p,"-mask"),onClick:F?_:void 0,style:q,ref:c},null),E("div",{class:"".concat(p,"-content-wrapper"),style:k({transform:ke,msTransform:ke,width:Te(v)?"".concat(v,"px"):v,height:Te(m)?"".concat(m,"px"):m},re),ref:C},[E("div",{class:"".concat(p,"-content"),ref:D},[(t=a.default)===null||t===void 0?void 0:t.call(a)]),a.handler?E("div",{onClick:M,ref:S},[(i=a.handler)===null||i===void 0?void 0:i.call(a)]):null])])}}});function J(s){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.element,o=n===void 0?document.body:n,a={},d=Object.keys(s);return d.forEach(function(y){a[y]=o.style[y]}),d.forEach(function(y){o.style[y]=s[y]}),a}function vt(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var ye={};const Me=function(s){if(!(!vt()&&!s)){var e="ant-scrolling-effect",n=new RegExp("".concat(e),"g"),o=document.body.className;if(s){if(!n.test(o))return;J(ye),ye={},document.body.className=o.replace(n,"").trim();return}var a=pe();if(a&&(ye=J({position:"relative",width:"calc(100% - ".concat(a,"px)")}),!n.test(o))){var d="".concat(o," ").concat(e);document.body.className=d.trim()}}};var H=[],We="ant-scrolling-effect",ge=new RegExp("".concat(We),"g"),mt=0,we=new Map,ht=ot(function s(e){var n=this;rt(this,s),W(this,"getContainer",function(){var o;return(o=n.options)===null||o===void 0?void 0:o.container}),W(this,"reLock",function(o){var a=H.find(function(d){var y=d.target;return y===n.lockTarget});a&&n.unLock(),n.options=o,a&&(a.options=o,n.lock())}),W(this,"lock",function(){var o;if(!H.some(function(r){var c=r.target;return c===n.lockTarget})){if(H.some(function(r){var c,S=r.options;return(S==null?void 0:S.container)===((c=n.options)===null||c===void 0?void 0:c.container)})){H=[].concat(Se(H),[{target:n.lockTarget,options:n.options}]);return}var a=0,d=((o=n.options)===null||o===void 0?void 0:o.container)||document.body;(d===document.body&&window.innerWidth-document.documentElement.clientWidth>0||d.scrollHeight>d.clientHeight)&&(a=pe());var y=d.className;if(H.filter(function(r){var c,S=r.options;return(S==null?void 0:S.container)===((c=n.options)===null||c===void 0?void 0:c.container)}).length===0&&we.set(d,J({width:a!==0?"calc(100% - ".concat(a,"px)"):void 0,overflow:"hidden",overflowX:"hidden",overflowY:"hidden"},{element:d})),!ge.test(y)){var C="".concat(y," ").concat(We);d.className=C.trim()}H=[].concat(Se(H),[{target:n.lockTarget,options:n.options}])}}),W(this,"unLock",function(){var o,a=H.find(function(C){var r=C.target;return r===n.lockTarget});if(H=H.filter(function(C){var r=C.target;return r!==n.lockTarget}),!(!a||H.some(function(C){var r,c=C.options;return(c==null?void 0:c.container)===((r=a.options)===null||r===void 0?void 0:r.container)}))){var d=((o=n.options)===null||o===void 0?void 0:o.container)||document.body,y=d.className;ge.test(y)&&(J(we.get(d),{element:d}),we.delete(d),d.className=d.className.replace(ge,"").trim())}}),this.lockTarget=mt++,this.options=e}),z=0,ne=Ze(),ie={},Q=function(e){if(!ne)return null;if(e){if(typeof e=="string")return document.querySelectorAll(e)[0];if(typeof e=="function")return e();if(Ue(e)==="object"&&e instanceof window.HTMLElement)return e}return document.body};const yt=se({compatConfig:{MODE:3},name:"PortalWrapper",inheritAttrs:!1,props:{wrapperClassName:String,forceRender:{type:Boolean,default:void 0},getContainer:h.any,visible:{type:Boolean,default:void 0}},setup:function(e,n){var o=n.slots,a=V(),d=V(),y=V(),C=new ht({container:Q(e.getContainer)}),r=function(){var b,O;(b=a.value)===null||b===void 0||(O=b.parentNode)===null||O===void 0||O.removeChild(a.value)},c=function(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(b||a.value&&!a.value.parentNode){var O=Q(e.getContainer);return O?(O.appendChild(a.value),!0):!1}return!0},S=function(){return ne?(a.value||(a.value=document.createElement("div"),c(!0)),D(),a.value):null},D=function(){var b=e.wrapperClassName;a.value&&b&&b!==a.value.className&&(a.value.className=b)};Xe(function(){D(),c()});var L=function(){z===1&&!Object.keys(ie).length?(Me(),ie=J({overflow:"hidden",overflowX:"hidden",overflowY:"hidden"})):z||(J(ie),ie={},Me(!0))},B=Ke();return Ce(function(){var P=!1;G([function(){return e.visible},function(){return e.getContainer}],function(b,O){var A=Ne(b,2),j=A[0],_=A[1],X=Ne(O,2),U=X[0],R=X[1];if(ne&&Q(e.getContainer)===document.body&&(j&&!U?z+=1:P&&(z-=1)),P){var Z=typeof _=="function"&&typeof R=="function";(Z?_.toString()!==R.toString():_!==R)&&r(),j&&j!==U&&ne&&Q(_)!==C.getContainer()&&C.reLock({container:Q(_)})}P=!0},{immediate:!0,flush:"post"}),ae(function(){c()||(y.value=Ee(function(){B.update()}))})}),Ye(function(){var P=e.visible,b=e.getContainer;ne&&Q(b)===document.body&&(z=P&&z?z-1:z),r(),Ee.cancel(y.value)}),function(){var P=e.forceRender,b=e.visible,O=null,A={getOpenCount:function(){return z},getContainer:S,switchScrollingEffect:L,scrollLocker:C};return(P||b||d.value)&&(O=E(at,{getContainer:S,ref:d},{default:function(){var _;return(_=o.default)===null||_===void 0?void 0:_.call(o,A)}})),O}}});var gt=["afterVisibleChange","getContainer","wrapperClassName","forceRender"],wt=["visible","afterClose"],bt=se({compatConfig:{MODE:3},inheritAttrs:!1,props:$e(lt(),{prefixCls:"drawer",placement:"left",getContainer:"body",level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",afterVisibleChange:function(){},showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",keyboard:!0,forceRender:!1,autofocus:!0}),emits:["handleClick","close"],slots:["handler"],setup:function(e,n){var o=n.emit,a=n.slots,d=V(null),y=function(c){o("handleClick",c)},C=function(c){o("close",c)};return function(){e.afterVisibleChange;var r=e.getContainer,c=e.wrapperClassName,S=e.forceRender,D=ce(e,gt),L=null;if(!r)return E("div",{class:c,ref:d},[E(De,k(k({},D),{},{open:e.open,getContainer:function(){return d.value},onClose:C,onHandleClick:y}),a)]);var B=!!a.handler||S;return(B||e.open||d.value)&&(L=E(yt,{visible:e.open,forceRender:B,getContainer:r,wrapperClassName:c},{default:function(b){var O=b.visible,A=b.afterClose,j=ce(b,wt);return E(De,k(k(k({ref:d},D),j),{},{open:O!==void 0?O:e.open,afterVisibleChange:A!==void 0?A:e.afterVisibleChange,onClose:C,onHandleClick:y}),a)}})),L}}}),Ct=["width","height","visible","placement","mask","wrapClassName","class"],pt=Be("top","right","bottom","left");Be("default","large");var Le={distance:180},kt=function(){return{autofocus:{type:Boolean,default:void 0},closable:{type:Boolean,default:void 0},closeIcon:h.any,destroyOnClose:{type:Boolean,default:void 0},forceRender:{type:Boolean,default:void 0},getContainer:h.any,maskClosable:{type:Boolean,default:void 0},mask:{type:Boolean,default:void 0},maskStyle:{type:Object,default:void 0},wrapStyle:{type:Object,default:void 0},style:{type:Object,default:void 0},class:h.any,wrapClassName:String,size:{type:String},drawerStyle:{type:Object,default:void 0},headerStyle:{type:Object,default:void 0},bodyStyle:{type:Object,default:void 0},contentWrapperStyle:{type:Object,default:void 0},title:h.any,visible:{type:Boolean,default:void 0},width:h.oneOfType([h.string,h.number]),height:h.oneOfType([h.string,h.number]),zIndex:Number,prefixCls:String,push:h.oneOfType([h.looseBool,{type:Object}]),placement:h.oneOf(pt),keyboard:{type:Boolean,default:void 0},extra:h.any,footer:h.any,footerStyle:{type:Object,default:void 0},level:h.any,levelMove:{type:[Number,Array,Function]},handle:h.any,afterVisibleChange:Function,onAfterVisibleChange:Function,"onUpdate:visible":Function,onClose:Function}},St=se({compatConfig:{MODE:3},name:"ADrawer",inheritAttrs:!1,props:$e(kt(),{closable:!0,placement:"right",maskClosable:!0,mask:!0,level:null,keyboard:!0,push:Le}),slots:["closeIcon","title","extra","footer","handle"],setup:function(e,n){var o=n.emit,a=n.slots,d=n.attrs,y=V(!1),C=V(!1),r=V(null),c=Qe("parentDrawerOpts",null),S=Ge("drawer",e),D=S.prefixCls;fe(!e.afterVisibleChange,"Drawer","`afterVisibleChange` prop is deprecated, please use `@afterVisibleChange` event instead"),fe(e.wrapStyle===void 0,"Drawer","`wrapStyle` prop is deprecated, please use `style` instead"),fe(e.wrapClassName===void 0,"Drawer","`wrapClassName` prop is deprecated, please use `class` instead");var L=function(){y.value=!0},B=function(){y.value=!1,ae(function(){P()})};et("parentDrawerOpts",{setPush:L,setPull:B}),Ce(function(){var g=e.visible;g&&c&&c.setPush()}),_e(function(){c&&c.setPull()}),G(function(){return e.visible},function(g){c&&(g?c.setPush():c.setPull())},{flush:"post"});var P=function(){var u,f;(u=r.value)===null||u===void 0||(f=u.domFocus)===null||f===void 0||f.call(u)},b=function(u){o("update:visible",!1),o("close",u)},O=function(u){var f;(f=e.afterVisibleChange)===null||f===void 0||f.call(e,u),o("afterVisibleChange",u)},A=te(function(){return e.destroyOnClose&&!e.visible}),j=function(){var u=A.value;u&&(e.visible||(C.value=!0))},_=te(function(){var g=e.push,u=e.placement,f;return typeof g=="boolean"?f=g?Le.distance:0:f=g.distance,f=parseFloat(String(f||0)),u==="left"||u==="right"?"translateX(".concat(u==="left"?f:-f,"px)"):u==="top"||u==="bottom"?"translateY(".concat(u==="top"?f:-f,"px)"):null}),X=te(function(){var g=e.visible,u=e.mask,f=e.placement,x=e.size,T=x===void 0?"default":x,M=e.width,I=e.height;if(!g&&!u)return{};var l={};if(f==="left"||f==="right"){var t=T==="large"?736:378;l.width=typeof M>"u"?t:M,l.width=typeof l.width=="string"?l.width:"".concat(l.width,"px")}else{var i=T==="large"?736:378;l.height=typeof I>"u"?i:I,l.height=typeof l.height=="string"?l.height:"".concat(l.height,"px")}return l}),U=te(function(){var g=e.zIndex,u=e.wrapStyle,f=e.mask,x=e.style,T=f?{}:X.value;return k(k(k({zIndex:g,transform:y.value?_.value:void 0},T),u),x)}),R=function(u){var f=e.closable,x=e.headerStyle,T=ve(a,e,"extra"),M=ve(a,e,"title");return!M&&!f?null:E("div",{class:be("".concat(u,"-header"),W({},"".concat(u,"-header-close-only"),f&&!M&&!T)),style:x},[E("div",{class:"".concat(u,"-header-title")},[Z(u),M&&E("div",{class:"".concat(u,"-title")},[M])]),T&&E("div",{class:"".concat(u,"-extra")},[T])])},Z=function(u){var f,x=e.closable,T=a.closeIcon?(f=a.closeIcon)===null||f===void 0?void 0:f.call(a):e.closeIcon;return x&&E("button",{key:"closer",onClick:b,"aria-label":"Close",class:"".concat(u,"-close")},[T===void 0?E(Je,null,null):T])},oe=function(u){var f;if(C.value&&!e.visible)return null;C.value=!1;var x=e.bodyStyle,T=e.drawerStyle,M={},I=A.value;return I&&(M.opacity=0,M.transition="opacity .3s"),E("div",{class:"".concat(u,"-wrapper-body"),style:k(k({},M),T),onTransitionend:j},[R(u),E("div",{key:"body",class:"".concat(u,"-body"),style:x},[(f=a.default)===null||f===void 0?void 0:f.call(a)]),ue(u)])},ue=function(u){var f=ve(a,e,"footer");if(!f)return null;var x="".concat(u,"-footer");return E("div",{class:x,style:e.footerStyle},[f])};return function(){var g;e.width,e.height;var u=e.visible,f=e.placement,x=e.mask,T=e.wrapClassName,M=e.class,I=ce(e,Ct),l=x?X.value:{},t=x?"":"no-mask",i=k(k(k(k({},d),Ae(I,["size","closeIcon","closable","destroyOnClose","drawerStyle","headerStyle","bodyStyle","title","push","wrapStyle","onAfterVisibleChange","onClose","onUpdate:visible"])),l),{},{onClose:b,afterVisibleChange:O,handler:!1,prefixCls:D.value,open:u,showMask:x,placement:f,class:be((g={},W(g,M,M),W(g,T,!!T),W(g,t,!!t),g)),style:U.value,ref:r});return E(bt,i,{handler:e.handle?function(){return e.handle}:a.handle,default:function(){return oe(D.value)}})}}});const xt=qe(St);export{xt as D}; diff --git a/apps/user-app-v2/dist/index.html b/apps/user-app-v2/dist/index.html index db5d040..966631c 100644 --- a/apps/user-app-v2/dist/index.html +++ b/apps/user-app-v2/dist/index.html @@ -32,10 +32,10 @@ html.theme-dark, html.theme-dark body { background-color: #15171A !important; } طلای منتزر - + - +
diff --git a/apps/user-app-v2/dist/sw.js b/apps/user-app-v2/dist/sw.js index 0aa8e10..a83c23a 100644 --- a/apps/user-app-v2/dist/sw.js +++ b/apps/user-app-v2/dist/sw.js @@ -1,2 +1,2 @@ try{self["workbox:core:7.4.0"]&&_()}catch{}const T=(a,...e)=>{let t=a;return e.length>0&&(t+=` :: ${JSON.stringify(e)}`),t},x=T;class l extends Error{constructor(e,t){const s=x(e,t);super(s),this.name=e,this.details=t}}const f={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},C=a=>[f.prefix,a,f.suffix].filter(e=>e&&e.length>0).join("-"),N=a=>{for(const e of Object.keys(f))a(e)},U={updateDetails:a=>{N(e=>{typeof a[e]=="string"&&(f[e]=a[e])})},getGoogleAnalyticsName:a=>a||C(f.googleAnalytics),getPrecacheName:a=>a||C(f.precache),getPrefix:()=>f.prefix,getRuntimeName:a=>a||C(f.runtime),getSuffix:()=>f.suffix};function k(a,e){const t=e();return a.waitUntil(t),t}try{self["workbox:precaching:7.4.0"]&&_()}catch{}const E="__WB_REVISION__";function I(a){if(!a)throw new l("add-to-cache-list-unexpected-type",{entry:a});if(typeof a=="string"){const n=new URL(a,location.href);return{cacheKey:n.href,url:n.href}}const{revision:e,url:t}=a;if(!t)throw new l("add-to-cache-list-unexpected-type",{entry:a});if(!e){const n=new URL(t,location.href);return{cacheKey:n.href,url:n.href}}const s=new URL(t,location.href),r=new URL(t,location.href);return s.searchParams.set(E,e),{cacheKey:s.href,url:r.href}}class O{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:s})=>{if(e.type==="install"&&t&&t.originalRequest&&t.originalRequest instanceof Request){const r=t.originalRequest.url;s?this.notUpdatedURLs.push(r):this.updatedURLs.push(r)}return s}}}class M{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:t,params:s})=>{const r=(s==null?void 0:s.cacheKey)||this._precacheController.getCacheKeyForURL(t.url);return r?new Request(r,{headers:t.headers}):t},this._precacheController=e}}let p;function W(){if(p===void 0){const a=new Response("");if("body"in a)try{new Response(a.body),p=!0}catch{p=!1}p=!1}return p}async function A(a,e){let t=null;if(a.url&&(t=new URL(a.url).origin),t!==self.location.origin)throw new l("cross-origin-copy-response",{origin:t});const s=a.clone(),n={headers:new Headers(s.headers),status:s.status,statusText:s.statusText},c=W()?s.body:await s.blob();return new Response(c,n)}const q=a=>new URL(String(a),location.href).href.replace(new RegExp(`^${location.origin}`),"");function P(a,e){const t=new URL(a);for(const s of e)t.searchParams.delete(s);return t.href}async function S(a,e,t,s){const r=P(e.url,t);if(e.url===r)return a.match(e,s);const n=Object.assign(Object.assign({},s),{ignoreSearch:!0}),c=await a.keys(e,n);for(const i of c){const o=P(i.url,t);if(r===o)return a.match(i,s)}}class D{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}const j=new Set;async function H(){for(const a of j)await a()}function F(a){return new Promise(e=>setTimeout(e,a))}try{self["workbox:strategies:7.4.0"]&&_()}catch{}function m(a){return typeof a=="string"?new Request(a):a}class B{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new D,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const s of this._plugins)this._pluginStateMap.set(s,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:t}=this;let s=m(e);if(s.mode==="navigate"&&t instanceof FetchEvent&&t.preloadResponse){const c=await t.preloadResponse;if(c)return c}const r=this.hasCallback("fetchDidFail")?s.clone():null;try{for(const c of this.iterateCallbacks("requestWillFetch"))s=await c({request:s.clone(),event:t})}catch(c){if(c instanceof Error)throw new l("plugin-error-request-will-fetch",{thrownErrorMessage:c.message})}const n=s.clone();try{let c;c=await fetch(s,s.mode==="navigate"?void 0:this._strategy.fetchOptions);for(const i of this.iterateCallbacks("fetchDidSucceed"))c=await i({event:t,request:n,response:c});return c}catch(c){throw r&&await this.runCallbacks("fetchDidFail",{error:c,event:t,originalRequest:r.clone(),request:n.clone()}),c}}async fetchAndCachePut(e){const t=await this.fetch(e),s=t.clone();return this.waitUntil(this.cachePut(e,s)),t}async cacheMatch(e){const t=m(e);let s;const{cacheName:r,matchOptions:n}=this._strategy,c=await this.getCacheKey(t,"read"),i=Object.assign(Object.assign({},n),{cacheName:r});s=await caches.match(c,i);for(const o of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await o({cacheName:r,matchOptions:n,cachedResponse:s,request:c,event:this.event})||void 0;return s}async cachePut(e,t){const s=m(e);await F(0);const r=await this.getCacheKey(s,"write");if(!t)throw new l("cache-put-with-no-response",{url:q(r.url)});const n=await this._ensureResponseSafeToCache(t);if(!n)return!1;const{cacheName:c,matchOptions:i}=this._strategy,o=await self.caches.open(c),h=this.hasCallback("cacheDidUpdate"),g=h?await S(o,r.clone(),["__WB_REVISION__"],i):null;try{await o.put(r,h?n.clone():n)}catch(u){if(u instanceof Error)throw u.name==="QuotaExceededError"&&await H(),u}for(const u of this.iterateCallbacks("cacheDidUpdate"))await u({cacheName:c,oldResponse:g,newResponse:n.clone(),request:r,event:this.event});return!0}async getCacheKey(e,t){const s=`${e.url} | ${t}`;if(!this._cacheKeys[s]){let r=e;for(const n of this.iterateCallbacks("cacheKeyWillBeUsed"))r=m(await n({mode:t,request:r,event:this.event,params:this.params}));this._cacheKeys[s]=r}return this._cacheKeys[s]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const s of this.iterateCallbacks(e))await s(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if(typeof t[e]=="function"){const s=this._pluginStateMap.get(t);yield n=>{const c=Object.assign(Object.assign({},n),{state:s});return t[e](c)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){for(;this._extendLifetimePromises.length;){const e=this._extendLifetimePromises.splice(0),s=(await Promise.allSettled(e)).find(r=>r.status==="rejected");if(s)throw s.reason}}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,s=!1;for(const r of this.iterateCallbacks("cacheWillUpdate"))if(t=await r({request:this.request,response:t,event:this.event})||void 0,s=!0,!t)break;return s||t&&t.status!==200&&(t=void 0),t}}class ${constructor(e={}){this.cacheName=U.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,s=typeof e.request=="string"?new Request(e.request):e.request,r="params"in e?e.params:void 0,n=new B(this,{event:t,request:s,params:r}),c=this._getResponse(n,s,t),i=this._awaitComplete(c,n,s,t);return[c,i]}async _getResponse(e,t,s){await e.runCallbacks("handlerWillStart",{event:s,request:t});let r;try{if(r=await this._handle(t,e),!r||r.type==="error")throw new l("no-response",{url:t.url})}catch(n){if(n instanceof Error){for(const c of e.iterateCallbacks("handlerDidError"))if(r=await c({error:n,event:s,request:t}),r)break}if(!r)throw n}for(const n of e.iterateCallbacks("handlerWillRespond"))r=await n({event:s,request:t,response:r});return r}async _awaitComplete(e,t,s,r){let n,c;try{n=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:r,request:s,response:n}),await t.doneWaiting()}catch(i){i instanceof Error&&(c=i)}if(await t.runCallbacks("handlerDidComplete",{event:r,request:s,response:n,error:c}),t.destroy(),c)throw c}}class d extends ${constructor(e={}){e.cacheName=U.getPrecacheName(e.cacheName),super(e),this._fallbackToNetwork=e.fallbackToNetwork!==!1,this.plugins.push(d.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const s=await t.cacheMatch(e);return s||(t.event&&t.event.type==="install"?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let s;const r=t.params||{};if(this._fallbackToNetwork){const n=r.integrity,c=e.integrity,i=!c||c===n;s=await t.fetch(new Request(e,{integrity:e.mode!=="no-cors"?c||n:void 0})),n&&i&&e.mode!=="no-cors"&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,s.clone()))}else throw new l("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return s}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();const s=await t.fetch(e);if(!await t.cachePut(e,s.clone()))throw new l("bad-precaching-response",{url:e.url,status:s.status});return s}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[s,r]of this.plugins.entries())r!==d.copyRedirectedCacheableResponsesPlugin&&(r===d.defaultPrecacheCacheabilityPlugin&&(e=s),r.cacheWillUpdate&&t++);t===0?this.plugins.push(d.defaultPrecacheCacheabilityPlugin):t>1&&e!==null&&this.plugins.splice(e,1)}}d.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:a}){return!a||a.status>=400?null:a}};d.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:a}){return a.redirected?await A(a):a}};class G{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:s=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new d({cacheName:U.getPrecacheName(e),plugins:[...t,new M({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const t=[];for(const s of e){typeof s=="string"?t.push(s):s&&s.revision===void 0&&t.push(s.url);const{cacheKey:r,url:n}=I(s),c=typeof s!="string"&&s.revision?"reload":"default";if(this._urlsToCacheKeys.has(n)&&this._urlsToCacheKeys.get(n)!==r)throw new l("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(n),secondEntry:r});if(typeof s!="string"&&s.integrity){if(this._cacheKeysToIntegrities.has(r)&&this._cacheKeysToIntegrities.get(r)!==s.integrity)throw new l("add-to-cache-list-conflicting-integrities",{url:n});this._cacheKeysToIntegrities.set(r,s.integrity)}if(this._urlsToCacheKeys.set(n,r),this._urlsToCacheModes.set(n,c),t.length>0){const i=`Workbox is precaching URLs without revision info: ${t.join(", ")} -This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(i)}}}install(e){return k(e,async()=>{const t=new O;this.strategy.plugins.push(t);for(const[n,c]of this._urlsToCacheKeys){const i=this._cacheKeysToIntegrities.get(c),o=this._urlsToCacheModes.get(n),h=new Request(n,{integrity:i,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:c},request:h,event:e}))}const{updatedURLs:s,notUpdatedURLs:r}=t;return{updatedURLs:s,notUpdatedURLs:r}})}activate(e){return k(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),s=await t.keys(),r=new Set(this._urlsToCacheKeys.values()),n=[];for(const c of s)r.has(c.url)||(await t.delete(c),n.push(c.url));return{deletedURLs:n}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s)return(await self.caches.open(this.strategy.cacheName)).match(s)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return s=>(s.request=new Request(e),s.params=Object.assign({cacheKey:t},s.params),this.strategy.handle(s))}}let b;const K=()=>(b||(b=new G),b);try{self["workbox:routing:7.4.0"]&&_()}catch{}const v="GET",R=a=>a&&typeof a=="object"?a:{handle:a};class w{constructor(e,t,s=v){this.handler=R(t),this.match=e,this.method=s}setCatchHandler(e){this.catchHandler=R(e)}}class V extends w{constructor(e,t,s){const r=({url:n})=>{const c=e.exec(n.href);if(c&&!(n.origin!==location.origin&&c.index!==0))return c.slice(1)};super(r,t,s)}}class Q{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,s=this.handleRequest({request:t,event:e});s&&e.respondWith(s)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,s=Promise.all(t.urlsToCache.map(r=>{typeof r=="string"&&(r=[r]);const n=new Request(...r);return this.handleRequest({request:n,event:e})}));e.waitUntil(s),e.ports&&e.ports[0]&&s.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return;const r=s.origin===location.origin,{params:n,route:c}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:s});let i=c&&c.handler;const o=e.method;if(!i&&this._defaultHandlerMap.has(o)&&(i=this._defaultHandlerMap.get(o)),!i)return;let h;try{h=i.handle({url:s,request:e,event:t,params:n})}catch(u){h=Promise.reject(u)}const g=c&&c.catchHandler;return h instanceof Promise&&(this._catchHandler||g)&&(h=h.catch(async u=>{if(g)try{return await g.handle({url:s,request:e,event:t,params:n})}catch(L){L instanceof Error&&(u=L)}if(this._catchHandler)return this._catchHandler.handle({url:s,request:e,event:t});throw u})),h}findMatchingRoute({url:e,sameOrigin:t,request:s,event:r}){const n=this._routes.get(s.method)||[];for(const c of n){let i;const o=c.match({url:e,sameOrigin:t,request:s,event:r});if(o)return i=o,(Array.isArray(i)&&i.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(i=void 0),{route:c,params:i}}return{}}setDefaultHandler(e,t=v){this._defaultHandlerMap.set(t,R(e))}setCatchHandler(e){this._catchHandler=R(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}}let y;const z=()=>(y||(y=new Q,y.addFetchListener(),y.addCacheListener()),y);function J(a,e,t){let s;if(typeof a=="string"){const n=new URL(a,location.href),c=({url:i})=>i.href===n.href;s=new w(c,e,t)}else if(a instanceof RegExp)s=new V(a,e,t);else if(typeof a=="function")s=new w(a,e,t);else if(a instanceof w)s=a;else throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return z().registerRoute(s),s}function X(a,e=[]){for(const t of[...a.searchParams.keys()])e.some(s=>s.test(t))&&a.searchParams.delete(t);return a}function*Y(a,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:s=!0,urlManipulation:r}={}){const n=new URL(a,location.href);n.hash="",yield n.href;const c=X(n,e);if(yield c.href,t&&c.pathname.endsWith("/")){const i=new URL(c.href);i.pathname+=t,yield i.href}if(s){const i=new URL(c.href);i.pathname+=".html",yield i.href}if(r){const i=r({url:n});for(const o of i)yield o.href}}class Z extends w{constructor(e,t){const s=({request:r})=>{const n=e.getURLsToCacheKeys();for(const c of Y(r.url,t)){const i=n.get(c);if(i){const o=e.getIntegrityForCacheKey(i);return{cacheKey:i,integrity:o}}}};super(s,e.strategy)}}function ee(a){const e=K(),t=new Z(e,a);J(t)}function te(a){K().precache(a)}function se(a,e){te(a),ee(e)}self.addEventListener("message",a=>{a.data&&a.data.type==="SKIP_WAITING"&&self.skipWaiting()});se([{"revision":"3c6786cdcf9eb08a55e94bc7b70b75e2","url":"index.html"},{"revision":null,"url":"assets/workbox-window.prod.es5-BqEJf4Xk.js"},{"revision":null,"url":"assets/TransactionsView-CE67aKDY.css"},{"revision":null,"url":"assets/TransactionsView-BaIYETDv.js"},{"revision":null,"url":"assets/SectionHead-X7JFvmOG.css"},{"revision":null,"url":"assets/SectionHead-BiCEpXAe.js"},{"revision":null,"url":"assets/SearchView-uJ2hiU7a.js"},{"revision":null,"url":"assets/SearchView-CS1oUiFo.css"},{"revision":null,"url":"assets/SearchInput-DEfgrsbu.css"},{"revision":null,"url":"assets/SearchInput-BZCG2e_m.js"},{"revision":null,"url":"assets/ReportView-NtWL-hNL.js"},{"revision":null,"url":"assets/ReportView-DjU8BNPp.css"},{"revision":null,"url":"assets/RateStrip-BjkE-E9D.css"},{"revision":null,"url":"assets/RateStrip-0Viss8IX.js"},{"revision":null,"url":"assets/raf-nDFcuFT6.js"},{"revision":null,"url":"assets/ProfileView-Bcb3A35W.js"},{"revision":null,"url":"assets/ProfileView-0KcCKpWF.css"},{"revision":null,"url":"assets/ProductCard-nL92ZIkB.js"},{"revision":null,"url":"assets/ProductCard-C8bieA3Y.css"},{"revision":null,"url":"assets/PageBar-D5DXU6sO.js"},{"revision":null,"url":"assets/PageBar-CKAnfXNs.css"},{"revision":null,"url":"assets/OrdersView-BcT-EgU-.js"},{"revision":null,"url":"assets/OrdersView-B7LDWHTY.css"},{"revision":null,"url":"assets/NotificationsView-QOE6v-gp.js"},{"revision":null,"url":"assets/NotificationsView-BYJ2kMU3.css"},{"revision":null,"url":"assets/NewestView-D2rB4-Sw.css"},{"revision":null,"url":"assets/NewestView--pb6tWn4.js"},{"revision":null,"url":"assets/LoginRegisterView-COhrUF6E.css"},{"revision":null,"url":"assets/LoginRegisterView-CFYOzXdH.js"},{"revision":null,"url":"assets/KeyCode-CA5MXqE7.js"},{"revision":null,"url":"assets/index-sLHXZqt3.js"},{"revision":null,"url":"assets/index-ecOSUWQv.js"},{"revision":null,"url":"assets/index-CCuOiiOn.css"},{"revision":null,"url":"assets/index-BWyw3RAx.js"},{"revision":null,"url":"assets/index-7kdFQ8tV.js"},{"revision":null,"url":"assets/HomeView-BsWyRfva.css"},{"revision":null,"url":"assets/HomeView-BLj03XEk.js"},{"revision":null,"url":"assets/FormItemContext-Bxnh5gKQ.js"},{"revision":null,"url":"assets/filters-DVocLz3o.js"},{"revision":null,"url":"assets/FavoritesView-CiVaZUZb.js"},{"revision":null,"url":"assets/FavoritesView-ChC1yylj.css"},{"revision":null,"url":"assets/DashboardView-D5cEPlGT.css"},{"revision":null,"url":"assets/DashboardView-B0WNzWOb.js"},{"revision":null,"url":"assets/CustomerChoiceView-Yt6glUHR.js"},{"revision":null,"url":"assets/CustomerChoiceView-B2Wj4PsY.css"},{"revision":null,"url":"assets/CompleteProfileView-h4pf7JXN.js"},{"revision":null,"url":"assets/CompleteProfileView-Cy-typLQ.css"},{"revision":null,"url":"assets/CollectionView-hOc6F2Q6.css"},{"revision":null,"url":"assets/CollectionView-C1GrIPCU.js"},{"revision":null,"url":"assets/classCallCheck-Ou87VTNv.js"},{"revision":null,"url":"assets/ChildOrdersView-qV6oiil_.js"},{"revision":null,"url":"assets/ChildOrdersView-DS4jSTHf.css"},{"revision":null,"url":"assets/CartView-DyEDwwD2.js"},{"revision":null,"url":"assets/CartView-DSMBGhzx.css"},{"revision":null,"url":"assets/AppearanceView-ckFSThyi.js"},{"revision":null,"url":"assets/AppearanceView-B8ytXsfh.css"},{"revision":"2d61085b7d642f658b0293f7d21fa261","url":"favicon.ico"},{"revision":"809f622706a5b36825403377f1155953","url":"icon-192.png"},{"revision":"bc2dd1f4bb210316c01158b1539def63","url":"icon-512.png"},{"revision":"2e39c9668b2bdc8b430f61d95dfc35b0","url":"manifest.webmanifest"}]); +This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(i)}}}install(e){return k(e,async()=>{const t=new O;this.strategy.plugins.push(t);for(const[n,c]of this._urlsToCacheKeys){const i=this._cacheKeysToIntegrities.get(c),o=this._urlsToCacheModes.get(n),h=new Request(n,{integrity:i,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:c},request:h,event:e}))}const{updatedURLs:s,notUpdatedURLs:r}=t;return{updatedURLs:s,notUpdatedURLs:r}})}activate(e){return k(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),s=await t.keys(),r=new Set(this._urlsToCacheKeys.values()),n=[];for(const c of s)r.has(c.url)||(await t.delete(c),n.push(c.url));return{deletedURLs:n}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s)return(await self.caches.open(this.strategy.cacheName)).match(s)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return s=>(s.request=new Request(e),s.params=Object.assign({cacheKey:t},s.params),this.strategy.handle(s))}}let b;const K=()=>(b||(b=new G),b);try{self["workbox:routing:7.4.0"]&&_()}catch{}const v="GET",R=a=>a&&typeof a=="object"?a:{handle:a};class w{constructor(e,t,s=v){this.handler=R(t),this.match=e,this.method=s}setCatchHandler(e){this.catchHandler=R(e)}}class V extends w{constructor(e,t,s){const r=({url:n})=>{const c=e.exec(n.href);if(c&&!(n.origin!==location.origin&&c.index!==0))return c.slice(1)};super(r,t,s)}}class Q{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,s=this.handleRequest({request:t,event:e});s&&e.respondWith(s)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,s=Promise.all(t.urlsToCache.map(r=>{typeof r=="string"&&(r=[r]);const n=new Request(...r);return this.handleRequest({request:n,event:e})}));e.waitUntil(s),e.ports&&e.ports[0]&&s.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return;const r=s.origin===location.origin,{params:n,route:c}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:s});let i=c&&c.handler;const o=e.method;if(!i&&this._defaultHandlerMap.has(o)&&(i=this._defaultHandlerMap.get(o)),!i)return;let h;try{h=i.handle({url:s,request:e,event:t,params:n})}catch(u){h=Promise.reject(u)}const g=c&&c.catchHandler;return h instanceof Promise&&(this._catchHandler||g)&&(h=h.catch(async u=>{if(g)try{return await g.handle({url:s,request:e,event:t,params:n})}catch(L){L instanceof Error&&(u=L)}if(this._catchHandler)return this._catchHandler.handle({url:s,request:e,event:t});throw u})),h}findMatchingRoute({url:e,sameOrigin:t,request:s,event:r}){const n=this._routes.get(s.method)||[];for(const c of n){let i;const o=c.match({url:e,sameOrigin:t,request:s,event:r});if(o)return i=o,(Array.isArray(i)&&i.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(i=void 0),{route:c,params:i}}return{}}setDefaultHandler(e,t=v){this._defaultHandlerMap.set(t,R(e))}setCatchHandler(e){this._catchHandler=R(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}}let y;const z=()=>(y||(y=new Q,y.addFetchListener(),y.addCacheListener()),y);function J(a,e,t){let s;if(typeof a=="string"){const n=new URL(a,location.href),c=({url:i})=>i.href===n.href;s=new w(c,e,t)}else if(a instanceof RegExp)s=new V(a,e,t);else if(typeof a=="function")s=new w(a,e,t);else if(a instanceof w)s=a;else throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return z().registerRoute(s),s}function X(a,e=[]){for(const t of[...a.searchParams.keys()])e.some(s=>s.test(t))&&a.searchParams.delete(t);return a}function*Y(a,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:s=!0,urlManipulation:r}={}){const n=new URL(a,location.href);n.hash="",yield n.href;const c=X(n,e);if(yield c.href,t&&c.pathname.endsWith("/")){const i=new URL(c.href);i.pathname+=t,yield i.href}if(s){const i=new URL(c.href);i.pathname+=".html",yield i.href}if(r){const i=r({url:n});for(const o of i)yield o.href}}class Z extends w{constructor(e,t){const s=({request:r})=>{const n=e.getURLsToCacheKeys();for(const c of Y(r.url,t)){const i=n.get(c);if(i){const o=e.getIntegrityForCacheKey(i);return{cacheKey:i,integrity:o}}}};super(s,e.strategy)}}function ee(a){const e=K(),t=new Z(e,a);J(t)}function te(a){K().precache(a)}function se(a,e){te(a),ee(e)}self.addEventListener("message",a=>{a.data&&a.data.type==="SKIP_WAITING"&&self.skipWaiting()});se([{"revision":"ebf761b054e97365094df6b8d1ad177a","url":"index.html"},{"revision":null,"url":"assets/workbox-window.prod.es5-BqEJf4Xk.js"},{"revision":null,"url":"assets/TransactionsView-CUA8xQcy.js"},{"revision":null,"url":"assets/TransactionsView-CE67aKDY.css"},{"revision":null,"url":"assets/SectionHead-X7JFvmOG.css"},{"revision":null,"url":"assets/SectionHead-DNG9ywW4.js"},{"revision":null,"url":"assets/SearchView-DNae1fsD.js"},{"revision":null,"url":"assets/SearchView-CS1oUiFo.css"},{"revision":null,"url":"assets/SearchInput-OrOd8Tqr.js"},{"revision":null,"url":"assets/SearchInput-DEfgrsbu.css"},{"revision":null,"url":"assets/ReportView-tLoo_9HZ.css"},{"revision":null,"url":"assets/ReportView-ooq-YW_N.js"},{"revision":null,"url":"assets/RateStrip-Cjr1qlEL.js"},{"revision":null,"url":"assets/RateStrip-BjkE-E9D.css"},{"revision":null,"url":"assets/raf-nDFcuFT6.js"},{"revision":null,"url":"assets/ProfileView-qElFZKrE.js"},{"revision":null,"url":"assets/ProfileView-0KcCKpWF.css"},{"revision":null,"url":"assets/ProductCard-CvKEozHI.js"},{"revision":null,"url":"assets/ProductCard-C8bieA3Y.css"},{"revision":null,"url":"assets/PageBar-El-laHqK.js"},{"revision":null,"url":"assets/PageBar-CKAnfXNs.css"},{"revision":null,"url":"assets/OrdersView-C8fvzMFb.js"},{"revision":null,"url":"assets/OrdersView-BULq1WHJ.css"},{"revision":null,"url":"assets/NotificationsView-BYJ2kMU3.css"},{"revision":null,"url":"assets/NotificationsView-BuhDQ6dh.js"},{"revision":null,"url":"assets/NewestView-D2rB4-Sw.css"},{"revision":null,"url":"assets/NewestView-BG4MNUeW.js"},{"revision":null,"url":"assets/LoginRegisterView-GyFoinkN.js"},{"revision":null,"url":"assets/LoginRegisterView-COhrUF6E.css"},{"revision":null,"url":"assets/KeyCode-DAs3W-5E.js"},{"revision":null,"url":"assets/index-UuozCFb-.js"},{"revision":null,"url":"assets/index-UkXhTnpw.js"},{"revision":null,"url":"assets/index-Dp9sxvBv.js"},{"revision":null,"url":"assets/index-CCuOiiOn.css"},{"revision":null,"url":"assets/index-B0RgkHMm.js"},{"revision":null,"url":"assets/HomeView-C0cpdx4l.js"},{"revision":null,"url":"assets/HomeView-BsWyRfva.css"},{"revision":null,"url":"assets/FormItemContext-C33n6IMx.js"},{"revision":null,"url":"assets/filters-CUgGgSea.js"},{"revision":null,"url":"assets/FavoritesView-DxHQrp9E.js"},{"revision":null,"url":"assets/FavoritesView-ChC1yylj.css"},{"revision":null,"url":"assets/DashboardView-Dd-mLt1P.css"},{"revision":null,"url":"assets/DashboardView-BRB4XUhz.js"},{"revision":null,"url":"assets/CustomerChoiceView-H1FeybTn.css"},{"revision":null,"url":"assets/CustomerChoiceView-D-JqOITb.js"},{"revision":null,"url":"assets/CompleteProfileView-Cy-typLQ.css"},{"revision":null,"url":"assets/CompleteProfileView-CxdqhMlz.js"},{"revision":null,"url":"assets/CollectionView-hOc6F2Q6.css"},{"revision":null,"url":"assets/CollectionView-CjJy961h.js"},{"revision":null,"url":"assets/classCallCheck-BTVV3tFI.js"},{"revision":null,"url":"assets/ChildOrdersView-CTHMBAuv.js"},{"revision":null,"url":"assets/ChildOrdersView-BSUeH1Jr.css"},{"revision":null,"url":"assets/CartView-MDu3XibQ.js"},{"revision":null,"url":"assets/CartView-DSMBGhzx.css"},{"revision":null,"url":"assets/AppearanceView-B8ytXsfh.css"},{"revision":null,"url":"assets/AppearanceView-B0bKuyHr.js"},{"revision":"2d61085b7d642f658b0293f7d21fa261","url":"favicon.ico"},{"revision":"809f622706a5b36825403377f1155953","url":"icon-192.png"},{"revision":"bc2dd1f4bb210316c01158b1539def63","url":"icon-512.png"},{"revision":"2e39c9668b2bdc8b430f61d95dfc35b0","url":"manifest.webmanifest"}]); diff --git a/apps/user-app-v2/index.html b/apps/user-app-v2/index.html index 853870b..2fac0fd 100644 --- a/apps/user-app-v2/index.html +++ b/apps/user-app-v2/index.html @@ -33,7 +33,7 @@ طلای منتزر - +
diff --git a/apps/user-app-v2/src/api/client.ts b/apps/user-app-v2/src/api/client.ts index 7419b7c..7ca51cf 100644 --- a/apps/user-app-v2/src/api/client.ts +++ b/apps/user-app-v2/src/api/client.ts @@ -279,6 +279,15 @@ export interface ReportBalance { arz: string; mandeh: string; } +/** GET /customer/me/accounting-balance. Signed like the app: positive = owes. */ +export interface AccountingBalance { + source: 'accounting' | 'stored' | 'none' + gold: string | null + rial: string | null + at: string | null + provider: string | null +} + export const api = { listProducts: () => request('/catalog/products'), /** @@ -307,6 +316,8 @@ export const api = { // /customers/:id, /:id/orders and /:id/ledger-entries, which took the id from // the URL and let anyone read anyone (SEC-08). getMe: () => request('/customer/me'), + /** D27 §12 — this customer's balance, read from the accounting software on every call. */ + getAccountingBalance: () => request('/customer/me/accounting-balance'), getMyOrders: () => request('/customer/me/orders'), getMyLedgerEntries: () => request('/customer/me/ledger-entries'), createOrder: (dto: CreateOrderDto) => request('/orders', { method: 'POST', body: JSON.stringify(dto) }), diff --git a/apps/user-app-v2/src/main.ts b/apps/user-app-v2/src/main.ts index 440a161..10237f9 100644 --- a/apps/user-app-v2/src/main.ts +++ b/apps/user-app-v2/src/main.ts @@ -1,6 +1,8 @@ import { createApp } from 'vue'; import { createPinia } from 'pinia'; import VueLazyLoad from 'vue3-lazyload'; +import { Locale } from 'vant'; +import faIR from 'vant/es/locale/lang/fa-IR'; import App from './App.vue'; import { router } from './router'; import { setUnauthorizedHandler } from './api/client'; @@ -9,6 +11,12 @@ import { useAppearanceStore } from './stores/appearanceStore'; import Container from './components/ui/Container.vue'; import Vector from './assets/img/Vector.svg'; +// Vant defaults to zh-CN. Every view in this app is Persian (RTL), so any +// Vant component rendering its own built-in text (PullRefresh's +// pulling/loosing labels, etc.) would otherwise show untranslated Chinese — +// switch to Vant's own fa-IR locale before anything mounts. +Locale.use('fa-IR', faIR); + // Global styles, ported from legacy henza_pwa/src/main.ts — same import order // (ant-design-vue's own theme first, then our Less overrides on top). Legacy // imported 'vant/lib/index.css' twice (a dead duplicate) — imported once here. diff --git a/apps/user-app-v2/src/views/expert/ChildOrdersView.vue b/apps/user-app-v2/src/views/expert/ChildOrdersView.vue index 64ecb99..4d17a3a 100644 --- a/apps/user-app-v2/src/views/expert/ChildOrdersView.vue +++ b/apps/user-app-v2/src/views/expert/ChildOrdersView.vue @@ -37,6 +37,10 @@ + + + +