@vendure/dashboard 3.7.1-master-202607110305 → 3.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/bundle/chunks/{2SSKDMRQ-BXz8vjrT.js → 2SSKDMRQ-CGPzX7ok.js} +2 -2
  2. package/dist/bundle/chunks/{AP7HFJJL-BcewBvAf.js → AP7HFJJL-BANaC6nc.js} +1 -1
  3. package/dist/bundle/chunks/{WDYDFRGG-Cd364FN_.js → WDYDFRGG-DWwEqh2h.js} +2 -2
  4. package/dist/bundle/chunks/ar-DCEbHB2w.js +4 -0
  5. package/dist/bundle/chunks/bg-Dfcm3H-7.js +4 -0
  6. package/dist/bundle/chunks/cs-CAXaYQpr.js +4 -0
  7. package/dist/bundle/chunks/de-2rMAToGI.js +4 -0
  8. package/dist/bundle/chunks/en-CBy7m12i.js +4 -0
  9. package/dist/bundle/chunks/es-DhcrnvxO.js +4 -0
  10. package/dist/bundle/chunks/fa-BvgI8zZ5.js +4 -0
  11. package/dist/bundle/chunks/fr-B1Aw3cxh.js +4 -0
  12. package/dist/bundle/chunks/he-Dvum09Nk.js +4 -0
  13. package/dist/bundle/chunks/hr-CiUxzJsU.js +4 -0
  14. package/dist/bundle/chunks/hu-nmofxtH_.js +4 -0
  15. package/dist/bundle/chunks/it-CHi8ynGm.js +4 -0
  16. package/dist/bundle/chunks/ja-zasGFj1j.js +4 -0
  17. package/dist/bundle/chunks/ko-CBy7m12i.js +4 -0
  18. package/dist/bundle/chunks/{locale-YfvnivAQ.js → locale--aauL66m.js} +1 -1
  19. package/dist/bundle/chunks/{main-CG6JVORh.js → main-DVt3RsH7.js} +385 -1076
  20. package/dist/bundle/chunks/nb-DL1AcZeO.js +4 -0
  21. package/dist/bundle/chunks/ne-4aOoOw2J.js +4 -0
  22. package/dist/bundle/chunks/nl-Bf1kuLeC.js +4 -0
  23. package/dist/bundle/chunks/pl-Ak_kyBWq.js +4 -0
  24. package/dist/bundle/chunks/pt_BR-DS-J3yJI.js +4 -0
  25. package/dist/bundle/chunks/pt_PT-CQT5peF9.js +4 -0
  26. package/dist/bundle/chunks/ro-BJ2PuiOl.js +4 -0
  27. package/dist/bundle/chunks/ru-Bc_E807P.js +4 -0
  28. package/dist/bundle/chunks/sv-CZhEzelP.js +4 -0
  29. package/dist/bundle/chunks/tr-mdPJPyeZ.js +4 -0
  30. package/dist/bundle/chunks/uk-fAchGf1H.js +4 -0
  31. package/dist/bundle/chunks/{use-job-queue-polling-BESJ2s1g.js → use-job-queue-polling-mUjHlukj.js} +1329 -12523
  32. package/dist/bundle/chunks/uz-B5L-lMAZ.js +4 -0
  33. package/dist/bundle/chunks/zh_Hans-C8s-LcKM.js +4 -0
  34. package/dist/bundle/chunks/zh_Hant-CGwnZIiO.js +4 -0
  35. package/dist/bundle/lib.js +584 -577
  36. package/dist/bundle/main.js +4 -2
  37. package/dist/plugin/service/metrics.service.js +1 -1
  38. package/dist/vite/lib-externals.d.ts +44 -0
  39. package/dist/vite/lib-externals.js +80 -0
  40. package/dist/vite/vite-plugin-config.js +8 -0
  41. package/package.json +4 -3
  42. package/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-bulk-actions.tsx +69 -0
  43. package/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-table.tsx +12 -2
  44. package/src/app/routes/_authenticated/_orders/components/edit-order-table.tsx +79 -44
  45. package/src/app/routes/_authenticated/_products/components/force-remove-option-group-dialog.tsx +66 -0
  46. package/src/app/routes/_authenticated/_products/components/product-option-group-badge.tsx +66 -12
  47. package/src/app/routes/_authenticated/_products/hooks/use-remove-option-group.ts +90 -0
  48. package/src/app/routes/_authenticated/_products/products_.$id.tsx +15 -21
  49. package/src/app/routes/_authenticated/_products/products_.$id_.variants.tsx +34 -75
  50. package/src/i18n/locales/ar.po +89 -63
  51. package/src/i18n/locales/bg.po +89 -63
  52. package/src/i18n/locales/cs.po +89 -63
  53. package/src/i18n/locales/de.po +89 -63
  54. package/src/i18n/locales/en.po +89 -63
  55. package/src/i18n/locales/es.po +89 -63
  56. package/src/i18n/locales/fa.po +89 -63
  57. package/src/i18n/locales/fr.po +89 -63
  58. package/src/i18n/locales/he.po +89 -63
  59. package/src/i18n/locales/hr.po +89 -63
  60. package/src/i18n/locales/hu.po +89 -63
  61. package/src/i18n/locales/it.po +89 -63
  62. package/src/i18n/locales/ja.po +89 -63
  63. package/src/i18n/locales/ko.po +16 -0
  64. package/src/i18n/locales/nb.po +89 -63
  65. package/src/i18n/locales/ne.po +89 -63
  66. package/src/i18n/locales/nl.po +89 -63
  67. package/src/i18n/locales/pl.po +89 -63
  68. package/src/i18n/locales/pt_BR.po +89 -63
  69. package/src/i18n/locales/pt_PT.po +89 -63
  70. package/src/i18n/locales/ro.po +89 -63
  71. package/src/i18n/locales/ru.po +89 -63
  72. package/src/i18n/locales/sv.po +89 -63
  73. package/src/i18n/locales/tr.po +89 -63
  74. package/src/i18n/locales/uk.po +89 -63
  75. package/src/i18n/locales/uz.po +89 -63
  76. package/src/i18n/locales/zh_Hans.po +89 -63
  77. package/src/i18n/locales/zh_Hant.po +89 -63
  78. package/src/lib/components/layout/nav-main.tsx +3 -1
  79. package/src/lib/framework/document-introspection/add-custom-fields.ts +2 -2
  80. package/src/lib/framework/document-introspection/include-only-selected-list-fields.ts +4 -1
  81. package/src/lib/framework/extension-api/custom-providers.ts +1 -1
  82. package/dist/bundle/chunks/ar-BGF27StW.js +0 -4
  83. package/dist/bundle/chunks/bg-DkqOGEvG.js +0 -4
  84. package/dist/bundle/chunks/cs-CKnEitnA.js +0 -4
  85. package/dist/bundle/chunks/de-B-hSTdcF.js +0 -4
  86. package/dist/bundle/chunks/en-4EbLSxP4.js +0 -4
  87. package/dist/bundle/chunks/es-BJr_pTZZ.js +0 -4
  88. package/dist/bundle/chunks/fa-NHk9jRAC.js +0 -4
  89. package/dist/bundle/chunks/fr-gP2g5_ht.js +0 -4
  90. package/dist/bundle/chunks/he-Xr8Cx_mh.js +0 -4
  91. package/dist/bundle/chunks/hr-DzjCNMEU.js +0 -4
  92. package/dist/bundle/chunks/hu-CXOlSiP6.js +0 -4
  93. package/dist/bundle/chunks/it-DYujYua2.js +0 -4
  94. package/dist/bundle/chunks/ja-ZaE7h4EQ.js +0 -4
  95. package/dist/bundle/chunks/ko-4EbLSxP4.js +0 -4
  96. package/dist/bundle/chunks/nb-BGkcDLkm.js +0 -4
  97. package/dist/bundle/chunks/ne-DDJwrpmB.js +0 -4
  98. package/dist/bundle/chunks/nl-DaJt2O1a.js +0 -4
  99. package/dist/bundle/chunks/pl-DQ-xjSLt.js +0 -4
  100. package/dist/bundle/chunks/pt_BR-Bv3fwQyM.js +0 -4
  101. package/dist/bundle/chunks/pt_PT-DdlVuwFg.js +0 -4
  102. package/dist/bundle/chunks/ro-CsBx1KAe.js +0 -4
  103. package/dist/bundle/chunks/ru-CfK8XmB-.js +0 -4
  104. package/dist/bundle/chunks/sv-DpW1nyx4.js +0 -4
  105. package/dist/bundle/chunks/tr-iM7XvP3W.js +0 -4
  106. package/dist/bundle/chunks/uk-Cc2aTucO.js +0 -4
  107. package/dist/bundle/chunks/uz-Bp06aVxW.js +0 -4
  108. package/dist/bundle/chunks/zh_Hans-D1qOG21m.js +0 -4
  109. package/dist/bundle/chunks/zh_Hant-C2Tj1zDP.js +0 -4
  110. package/dist/vite/.vendure-dashboard-temp/compiler/4346-7f116ae5-e526-4aad-b671-b514921c7c92/dev-config.js +0 -251
  111. package/dist/vite/.vendure-dashboard-temp/compiler/4346-7f116ae5-e526-4aad-b671-b514921c7c92/package.json +0 -4
  112. package/dist/vite/.vendure-dashboard-temp/compiler/4346-7f116ae5-e526-4aad-b671-b514921c7c92/test-plugins/nav-modifier-plugin/nav-modifier-plugin.js +0 -23
  113. package/dist/vite/.vendure-dashboard-temp/compiler/4346-7f116ae5-e526-4aad-b671-b514921c7c92/test-plugins/reviews/api/api-extensions.js +0 -99
  114. package/dist/vite/.vendure-dashboard-temp/compiler/4346-7f116ae5-e526-4aad-b671-b514921c7c92/test-plugins/reviews/api/product-entity.resolver.js +0 -73
  115. package/dist/vite/.vendure-dashboard-temp/compiler/4346-7f116ae5-e526-4aad-b671-b514921c7c92/test-plugins/reviews/api/product-review-admin.resolver.js +0 -146
  116. package/dist/vite/.vendure-dashboard-temp/compiler/4346-7f116ae5-e526-4aad-b671-b514921c7c92/test-plugins/reviews/api/product-review-entity.resolver.js +0 -79
  117. package/dist/vite/.vendure-dashboard-temp/compiler/4346-7f116ae5-e526-4aad-b671-b514921c7c92/test-plugins/reviews/api/product-review-shop.resolver.js +0 -79
  118. package/dist/vite/.vendure-dashboard-temp/compiler/4346-7f116ae5-e526-4aad-b671-b514921c7c92/test-plugins/reviews/entities/product-review-translation.entity.js +0 -47
  119. package/dist/vite/.vendure-dashboard-temp/compiler/4346-7f116ae5-e526-4aad-b671-b514921c7c92/test-plugins/reviews/entities/product-review.entity.js +0 -90
  120. package/dist/vite/.vendure-dashboard-temp/compiler/4346-7f116ae5-e526-4aad-b671-b514921c7c92/test-plugins/reviews/generated-admin-types.js +0 -1021
  121. package/dist/vite/.vendure-dashboard-temp/compiler/4346-7f116ae5-e526-4aad-b671-b514921c7c92/test-plugins/reviews/generated-shop-types.js +0 -974
  122. package/dist/vite/.vendure-dashboard-temp/compiler/4346-7f116ae5-e526-4aad-b671-b514921c7c92/test-plugins/reviews/reviews-plugin.js +0 -46
  123. package/dist/vite/.vendure-dashboard-temp/compiler/4346-7f116ae5-e526-4aad-b671-b514921c7c92/test-plugins/reviews/types.js +0 -2
  124. package/dist/vite/.vendure-dashboard-temp/gql-tada/4346-7f116ae5-e526-4aad-b671-b514921c7c92/schema.graphql +0 -6844
  125. package/dist/vite/.vendure-dashboard-temp/gql-tada/4346-7f116ae5-e526-4aad-b671-b514921c7c92/tsconfig.json +0 -10
  126. /package/dist/vite/.vendure-dashboard-temp/compiler/{3392-6cc5883f-d536-4750-80a8-e56ef4d1f34c → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/dev-config.js +0 -0
  127. /package/dist/vite/.vendure-dashboard-temp/compiler/{3392-6cc5883f-d536-4750-80a8-e56ef4d1f34c → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/package.json +0 -0
  128. /package/dist/vite/.vendure-dashboard-temp/compiler/{3392-6cc5883f-d536-4750-80a8-e56ef4d1f34c → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/nav-modifier-plugin/nav-modifier-plugin.js +0 -0
  129. /package/dist/vite/.vendure-dashboard-temp/compiler/{3392-6cc5883f-d536-4750-80a8-e56ef4d1f34c → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/api/api-extensions.js +0 -0
  130. /package/dist/vite/.vendure-dashboard-temp/compiler/{3392-6cc5883f-d536-4750-80a8-e56ef4d1f34c → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/api/product-entity.resolver.js +0 -0
  131. /package/dist/vite/.vendure-dashboard-temp/compiler/{3392-6cc5883f-d536-4750-80a8-e56ef4d1f34c → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/api/product-review-admin.resolver.js +0 -0
  132. /package/dist/vite/.vendure-dashboard-temp/compiler/{3392-6cc5883f-d536-4750-80a8-e56ef4d1f34c → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/api/product-review-entity.resolver.js +0 -0
  133. /package/dist/vite/.vendure-dashboard-temp/compiler/{3392-6cc5883f-d536-4750-80a8-e56ef4d1f34c → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/api/product-review-shop.resolver.js +0 -0
  134. /package/dist/vite/.vendure-dashboard-temp/compiler/{3392-6cc5883f-d536-4750-80a8-e56ef4d1f34c → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/entities/product-review-translation.entity.js +0 -0
  135. /package/dist/vite/.vendure-dashboard-temp/compiler/{3392-6cc5883f-d536-4750-80a8-e56ef4d1f34c → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/entities/product-review.entity.js +0 -0
  136. /package/dist/vite/.vendure-dashboard-temp/compiler/{3392-6cc5883f-d536-4750-80a8-e56ef4d1f34c → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/generated-admin-types.js +0 -0
  137. /package/dist/vite/.vendure-dashboard-temp/compiler/{3392-6cc5883f-d536-4750-80a8-e56ef4d1f34c → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/generated-shop-types.js +0 -0
  138. /package/dist/vite/.vendure-dashboard-temp/compiler/{3392-6cc5883f-d536-4750-80a8-e56ef4d1f34c → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/reviews-plugin.js +0 -0
  139. /package/dist/vite/.vendure-dashboard-temp/compiler/{3392-6cc5883f-d536-4750-80a8-e56ef4d1f34c → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/types.js +0 -0
  140. /package/dist/vite/.vendure-dashboard-temp/gql-tada/{3392-6cc5883f-d536-4750-80a8-e56ef4d1f34c → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/schema.graphql +0 -0
  141. /package/dist/vite/.vendure-dashboard-temp/gql-tada/{3392-6cc5883f-d536-4750-80a8-e56ef4d1f34c → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/tsconfig.json +0 -0
@@ -1,29 +1,33 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { c as createLucideIcon, nX as Subscribable, nY as Mutation, nZ as notifyManager, n_ as matchMutation, n$ as noop, o0 as hashQueryKeyByOptions, o1 as Query, o2 as matchQuery, o3 as focusManager, o4 as onlineManager, o5 as resolveStaleTime, o6 as functionalUpdate, o7 as infiniteQueryBehavior, o8 as hashKey, o9 as partialMatchKey, oa as skipToken, nQ as useRouter, ob as useStore, oc as usePrevious, od as trimPathRight, oe as useLayoutEffect, of as getLocationChangeInfo, og as batch$1, oh as handleHashScroll, oi as replaceEqualDeep, oj as rootRouteId, ok as SafeFragment, ol as matchContext, om as CatchBoundary, on as ErrorComponent, oo as warning, op as Match$1, oq as routerContext, or as useHydrated, os as deepEqual, ot as escapeHtml, nB as loadI18nMessages, nL as useQueryClient, nG as keepPreviousData, ou as QueryClientProvider, ov as UserSettingsProvider, ow as ThemeProvider, ox as AuthProvider, oy as ServerConfigProvider, oz as ChannelProvider, oA as AlertsProvider, l9 as CustomProviders, oB as createRootRouteWithContext, nO as Outlet, oC as createFileRoute, df as objectType, oD as redirect, du as stringType, mY as useAuth, nR as useRouterState, oE as Navigate, gz as LoginForm, hu as LoginBranding, eK as useNavigate, go as AppLayout, oF as endOfDay, oG as startOfMonth, bD as useUserSettings, nf as usePermissions, kB as getDashboardWidgetRegistry, eP as Page, eQ as PageTitle, eR as PageActionBar, mh as ActionBarItem, gm as DateRangePicker, dR as Button, eT as PageLayout, ms as FullWidthPageBlock, kE as WidgetFiltersProvider, j3 as GridLayout, kC as getDashboardWidget, ne as usePaginatedList, nJ as useMutation, mI as api, eN as toast, kZ as getMutationName, fE as DataTableBulkActionItem, oH as Trash, mQ as graphql, nK as useQuery, gj as useGeneratedColumns, fY as DataTable, h0 as CountrySelector, jx as Sheet, jE as SheetTrigger, jz as SheetContent, jC as SheetHeader, jD as SheetTitle, jA as SheetDescription, jq as ScrollArea, mA as ListPage, dS as Plus, nN as Link, h7 as DetailPageButton, e$ as BooleanDisplayBadge, dT as Badge, mV as setSettingsStoreValueDocument, oI as createColumnHelper, g$ as CopyableText, jZ as Switch$1, iI as Dialog, iQ as DialogTrigger, iK as DialogContent, iN as DialogHeader, iH as DialogTitle, iL as DialogDescription, f1 as JsonViewer, iM as DialogFooter, dQ as Input, na as useLocalFormat, bR as DropdownMenu, bS as DropdownMenuTrigger, bT as Ellipsis, bV as DropdownMenuContent, bW as DropdownMenuItem, oJ as Clock, oK as Check, oL as RefreshCw, oM as ChevronDown, oN as EllipsisVertical, gN as AssignToChannelBulkAction, mZ as useChannel, hw as RemoveFromChannelBulkAction, mM as configurableOperationFragment, nz as useForm, nt as LS_KEY_SHIPPING_TEST_ADDRESS, hV as AccordionItem, hW as AccordionTrigger, hU as AccordionContent, j2 as Form, eW as FormFieldWrapper, bF as Select, bG as SelectTrigger, bI as SelectValue, bJ as SelectContent, bK as SelectItem, nu as LS_KEY_SHIPPING_TEST_ORDER, oO as useReactTable, oP as getCoreRowModel, j_ as Table, k4 as TableHeader, k5 as TableRow, k3 as TableHead, oQ as flexRender, j$ as TableBody, k1 as TableCell, hv as ProductVariantSelector, hN as VendureImage, bZ as Trash2, f3 as Money, io as Card, it as CardHeader, iu as CardTitle, iq as CardContent, i7 as Alert, i8 as AlertDescription, hT as Accordion, hK as RichTextDescriptionCell, nw as SUPER_ADMIN_ROLE_CODE, no as CUSTOMER_ROLE_CODE, oR as Layers, gT as ChannelCodeLabel, hD as RoleCodeLabel, oS as getInitialConfigArgValue, gW as ConfigurableOperationInput, mK as getEntityDuplicatorsDocument, mJ as duplicateEntityDocument, oT as Copy, h9 as ErrorPage, kM as extendDetailFormQuery, kT as addCustomFields, mD as getDetailQueryOptions, eM as useDetailPage, eU as PageBlock, eV as DetailFormGrid, eY as CustomFieldsPageBlock, mL as assetFragment, hb as FacetValueSelector, ha as FacetValueChip, gP as usePriceFactor, fJ as FacetValueFacetedFilter, hG as StockLevelLabel, mP as errorResultFragment, mO as configurableOperationDefFragment, bC as useServerConfig, hH as CustomerCell, hI as OrderStateCell, hJ as OrderMoneyCell, eJ as NEW_ENTITY_PATH, hl as LanguageSelector, mS as schemaLanguageCodes, ff as NumberInput, hr as PaginatedListDataTable, hq as PaginatedListDataTableKey, h6 as CustomerSelector, nH as queryOptions, oU as useDebounce, oV as useQueries, bX as Folder, oW as Search, oX as ChevronRight, oY as getExpandedRowModel, fS as getItemParentId, fV as calculateDragTargetPosition, fU as isCircularReference, fW as calculateSiblingIndex, oZ as deleteAssetsDocument, cW as enumType, cP as coerce, gH as AssetGallery, mz as detailPageRouteLoader, hL as TaxCategorySelector, hS as ZoneSelector, kb as Textarea, gZ as ConfigurableOperationSelector, eX as TranslatableFormFieldWrapper, fu as RichTextInput, n8 as useGroupedPermissions, ki as TooltipProvider, kg as Tooltip, kj as TooltipTrigger, o_ as Info, kh as TooltipContent, gU as ChannelSelector, gY as ConfigurableOperationMultiSelector, fb as DateTimeInput, dU as X, cM as arrayType, dP as useFieldArray, nW as a, k6 as Tabs, k8 as TabsList, k9 as TabsTrigger, o$ as Link$1, k7 as TabsContent, iy as Command, iC as CommandInput, iE as CommandList, iA as CommandEmpty, iD as CommandItem, cO as booleanType, cl as ZodIssueCode, dq as recordType, nA as useWatch, C as Checkbox, nx as Controller, iU as Field, iX as FieldError, fe as MoneyInput, g_ as ConfirmationDialog, nd as usePage, fw as SlugInput, gR as AssignedFacetValues, gQ as AssignedChannels, h8 as EntityAssets, dX as Separator, h2 as CustomFieldsForm, iZ as FieldLabel, n2 as useDynamicTranslations, p0 as getTypeForState, bH as cn, nq as DEFAULT_CHANNEL_CODE, ft as createRelationSelectorConfig, fs as RelationSelector, j9 as Label, p1 as CircleAlert, m_ as useCustomFieldConfig, gn as LabeledData, iv as Collapsible, iw as CollapsibleTrigger, ix as CollapsibleContent, p2 as Globe, mg as HistoryEntry, p3 as SquarePen, hj as useHistoryNoteEditor, hh as HistoryTimelineWithGrouping, hg as HistoryNoteInput, he as HistoryNoteEditor, hf as HistoryNoteEntry, nI as useInfiniteQuery, jW as Skeleton, kV as getFieldsFromDocumentNode, fP as getColumnVisibility, p4 as Pencil, hs as PermissionGuard, p5 as stateTypeToBadgeVariant, p6 as ChevronLeft, h3 as CustomerAddressForm$1, p7 as Users, h4 as CustomerGroupChip, h5 as CustomerGroupSelector, p8 as Eye, i9 as AlertTitle, n9 as useJobQueuePolling, hF as SellerSelector, h1 as CurrencySelector, p9 as updateTagDocument, pa as deleteTagDocument, pb as tagListDocument, pc as createTagDocument, ji as Popover, jn as PopoverTrigger, pd as ChevronsUpDown, jj as PopoverContent, iB as CommandGroup, pe as Settings2, pf as assetDetailDocument, pg as assetUpdateDocument, gF as AssetFocalPointEditor, gM as AssetProperties, gK as AssetPreviewSelector, ph as Focus, hE as RoleSelector, hn as MultiSelect, pi as useRedirectToListOnNotFound, hY as AlertDialog, h$ as AlertDialogContent, i2 as AlertDialogHeader, hX as AlertDialogTitle, i0 as AlertDialogDescription, i1 as AlertDialogFooter, h_ as AlertDialogCancel, hZ as AlertDialogAction, fl as SingleRelationInput, lH as useGeneratedForm, de as numberType, f4 as AffixedInput, iJ as DialogClose, pj as createRouter, lu as useDashboardExtensions, kL as registerDefaults, lb as executeDashboardExtensionCallbacks, jX as Toaster, jY as Spinner, mE as useExtendedRouter, n0 as useDisplayLocale, nk as useUiLanguageLoader, kP as setCustomFieldsMap, iR as DirectionProvider, kQ as clearCustomFieldsMap } from "./use-job-queue-polling-BESJ2s1g.js";
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { c as createLucideIcon, nt as loadI18nMessages, nD as UserSettingsProvider, nE as ThemeProvider, nF as AuthProvider, nG as ServerConfigProvider, nH as ChannelProvider, nI as AlertsProvider, l5 as CustomProviders, df as objectType, du as stringType, mU as useAuth, gv as LoginForm, hq as LoginBranding, gk as AppLayout, nJ as endOfDay, nK as startOfMonth, bD as useUserSettings, nb as usePermissions, kx as getDashboardWidgetRegistry, eL as Page, eM as PageTitle, eN as PageActionBar, md as ActionBarItem, gi as DateRangePicker, dP as Button, eP as PageLayout, mo as FullWidthPageBlock, kA as WidgetFiltersProvider, i$ as GridLayout, ky as getDashboardWidget, na as usePaginatedList, mE as api, kV as getMutationName, fA as DataTableBulkActionItem, nL as Trash, mM as graphql, gf as useGeneratedColumns, fU as DataTable, gY as CountrySelector, jt as Sheet, jA as SheetTrigger, jv as SheetContent, jy as SheetHeader, jz as SheetTitle, jw as SheetDescription, jm as ScrollArea, mw as ListPage, dQ as Plus, h3 as DetailPageButton, eX as BooleanDisplayBadge, dR as Badge, mR as setSettingsStoreValueDocument, nM as createColumnHelper, gX as CopyableText, jV as Switch$1, iE as Dialog, iM as DialogTrigger, iG as DialogContent, iJ as DialogHeader, iD as DialogTitle, iH as DialogDescription, eZ as JsonViewer, iI as DialogFooter, dO as Input, n6 as useLocalFormat, bR as DropdownMenu, bS as DropdownMenuTrigger, bT as Ellipsis, bV as DropdownMenuContent, bW as DropdownMenuItem, nN as Clock, nO as Check, nP as RefreshCw, nQ as ChevronDown, nR as EllipsisVertical, gJ as AssignToChannelBulkAction, mV as useChannel, hs as RemoveFromChannelBulkAction, mI as configurableOperationFragment, np as LS_KEY_SHIPPING_TEST_ADDRESS, hR as AccordionItem, hS as AccordionTrigger, hQ as AccordionContent, i_ as Form, eS as FormFieldWrapper, bF as Select, bG as SelectTrigger, bI as SelectValue, bJ as SelectContent, bK as SelectItem, nq as LS_KEY_SHIPPING_TEST_ORDER, nS as useReactTable, nT as getCoreRowModel, jW as Table, k0 as TableHeader, k1 as TableRow, j$ as TableHead, nU as flexRender, jX as TableBody, jZ as TableCell, hr as ProductVariantSelector, hJ as VendureImage, bZ as Trash2, e$ as Money, ij as Card, ip as CardHeader, iq as CardTitle, il as CardContent, i3 as Alert, i4 as AlertDescription, hP as Accordion, hG as RichTextDescriptionCell, ns as SUPER_ADMIN_ROLE_CODE, nk as CUSTOMER_ROLE_CODE, nV as Layers, gP as ChannelCodeLabel, hz as RoleCodeLabel, mG as getEntityDuplicatorsDocument, nW as getInitialConfigArgValue, gS as ConfigurableOperationInput, mF as duplicateEntityDocument, nX as Copy, h5 as ErrorPage, kI as extendDetailFormQuery, kP as addCustomFields, mz as getDetailQueryOptions, eJ as useDetailPage, eQ as PageBlock, eR as DetailFormGrid, eU as CustomFieldsPageBlock, mH as assetFragment, h7 as FacetValueSelector, h6 as FacetValueChip, gL as usePriceFactor, fF as FacetValueFacetedFilter, hC as StockLevelLabel, mL as errorResultFragment, mK as configurableOperationDefFragment, bC as useServerConfig, hD as CustomerCell, hE as OrderStateCell, hF as OrderMoneyCell, eH as NEW_ENTITY_PATH, hh as LanguageSelector, mO as schemaLanguageCodes, fb as NumberInput, hn as PaginatedListDataTable, hm as PaginatedListDataTableKey, h2 as CustomerSelector, nY as useDebounce, bX as Folder, nZ as Search, n_ as ChevronRight, n$ as getExpandedRowModel, fO as getItemParentId, fR as calculateDragTargetPosition, fQ as isCircularReference, fS as calculateSiblingIndex, o0 as deleteAssetsDocument, cW as enumType, cP as coerce, gD as AssetGallery, mv as detailPageRouteLoader, hH as TaxCategorySelector, hO as ZoneSelector, k7 as Textarea, gV as ConfigurableOperationSelector, eT as TranslatableFormFieldWrapper, fq as RichTextInput, n4 as useGroupedPermissions, ke as TooltipProvider, kc as Tooltip, kf as TooltipTrigger, o1 as Info, kd as TooltipContent, gQ as ChannelSelector, gU as ConfigurableOperationMultiSelector, f7 as DateTimeInput, dS as X, cM as arrayType, nC as a, k2 as Tabs, k4 as TabsList, k5 as TabsTrigger, o2 as Link$1, k3 as TabsContent, iu as Command, iy as CommandInput, iA as CommandList, iw as CommandEmpty, iz as CommandItem, cO as booleanType, cl as ZodIssueCode, dq as recordType, C as Checkbox, iQ as Field, iT as FieldError, fa as MoneyInput, gW as ConfirmationDialog, hU as AlertDialog, hX as AlertDialogContent, h_ as AlertDialogHeader, hT as AlertDialogTitle, hY as AlertDialogDescription, hZ as AlertDialogFooter, hW as AlertDialogCancel, hV as AlertDialogAction, ho as PermissionGuard, n9 as usePage, fs as SlugInput, gN as AssignedFacetValues, gM as AssignedChannels, h4 as EntityAssets, dV as Separator, g_ as CustomFieldsForm, iV as FieldLabel, m_ as useDynamicTranslations, o3 as getTypeForState, bH as cn, nm as DEFAULT_CHANNEL_CODE, fp as createRelationSelectorConfig, fo as RelationSelector, j5 as Label, o4 as CircleAlert, mW as useCustomFieldConfig, gj as LabeledData, ir as Collapsible, is as CollapsibleTrigger, it as CollapsibleContent, o5 as Globe, mc as HistoryEntry, o6 as SquarePen, hf as useHistoryNoteEditor, hd as HistoryTimelineWithGrouping, hc as HistoryNoteInput, ha as HistoryNoteEditor, hb as HistoryNoteEntry, jS as Skeleton, kR as getFieldsFromDocumentNode, fL as getColumnVisibility, o7 as Pencil, o8 as stateTypeToBadgeVariant, o9 as ChevronLeft, g$ as CustomerAddressForm$1, oa as Users, h0 as CustomerGroupChip, h1 as CustomerGroupSelector, ob as Eye, i5 as AlertTitle, n5 as useJobQueuePolling, hB as SellerSelector, gZ as CurrencySelector, oc as tagListDocument, od as updateTagDocument, oe as deleteTagDocument, of as createTagDocument, je as Popover, jj as PopoverTrigger, og as ChevronsUpDown, jf as PopoverContent, ix as CommandGroup, oh as Settings2, oi as assetDetailDocument, oj as assetUpdateDocument, gB as AssetFocalPointEditor, gI as AssetProperties, gG as AssetPreviewSelector, ok as Focus, hA as RoleSelector, hj as MultiSelect, ol as useRedirectToListOnNotFound, fh as SingleRelationInput, lD as useGeneratedForm, de as numberType, f0 as AffixedInput, iF as DialogClose, jU as Spinner, lq as useDashboardExtensions, kH as registerDefaults, l7 as executeDashboardExtensionCallbacks, jT as Toaster, mA as useExtendedRouter, mY as useDisplayLocale, ng as useUiLanguageLoader, kL as setCustomFieldsMap, iN as DirectionProvider, kM as clearCustomFieldsMap } from "./use-job-queue-polling-mUjHlukj.js";
3
+ import { toast } from "sonner";
3
4
  import { i18n } from "@lingui/core";
4
5
  import { I18nProvider as I18nProvider$1, useLingui, Trans } from "@lingui/react";
6
+ import { useMatches, createRootRouteWithContext, HeadContent, Outlet, createFileRoute, redirect, useRouterState, Navigate, useNavigate, Link, useLocation, createRouter, RouterProvider } from "@tanstack/react-router";
5
7
  import * as React from "react";
6
- import React__default, { useRef, createElement as createElement$1, useState, useEffect, isValidElement, useMemo, useCallback, Fragment as Fragment$1, forwardRef, useImperativeHandle } from "react";
8
+ import React__default, { useState, useEffect, isValidElement, useRef, useMemo, useCallback, Fragment as Fragment$1, forwardRef, useImperativeHandle } from "react";
7
9
  import { createPortal } from "react-dom";
8
10
  import { createRoot as createRoot$1 } from "react-dom/client";
11
+ import { useQueryClient, onlineManager, QueryClient, keepPreviousData, QueryClientProvider, useMutation, useQuery, queryOptions, useQueries, useInfiniteQuery } from "@tanstack/react-query";
12
+ import { useForm, useFieldArray, useWatch, Controller } from "react-hook-form";
9
13
  import { uiConfig } from "virtual:vendure-ui-config";
10
- const __iconNode$A = [
14
+ const __iconNode$B = [
11
15
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
12
16
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
13
17
  ];
14
- const ArrowLeft = createLucideIcon("ArrowLeft", __iconNode$A);
15
- const __iconNode$z = [
18
+ const ArrowLeft = createLucideIcon("ArrowLeft", __iconNode$B);
19
+ const __iconNode$A = [
16
20
  ["path", { d: "M17 12H3", key: "8awo09" }],
17
21
  ["path", { d: "m11 18 6-6-6-6", key: "8c2y43" }],
18
22
  ["path", { d: "M21 5v14", key: "nzette" }]
19
23
  ];
20
- const ArrowRightToLine = createLucideIcon("ArrowRightToLine", __iconNode$z);
21
- const __iconNode$y = [
24
+ const ArrowRightToLine = createLucideIcon("ArrowRightToLine", __iconNode$A);
25
+ const __iconNode$z = [
22
26
  ["path", { d: "M5 12h14", key: "1ays0h" }],
23
27
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
24
28
  ];
25
- const ArrowRight = createLucideIcon("ArrowRight", __iconNode$y);
26
- const __iconNode$x = [
29
+ const ArrowRight = createLucideIcon("ArrowRight", __iconNode$z);
30
+ const __iconNode$y = [
27
31
  [
28
32
  "path",
29
33
  {
@@ -33,8 +37,8 @@ const __iconNode$x = [
33
37
  ],
34
38
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
35
39
  ];
36
- const BadgeCheck = createLucideIcon("BadgeCheck", __iconNode$x);
37
- const __iconNode$w = [
40
+ const BadgeCheck = createLucideIcon("BadgeCheck", __iconNode$y);
41
+ const __iconNode$x = [
38
42
  [
39
43
  "path",
40
44
  {
@@ -45,13 +49,13 @@ const __iconNode$w = [
45
49
  ["line", { x1: "15", x2: "9", y1: "9", y2: "15", key: "f7djnv" }],
46
50
  ["line", { x1: "9", x2: "15", y1: "9", y2: "15", key: "1shsy8" }]
47
51
  ];
48
- const BadgeX = createLucideIcon("BadgeX", __iconNode$w);
49
- const __iconNode$v = [
52
+ const BadgeX = createLucideIcon("BadgeX", __iconNode$x);
53
+ const __iconNode$w = [
50
54
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
51
55
  ["path", { d: "m4.9 4.9 14.2 14.2", key: "1m5liu" }]
52
56
  ];
53
- const Ban = createLucideIcon("Ban", __iconNode$v);
54
- const __iconNode$u = [
57
+ const Ban = createLucideIcon("Ban", __iconNode$w);
58
+ const __iconNode$v = [
55
59
  [
56
60
  "path",
57
61
  { d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1", key: "ezmyqa" }
@@ -64,18 +68,18 @@ const __iconNode$u = [
64
68
  }
65
69
  ]
66
70
  ];
67
- const Braces = createLucideIcon("Braces", __iconNode$u);
68
- const __iconNode$t = [
71
+ const Braces = createLucideIcon("Braces", __iconNode$v);
72
+ const __iconNode$u = [
69
73
  ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
70
74
  ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
71
75
  ];
72
- const CircleCheckBig = createLucideIcon("CircleCheckBig", __iconNode$t);
73
- const __iconNode$s = [
76
+ const CircleCheckBig = createLucideIcon("CircleCheckBig", __iconNode$u);
77
+ const __iconNode$t = [
74
78
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
75
79
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
76
80
  ];
77
- const CircleCheck = createLucideIcon("CircleCheck", __iconNode$s);
78
- const __iconNode$r = [
81
+ const CircleCheck = createLucideIcon("CircleCheck", __iconNode$t);
82
+ const __iconNode$s = [
79
83
  ["path", { d: "M10.1 2.182a10 10 0 0 1 3.8 0", key: "5ilxe3" }],
80
84
  ["path", { d: "M13.9 21.818a10 10 0 0 1-3.8 0", key: "11zvb9" }],
81
85
  ["path", { d: "M17.609 3.721a10 10 0 0 1 2.69 2.7", key: "1iw5b2" }],
@@ -85,30 +89,30 @@ const __iconNode$r = [
85
89
  ["path", { d: "M3.721 6.391a10 10 0 0 1 2.7-2.69", key: "1mcia2" }],
86
90
  ["path", { d: "M6.391 20.279a10 10 0 0 1-2.69-2.7", key: "1fvljs" }]
87
91
  ];
88
- const CircleDashed = createLucideIcon("CircleDashed", __iconNode$r);
89
- const __iconNode$q = [
92
+ const CircleDashed = createLucideIcon("CircleDashed", __iconNode$s);
93
+ const __iconNode$r = [
90
94
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
91
95
  ["polygon", { points: "10 8 16 12 10 16 10 8", key: "1cimsy" }]
92
96
  ];
93
- const CirclePlay = createLucideIcon("CirclePlay", __iconNode$q);
94
- const __iconNode$p = [
97
+ const CirclePlay = createLucideIcon("CirclePlay", __iconNode$r);
98
+ const __iconNode$q = [
95
99
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
96
100
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
97
101
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
98
102
  ];
99
- const CircleX = createLucideIcon("CircleX", __iconNode$p);
100
- const __iconNode$o = [
103
+ const CircleX = createLucideIcon("CircleX", __iconNode$q);
104
+ const __iconNode$p = [
101
105
  ["rect", { width: "20", height: "14", x: "2", y: "5", rx: "2", key: "ynyp8z" }],
102
106
  ["line", { x1: "2", x2: "22", y1: "10", y2: "10", key: "1b3vmo" }]
103
107
  ];
104
- const CreditCard = createLucideIcon("CreditCard", __iconNode$o);
105
- const __iconNode$n = [
108
+ const CreditCard = createLucideIcon("CreditCard", __iconNode$p);
109
+ const __iconNode$o = [
106
110
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
107
111
  ["polyline", { points: "7 10 12 15 17 10", key: "2ggqvy" }],
108
112
  ["line", { x1: "12", x2: "12", y1: "15", y2: "3", key: "1vk2je" }]
109
113
  ];
110
- const Download = createLucideIcon("Download", __iconNode$n);
111
- const __iconNode$m = [
114
+ const Download = createLucideIcon("Download", __iconNode$o);
115
+ const __iconNode$n = [
112
116
  [
113
117
  "path",
114
118
  {
@@ -119,8 +123,8 @@ const __iconNode$m = [
119
123
  ["path", { d: "M6.453 15h11.094", key: "3shlmq" }],
120
124
  ["path", { d: "M8.5 2h7", key: "csnxdl" }]
121
125
  ];
122
- const FlaskConical = createLucideIcon("FlaskConical", __iconNode$m);
123
- const __iconNode$l = [
126
+ const FlaskConical = createLucideIcon("FlaskConical", __iconNode$n);
127
+ const __iconNode$m = [
124
128
  [
125
129
  "path",
126
130
  {
@@ -129,8 +133,8 @@ const __iconNode$l = [
129
133
  }
130
134
  ]
131
135
  ];
132
- const FolderOpen = createLucideIcon("FolderOpen", __iconNode$l);
133
- const __iconNode$k = [
136
+ const FolderOpen = createLucideIcon("FolderOpen", __iconNode$m);
137
+ const __iconNode$l = [
134
138
  [
135
139
  "path",
136
140
  {
@@ -148,14 +152,14 @@ const __iconNode$k = [
148
152
  ["path", { d: "M3 5a2 2 0 0 0 2 2h3", key: "f2jnh7" }],
149
153
  ["path", { d: "M3 3v13a2 2 0 0 0 2 2h3", key: "k8epm1" }]
150
154
  ];
151
- const FolderTree = createLucideIcon("FolderTree", __iconNode$k);
152
- const __iconNode$j = [
155
+ const FolderTree = createLucideIcon("FolderTree", __iconNode$l);
156
+ const __iconNode$k = [
153
157
  ["path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4", key: "g0fldk" }],
154
158
  ["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
155
159
  ["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
156
160
  ];
157
- const Key = createLucideIcon("Key", __iconNode$j);
158
- const __iconNode$i = [
161
+ const Key = createLucideIcon("Key", __iconNode$k);
162
+ const __iconNode$j = [
159
163
  ["path", { d: "M21 6H3", key: "1jwq7v" }],
160
164
  ["path", { d: "M7 12H3", key: "13ou7f" }],
161
165
  ["path", { d: "M7 18H3", key: "1sijw9" }],
@@ -168,8 +172,8 @@ const __iconNode$i = [
168
172
  ],
169
173
  ["path", { d: "M11 10v4h4", key: "172dkj" }]
170
174
  ];
171
- const ListRestart = createLucideIcon("ListRestart", __iconNode$i);
172
- const __iconNode$h = [
175
+ const ListRestart = createLucideIcon("ListRestart", __iconNode$j);
176
+ const __iconNode$i = [
173
177
  ["path", { d: "M12 2v4", key: "3427ic" }],
174
178
  ["path", { d: "m16.2 7.8 2.9-2.9", key: "r700ao" }],
175
179
  ["path", { d: "M18 12h4", key: "wj9ykh" }],
@@ -179,13 +183,13 @@ const __iconNode$h = [
179
183
  ["path", { d: "M2 12h4", key: "j09sii" }],
180
184
  ["path", { d: "m4.9 4.9 2.9 2.9", key: "giyufr" }]
181
185
  ];
182
- const Loader = createLucideIcon("Loader", __iconNode$h);
183
- const __iconNode$g = [
186
+ const Loader = createLucideIcon("Loader", __iconNode$i);
187
+ const __iconNode$h = [
184
188
  ["rect", { width: "20", height: "16", x: "2", y: "4", rx: "2", key: "18n3k1" }],
185
189
  ["path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7", key: "1ocrg3" }]
186
190
  ];
187
- const Mail = createLucideIcon("Mail", __iconNode$g);
188
- const __iconNode$f = [
191
+ const Mail = createLucideIcon("Mail", __iconNode$h);
192
+ const __iconNode$g = [
189
193
  [
190
194
  "path",
191
195
  {
@@ -195,8 +199,8 @@ const __iconNode$f = [
195
199
  ],
196
200
  ["circle", { cx: "12", cy: "10", r: "3", key: "ilqhr7" }]
197
201
  ];
198
- const MapPin = createLucideIcon("MapPin", __iconNode$f);
199
- const __iconNode$e = [
202
+ const MapPin = createLucideIcon("MapPin", __iconNode$g);
203
+ const __iconNode$f = [
200
204
  [
201
205
  "path",
202
206
  {
@@ -208,14 +212,14 @@ const __iconNode$e = [
208
212
  ["polyline", { points: "3.29 7 12 12 20.71 7", key: "ousv84" }],
209
213
  ["path", { d: "m7.5 4.27 9 5.15", key: "1c824w" }]
210
214
  ];
211
- const Package = createLucideIcon("Package", __iconNode$e);
212
- const __iconNode$d = [
215
+ const Package = createLucideIcon("Package", __iconNode$f);
216
+ const __iconNode$e = [
213
217
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
214
218
  ["path", { d: "M9 3v18", key: "fh3hqa" }],
215
219
  ["path", { d: "m14 9 3 3-3 3", key: "8010ee" }]
216
220
  ];
217
- const PanelLeftOpen = createLucideIcon("PanelLeftOpen", __iconNode$d);
218
- const __iconNode$c = [
221
+ const PanelLeftOpen = createLucideIcon("PanelLeftOpen", __iconNode$e);
222
+ const __iconNode$d = [
219
223
  ["path", { d: "M12 20h9", key: "t2du7b" }],
220
224
  [
221
225
  "path",
@@ -225,8 +229,8 @@ const __iconNode$c = [
225
229
  }
226
230
  ]
227
231
  ];
228
- const PenLine = createLucideIcon("PenLine", __iconNode$c);
229
- const __iconNode$b = [
232
+ const PenLine = createLucideIcon("PenLine", __iconNode$d);
233
+ const __iconNode$c = [
230
234
  [
231
235
  "path",
232
236
  {
@@ -235,8 +239,8 @@ const __iconNode$b = [
235
239
  }
236
240
  ]
237
241
  ];
238
- const Pen = createLucideIcon("Pen", __iconNode$b);
239
- const __iconNode$a = [
242
+ const Pen = createLucideIcon("Pen", __iconNode$c);
243
+ const __iconNode$b = [
240
244
  [
241
245
  "path",
242
246
  {
@@ -245,15 +249,15 @@ const __iconNode$a = [
245
249
  }
246
250
  ]
247
251
  ];
248
- const Phone = createLucideIcon("Phone", __iconNode$a);
249
- const __iconNode$9 = [["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]];
250
- const Play = createLucideIcon("Play", __iconNode$9);
251
- const __iconNode$8 = [
252
+ const Phone = createLucideIcon("Phone", __iconNode$b);
253
+ const __iconNode$a = [["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]];
254
+ const Play = createLucideIcon("Play", __iconNode$a);
255
+ const __iconNode$9 = [
252
256
  ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
253
257
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
254
258
  ];
255
- const RotateCcw = createLucideIcon("RotateCcw", __iconNode$8);
256
- const __iconNode$7 = [
259
+ const RotateCcw = createLucideIcon("RotateCcw", __iconNode$9);
260
+ const __iconNode$8 = [
257
261
  [
258
262
  "path",
259
263
  {
@@ -264,8 +268,8 @@ const __iconNode$7 = [
264
268
  ["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
265
269
  ["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
266
270
  ];
267
- const Save = createLucideIcon("Save", __iconNode$7);
268
- const __iconNode$6 = [
271
+ const Save = createLucideIcon("Save", __iconNode$8);
272
+ const __iconNode$7 = [
269
273
  [
270
274
  "path",
271
275
  {
@@ -275,8 +279,8 @@ const __iconNode$6 = [
275
279
  ],
276
280
  ["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }]
277
281
  ];
278
- const Tag = createLucideIcon("Tag", __iconNode$6);
279
- const __iconNode$5 = [
282
+ const Tag = createLucideIcon("Tag", __iconNode$7);
283
+ const __iconNode$6 = [
280
284
  [
281
285
  "path",
282
286
  {
@@ -287,8 +291,8 @@ const __iconNode$5 = [
287
291
  ["path", { d: "M12 9v4", key: "juzpu7" }],
288
292
  ["path", { d: "M12 17h.01", key: "p32p05" }]
289
293
  ];
290
- const TriangleAlert = createLucideIcon("TriangleAlert", __iconNode$5);
291
- const __iconNode$4 = [
294
+ const TriangleAlert = createLucideIcon("TriangleAlert", __iconNode$6);
295
+ const __iconNode$5 = [
292
296
  ["path", { d: "M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2", key: "wrbu53" }],
293
297
  ["path", { d: "M15 18H9", key: "1lyqi6" }],
294
298
  [
@@ -301,13 +305,19 @@ const __iconNode$4 = [
301
305
  ["circle", { cx: "17", cy: "18", r: "2", key: "332jqn" }],
302
306
  ["circle", { cx: "7", cy: "18", r: "2", key: "19iecd" }]
303
307
  ];
304
- const Truck = createLucideIcon("Truck", __iconNode$4);
305
- const __iconNode$3 = [
308
+ const Truck = createLucideIcon("Truck", __iconNode$5);
309
+ const __iconNode$4 = [
306
310
  ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
307
311
  ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
308
312
  ["polyline", { points: "16 11 18 13 22 9", key: "1pwet4" }]
309
313
  ];
310
- const UserCheck = createLucideIcon("UserCheck", __iconNode$3);
314
+ const UserCheck = createLucideIcon("UserCheck", __iconNode$4);
315
+ const __iconNode$3 = [
316
+ ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
317
+ ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
318
+ ["line", { x1: "22", x2: "16", y1: "11", y2: "11", key: "1shjgl" }]
319
+ ];
320
+ const UserMinus = createLucideIcon("UserMinus", __iconNode$3);
311
321
  const __iconNode$2 = [
312
322
  ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
313
323
  ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
@@ -326,896 +336,6 @@ const __iconNode = [
326
336
  ["rect", { width: "8", height: "8", x: "13", y: "13", rx: "2", key: "1cgmvn" }]
327
337
  ];
328
338
  const Workflow = createLucideIcon("Workflow", __iconNode);
329
- var MutationCache = class extends Subscribable {
330
- constructor(config = {}) {
331
- super();
332
- this.config = config;
333
- this.#mutations = /* @__PURE__ */ new Set();
334
- this.#scopes = /* @__PURE__ */ new Map();
335
- this.#mutationId = 0;
336
- }
337
- #mutations;
338
- #scopes;
339
- #mutationId;
340
- build(client, options, state) {
341
- const mutation = new Mutation({
342
- client,
343
- mutationCache: this,
344
- mutationId: ++this.#mutationId,
345
- options: client.defaultMutationOptions(options),
346
- state
347
- });
348
- this.add(mutation);
349
- return mutation;
350
- }
351
- add(mutation) {
352
- this.#mutations.add(mutation);
353
- const scope = scopeFor(mutation);
354
- if (typeof scope === "string") {
355
- const scopedMutations = this.#scopes.get(scope);
356
- if (scopedMutations) {
357
- scopedMutations.push(mutation);
358
- } else {
359
- this.#scopes.set(scope, [mutation]);
360
- }
361
- }
362
- this.notify({ type: "added", mutation });
363
- }
364
- remove(mutation) {
365
- if (this.#mutations.delete(mutation)) {
366
- const scope = scopeFor(mutation);
367
- if (typeof scope === "string") {
368
- const scopedMutations = this.#scopes.get(scope);
369
- if (scopedMutations) {
370
- if (scopedMutations.length > 1) {
371
- const index = scopedMutations.indexOf(mutation);
372
- if (index !== -1) {
373
- scopedMutations.splice(index, 1);
374
- }
375
- } else if (scopedMutations[0] === mutation) {
376
- this.#scopes.delete(scope);
377
- }
378
- }
379
- }
380
- }
381
- this.notify({ type: "removed", mutation });
382
- }
383
- canRun(mutation) {
384
- const scope = scopeFor(mutation);
385
- if (typeof scope === "string") {
386
- const mutationsWithSameScope = this.#scopes.get(scope);
387
- const firstPendingMutation = mutationsWithSameScope?.find(
388
- (m) => m.state.status === "pending"
389
- );
390
- return !firstPendingMutation || firstPendingMutation === mutation;
391
- } else {
392
- return true;
393
- }
394
- }
395
- runNext(mutation) {
396
- const scope = scopeFor(mutation);
397
- if (typeof scope === "string") {
398
- const foundMutation = this.#scopes.get(scope)?.find((m) => m !== mutation && m.state.isPaused);
399
- return foundMutation?.continue() ?? Promise.resolve();
400
- } else {
401
- return Promise.resolve();
402
- }
403
- }
404
- clear() {
405
- notifyManager.batch(() => {
406
- this.#mutations.forEach((mutation) => {
407
- this.notify({ type: "removed", mutation });
408
- });
409
- this.#mutations.clear();
410
- this.#scopes.clear();
411
- });
412
- }
413
- getAll() {
414
- return Array.from(this.#mutations);
415
- }
416
- find(filters) {
417
- const defaultedFilters = { exact: true, ...filters };
418
- return this.getAll().find(
419
- (mutation) => matchMutation(defaultedFilters, mutation)
420
- );
421
- }
422
- findAll(filters = {}) {
423
- return this.getAll().filter((mutation) => matchMutation(filters, mutation));
424
- }
425
- notify(event) {
426
- notifyManager.batch(() => {
427
- this.listeners.forEach((listener) => {
428
- listener(event);
429
- });
430
- });
431
- }
432
- resumePausedMutations() {
433
- const pausedMutations = this.getAll().filter((x) => x.state.isPaused);
434
- return notifyManager.batch(
435
- () => Promise.all(
436
- pausedMutations.map((mutation) => mutation.continue().catch(noop))
437
- )
438
- );
439
- }
440
- };
441
- function scopeFor(mutation) {
442
- return mutation.options.scope?.id;
443
- }
444
- var QueryCache = class extends Subscribable {
445
- constructor(config = {}) {
446
- super();
447
- this.config = config;
448
- this.#queries = /* @__PURE__ */ new Map();
449
- }
450
- #queries;
451
- build(client, options, state) {
452
- const queryKey = options.queryKey;
453
- const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);
454
- let query = this.get(queryHash);
455
- if (!query) {
456
- query = new Query({
457
- client,
458
- queryKey,
459
- queryHash,
460
- options: client.defaultQueryOptions(options),
461
- state,
462
- defaultOptions: client.getQueryDefaults(queryKey)
463
- });
464
- this.add(query);
465
- }
466
- return query;
467
- }
468
- add(query) {
469
- if (!this.#queries.has(query.queryHash)) {
470
- this.#queries.set(query.queryHash, query);
471
- this.notify({
472
- type: "added",
473
- query
474
- });
475
- }
476
- }
477
- remove(query) {
478
- const queryInMap = this.#queries.get(query.queryHash);
479
- if (queryInMap) {
480
- query.destroy();
481
- if (queryInMap === query) {
482
- this.#queries.delete(query.queryHash);
483
- }
484
- this.notify({ type: "removed", query });
485
- }
486
- }
487
- clear() {
488
- notifyManager.batch(() => {
489
- this.getAll().forEach((query) => {
490
- this.remove(query);
491
- });
492
- });
493
- }
494
- get(queryHash) {
495
- return this.#queries.get(queryHash);
496
- }
497
- getAll() {
498
- return [...this.#queries.values()];
499
- }
500
- find(filters) {
501
- const defaultedFilters = { exact: true, ...filters };
502
- return this.getAll().find(
503
- (query) => matchQuery(defaultedFilters, query)
504
- );
505
- }
506
- findAll(filters = {}) {
507
- const queries = this.getAll();
508
- return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;
509
- }
510
- notify(event) {
511
- notifyManager.batch(() => {
512
- this.listeners.forEach((listener) => {
513
- listener(event);
514
- });
515
- });
516
- }
517
- onFocus() {
518
- notifyManager.batch(() => {
519
- this.getAll().forEach((query) => {
520
- query.onFocus();
521
- });
522
- });
523
- }
524
- onOnline() {
525
- notifyManager.batch(() => {
526
- this.getAll().forEach((query) => {
527
- query.onOnline();
528
- });
529
- });
530
- }
531
- };
532
- var QueryClient = class {
533
- #queryCache;
534
- #mutationCache;
535
- #defaultOptions;
536
- #queryDefaults;
537
- #mutationDefaults;
538
- #mountCount;
539
- #unsubscribeFocus;
540
- #unsubscribeOnline;
541
- constructor(config = {}) {
542
- this.#queryCache = config.queryCache || new QueryCache();
543
- this.#mutationCache = config.mutationCache || new MutationCache();
544
- this.#defaultOptions = config.defaultOptions || {};
545
- this.#queryDefaults = /* @__PURE__ */ new Map();
546
- this.#mutationDefaults = /* @__PURE__ */ new Map();
547
- this.#mountCount = 0;
548
- }
549
- mount() {
550
- this.#mountCount++;
551
- if (this.#mountCount !== 1) return;
552
- this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {
553
- if (focused) {
554
- await this.resumePausedMutations();
555
- this.#queryCache.onFocus();
556
- }
557
- });
558
- this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {
559
- if (online) {
560
- await this.resumePausedMutations();
561
- this.#queryCache.onOnline();
562
- }
563
- });
564
- }
565
- unmount() {
566
- this.#mountCount--;
567
- if (this.#mountCount !== 0) return;
568
- this.#unsubscribeFocus?.();
569
- this.#unsubscribeFocus = void 0;
570
- this.#unsubscribeOnline?.();
571
- this.#unsubscribeOnline = void 0;
572
- }
573
- isFetching(filters) {
574
- return this.#queryCache.findAll({ ...filters, fetchStatus: "fetching" }).length;
575
- }
576
- isMutating(filters) {
577
- return this.#mutationCache.findAll({ ...filters, status: "pending" }).length;
578
- }
579
- /**
580
- * Imperative (non-reactive) way to retrieve data for a QueryKey.
581
- * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
582
- *
583
- * Hint: Do not use this function inside a component, because it won't receive updates.
584
- * Use `useQuery` to create a `QueryObserver` that subscribes to changes.
585
- */
586
- getQueryData(queryKey) {
587
- const options = this.defaultQueryOptions({ queryKey });
588
- return this.#queryCache.get(options.queryHash)?.state.data;
589
- }
590
- ensureQueryData(options) {
591
- const defaultedOptions = this.defaultQueryOptions(options);
592
- const query = this.#queryCache.build(this, defaultedOptions);
593
- const cachedData = query.state.data;
594
- if (cachedData === void 0) {
595
- return this.fetchQuery(options);
596
- }
597
- if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) {
598
- void this.prefetchQuery(defaultedOptions);
599
- }
600
- return Promise.resolve(cachedData);
601
- }
602
- getQueriesData(filters) {
603
- return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {
604
- const data = state.data;
605
- return [queryKey, data];
606
- });
607
- }
608
- setQueryData(queryKey, updater, options) {
609
- const defaultedOptions = this.defaultQueryOptions({ queryKey });
610
- const query = this.#queryCache.get(
611
- defaultedOptions.queryHash
612
- );
613
- const prevData = query?.state.data;
614
- const data = functionalUpdate(updater, prevData);
615
- if (data === void 0) {
616
- return void 0;
617
- }
618
- return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true });
619
- }
620
- setQueriesData(filters, updater, options) {
621
- return notifyManager.batch(
622
- () => this.#queryCache.findAll(filters).map(({ queryKey }) => [
623
- queryKey,
624
- this.setQueryData(queryKey, updater, options)
625
- ])
626
- );
627
- }
628
- getQueryState(queryKey) {
629
- const options = this.defaultQueryOptions({ queryKey });
630
- return this.#queryCache.get(
631
- options.queryHash
632
- )?.state;
633
- }
634
- removeQueries(filters) {
635
- const queryCache = this.#queryCache;
636
- notifyManager.batch(() => {
637
- queryCache.findAll(filters).forEach((query) => {
638
- queryCache.remove(query);
639
- });
640
- });
641
- }
642
- resetQueries(filters, options) {
643
- const queryCache = this.#queryCache;
644
- return notifyManager.batch(() => {
645
- queryCache.findAll(filters).forEach((query) => {
646
- query.reset();
647
- });
648
- return this.refetchQueries(
649
- {
650
- type: "active",
651
- ...filters
652
- },
653
- options
654
- );
655
- });
656
- }
657
- cancelQueries(filters, cancelOptions = {}) {
658
- const defaultedCancelOptions = { revert: true, ...cancelOptions };
659
- const promises = notifyManager.batch(
660
- () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions))
661
- );
662
- return Promise.all(promises).then(noop).catch(noop);
663
- }
664
- invalidateQueries(filters, options = {}) {
665
- return notifyManager.batch(() => {
666
- this.#queryCache.findAll(filters).forEach((query) => {
667
- query.invalidate();
668
- });
669
- if (filters?.refetchType === "none") {
670
- return Promise.resolve();
671
- }
672
- return this.refetchQueries(
673
- {
674
- ...filters,
675
- type: filters?.refetchType ?? filters?.type ?? "active"
676
- },
677
- options
678
- );
679
- });
680
- }
681
- refetchQueries(filters, options = {}) {
682
- const fetchOptions = {
683
- ...options,
684
- cancelRefetch: options.cancelRefetch ?? true
685
- };
686
- const promises = notifyManager.batch(
687
- () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => {
688
- let promise = query.fetch(void 0, fetchOptions);
689
- if (!fetchOptions.throwOnError) {
690
- promise = promise.catch(noop);
691
- }
692
- return query.state.fetchStatus === "paused" ? Promise.resolve() : promise;
693
- })
694
- );
695
- return Promise.all(promises).then(noop);
696
- }
697
- fetchQuery(options) {
698
- const defaultedOptions = this.defaultQueryOptions(options);
699
- if (defaultedOptions.retry === void 0) {
700
- defaultedOptions.retry = false;
701
- }
702
- const query = this.#queryCache.build(this, defaultedOptions);
703
- return query.isStaleByTime(
704
- resolveStaleTime(defaultedOptions.staleTime, query)
705
- ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);
706
- }
707
- prefetchQuery(options) {
708
- return this.fetchQuery(options).then(noop).catch(noop);
709
- }
710
- fetchInfiniteQuery(options) {
711
- options.behavior = infiniteQueryBehavior(options.pages);
712
- return this.fetchQuery(options);
713
- }
714
- prefetchInfiniteQuery(options) {
715
- return this.fetchInfiniteQuery(options).then(noop).catch(noop);
716
- }
717
- ensureInfiniteQueryData(options) {
718
- options.behavior = infiniteQueryBehavior(options.pages);
719
- return this.ensureQueryData(options);
720
- }
721
- resumePausedMutations() {
722
- if (onlineManager.isOnline()) {
723
- return this.#mutationCache.resumePausedMutations();
724
- }
725
- return Promise.resolve();
726
- }
727
- getQueryCache() {
728
- return this.#queryCache;
729
- }
730
- getMutationCache() {
731
- return this.#mutationCache;
732
- }
733
- getDefaultOptions() {
734
- return this.#defaultOptions;
735
- }
736
- setDefaultOptions(options) {
737
- this.#defaultOptions = options;
738
- }
739
- setQueryDefaults(queryKey, options) {
740
- this.#queryDefaults.set(hashKey(queryKey), {
741
- queryKey,
742
- defaultOptions: options
743
- });
744
- }
745
- getQueryDefaults(queryKey) {
746
- const defaults = [...this.#queryDefaults.values()];
747
- const result = {};
748
- defaults.forEach((queryDefault) => {
749
- if (partialMatchKey(queryKey, queryDefault.queryKey)) {
750
- Object.assign(result, queryDefault.defaultOptions);
751
- }
752
- });
753
- return result;
754
- }
755
- setMutationDefaults(mutationKey, options) {
756
- this.#mutationDefaults.set(hashKey(mutationKey), {
757
- mutationKey,
758
- defaultOptions: options
759
- });
760
- }
761
- getMutationDefaults(mutationKey) {
762
- const defaults = [...this.#mutationDefaults.values()];
763
- const result = {};
764
- defaults.forEach((queryDefault) => {
765
- if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {
766
- Object.assign(result, queryDefault.defaultOptions);
767
- }
768
- });
769
- return result;
770
- }
771
- defaultQueryOptions(options) {
772
- if (options._defaulted) {
773
- return options;
774
- }
775
- const defaultedOptions = {
776
- ...this.#defaultOptions.queries,
777
- ...this.getQueryDefaults(options.queryKey),
778
- ...options,
779
- _defaulted: true
780
- };
781
- if (!defaultedOptions.queryHash) {
782
- defaultedOptions.queryHash = hashQueryKeyByOptions(
783
- defaultedOptions.queryKey,
784
- defaultedOptions
785
- );
786
- }
787
- if (defaultedOptions.refetchOnReconnect === void 0) {
788
- defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always";
789
- }
790
- if (defaultedOptions.throwOnError === void 0) {
791
- defaultedOptions.throwOnError = !!defaultedOptions.suspense;
792
- }
793
- if (!defaultedOptions.networkMode && defaultedOptions.persister) {
794
- defaultedOptions.networkMode = "offlineFirst";
795
- }
796
- if (defaultedOptions.queryFn === skipToken) {
797
- defaultedOptions.enabled = false;
798
- }
799
- return defaultedOptions;
800
- }
801
- defaultMutationOptions(options) {
802
- if (options?._defaulted) {
803
- return options;
804
- }
805
- return {
806
- ...this.#defaultOptions.mutations,
807
- ...options?.mutationKey && this.getMutationDefaults(options.mutationKey),
808
- ...options,
809
- _defaulted: true
810
- };
811
- }
812
- clear() {
813
- this.#queryCache.clear();
814
- this.#mutationCache.clear();
815
- }
816
- };
817
- function Transitioner() {
818
- const router = useRouter();
819
- const mountLoadForRouter = React.useRef({
820
- router,
821
- mounted: false
822
- });
823
- const [isTransitioning, setIsTransitioning] = React.useState(false);
824
- const isLoading = useStore(router.stores.isLoading, (value) => value);
825
- const hasPendingMatches = useStore(router.stores.hasPendingMatches, (value) => value);
826
- const previousIsLoading = usePrevious(isLoading);
827
- const isAnyPending = isLoading || isTransitioning || hasPendingMatches;
828
- const previousIsAnyPending = usePrevious(isAnyPending);
829
- const isPagePending = isLoading || hasPendingMatches;
830
- const previousIsPagePending = usePrevious(isPagePending);
831
- router.startTransition = (fn) => {
832
- setIsTransitioning(true);
833
- React.startTransition(() => {
834
- fn();
835
- setIsTransitioning(false);
836
- });
837
- };
838
- React.useEffect(() => {
839
- const unsub = router.history.subscribe(router.load);
840
- const nextLocation = router.buildLocation({
841
- to: router.latestLocation.pathname,
842
- search: true,
843
- params: true,
844
- hash: true,
845
- state: true,
846
- _includeValidateSearch: true
847
- });
848
- if (trimPathRight(router.latestLocation.publicHref) !== trimPathRight(nextLocation.publicHref)) router.commitLocation({
849
- ...nextLocation,
850
- replace: true
851
- });
852
- return () => {
853
- unsub();
854
- };
855
- }, [router, router.history]);
856
- useLayoutEffect(() => {
857
- if (typeof window !== "undefined" && router.ssr || mountLoadForRouter.current.router === router && mountLoadForRouter.current.mounted) return;
858
- mountLoadForRouter.current = {
859
- router,
860
- mounted: true
861
- };
862
- const tryLoad = async () => {
863
- try {
864
- await router.load();
865
- } catch (err) {
866
- console.error(err);
867
- }
868
- };
869
- tryLoad();
870
- }, [router]);
871
- useLayoutEffect(() => {
872
- if (previousIsLoading && !isLoading) router.emit({
873
- type: "onLoad",
874
- ...getLocationChangeInfo(router.stores.location.state, router.stores.resolvedLocation.state)
875
- });
876
- }, [
877
- previousIsLoading,
878
- router,
879
- isLoading
880
- ]);
881
- useLayoutEffect(() => {
882
- if (previousIsPagePending && !isPagePending) router.emit({
883
- type: "onBeforeRouteMount",
884
- ...getLocationChangeInfo(router.stores.location.state, router.stores.resolvedLocation.state)
885
- });
886
- }, [
887
- isPagePending,
888
- previousIsPagePending,
889
- router
890
- ]);
891
- useLayoutEffect(() => {
892
- if (previousIsAnyPending && !isAnyPending) {
893
- const changeInfo = getLocationChangeInfo(router.stores.location.state, router.stores.resolvedLocation.state);
894
- router.emit({
895
- type: "onResolved",
896
- ...changeInfo
897
- });
898
- batch$1(() => {
899
- router.stores.status.setState(() => "idle");
900
- router.stores.resolvedLocation.setState(() => router.stores.location.state);
901
- });
902
- if (changeInfo.hrefChanged) handleHashScroll(router);
903
- }
904
- }, [
905
- isAnyPending,
906
- previousIsAnyPending,
907
- router
908
- ]);
909
- return null;
910
- }
911
- function Matches() {
912
- const router = useRouter();
913
- const PendingComponent = router.routesById[rootRouteId].options.pendingComponent ?? router.options.defaultPendingComponent;
914
- const pendingElement = PendingComponent ? /* @__PURE__ */ jsx(PendingComponent, {}) : null;
915
- const inner = /* @__PURE__ */ jsxs(typeof document !== "undefined" && router.ssr ? SafeFragment : React.Suspense, {
916
- fallback: pendingElement,
917
- children: [/* @__PURE__ */ jsx(Transitioner, {}), /* @__PURE__ */ jsx(MatchesInner, {})]
918
- });
919
- return router.options.InnerWrap ? /* @__PURE__ */ jsx(router.options.InnerWrap, { children: inner }) : inner;
920
- }
921
- function MatchesInner() {
922
- const router = useRouter();
923
- const matchId = useStore(router.stores.firstMatchId, (id) => id);
924
- const resetKey = useStore(router.stores.loadedAt, (loadedAt) => loadedAt);
925
- const matchComponent = matchId ? /* @__PURE__ */ jsx(Match$1, { matchId }) : null;
926
- return /* @__PURE__ */ jsx(matchContext.Provider, {
927
- value: matchId,
928
- children: router.options.disableGlobalCatchBoundary ? matchComponent : /* @__PURE__ */ jsx(CatchBoundary, {
929
- getResetKey: () => resetKey,
930
- errorComponent: ErrorComponent,
931
- onCatch: process.env.NODE_ENV !== "production" ? (error) => {
932
- warning(false, `The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`);
933
- warning(false, error.message || error.toString());
934
- } : void 0,
935
- children: matchComponent
936
- })
937
- });
938
- }
939
- function useMatches(opts) {
940
- const router = useRouter();
941
- const previousResult = React.useRef(void 0);
942
- return useStore(router.stores.activeMatchesSnapshot, (matches) => {
943
- const selected = matches;
944
- if (router.options.defaultStructuralSharing) {
945
- const shared = replaceEqualDeep(previousResult.current, selected);
946
- previousResult.current = shared;
947
- return shared;
948
- }
949
- return selected;
950
- });
951
- }
952
- function RouterContextProvider({ router, children: children2, ...rest }) {
953
- if (Object.keys(rest).length > 0) router.update({
954
- ...router.options,
955
- ...rest,
956
- context: {
957
- ...router.options.context,
958
- ...rest.context
959
- }
960
- });
961
- const provider = /* @__PURE__ */ jsx(routerContext.Provider, {
962
- value: router,
963
- children: children2
964
- });
965
- if (router.options.Wrap) return /* @__PURE__ */ jsx(router.options.Wrap, { children: provider });
966
- return provider;
967
- }
968
- function RouterProvider({ router, ...rest }) {
969
- return /* @__PURE__ */ jsx(RouterContextProvider, {
970
- router,
971
- ...rest,
972
- children: /* @__PURE__ */ jsx(Matches, {})
973
- });
974
- }
975
- function useLocation(opts) {
976
- const router = useRouter();
977
- const previousResult = useRef(void 0);
978
- return useStore(router.stores.location, (location) => {
979
- const selected = location;
980
- if (router.options.defaultStructuralSharing) {
981
- const shared = replaceEqualDeep(previousResult.current, selected);
982
- previousResult.current = shared;
983
- return shared;
984
- }
985
- return selected;
986
- });
987
- }
988
- function Asset({ tag, attrs, children: children2, nonce }) {
989
- switch (tag) {
990
- case "title":
991
- return /* @__PURE__ */ jsx("title", {
992
- ...attrs,
993
- suppressHydrationWarning: true,
994
- children: children2
995
- });
996
- case "meta":
997
- return /* @__PURE__ */ jsx("meta", {
998
- ...attrs,
999
- suppressHydrationWarning: true
1000
- });
1001
- case "link":
1002
- return /* @__PURE__ */ jsx("link", {
1003
- ...attrs,
1004
- nonce,
1005
- suppressHydrationWarning: true
1006
- });
1007
- case "style":
1008
- return /* @__PURE__ */ jsx("style", {
1009
- ...attrs,
1010
- dangerouslySetInnerHTML: { __html: children2 },
1011
- nonce
1012
- });
1013
- case "script":
1014
- return /* @__PURE__ */ jsx(Script, {
1015
- attrs,
1016
- children: children2
1017
- });
1018
- default:
1019
- return null;
1020
- }
1021
- }
1022
- function Script({ attrs, children: children2 }) {
1023
- useRouter();
1024
- const hydrated = useHydrated();
1025
- const dataScript = typeof attrs?.type === "string" && attrs.type !== "" && attrs.type !== "text/javascript" && attrs.type !== "module";
1026
- if (process.env.NODE_ENV !== "production" && attrs?.src && typeof children2 === "string" && children2.trim().length) console.warn("[TanStack Router] <Script> received both `src` and `children`. The `children` content will be ignored. Remove `children` or remove `src`.");
1027
- React.useEffect(() => {
1028
- if (dataScript) return;
1029
- if (attrs?.src) {
1030
- const normSrc = (() => {
1031
- try {
1032
- const base = document.baseURI || window.location.href;
1033
- return new URL(attrs.src, base).href;
1034
- } catch {
1035
- return attrs.src;
1036
- }
1037
- })();
1038
- if (Array.from(document.querySelectorAll("script[src]")).find((el) => el.src === normSrc)) return;
1039
- const script = document.createElement("script");
1040
- for (const [key, value] of Object.entries(attrs)) if (key !== "suppressHydrationWarning" && value !== void 0 && value !== false) script.setAttribute(key, typeof value === "boolean" ? "" : String(value));
1041
- document.head.appendChild(script);
1042
- return () => {
1043
- if (script.parentNode) script.parentNode.removeChild(script);
1044
- };
1045
- }
1046
- if (typeof children2 === "string") {
1047
- const typeAttr = typeof attrs?.type === "string" ? attrs.type : "text/javascript";
1048
- const nonceAttr = typeof attrs?.nonce === "string" ? attrs.nonce : void 0;
1049
- if (Array.from(document.querySelectorAll("script:not([src])")).find((el) => {
1050
- if (!(el instanceof HTMLScriptElement)) return false;
1051
- const sType = el.getAttribute("type") ?? "text/javascript";
1052
- const sNonce = el.getAttribute("nonce") ?? void 0;
1053
- return el.textContent === children2 && sType === typeAttr && sNonce === nonceAttr;
1054
- })) return;
1055
- const script = document.createElement("script");
1056
- script.textContent = children2;
1057
- if (attrs) {
1058
- for (const [key, value] of Object.entries(attrs)) if (key !== "suppressHydrationWarning" && value !== void 0 && value !== false) script.setAttribute(key, typeof value === "boolean" ? "" : String(value));
1059
- }
1060
- document.head.appendChild(script);
1061
- return () => {
1062
- if (script.parentNode) script.parentNode.removeChild(script);
1063
- };
1064
- }
1065
- }, [
1066
- attrs,
1067
- children2,
1068
- dataScript
1069
- ]);
1070
- if (dataScript && typeof children2 === "string") return /* @__PURE__ */ jsx("script", {
1071
- ...attrs,
1072
- suppressHydrationWarning: true,
1073
- dangerouslySetInnerHTML: { __html: children2 }
1074
- });
1075
- if (!hydrated) {
1076
- if (attrs?.src) return /* @__PURE__ */ jsx("script", {
1077
- ...attrs,
1078
- suppressHydrationWarning: true
1079
- });
1080
- if (typeof children2 === "string") return /* @__PURE__ */ jsx("script", {
1081
- ...attrs,
1082
- dangerouslySetInnerHTML: { __html: children2 },
1083
- suppressHydrationWarning: true
1084
- });
1085
- }
1086
- return null;
1087
- }
1088
- var useTags = () => {
1089
- const router = useRouter();
1090
- const nonce = router.options.ssr?.nonce;
1091
- const routeMeta = useStore(router.stores.activeMatchesSnapshot, (matches) => {
1092
- return matches.map((match) => match.meta).filter(Boolean);
1093
- }, deepEqual);
1094
- const meta = React.useMemo(() => {
1095
- const resultMeta = [];
1096
- const metaByAttribute = {};
1097
- let title;
1098
- for (let i = routeMeta.length - 1; i >= 0; i--) {
1099
- const metas = routeMeta[i];
1100
- for (let j = metas.length - 1; j >= 0; j--) {
1101
- const m = metas[j];
1102
- if (!m) continue;
1103
- if (m.title) {
1104
- if (!title) title = {
1105
- tag: "title",
1106
- children: m.title
1107
- };
1108
- } else if ("script:ld+json" in m) try {
1109
- const json = JSON.stringify(m["script:ld+json"]);
1110
- resultMeta.push({
1111
- tag: "script",
1112
- attrs: { type: "application/ld+json" },
1113
- children: escapeHtml(json)
1114
- });
1115
- } catch {
1116
- }
1117
- else {
1118
- const attribute = m.name ?? m.property;
1119
- if (attribute) if (metaByAttribute[attribute]) continue;
1120
- else metaByAttribute[attribute] = true;
1121
- resultMeta.push({
1122
- tag: "meta",
1123
- attrs: {
1124
- ...m,
1125
- nonce
1126
- }
1127
- });
1128
- }
1129
- }
1130
- }
1131
- if (title) resultMeta.push(title);
1132
- if (nonce) resultMeta.push({
1133
- tag: "meta",
1134
- attrs: {
1135
- property: "csp-nonce",
1136
- content: nonce
1137
- }
1138
- });
1139
- resultMeta.reverse();
1140
- return resultMeta;
1141
- }, [routeMeta, nonce]);
1142
- const links = useStore(router.stores.activeMatchesSnapshot, (matches) => {
1143
- const constructed = matches.map((match) => match.links).filter(Boolean).flat(1).map((link) => ({
1144
- tag: "link",
1145
- attrs: {
1146
- ...link,
1147
- nonce
1148
- }
1149
- }));
1150
- const manifest = router.ssr?.manifest;
1151
- const assets = matches.map((match) => manifest?.routes[match.routeId]?.assets ?? []).filter(Boolean).flat(1).filter((asset) => asset.tag === "link").map((asset) => ({
1152
- tag: "link",
1153
- attrs: {
1154
- ...asset.attrs,
1155
- suppressHydrationWarning: true,
1156
- nonce
1157
- }
1158
- }));
1159
- return [...constructed, ...assets];
1160
- }, deepEqual);
1161
- const preloadLinks = useStore(router.stores.activeMatchesSnapshot, (matches) => {
1162
- const preloadLinks2 = [];
1163
- matches.map((match) => router.looseRoutesById[match.routeId]).forEach((route) => router.ssr?.manifest?.routes[route.id]?.preloads?.filter(Boolean).forEach((preload) => {
1164
- preloadLinks2.push({
1165
- tag: "link",
1166
- attrs: {
1167
- rel: "modulepreload",
1168
- href: preload,
1169
- nonce
1170
- }
1171
- });
1172
- }));
1173
- return preloadLinks2;
1174
- }, deepEqual);
1175
- const styles = useStore(router.stores.activeMatchesSnapshot, (matches) => matches.map((match) => match.styles).flat(1).filter(Boolean).map(({ children: children2, ...attrs }) => ({
1176
- tag: "style",
1177
- attrs: {
1178
- ...attrs,
1179
- nonce
1180
- },
1181
- children: children2
1182
- })), deepEqual);
1183
- const headScripts = useStore(router.stores.activeMatchesSnapshot, (matches) => matches.map((match) => match.headScripts).flat(1).filter(Boolean).map(({ children: children2, ...script }) => ({
1184
- tag: "script",
1185
- attrs: {
1186
- ...script,
1187
- nonce
1188
- },
1189
- children: children2
1190
- })), deepEqual);
1191
- return uniqBy([
1192
- ...meta,
1193
- ...preloadLinks,
1194
- ...links,
1195
- ...styles,
1196
- ...headScripts
1197
- ], (d) => {
1198
- return JSON.stringify(d);
1199
- });
1200
- };
1201
- function uniqBy(arr, fn) {
1202
- const seen = /* @__PURE__ */ new Set();
1203
- return arr.filter((item) => {
1204
- const key = fn(item);
1205
- if (seen.has(key)) return false;
1206
- seen.add(key);
1207
- return true;
1208
- });
1209
- }
1210
- function HeadContent() {
1211
- const tags = useTags();
1212
- const nonce = useRouter().options.ssr?.nonce;
1213
- return /* @__PURE__ */ jsx(Fragment, { children: tags.map((tag) => /* @__PURE__ */ createElement$1(Asset, {
1214
- ...tag,
1215
- key: `tsr-meta-${JSON.stringify(tag)}`,
1216
- nonce
1217
- })) });
1218
- }
1219
339
  const defaultLocale = "en";
1220
340
  async function dynamicActivate(locale, onActivate) {
1221
341
  const messages = await loadI18nMessages(locale);
@@ -3812,7 +2932,7 @@ var TanstackQueryDevtools = class {
3812
2932
  if (this.#Component) {
3813
2933
  Devtools = this.#Component;
3814
2934
  } else {
3815
- Devtools = lazy(() => import("./WDYDFRGG-Cd364FN_.js"));
2935
+ Devtools = lazy(() => import("./WDYDFRGG-DWwEqh2h.js"));
3816
2936
  this.#Component = Devtools;
3817
2937
  }
3818
2938
  setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
@@ -3950,7 +3070,7 @@ var TanstackQueryDevtoolsPanel = class {
3950
3070
  if (this.#Component) {
3951
3071
  Devtools = this.#Component;
3952
3072
  } else {
3953
- Devtools = lazy(() => import("./2SSKDMRQ-BXz8vjrT.js"));
3073
+ Devtools = lazy(() => import("./2SSKDMRQ-CGPzX7ok.js"));
3954
3074
  this.#Component = Devtools;
3955
3075
  }
3956
3076
  setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
@@ -11108,7 +10228,7 @@ graphql(`
11108
10228
  }
11109
10229
  }
11110
10230
  `);
11111
- graphql(`
10231
+ const removeCustomersFromGroupDocument = graphql(`
11112
10232
  mutation RemoveCustomersFromGroup($customerGroupId: ID!, $customerIds: [ID!]!) {
11113
10233
  removeCustomersFromGroup(customerGroupId: $customerGroupId, customerIds: $customerIds) {
11114
10234
  id
@@ -11162,6 +10282,62 @@ const DeleteCustomerGroupsBulkAction = ({
11162
10282
  }) => {
11163
10283
  return /* @__PURE__ */ jsx(DeleteBulkAction, { mutationDocument: deleteCustomerGroupsDocument, entityName: "customer groups", requiredPermissions: ["DeleteCustomerGroup"], selection, table });
11164
10284
  };
10285
+ function createRemoveFromGroupBulkAction(customerGroupId) {
10286
+ return function RemoveFromGroupBulkAction({
10287
+ selection,
10288
+ table
10289
+ }) {
10290
+ const {
10291
+ refetchPaginatedList
10292
+ } = usePaginatedList();
10293
+ const {
10294
+ _: _t
10295
+ } = useLingui();
10296
+ const count = selection.length;
10297
+ const {
10298
+ mutate,
10299
+ isPending
10300
+ } = useMutation({
10301
+ mutationFn: api.mutate(removeCustomersFromGroupDocument),
10302
+ onSuccess: () => {
10303
+ toast.success(i18n._(
10304
+ /*i18n*/
10305
+ {
10306
+ id: "T8gVni",
10307
+ values: {
10308
+ count
10309
+ }
10310
+ }
10311
+ ));
10312
+ refetchPaginatedList();
10313
+ table.resetRowSelection();
10314
+ },
10315
+ onError: (error) => {
10316
+ toast.error(_t(
10317
+ /*i18n*/
10318
+ {
10319
+ id: "tb6I7X"
10320
+ }
10321
+ ), {
10322
+ description: error.message
10323
+ });
10324
+ }
10325
+ });
10326
+ return /* @__PURE__ */ jsx(DataTableBulkActionItem, { requiresPermission: ["UpdateCustomerGroup"], onClick: () => mutate({
10327
+ customerGroupId,
10328
+ customerIds: selection.map((s) => s.id)
10329
+ }), disabled: isPending, label: /* @__PURE__ */ jsx(Trans, { .../*i18n*/
10330
+ {
10331
+ id: "LNV3uL"
10332
+ } }), confirmationText: /* @__PURE__ */ jsx(Trans, { .../*i18n*/
10333
+ {
10334
+ id: "FZk7Sh",
10335
+ values: {
10336
+ count
10337
+ }
10338
+ } }), icon: UserMinus, className: "text-destructive" });
10339
+ };
10340
+ }
11165
10341
  const customerGroupMemberListDocument = graphql(`
11166
10342
  query CustomerGroupMemberList($id: ID!, $options: CustomerListOptions) {
11167
10343
  customerGroup(id: $id) {
@@ -11191,6 +10367,9 @@ function CustomerGroupMembersTable({
11191
10367
  _: _t
11192
10368
  } = useLingui();
11193
10369
  const queryClient2 = useQueryClient();
10370
+ const bulkActions = useMemo(() => [{
10371
+ component: createRemoveFromGroupBulkAction(customerGroupId)
10372
+ }], [customerGroupId]);
11194
10373
  const {
11195
10374
  mutate: addCustomerToGroup
11196
10375
  } = useMutation({
@@ -11219,7 +10398,7 @@ function CustomerGroupMembersTable({
11219
10398
  /* @__PURE__ */ jsx(PaginatedListDataTable, { listQuery: addCustomFields(customerGroupMemberListDocument), transformVariables: (variables) => ({
11220
10399
  ...variables,
11221
10400
  id: customerGroupId
11222
- }), page, itemsPerPage: pageSize, sorting, columnFilters: filters, onPageChange: (_, page2, perPage) => {
10401
+ }), bulkActions, page, itemsPerPage: pageSize, sorting, columnFilters: filters, onPageChange: (_, page2, perPage) => {
11223
10402
  setPage(page2);
11224
10403
  setPageSize(perPage);
11225
10404
  }, onSortChange: (_, sorting2) => {
@@ -15290,17 +14469,178 @@ function GenerateVariantsPanel({
15290
14469
  ] })
15291
14470
  ] }) });
15292
14471
  }
14472
+ function useRemoveOptionGroup(productId, options) {
14473
+ const {
14474
+ _: _t
14475
+ } = useLingui();
14476
+ const [inUseGroupId, setInUseGroupId] = useState(null);
14477
+ const mutation = useMutation({
14478
+ mutationFn: api.mutate(removeOptionGroupFromProductDocument)
14479
+ });
14480
+ const removeOptionGroupAsync = (optionGroupId, force = false) => mutation.mutateAsync({
14481
+ productId,
14482
+ optionGroupId,
14483
+ force
14484
+ }).then((result) => result.removeOptionGroupFromProduct);
14485
+ const remove = async (optionGroupId) => {
14486
+ try {
14487
+ const result = await removeOptionGroupAsync(optionGroupId);
14488
+ if (result.__typename === "ProductOptionInUseError") {
14489
+ setInUseGroupId(optionGroupId);
14490
+ return;
14491
+ }
14492
+ toast.success(_t(
14493
+ /*i18n*/
14494
+ {
14495
+ id: "UnFBTo"
14496
+ }
14497
+ ));
14498
+ options?.onRemoved?.();
14499
+ } catch (error) {
14500
+ toast.error(_t(
14501
+ /*i18n*/
14502
+ {
14503
+ id: "V9Sy/8"
14504
+ }
14505
+ ), {
14506
+ description: error instanceof Error ? error.message : _t(
14507
+ /*i18n*/
14508
+ {
14509
+ id: "29VNqC"
14510
+ }
14511
+ )
14512
+ });
14513
+ }
14514
+ };
14515
+ const forceRemove = async () => {
14516
+ if (!inUseGroupId) {
14517
+ return;
14518
+ }
14519
+ try {
14520
+ await removeOptionGroupAsync(inUseGroupId, true);
14521
+ setInUseGroupId(null);
14522
+ toast.success(_t(
14523
+ /*i18n*/
14524
+ {
14525
+ id: "UnFBTo"
14526
+ }
14527
+ ));
14528
+ options?.onRemoved?.();
14529
+ } catch (error) {
14530
+ toast.error(_t(
14531
+ /*i18n*/
14532
+ {
14533
+ id: "V9Sy/8"
14534
+ }
14535
+ ), {
14536
+ description: error instanceof Error ? error.message : _t(
14537
+ /*i18n*/
14538
+ {
14539
+ id: "29VNqC"
14540
+ }
14541
+ )
14542
+ });
14543
+ }
14544
+ };
14545
+ return {
14546
+ /** Remove a single group, surfacing the force dialog if it is in use. */
14547
+ remove,
14548
+ /** Confirm force-removal of the group currently in `inUseGroupId`. */
14549
+ forceRemove,
14550
+ /** Typed remove primitive for batch callers that inspect the result. */
14551
+ removeOptionGroupAsync,
14552
+ /** Non-null while the force-remove dialog should be shown for that group. */
14553
+ inUseGroupId,
14554
+ clearInUseGroup: () => setInUseGroupId(null),
14555
+ isPending: mutation.isPending
14556
+ };
14557
+ }
14558
+ function ForceRemoveOptionGroupDialog({
14559
+ open,
14560
+ onOpenChange,
14561
+ onConfirm,
14562
+ isPending
14563
+ }) {
14564
+ return /* @__PURE__ */ jsx(AlertDialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [
14565
+ /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [
14566
+ /* @__PURE__ */ jsx(AlertDialogTitle, { children: /* @__PURE__ */ jsx(Trans, { .../*i18n*/
14567
+ {
14568
+ id: "HNmClM"
14569
+ } }) }),
14570
+ /* @__PURE__ */ jsx(AlertDialogDescription, { children: /* @__PURE__ */ jsx(Trans, { .../*i18n*/
14571
+ {
14572
+ id: "KXbQBL"
14573
+ } }) })
14574
+ ] }),
14575
+ /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [
14576
+ /* @__PURE__ */ jsx(AlertDialogCancel, { disabled: isPending, children: /* @__PURE__ */ jsx(Trans, { .../*i18n*/
14577
+ {
14578
+ id: "dEgA5A"
14579
+ } }) }),
14580
+ /* @__PURE__ */ jsx(
14581
+ AlertDialogAction,
14582
+ {
14583
+ disabled: isPending,
14584
+ onClick: (event) => {
14585
+ event.preventDefault();
14586
+ onConfirm();
14587
+ },
14588
+ children: /* @__PURE__ */ jsx(Trans, { .../*i18n*/
14589
+ {
14590
+ id: "MtRMQU"
14591
+ } })
14592
+ }
14593
+ )
14594
+ ] })
14595
+ ] }) });
14596
+ }
15293
14597
  function ProductOptionGroupBadge({
15294
14598
  id,
15295
14599
  name,
15296
- productId
14600
+ productId,
14601
+ onRemoved
15297
14602
  }) {
15298
- return /* @__PURE__ */ jsxs(Badge, { variant: "secondary", className: "text-xs", children: [
15299
- /* @__PURE__ */ jsx("span", { children: name }),
15300
- /* @__PURE__ */ jsx(Link, { to: `/option-groups/${id}`, search: {
15301
- from: "product",
15302
- productId
15303
- }, className: "ml-1.5 inline-flex", children: /* @__PURE__ */ jsx(Pen, { className: "h-3 w-3" }) })
14603
+ const {
14604
+ _: _t
14605
+ } = useLingui();
14606
+ const {
14607
+ remove,
14608
+ forceRemove,
14609
+ inUseGroupId,
14610
+ clearInUseGroup,
14611
+ isPending
14612
+ } = useRemoveOptionGroup(productId, {
14613
+ onRemoved
14614
+ });
14615
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
14616
+ /* @__PURE__ */ jsxs(Badge, { variant: "secondary", className: "text-xs", children: [
14617
+ /* @__PURE__ */ jsx("span", { children: name }),
14618
+ /* @__PURE__ */ jsx(Link, { to: `/option-groups/${id}`, search: {
14619
+ from: "product",
14620
+ productId
14621
+ }, className: "ml-1.5 inline-flex", children: /* @__PURE__ */ jsx(Pen, { className: "h-3 w-3" }) }),
14622
+ onRemoved && /* @__PURE__ */ jsx(PermissionGuard, { requires: ["UpdateProduct", "UpdateCatalog"], children: /* @__PURE__ */ jsx(ConfirmationDialog, { title: _t(
14623
+ /*i18n*/
14624
+ {
14625
+ id: "nTzGeg"
14626
+ }
14627
+ ), description: _t(
14628
+ /*i18n*/
14629
+ {
14630
+ id: "WPNlgt"
14631
+ }
14632
+ ), onConfirm: () => remove(id), children: /* @__PURE__ */ jsx("button", { type: "button", "aria-label": _t(
14633
+ /*i18n*/
14634
+ {
14635
+ id: "nTzGeg"
14636
+ }
14637
+ ), disabled: isPending, className: "ml-1 inline-flex", children: /* @__PURE__ */ jsx(Trash2, { className: "h-3 w-3 text-destructive" }) }) }) })
14638
+ ] }),
14639
+ /* @__PURE__ */ jsx(ForceRemoveOptionGroupDialog, { open: inUseGroupId === id, onOpenChange: (open) => {
14640
+ if (!open) {
14641
+ clearInUseGroup();
14642
+ }
14643
+ }, onConfirm: forceRemove, isPending })
15304
14644
  ] });
15305
14645
  }
15306
14646
  function ProductVariantsTable({
@@ -15557,25 +14897,21 @@ function ProductDetailPage() {
15557
14897
  });
15558
14898
  }
15559
14899
  });
15560
- const removeOptionGroupMutation = useMutation({
15561
- mutationFn: api.mutate(removeOptionGroupFromProductDocument)
15562
- });
15563
- const removeAllOptionGroups = async (productId, optionGroups) => {
14900
+ const {
14901
+ removeOptionGroupAsync
14902
+ } = useRemoveOptionGroup(entity?.id ?? "");
14903
+ const removeAllOptionGroups = async (optionGroups) => {
15564
14904
  try {
15565
14905
  for (const group of optionGroups) {
15566
- const result = await removeOptionGroupMutation.mutateAsync({
15567
- productId,
15568
- optionGroupId: group.id
15569
- });
15570
- const removeResult = result?.removeOptionGroupFromProduct;
15571
- if (removeResult && "__typename" in removeResult && removeResult.__typename === "ProductOptionInUseError") {
14906
+ const result = await removeOptionGroupAsync(group.id);
14907
+ if (result.__typename === "ProductOptionInUseError") {
15572
14908
  toast.error(_t(
15573
14909
  /*i18n*/
15574
14910
  {
15575
14911
  id: "EGhToZ"
15576
14912
  }
15577
14913
  ), {
15578
- description: removeResult.message
14914
+ description: result.message
15579
14915
  });
15580
14916
  refreshEntity();
15581
14917
  return;
@@ -15660,7 +14996,7 @@ function ProductDetailPage() {
15660
14996
  {
15661
14997
  id: "2rtm5r"
15662
14998
  } }), children: entity.optionGroups.length === 0 ? /* @__PURE__ */ jsx(NoVariantsPrompt, { productId: entity.id, productName: entity.name, onOptionGroupCreated: () => refreshEntity(), onVariantCreated: () => refreshEntity() }) : /* @__PURE__ */ jsx(GenerateVariantsPanel, { productId: entity.id, productName: entity.name, optionGroups: entity.optionGroups, onSuccess: () => refreshEntity(), onBack: {
15663
- handler: () => removeAllOptionGroups(entity.id, entity.optionGroups),
14999
+ handler: () => removeAllOptionGroups(entity.optionGroups),
15664
15000
  confirmation: {
15665
15001
  title: _t(
15666
15002
  /*i18n*/
@@ -15680,7 +15016,7 @@ function ProductDetailPage() {
15680
15016
  {
15681
15017
  id: "HiuEp7"
15682
15018
  } }), children: [
15683
- /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5 mb-3", children: entity.optionGroups.map((g) => /* @__PURE__ */ jsx(ProductOptionGroupBadge, { id: g.id, name: g.name, productId: entity.id }, g.id)) }),
15019
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5 mb-3", children: entity.optionGroups.map((g) => /* @__PURE__ */ jsx(ProductOptionGroupBadge, { id: g.id, name: g.name, productId: entity.id, onRemoved: () => refreshEntity() }, g.id)) }),
15684
15020
  /* @__PURE__ */ jsx(AddOptionGroupDialog, { productId: entity.id, existingGroupIds: entity.optionGroups.map((g) => g.id), onSuccess: () => refreshEntity() })
15685
15021
  ] }),
15686
15022
  /* @__PURE__ */ jsx(PageBlock, { column: "side", blockId: "facet-values", title: /* @__PURE__ */ jsx(Trans, { .../*i18n*/
@@ -17690,7 +17026,7 @@ function orderHistoryUtils(order) {
17690
17026
  }) => {
17691
17027
  const success = "bg-success text-success-foreground";
17692
17028
  const destructive = "bg-destructive text-destructive-foreground";
17693
- const warning2 = "bg-warning text-warning-foreground";
17029
+ const warning = "bg-warning text-warning-foreground";
17694
17030
  const regular = "bg-muted text-muted-foreground";
17695
17031
  if (type === "ORDER_PAYMENT_TRANSITION" && data.to === "Settled") {
17696
17032
  return success;
@@ -17704,7 +17040,7 @@ function orderHistoryUtils(order) {
17704
17040
  if (type === "ORDER_CANCELLATION") {
17705
17041
  const lines = data.lines;
17706
17042
  const hasRefundData = lines && lines.length > 0 || data.reason;
17707
- return hasRefundData ? warning2 : destructive;
17043
+ return hasRefundData ? warning : destructive;
17708
17044
  }
17709
17045
  if (type === "ORDER_STATE_TRANSITION" && data.to === "Cancelled") {
17710
17046
  return destructive;
@@ -23778,36 +23114,14 @@ function ManageProductVariants() {
23778
23114
  refetch();
23779
23115
  }
23780
23116
  });
23781
- const [forceRemoveGroupId, setForceRemoveGroupId] = useState(null);
23782
- const removeOptionGroupMutation = useMutation({
23783
- mutationFn: api.mutate(removeOptionGroupFromProductDocument),
23784
- onSuccess: (result, variables) => {
23785
- const removeResult = result?.removeOptionGroupFromProduct;
23786
- if (removeResult && "__typename" in removeResult && removeResult.__typename === "ProductOptionInUseError") {
23787
- setForceRemoveGroupId(variables.optionGroupId);
23788
- return;
23789
- }
23790
- toast.success(_t2(
23791
- /*i18n*/
23792
- {
23793
- id: "UnFBTo"
23794
- }
23795
- ));
23796
- refetch();
23797
- }
23798
- });
23799
- const forceRemoveOptionGroupMutation = useMutation({
23800
- mutationFn: api.mutate(removeOptionGroupFromProductDocument),
23801
- onSuccess: () => {
23802
- setForceRemoveGroupId(null);
23803
- toast.success(_t2(
23804
- /*i18n*/
23805
- {
23806
- id: "UnFBTo"
23807
- }
23808
- ));
23809
- refetch();
23810
- }
23117
+ const {
23118
+ remove: removeOptionGroup,
23119
+ forceRemove: forceRemoveOptionGroup,
23120
+ inUseGroupId: forceRemoveGroupId,
23121
+ clearInUseGroup,
23122
+ isPending: isRemovingOptionGroup
23123
+ } = useRemoveOptionGroup(id, {
23124
+ onRemoved: refetch
23811
23125
  });
23812
23126
  const setOptionToAddToVariant = (variantId, groupId, optionId) => {
23813
23127
  if (!optionId) {
@@ -23894,7 +23208,7 @@ function ManageProductVariants() {
23894
23208
  /* @__PURE__ */ jsx(AddOptionValueDialog, { groupId: group.id, groupName: group.name, onSuccess: () => refetch() })
23895
23209
  ] })
23896
23210
  ] }),
23897
- /* @__PURE__ */ jsx("div", { className: "col-span-1 flex items-end justify-end", children: /* @__PURE__ */ jsx(ConfirmationDialog, { title: _t2(
23211
+ /* @__PURE__ */ jsx("div", { className: "col-span-1 flex items-end justify-end", children: /* @__PURE__ */ jsx(PermissionGuard, { requires: ["UpdateProduct", "UpdateCatalog"], children: /* @__PURE__ */ jsx(ConfirmationDialog, { title: _t2(
23898
23212
  /*i18n*/
23899
23213
  {
23900
23214
  id: "nTzGeg"
@@ -23904,10 +23218,7 @@ function ManageProductVariants() {
23904
23218
  {
23905
23219
  id: "WPNlgt"
23906
23220
  }
23907
- ), onConfirm: () => removeOptionGroupMutation.mutate({
23908
- productId: id,
23909
- optionGroupId: group.id
23910
- }), children: /* @__PURE__ */ jsx(Button, { size: "icon", variant: "ghost", disabled: removeOptionGroupMutation.isPending, children: /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4 text-destructive" }) }) }) })
23221
+ ), onConfirm: () => removeOptionGroup(group.id), children: /* @__PURE__ */ jsx(Button, { size: "icon", variant: "ghost", disabled: isRemovingOptionGroup, children: /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4 text-destructive" }) }) }) }) })
23911
23222
  ] }, group.id)) }),
23912
23223
  /* @__PURE__ */ jsx(AddOptionGroupDialog, { productId: id, existingGroupIds: productData.product.optionGroups.map((g) => g.id), onSuccess: () => refetch() })
23913
23224
  ] }),
@@ -23970,38 +23281,11 @@ function ManageProductVariants() {
23970
23281
  } })
23971
23282
  ] })
23972
23283
  ] }),
23973
- /* @__PURE__ */ jsx(AlertDialog, { open: !!forceRemoveGroupId, onOpenChange: (open) => {
23974
- if (!open) setForceRemoveGroupId(null);
23975
- }, children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [
23976
- /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [
23977
- /* @__PURE__ */ jsx(AlertDialogTitle, { children: /* @__PURE__ */ jsx(Trans, { .../*i18n*/
23978
- {
23979
- id: "HNmClM"
23980
- } }) }),
23981
- /* @__PURE__ */ jsx(AlertDialogDescription, { children: /* @__PURE__ */ jsx(Trans, { .../*i18n*/
23982
- {
23983
- id: "KXbQBL"
23984
- } }) })
23985
- ] }),
23986
- /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [
23987
- /* @__PURE__ */ jsx(AlertDialogCancel, { onClick: () => setForceRemoveGroupId(null), children: /* @__PURE__ */ jsx(Trans, { .../*i18n*/
23988
- {
23989
- id: "dEgA5A"
23990
- } }) }),
23991
- /* @__PURE__ */ jsx(AlertDialogAction, { onClick: () => {
23992
- if (forceRemoveGroupId) {
23993
- forceRemoveOptionGroupMutation.mutate({
23994
- productId: id,
23995
- optionGroupId: forceRemoveGroupId,
23996
- force: true
23997
- });
23998
- }
23999
- }, children: /* @__PURE__ */ jsx(Trans, { .../*i18n*/
24000
- {
24001
- id: "MtRMQU"
24002
- } }) })
24003
- ] })
24004
- ] }) })
23284
+ /* @__PURE__ */ jsx(ForceRemoveOptionGroupDialog, { open: !!forceRemoveGroupId, onOpenChange: (open) => {
23285
+ if (!open) {
23286
+ clearInUseGroup();
23287
+ }
23288
+ }, onConfirm: forceRemoveOptionGroup, isPending: isRemovingOptionGroup })
24005
23289
  ] });
24006
23290
  }
24007
23291
  function CustomerAddressSelector({
@@ -24191,6 +23475,52 @@ function ShippingMethodSelector({
24191
23475
  id: "5I+a3G"
24192
23476
  } }) }) });
24193
23477
  }
23478
+ function QuantityCell({
23479
+ line,
23480
+ onAdjustLine,
23481
+ onRemoveLine
23482
+ }) {
23483
+ const [localValue, setLocalValue] = useState(String(line.quantity));
23484
+ useEffect(() => {
23485
+ setLocalValue(String(line.quantity));
23486
+ }, [line.quantity]);
23487
+ const commitValue = (removeOnZero) => {
23488
+ const numValue = localValue === "" ? 0 : Number(localValue);
23489
+ if (numValue <= 0 || Number.isNaN(numValue)) {
23490
+ if (removeOnZero) {
23491
+ onRemoveLine({
23492
+ lineId: line.id
23493
+ });
23494
+ } else {
23495
+ setLocalValue(String(line.quantity));
23496
+ }
23497
+ } else if (numValue !== line.quantity) {
23498
+ onAdjustLine({
23499
+ lineId: line.id,
23500
+ quantity: numValue,
23501
+ customFields: line.customFields
23502
+ });
23503
+ }
23504
+ };
23505
+ return /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
23506
+ /* @__PURE__ */ jsx(Input, { type: "number", value: localValue, min: 0, placeholder: "0", "data-testid": "order-line-quantity", onChange: (e) => setLocalValue(e.target.value), onKeyDown: (e) => {
23507
+ if (e.key === "Enter") {
23508
+ e.preventDefault();
23509
+ commitValue(true);
23510
+ }
23511
+ }, onBlur: () => commitValue(false) }),
23512
+ /* @__PURE__ */ jsx(Button, { variant: "outline", type: "button", size: "icon", onClick: () => onRemoveLine({
23513
+ lineId: line.id
23514
+ }), children: /* @__PURE__ */ jsx(Trash2, {}) }),
23515
+ line.customFields && /* @__PURE__ */ jsx(OrderLineCustomFieldsForm, { onUpdate: (customFields) => {
23516
+ onAdjustLine({
23517
+ lineId: line.id,
23518
+ quantity: line.quantity,
23519
+ customFields
23520
+ });
23521
+ }, value: line.customFields })
23522
+ ] });
23523
+ }
24194
23524
  function EditOrderTable({
24195
23525
  order,
24196
23526
  eligibleShippingMethods,
@@ -24265,28 +23595,7 @@ function EditOrderTable({
24265
23595
  accessorKey: "quantity",
24266
23596
  cell: ({
24267
23597
  row
24268
- }) => {
24269
- return /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
24270
- /* @__PURE__ */ jsx(Input, { type: "number", value: row.original.quantity, min: 0, "data-testid": "order-line-quantity", onChange: (e) => {
24271
- const value = Number.isNaN(e.target.valueAsNumber) ? 0 : e.target.valueAsNumber;
24272
- onAdjustLine({
24273
- lineId: row.original.id,
24274
- quantity: value,
24275
- customFields: row.original.customFields
24276
- });
24277
- } }),
24278
- /* @__PURE__ */ jsx(Button, { variant: "outline", type: "button", size: "icon", disabled: row.original.quantity === 0, onClick: () => onRemoveLine({
24279
- lineId: row.original.id
24280
- }), children: /* @__PURE__ */ jsx(Trash2, {}) }),
24281
- row.original.customFields && /* @__PURE__ */ jsx(OrderLineCustomFieldsForm, { onUpdate: (customFields) => {
24282
- onAdjustLine({
24283
- lineId: row.original.id,
24284
- quantity: row.original.quantity,
24285
- customFields
24286
- });
24287
- }, value: row.original.customFields })
24288
- ] });
24289
- }
23598
+ }) => /* @__PURE__ */ jsx(QuantityCell, { line: row.original, onAdjustLine, onRemoveLine })
24290
23599
  }, {
24291
23600
  header: _t(
24292
23601
  /*i18n*/