@pisell/private-materials 6.12.168 → 6.12.170
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +10 -10
- package/es/components/HDLKiosk/{contracts → app/contracts}/config.js +1 -1
- package/es/components/HDLKiosk/app/manifest.js +11 -11
- package/es/components/HDLKiosk/app/operations.js +92 -0
- package/es/components/HDLKiosk/app/workflow/barcode.js +7 -3
- package/es/components/HDLKiosk/app/workflow/index.js +16 -0
- package/es/components/HDLKiosk/app/workflow/predicates.js +1 -1
- package/es/components/HDLKiosk/app/workflow/quick.js +1 -1
- package/es/components/HDLKiosk/app/workflow/registry.js +4 -4
- package/es/components/HDLKiosk/app/workflow/scale.js +5 -1
- package/es/components/HDLKiosk/components/common/HDLKioskSkuOptionsSelection/index.less +1 -1
- package/es/components/HDLKiosk/components/overlays/HDLKioskModal/index.less +1 -1
- package/es/components/HDLKiosk/components/shell/HDLKioskBottomBarHost/index.js +4 -1
- package/es/components/HDLKiosk/docs/00-/346/226/207/344/273/266/345/257/274/350/210/252.md +104 -167
- package/es/components/HDLKiosk/docs/01-/346/240/270/345/277/203/350/277/220/350/241/214/346/234/272/345/210/266.md +95 -89
- package/es/components/HDLKiosk/docs/02-Host/351/200/202/351/205/215/344/270/216/344/270/232/345/212/241/346/225/260/346/215/256.md +20 -19
- package/es/components/HDLKiosk/docs/04-/350/256/276/345/244/207/344/270/216/347/247/260/351/207/215.md +43 -26
- package/es/components/HDLKiosk/docs/05-/344/272/244/346/230/223/345/256/211/345/205/250.md +2 -0
- package/es/components/HDLKiosk/docs/08-/346/227/240/345/244/264Application/350/277/220/350/241/214/346/227/266/351/207/215/346/236/204/350/256/276/350/256/241.md +719 -0
- package/es/components/HDLKiosk/docs/09-Entry/350/256/276/345/244/207/344/272/213/344/273/266/351/207/215/346/236/204/344/277/256/345/244/215/346/212/245/345/221/212.md +187 -0
- package/es/components/HDLKiosk/docs/README.md +6 -2
- package/es/components/HDLKiosk/docs//345/256/236/346/226/275/350/277/233/345/272/246.md +8 -7
- package/es/components/HDLKiosk/docs//346/236/266/346/236/204/350/256/276/350/256/241.md +16 -18
- package/es/components/HDLKiosk/index.js +32 -30
- package/es/components/HDLKiosk/index.less +8 -3
- package/es/components/HDLKiosk/kernel/README.md +13 -12
- package/es/components/HDLKiosk/kernel/application/defineApplication.js +63 -24
- package/es/components/HDLKiosk/kernel/application/defineSlice.js +6 -6
- package/es/components/HDLKiosk/kernel/application/runtime.js +237 -0
- package/es/components/HDLKiosk/kernel/operations/coordinator.js +1 -1
- package/es/components/HDLKiosk/kernel/operations/registry.js +3 -3
- package/es/components/HDLKiosk/kernel/operations/sessionEpoch.js +1 -1
- package/es/components/HDLKiosk/kernel/operations/types.js +7 -3
- package/es/components/HDLKiosk/kernel/workflow/actor.js +16 -17
- package/es/components/HDLKiosk/kernel/workflow/compiler.js +14 -16
- package/es/components/HDLKiosk/runtime/createRuntime.js +238 -0
- package/es/components/HDLKiosk/{devices → runtime/devices}/dedupeStore.js +1 -1
- package/es/components/HDLKiosk/{devices → runtime/devices}/scaleIngress.js +1 -1
- package/es/components/HDLKiosk/{devices/scale/runtime.js → runtime/devices/scaleStore.js} +18 -24
- package/es/components/HDLKiosk/{devices → runtime/devices}/scannerIngress.js +1 -1
- package/es/components/HDLKiosk/runtime/devices/scannerSessionPort.js +60 -0
- package/es/components/HDLKiosk/runtime/devices/scannerSessionRouter.js +212 -0
- package/es/components/HDLKiosk/runtime/operations/barcode.js +18 -0
- package/es/components/HDLKiosk/runtime/operations/cart.js +44 -0
- package/es/components/HDLKiosk/{app → runtime}/operations/cartConsistency.js +1 -1
- package/es/components/HDLKiosk/{app → runtime}/operations/checkout.js +95 -110
- package/es/components/HDLKiosk/{app → runtime}/operations/checkoutRequirements.js +1 -1
- package/es/components/HDLKiosk/{app → runtime}/operations/checkoutSafety.js +1 -1
- package/es/components/HDLKiosk/{app → runtime}/operations/coordinator.js +2 -2
- package/es/components/HDLKiosk/runtime/operations/customization.js +70 -0
- package/es/components/HDLKiosk/{app → runtime}/operations/errors.js +1 -1
- package/es/components/HDLKiosk/runtime/operations/fulfillment.js +6 -0
- package/es/components/HDLKiosk/runtime/operations/identity.js +55 -0
- package/es/components/HDLKiosk/runtime/operations/registry.js +34 -0
- package/es/components/HDLKiosk/runtime/operations/session.js +29 -0
- package/es/components/HDLKiosk/runtime/operations/types.js +13 -0
- package/es/components/HDLKiosk/runtime/session/blockPolicy.js +14 -0
- package/es/components/HDLKiosk/runtime/{createWorkflowSession.js → session/createSession.js} +67 -17
- package/es/components/HDLKiosk/runtime/{domainTransitionRunner.js → session/transitionRunner.js} +10 -5
- package/es/components/HDLKiosk/runtime/{workflowContext.js → session/workflowContext.js} +2 -2
- package/es/components/HDLKiosk/runtime/{workflowLifecycle.js → session/workflowLifecycle.js} +2 -2
- package/es/components/HDLKiosk/runtime/triggers.js +28 -0
- package/es/components/HDLKiosk/slices/catalog/Screen/index.js +15 -8
- package/es/components/HDLKiosk/slices/catalog/Screen/index.less +74 -13
- package/es/components/HDLKiosk/slices/catalog/slice.js +2 -2
- package/es/components/HDLKiosk/slices/customization/Screen/index.js +34 -35
- package/es/components/HDLKiosk/slices/customization/Screen/index.less +5 -0
- package/es/components/HDLKiosk/slices/customization/slice.js +2 -3
- package/es/components/HDLKiosk/slices/fulfillment/slice.js +2 -2
- package/es/components/HDLKiosk/slices/fulfillment/view.js +1 -1
- package/es/components/HDLKiosk/slices/identity/Screen/index.less +1 -1
- package/es/components/HDLKiosk/slices/identity/slice.js +2 -2
- package/es/components/HDLKiosk/slices/identity/view.js +1 -1
- package/es/components/HDLKiosk/slices/payment/Screen/index.less +1 -1
- package/es/components/HDLKiosk/slices/payment/slice.js +3 -3
- package/es/components/HDLKiosk/slices/primaryProductPrompt/slice.js +1 -1
- package/es/components/HDLKiosk/{runtime → ui}/HDLKioskWorkflowView.js +68 -129
- package/es/components/HDLKiosk/ui/ScaleSimulatorConsole/index.js +387 -0
- package/es/components/HDLKiosk/ui/ScaleSimulatorConsole/index.less +621 -0
- package/es/components/HDLKiosk/{app → ui}/ScreenRenderer.js +1 -1
- package/es/components/HDLKiosk/ui/collaborationStatus.js +11 -0
- package/es/components/HDLKiosk/ui/controllers/useHDLKioskActionDispatcher.js +66 -0
- package/es/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskCustomerController.js +1 -1
- package/es/components/HDLKiosk/ui/controllers/useHDLKioskDeviceController.js +25 -0
- package/es/components/HDLKiosk/ui/controllers/useHDLKioskExitController.js +53 -0
- package/es/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskScreenData.js +1 -1
- package/es/components/HDLKiosk/ui/controllers/useHDLKioskSessionController.js +39 -0
- package/es/components/HDLKiosk/{app → ui}/entry/Screen/index.js +8 -6
- package/es/components/HDLKiosk/{app → ui}/entry/model.js +2 -2
- package/es/components/HDLKiosk/ui/scale.js +20 -0
- package/es/components/HDLKiosk/{runtime/useHostSnapshot.js → ui/snapshots.js} +6 -8
- package/es/components/HDLKiosk/{app → ui}/views.js +1 -1
- package/es/components/HDLKiosk/{runtime → ui}/workflowEvent.js +1 -1
- package/es/components/HDLKiosk/utils.js +4 -4
- package/es/components/bigSale/templates/HDLKiosk/README.md +43 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/createHost.js +7 -7
- package/es/components/bigSale/templates/HDLKiosk/adapter/{devices.js → devices/devicePort.js} +10 -38
- package/es/components/bigSale/templates/HDLKiosk/adapter/{capabilities.js → host/capabilities.js} +2 -2
- package/es/components/bigSale/templates/HDLKiosk/adapter/{fulfillment.js → host/fulfillmentWriter.js} +3 -3
- package/es/components/bigSale/templates/HDLKiosk/adapter/{projection.js → host/projection.js} +24 -14
- package/es/components/bigSale/templates/HDLKiosk/adapter/{telemetry.js → host/telemetry.js} +1 -1
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/cart.js +187 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/catalog.js +160 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/{customizationProduct.js → sales/customizationProduct.js} +3 -3
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/fulfillment.js +31 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/identity.js +57 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/index.js +18 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/payment.js +123 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/session.js +71 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/weightedOperations.js +124 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/{weightedProduct.js → sales/weightedProduct.js} +2 -2
- package/es/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskAdapter.js +41 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskHost.js +10 -7
- package/es/components/bigSale/templates/HDLKiosk/cart/useBigSaleHDLKioskCart.js +122 -0
- package/es/components/bigSale/templates/HDLKiosk/{adapter → hooks}/useHDLKioskEntryPreparationToast.js +2 -1
- package/es/components/bigSale/templates/HDLKiosk/index.js +42 -148
- package/es/components/bigSale/templates/HDLKiosk/{adapter/scaleTrigger.js → runtime/BigSaleScaleRuntimeOwner.js} +33 -62
- package/es/components/bigSale/templates/HDLKiosk/{adapter → runtime}/HDLKioskPaymentRuntime.js +4 -3
- package/es/components/bigSale/templates/HDLKiosk/runtime/scaleBridge.js +44 -0
- package/lib/components/HDLKiosk/{contracts → app/contracts}/config.js +1 -1
- package/lib/components/HDLKiosk/app/manifest.js +18 -19
- package/lib/components/HDLKiosk/app/operations.js +105 -0
- package/lib/components/HDLKiosk/app/workflow/barcode.js +7 -3
- package/lib/components/HDLKiosk/app/workflow/index.js +16 -0
- package/lib/components/HDLKiosk/app/workflow/predicates.js +1 -0
- package/lib/components/HDLKiosk/app/workflow/quick.js +1 -1
- package/lib/components/HDLKiosk/app/workflow/registry.js +3 -3
- package/lib/components/HDLKiosk/app/workflow/scale.js +5 -1
- package/lib/components/HDLKiosk/components/common/HDLKioskSkuOptionsSelection/index.less +1 -1
- package/lib/components/HDLKiosk/components/overlays/HDLKioskModal/index.less +1 -1
- package/lib/components/HDLKiosk/components/shell/HDLKioskBottomBarHost/index.js +4 -1
- package/lib/components/HDLKiosk/docs/00-/346/226/207/344/273/266/345/257/274/350/210/252.md +104 -167
- package/lib/components/HDLKiosk/docs/01-/346/240/270/345/277/203/350/277/220/350/241/214/346/234/272/345/210/266.md +95 -89
- package/lib/components/HDLKiosk/docs/02-Host/351/200/202/351/205/215/344/270/216/344/270/232/345/212/241/346/225/260/346/215/256.md +20 -19
- package/lib/components/HDLKiosk/docs/04-/350/256/276/345/244/207/344/270/216/347/247/260/351/207/215.md +43 -26
- package/lib/components/HDLKiosk/docs/05-/344/272/244/346/230/223/345/256/211/345/205/250.md +2 -0
- package/lib/components/HDLKiosk/docs/08-/346/227/240/345/244/264Application/350/277/220/350/241/214/346/227/266/351/207/215/346/236/204/350/256/276/350/256/241.md +719 -0
- package/lib/components/HDLKiosk/docs/09-Entry/350/256/276/345/244/207/344/272/213/344/273/266/351/207/215/346/236/204/344/277/256/345/244/215/346/212/245/345/221/212.md +187 -0
- package/lib/components/HDLKiosk/docs/README.md +6 -2
- package/lib/components/HDLKiosk/docs//345/256/236/346/226/275/350/277/233/345/272/246.md +8 -7
- package/lib/components/HDLKiosk/docs//346/236/266/346/236/204/350/256/276/350/256/241.md +16 -18
- package/lib/components/HDLKiosk/index.js +35 -33
- package/lib/components/HDLKiosk/index.less +8 -3
- package/lib/components/HDLKiosk/kernel/README.md +13 -12
- package/lib/components/HDLKiosk/kernel/application/defineApplication.js +65 -25
- package/lib/components/HDLKiosk/kernel/application/defineSlice.js +6 -6
- package/lib/components/HDLKiosk/kernel/application/runtime.js +237 -0
- package/lib/components/HDLKiosk/kernel/operations/coordinator.js +1 -1
- package/lib/components/HDLKiosk/kernel/operations/registry.js +3 -3
- package/lib/components/HDLKiosk/kernel/operations/sessionEpoch.js +1 -1
- package/lib/components/HDLKiosk/kernel/operations/types.js +8 -3
- package/lib/components/HDLKiosk/kernel/workflow/actor.js +16 -17
- package/lib/components/HDLKiosk/kernel/workflow/compiler.js +14 -16
- package/lib/components/HDLKiosk/runtime/createRuntime.js +239 -0
- package/lib/components/HDLKiosk/{devices → runtime/devices}/dedupeStore.js +1 -1
- package/lib/components/HDLKiosk/{devices → runtime/devices}/scaleIngress.js +1 -1
- package/lib/components/HDLKiosk/{devices/scale/runtime.js → runtime/devices/scaleStore.js} +17 -27
- package/lib/components/HDLKiosk/{devices → runtime/devices}/scannerIngress.js +1 -1
- package/lib/components/HDLKiosk/runtime/devices/scannerSessionPort.js +60 -0
- package/lib/components/HDLKiosk/runtime/devices/scannerSessionRouter.js +212 -0
- package/lib/components/HDLKiosk/runtime/operations/barcode.js +17 -0
- package/lib/components/HDLKiosk/runtime/operations/cart.js +46 -0
- package/lib/components/HDLKiosk/{app → runtime}/operations/cartConsistency.js +1 -1
- package/lib/components/HDLKiosk/{app → runtime}/operations/checkout.js +97 -112
- package/lib/components/HDLKiosk/{app → runtime}/operations/checkoutRequirements.js +1 -1
- package/lib/components/HDLKiosk/{app → runtime}/operations/checkoutSafety.js +1 -1
- package/lib/components/HDLKiosk/{app → runtime}/operations/coordinator.js +2 -2
- package/lib/components/HDLKiosk/runtime/operations/customization.js +73 -0
- package/lib/components/HDLKiosk/{app → runtime}/operations/errors.js +1 -1
- package/lib/components/HDLKiosk/runtime/operations/fulfillment.js +5 -0
- package/lib/components/HDLKiosk/runtime/operations/identity.js +55 -0
- package/lib/components/HDLKiosk/runtime/operations/registry.js +34 -0
- package/lib/components/HDLKiosk/runtime/operations/session.js +30 -0
- package/lib/components/HDLKiosk/runtime/operations/types.js +14 -0
- package/lib/components/HDLKiosk/runtime/session/blockPolicy.js +14 -0
- package/lib/components/HDLKiosk/runtime/{createWorkflowSession.js → session/createSession.js} +71 -21
- package/lib/components/HDLKiosk/runtime/{domainTransitionRunner.js → session/transitionRunner.js} +10 -5
- package/lib/components/HDLKiosk/runtime/{workflowContext.js → session/workflowContext.js} +2 -2
- package/lib/components/HDLKiosk/runtime/{workflowLifecycle.js → session/workflowLifecycle.js} +2 -2
- package/lib/components/HDLKiosk/runtime/triggers.js +28 -0
- package/lib/components/HDLKiosk/slices/catalog/Screen/index.js +15 -8
- package/lib/components/HDLKiosk/slices/catalog/Screen/index.less +74 -13
- package/lib/components/HDLKiosk/slices/catalog/slice.js +3 -3
- package/lib/components/HDLKiosk/slices/customization/Screen/index.js +35 -36
- package/lib/components/HDLKiosk/slices/customization/Screen/index.less +5 -0
- package/lib/components/HDLKiosk/slices/customization/slice.js +5 -6
- package/lib/components/HDLKiosk/slices/fulfillment/slice.js +3 -3
- package/lib/components/HDLKiosk/slices/fulfillment/view.js +1 -1
- package/lib/components/HDLKiosk/slices/identity/Screen/index.less +1 -1
- package/lib/components/HDLKiosk/slices/identity/slice.js +4 -4
- package/lib/components/HDLKiosk/slices/identity/view.js +1 -1
- package/lib/components/HDLKiosk/slices/payment/Screen/index.less +1 -1
- package/lib/components/HDLKiosk/slices/payment/slice.js +5 -5
- package/lib/components/HDLKiosk/slices/primaryProductPrompt/slice.js +1 -1
- package/lib/components/HDLKiosk/{runtime → ui}/HDLKioskWorkflowView.js +69 -130
- package/lib/components/HDLKiosk/ui/ScaleSimulatorConsole/index.js +390 -0
- package/lib/components/HDLKiosk/ui/ScaleSimulatorConsole/index.less +621 -0
- package/lib/components/HDLKiosk/{app → ui}/ScreenRenderer.js +1 -1
- package/lib/components/HDLKiosk/ui/collaborationStatus.js +11 -0
- package/lib/components/HDLKiosk/ui/controllers/useHDLKioskActionDispatcher.js +67 -0
- package/lib/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskCustomerController.js +1 -1
- package/lib/components/HDLKiosk/ui/controllers/useHDLKioskDeviceController.js +26 -0
- package/lib/components/HDLKiosk/ui/controllers/useHDLKioskExitController.js +54 -0
- package/lib/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskScreenData.js +1 -1
- package/lib/components/HDLKiosk/ui/controllers/useHDLKioskSessionController.js +40 -0
- package/lib/components/HDLKiosk/{app → ui}/entry/Screen/index.js +8 -6
- package/lib/components/HDLKiosk/{app → ui}/entry/model.js +2 -2
- package/lib/components/HDLKiosk/ui/scale.js +24 -0
- package/lib/components/HDLKiosk/{runtime/useHostSnapshot.js → ui/snapshots.js} +6 -7
- package/lib/components/HDLKiosk/{app → ui}/views.js +1 -1
- package/lib/components/HDLKiosk/{runtime → ui}/workflowEvent.js +1 -1
- package/lib/components/HDLKiosk/utils.js +4 -4
- package/lib/components/bigSale/templates/HDLKiosk/README.md +43 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/createHost.js +9 -9
- package/lib/components/bigSale/templates/HDLKiosk/adapter/{devices.js → devices/devicePort.js} +10 -38
- package/lib/components/bigSale/templates/HDLKiosk/adapter/{capabilities.js → host/capabilities.js} +2 -2
- package/lib/components/bigSale/templates/HDLKiosk/adapter/{fulfillment.js → host/fulfillmentWriter.js} +3 -3
- package/lib/components/bigSale/templates/HDLKiosk/adapter/{projection.js → host/projection.js} +25 -14
- package/lib/components/bigSale/templates/HDLKiosk/adapter/{telemetry.js → host/telemetry.js} +1 -1
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/cart.js +189 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/catalog.js +162 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/{customizationProduct.js → sales/customizationProduct.js} +4 -4
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/fulfillment.js +31 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/identity.js +57 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/index.js +18 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/payment.js +123 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/session.js +71 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/weightedOperations.js +126 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/{weightedProduct.js → sales/weightedProduct.js} +3 -3
- package/lib/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskAdapter.js +42 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskHost.js +10 -7
- package/lib/components/bigSale/templates/HDLKiosk/cart/useBigSaleHDLKioskCart.js +124 -0
- package/lib/components/bigSale/templates/HDLKiosk/{adapter → hooks}/useHDLKioskEntryPreparationToast.js +2 -1
- package/lib/components/bigSale/templates/HDLKiosk/index.js +43 -149
- package/lib/components/bigSale/templates/HDLKiosk/{adapter/scaleTrigger.js → runtime/BigSaleScaleRuntimeOwner.js} +31 -61
- package/lib/components/bigSale/templates/HDLKiosk/{adapter → runtime}/HDLKioskPaymentRuntime.js +4 -3
- package/lib/components/bigSale/templates/HDLKiosk/runtime/scaleBridge.js +44 -0
- package/package.json +2 -2
- package/es/components/HDLKiosk/app/constants.js +0 -9
- package/es/components/HDLKiosk/app/operations/barcode.js +0 -22
- package/es/components/HDLKiosk/app/operations/cart.js +0 -60
- package/es/components/HDLKiosk/app/operations/fulfillment.js +0 -11
- package/es/components/HDLKiosk/app/operations/session.js +0 -41
- package/es/components/HDLKiosk/app/operations/types.js +0 -11
- package/es/components/HDLKiosk/devices/entryArbiter.js +0 -33
- package/es/components/HDLKiosk/runtime/controllers/useHDLKioskDeviceController.js +0 -75
- package/es/components/HDLKiosk/runtime/controllers/useHDLKioskScannerController.js +0 -160
- package/es/components/HDLKiosk/runtime/controllers/useHDLKioskSessionController.js +0 -185
- package/es/components/HDLKiosk/runtime/useWorkflowSnapshot.js +0 -12
- package/es/components/HDLKiosk/slices/customization/operation.js +0 -80
- package/es/components/HDLKiosk/slices/identity/operation.js +0 -60
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales.js +0 -692
- package/lib/components/HDLKiosk/app/constants.js +0 -9
- package/lib/components/HDLKiosk/app/operations/barcode.js +0 -21
- package/lib/components/HDLKiosk/app/operations/cart.js +0 -62
- package/lib/components/HDLKiosk/app/operations/fulfillment.js +0 -10
- package/lib/components/HDLKiosk/app/operations/session.js +0 -42
- package/lib/components/HDLKiosk/app/operations/types.js +0 -12
- package/lib/components/HDLKiosk/devices/entryArbiter.js +0 -33
- package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskDeviceController.js +0 -76
- package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskScannerController.js +0 -161
- package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskSessionController.js +0 -186
- package/lib/components/HDLKiosk/runtime/useWorkflowSnapshot.js +0 -13
- package/lib/components/HDLKiosk/slices/customization/operation.js +0 -83
- package/lib/components/HDLKiosk/slices/identity/operation.js +0 -60
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales.js +0 -694
- /package/es/components/HDLKiosk/{app → ui}/entry/Screen/index.less +0 -0
- /package/lib/components/HDLKiosk/{app → ui}/entry/Screen/index.less +0 -0
|
@@ -1,692 +0,0 @@
|
|
|
1
|
-
import { _objectSpread2 } from "../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
|
-
import { _asyncToGenerator } from "../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
|
|
3
|
-
import { resolveProductPricePresentation } from "../../../../../plus/productSelect/pricing/pricePresentation.js";
|
|
4
|
-
import { buildProductSkuPatch, resolvePatchProductOptions } from "../../../../../plus/salesSdk/utils/productSkuOptions.js";
|
|
5
|
-
import { pickIdentity } from "../../../../../plus/salesSdk/utils/identity.js";
|
|
6
|
-
import { buildProductLineUpdates } from "../../../../../plus/salesSdk/utils/buildProductLineUpdates.js";
|
|
7
|
-
import { resolveHDLWeightedProduct } from "../../../../HDLKiosk/product.js";
|
|
8
|
-
import { projectBigSaleCartLine, resolveBigSaleLineId } from "./projection.js";
|
|
9
|
-
import { failed, isRecord, partialFailure, readPath, unknown } from "./normalize.js";
|
|
10
|
-
import { createHDLPrimaryWeightedPreparedProduct } from "./customizationProduct.js";
|
|
11
|
-
import Decimal from "decimal.js";
|
|
12
|
-
//#region src/components/bigSale/templates/HDLKiosk/adapter/sales.ts
|
|
13
|
-
/**
|
|
14
|
-
* 文件角色:实现 HDLSalesPort 到 BigSale/SalesSDK 的全部命令和商品查询映射。
|
|
15
|
-
* 运行机制:对接 queryProducts、OS add flow、购物车、客户、Summary、Checkout、
|
|
16
|
-
* reset,并把 writer 返回投影成最小 receipt 供 Core 写后验证。
|
|
17
|
-
* 边界:复杂 OS 对象止于本文件;模糊 callback、缺 writer 或不可表达商品必须 fail closed。
|
|
18
|
-
*/
|
|
19
|
-
function cancelled(reason) {
|
|
20
|
-
return {
|
|
21
|
-
status: "cancelled",
|
|
22
|
-
reason
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function findCartLine(context, lineId) {
|
|
26
|
-
var _context$cart$display;
|
|
27
|
-
return ((_context$cart$display = context.cart.displayLines) !== null && _context$cart$display !== void 0 ? _context$cart$display : context.cart.items).find((line) => resolveBigSaleLineId(line) === lineId);
|
|
28
|
-
}
|
|
29
|
-
function resolveCartProduct(line) {
|
|
30
|
-
var _line$_extend;
|
|
31
|
-
return "product_id" in line ? line : (_line$_extend = line._extend) === null || _line$_extend === void 0 ? void 0 : _line$_extend.product;
|
|
32
|
-
}
|
|
33
|
-
function hasRequestedWeight(product, requestedWeightKg) {
|
|
34
|
-
var _product$product_sku$, _product$product_sku;
|
|
35
|
-
const actual = new Decimal((_product$product_sku$ = (_product$product_sku = product.product_sku) === null || _product$product_sku === void 0 ? void 0 : _product$product_sku.net_weight) !== null && _product$product_sku$ !== void 0 ? _product$product_sku$ : NaN);
|
|
36
|
-
const expected = new Decimal(requestedWeightKg || NaN);
|
|
37
|
-
return actual.isFinite() && expected.isFinite() && actual.equals(expected);
|
|
38
|
-
}
|
|
39
|
-
function findConfirmedMutationLine(products, productId, requestedWeightKg, uniqueId) {
|
|
40
|
-
return [...products].reverse().find((candidate) => {
|
|
41
|
-
var _candidate$product_id, _candidate$metadata$u, _candidate$metadata;
|
|
42
|
-
if (String((_candidate$product_id = candidate.product_id) !== null && _candidate$product_id !== void 0 ? _candidate$product_id : "") !== productId) return false;
|
|
43
|
-
if (!hasRequestedWeight(candidate, requestedWeightKg)) return false;
|
|
44
|
-
if (uniqueId == null || uniqueId === "") return true;
|
|
45
|
-
return String((_candidate$metadata$u = (_candidate$metadata = candidate.metadata) === null || _candidate$metadata === void 0 ? void 0 : _candidate$metadata.unique_identification_number) !== null && _candidate$metadata$u !== void 0 ? _candidate$metadata$u : "") === String(uniqueId);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
function projectConfirmedMutationLine(product) {
|
|
49
|
-
var _projectBigSaleCartLi;
|
|
50
|
-
return product ? (_projectBigSaleCartLi = projectBigSaleCartLine(product)) !== null && _projectBigSaleCartLi !== void 0 ? _projectBigSaleCartLi : void 0 : void 0;
|
|
51
|
-
}
|
|
52
|
-
function projectConfirmedCartLineById(products, lineId) {
|
|
53
|
-
return projectConfirmedMutationLine(products.find((candidate) => resolveBigSaleLineId(candidate) === lineId));
|
|
54
|
-
}
|
|
55
|
-
function projectConfirmedCustomer(customer) {
|
|
56
|
-
var _customer$id;
|
|
57
|
-
if (!customer || [
|
|
58
|
-
"0",
|
|
59
|
-
"1",
|
|
60
|
-
""
|
|
61
|
-
].includes(String((_customer$id = customer.id) !== null && _customer$id !== void 0 ? _customer$id : ""))) return;
|
|
62
|
-
return Object.freeze(_objectSpread2(_objectSpread2({
|
|
63
|
-
customerId: String(customer.id),
|
|
64
|
-
displayName: typeof customer.name === "string" ? customer.name : void 0
|
|
65
|
-
}, typeof customer.avatar === "string" && customer.avatar.trim() ? { avatarUrl: customer.avatar.trim() } : {}), {}, { member: true }));
|
|
66
|
-
}
|
|
67
|
-
function findOrderProduct(context, product) {
|
|
68
|
-
var _product$_identity, _context$sales$tempOr, _products$find;
|
|
69
|
-
const uniqueId = ((_product$_identity = product._identity) !== null && _product$_identity !== void 0 ? _product$_identity : pickIdentity(product)).unique_identification_number;
|
|
70
|
-
return (_products$find = (((_context$sales$tempOr = context.sales.tempOrder) === null || _context$sales$tempOr === void 0 ? void 0 : _context$sales$tempOr.products) || []).find((candidate) => {
|
|
71
|
-
var _candidate$metadata$u2, _candidate$metadata2;
|
|
72
|
-
return uniqueId != null && String((_candidate$metadata$u2 = (_candidate$metadata2 = candidate.metadata) === null || _candidate$metadata2 === void 0 ? void 0 : _candidate$metadata2.unique_identification_number) !== null && _candidate$metadata$u2 !== void 0 ? _candidate$metadata$u2 : "") === String(uniqueId);
|
|
73
|
-
})) !== null && _products$find !== void 0 ? _products$find : product;
|
|
74
|
-
}
|
|
75
|
-
function findCatalogProduct(context, productId) {
|
|
76
|
-
return context.products.products.find((product) => String(product.id) === productId);
|
|
77
|
-
}
|
|
78
|
-
function resolveProductQuery(context) {
|
|
79
|
-
var _bookingTicket$store;
|
|
80
|
-
if (typeof context.products.queryProducts === "function") return function() {
|
|
81
|
-
var _ref = _asyncToGenerator(function* (params) {
|
|
82
|
-
return (yield context.products.queryProducts.call(context.products, params)) || [];
|
|
83
|
-
});
|
|
84
|
-
return function(_x) {
|
|
85
|
-
return _ref.apply(this, arguments);
|
|
86
|
-
};
|
|
87
|
-
}();
|
|
88
|
-
const bookingTicket = context.sales.bookingTicket;
|
|
89
|
-
if (typeof (bookingTicket === null || bookingTicket === void 0 ? void 0 : bookingTicket.queryProducts) === "function") return function() {
|
|
90
|
-
var _ref2 = _asyncToGenerator(function* (params) {
|
|
91
|
-
return (yield bookingTicket.queryProducts(params)) || [];
|
|
92
|
-
});
|
|
93
|
-
return function(_x2) {
|
|
94
|
-
return _ref2.apply(this, arguments);
|
|
95
|
-
};
|
|
96
|
-
}();
|
|
97
|
-
const productListStore = bookingTicket === null || bookingTicket === void 0 || (_bookingTicket$store = bookingTicket.store) === null || _bookingTicket$store === void 0 ? void 0 : _bookingTicket$store.products;
|
|
98
|
-
if (typeof (productListStore === null || productListStore === void 0 ? void 0 : productListStore.queryProducts) === "function") return function() {
|
|
99
|
-
var _ref3 = _asyncToGenerator(function* (params) {
|
|
100
|
-
return (yield productListStore.queryProducts.call(productListStore, params)) || [];
|
|
101
|
-
});
|
|
102
|
-
return function(_x3) {
|
|
103
|
-
return _ref3.apply(this, arguments);
|
|
104
|
-
};
|
|
105
|
-
}();
|
|
106
|
-
}
|
|
107
|
-
function queryPrimaryProduct(_x4, _x5, _x6) {
|
|
108
|
-
return _queryPrimaryProduct.apply(this, arguments);
|
|
109
|
-
}
|
|
110
|
-
function _queryPrimaryProduct() {
|
|
111
|
-
_queryPrimaryProduct = _asyncToGenerator(function* (context, productId, signal) {
|
|
112
|
-
if (signal.aborted) return { status: "cancelled" };
|
|
113
|
-
const queryProducts = resolveProductQuery(context);
|
|
114
|
-
if (typeof queryProducts !== "function") return failed("primaryProductQueryUnavailable", "staff");
|
|
115
|
-
try {
|
|
116
|
-
let products = yield queryProducts({ includeIds: [productId] });
|
|
117
|
-
if (signal.aborted) return { status: "cancelled" };
|
|
118
|
-
let product = products.find((candidate) => String(candidate.id) === productId);
|
|
119
|
-
const numericProductId = Number(productId);
|
|
120
|
-
if (!product && Number.isSafeInteger(numericProductId) && numericProductId > 0 && typeof context.products.findByIds === "function") {
|
|
121
|
-
yield context.products.findByIds([numericProductId], {
|
|
122
|
-
loadMissing: true,
|
|
123
|
-
refreshCatalog: false
|
|
124
|
-
});
|
|
125
|
-
if (signal.aborted) return { status: "cancelled" };
|
|
126
|
-
products = yield queryProducts({ includeIds: [productId] });
|
|
127
|
-
if (signal.aborted) return { status: "cancelled" };
|
|
128
|
-
product = products.find((candidate) => String(candidate.id) === productId);
|
|
129
|
-
}
|
|
130
|
-
return product ? {
|
|
131
|
-
status: "succeeded",
|
|
132
|
-
data: product
|
|
133
|
-
} : failed("primaryProductNotFound", "staff");
|
|
134
|
-
} catch (error) {
|
|
135
|
-
return partialFailure("primaryProductQueryFailed", error);
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
return _queryPrimaryProduct.apply(this, arguments);
|
|
139
|
-
}
|
|
140
|
-
function readProductName(product) {
|
|
141
|
-
const rawName = product.title;
|
|
142
|
-
if (typeof rawName === "string") return rawName || void 0;
|
|
143
|
-
if (!rawName || typeof rawName !== "object") return void 0;
|
|
144
|
-
return Object.values(rawName).find((value) => typeof value === "string" && value.length > 0);
|
|
145
|
-
}
|
|
146
|
-
function readLocalizedText(value) {
|
|
147
|
-
if (typeof value === "string") return value || void 0;
|
|
148
|
-
if (!value || typeof value !== "object") return void 0;
|
|
149
|
-
return Object.values(value).find((item) => typeof item === "string" && item.length > 0);
|
|
150
|
-
}
|
|
151
|
-
function projectProductCategories(product) {
|
|
152
|
-
const directCategories = Array.isArray(product.category) ? product.category : [];
|
|
153
|
-
const categories = /* @__PURE__ */ new Map();
|
|
154
|
-
const visit = (category, direct) => {
|
|
155
|
-
var _category$name, _ref4, _category$parent_id;
|
|
156
|
-
if (!category || category.id === void 0 || category.id === null) return;
|
|
157
|
-
const parent = category.parent_category;
|
|
158
|
-
visit(parent, false);
|
|
159
|
-
const categoryId = String(category.id);
|
|
160
|
-
const name = readLocalizedText((_category$name = category.name) !== null && _category$name !== void 0 ? _category$name : category.title);
|
|
161
|
-
if (!name) return;
|
|
162
|
-
const parentId = (_ref4 = (_category$parent_id = category.parent_id) !== null && _category$parent_id !== void 0 ? _category$parent_id : parent === null || parent === void 0 ? void 0 : parent.id) !== null && _ref4 !== void 0 ? _ref4 : void 0;
|
|
163
|
-
const previous = categories.get(categoryId);
|
|
164
|
-
categories.set(categoryId, Object.freeze({
|
|
165
|
-
categoryId,
|
|
166
|
-
name,
|
|
167
|
-
parentId: parentId === void 0 || parentId === null || parentId === 0 ? void 0 : String(parentId),
|
|
168
|
-
sort: Number.isFinite(Number(category.sort)) ? Number(category.sort) : void 0,
|
|
169
|
-
direct: direct || (previous === null || previous === void 0 ? void 0 : previous.direct) === true
|
|
170
|
-
}));
|
|
171
|
-
};
|
|
172
|
-
directCategories.forEach((category) => visit(category, true));
|
|
173
|
-
return Object.freeze(Array.from(categories.values()));
|
|
174
|
-
}
|
|
175
|
-
function projectCatalogProduct(product, currency, currencySymbol) {
|
|
176
|
-
var _ref5, _ref6, _product$price, _product$variants, _product$variants2;
|
|
177
|
-
const name = readProductName(product);
|
|
178
|
-
if (!name) return void 0;
|
|
179
|
-
const rawPrice = (_ref5 = (_ref6 = (_product$price = product.price) !== null && _product$price !== void 0 ? _product$price : product.selling_price) !== null && _ref6 !== void 0 ? _ref6 : (_product$variants = product.variants) === null || _product$variants === void 0 || (_product$variants = _product$variants[0]) === null || _product$variants === void 0 ? void 0 : _product$variants.selling_price) !== null && _ref5 !== void 0 ? _ref5 : (_product$variants2 = product.variants) === null || _product$variants2 === void 0 || (_product$variants2 = _product$variants2[0]) === null || _product$variants2 === void 0 ? void 0 : _product$variants2.price;
|
|
180
|
-
const pricePresentation = resolveProductPricePresentation(product, rawPrice === void 0 || rawPrice === null ? void 0 : { price: rawPrice });
|
|
181
|
-
const categories = projectProductCategories(product);
|
|
182
|
-
return Object.freeze(_objectSpread2({
|
|
183
|
-
productId: String(product.id),
|
|
184
|
-
name,
|
|
185
|
-
imageUrl: product.cover || void 0,
|
|
186
|
-
currency: currency || void 0,
|
|
187
|
-
currencySymbol: currencySymbol || void 0,
|
|
188
|
-
pricePresentation: pricePresentation ? Object.freeze({
|
|
189
|
-
amount: String(pricePresentation.amount),
|
|
190
|
-
originalAmount: pricePresentation.originalAmount === void 0 ? void 0 : String(pricePresentation.originalAmount),
|
|
191
|
-
qualifier: pricePresentation.qualifier,
|
|
192
|
-
unit: pricePresentation.unit,
|
|
193
|
-
precision: pricePresentation.precision
|
|
194
|
-
}) : void 0,
|
|
195
|
-
available: product.status !== "disabled" && product.status !== "sold_out" && product.is_sold_out !== true
|
|
196
|
-
}, categories.length ? { categories } : {}));
|
|
197
|
-
}
|
|
198
|
-
function normalizeCheckoutResult(result, snapshot) {
|
|
199
|
-
var _readPath;
|
|
200
|
-
const status = isRecord(result) ? result.status : void 0;
|
|
201
|
-
const reason = isRecord(result) ? result.reason : void 0;
|
|
202
|
-
const type = isRecord(result) ? result.type : void 0;
|
|
203
|
-
if (status === "cancelled" || reason === "back" || reason === "cancel") return {
|
|
204
|
-
status: "cancelled",
|
|
205
|
-
reason: String(reason !== null && reason !== void 0 ? reason : "cancelled")
|
|
206
|
-
};
|
|
207
|
-
const paymentStatus = (_readPath = readPath(result, [
|
|
208
|
-
"payload",
|
|
209
|
-
"paymentResult",
|
|
210
|
-
"paymentResultViewModel",
|
|
211
|
-
"status"
|
|
212
|
-
])) !== null && _readPath !== void 0 ? _readPath : readPath(result, [
|
|
213
|
-
"data",
|
|
214
|
-
"paymentResult",
|
|
215
|
-
"paymentResultViewModel",
|
|
216
|
-
"status"
|
|
217
|
-
]);
|
|
218
|
-
if (paymentStatus === "failed" || paymentStatus === "wallet-pass-failed") return failed("checkoutFailed", "retry");
|
|
219
|
-
if (type === "error" || status === "failed") return failed("checkoutFailed", "retry");
|
|
220
|
-
if (paymentStatus === "success" || paymentStatus === "paid" || paymentStatus === "deposit-paid" || status === "success" || status === "paid") {
|
|
221
|
-
var _result$orderId, _snapshot$orderId, _snapshot$customer;
|
|
222
|
-
const resultOrderId = isRecord(result) && ((_result$orderId = result.orderId) !== null && _result$orderId !== void 0 ? _result$orderId : result.order_id) || readPath(result, ["payload", "order_id"]) || readPath(result, ["payload", "orderId"]);
|
|
223
|
-
const orderId = (_snapshot$orderId = snapshot.orderId) !== null && _snapshot$orderId !== void 0 ? _snapshot$orderId : resultOrderId;
|
|
224
|
-
if (!orderId || snapshot.summary.status !== "ready") return unknown("checkoutSuccessMissingOrderFacts");
|
|
225
|
-
return {
|
|
226
|
-
status: "succeeded",
|
|
227
|
-
data: {
|
|
228
|
-
orderId: String(orderId),
|
|
229
|
-
amount: snapshot.summary.due,
|
|
230
|
-
member: ((_snapshot$customer = snapshot.customer) === null || _snapshot$customer === void 0 ? void 0 : _snapshot$customer.member) === true
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
return unknown("checkoutResultAmbiguous");
|
|
235
|
-
}
|
|
236
|
-
function refreshCheckoutOrderProjection(_x7, _x8, _x9) {
|
|
237
|
-
return _refreshCheckoutOrderProjection.apply(this, arguments);
|
|
238
|
-
}
|
|
239
|
-
function _refreshCheckoutOrderProjection() {
|
|
240
|
-
_refreshCheckoutOrderProjection = _asyncToGenerator(function* (getContext, getSnapshot, result) {
|
|
241
|
-
if (result.status !== "succeeded" || getSnapshot().pickupNumber) return;
|
|
242
|
-
const loadDetail = getContext().sales.loadDetail;
|
|
243
|
-
if (typeof loadDetail !== "function") return;
|
|
244
|
-
try {
|
|
245
|
-
yield loadDetail({
|
|
246
|
-
orderId: result.data.orderId,
|
|
247
|
-
forceRemote: true
|
|
248
|
-
});
|
|
249
|
-
} catch (_unused) {}
|
|
250
|
-
});
|
|
251
|
-
return _refreshCheckoutOrderProjection.apply(this, arguments);
|
|
252
|
-
}
|
|
253
|
-
function createBigSaleSalesPort({ getContext, getSnapshot, executeScan, writeFulfillment, getWriteFulfillment, getAuthenticatedCustomer, allowSimulatedFulfillment = false, onSimulatedFulfillment, subscribeProjection, getPaymentController }) {
|
|
254
|
-
return {
|
|
255
|
-
getObservedSnapshot: getSnapshot,
|
|
256
|
-
getCatalogSnapshot: () => {
|
|
257
|
-
var _context$sales$tempOr2, _context$sales$tempOr3, _context$sales$tempOr4, _context$sales$tempOr5;
|
|
258
|
-
const context = getContext();
|
|
259
|
-
const currency = String((_context$sales$tempOr2 = (_context$sales$tempOr3 = context.sales.tempOrder) === null || _context$sales$tempOr3 === void 0 ? void 0 : _context$sales$tempOr3.currency_code) !== null && _context$sales$tempOr2 !== void 0 ? _context$sales$tempOr2 : "");
|
|
260
|
-
const currencySymbol = String((_context$sales$tempOr4 = (_context$sales$tempOr5 = context.sales.tempOrder) === null || _context$sales$tempOr5 === void 0 ? void 0 : _context$sales$tempOr5.currency_symbol) !== null && _context$sales$tempOr4 !== void 0 ? _context$sales$tempOr4 : "");
|
|
261
|
-
const products = context.products.products.map((product) => projectCatalogProduct(product, currency, currencySymbol)).filter((product) => product !== void 0);
|
|
262
|
-
return Object.freeze({
|
|
263
|
-
status: context.products.error ? "error" : context.products.loading || context.sales.catalogState === "pending" ? "loading" : "ready",
|
|
264
|
-
products: Object.freeze(products)
|
|
265
|
-
});
|
|
266
|
-
},
|
|
267
|
-
subscribe: (listener) => {
|
|
268
|
-
var _subscribeProjection;
|
|
269
|
-
return (_subscribeProjection = subscribeProjection === null || subscribeProjection === void 0 ? void 0 : subscribeProjection(listener)) !== null && _subscribeProjection !== void 0 ? _subscribeProjection : (() => void 0);
|
|
270
|
-
},
|
|
271
|
-
ensureSession: function() {
|
|
272
|
-
var _ref7 = _asyncToGenerator(function* (signal) {
|
|
273
|
-
if (signal.aborted) return { status: "cancelled" };
|
|
274
|
-
const context = getContext();
|
|
275
|
-
if (context.sales.tempOrder) return {
|
|
276
|
-
status: "succeeded",
|
|
277
|
-
data: void 0
|
|
278
|
-
};
|
|
279
|
-
try {
|
|
280
|
-
yield context.sales.createNew();
|
|
281
|
-
if (signal.aborted) return unknown("ensureSessionAbortedAfterDispatch");
|
|
282
|
-
return {
|
|
283
|
-
status: "succeeded",
|
|
284
|
-
data: void 0
|
|
285
|
-
};
|
|
286
|
-
} catch (error) {
|
|
287
|
-
return partialFailure("ensureSessionFailed", error);
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
return function ensureSession(_x10) {
|
|
291
|
-
return _ref7.apply(this, arguments);
|
|
292
|
-
};
|
|
293
|
-
}(),
|
|
294
|
-
loadPrimaryProduct: function() {
|
|
295
|
-
var _ref8 = _asyncToGenerator(function* (rawProductId, signal) {
|
|
296
|
-
if (signal.aborted) return { status: "cancelled" };
|
|
297
|
-
const productId = Number(rawProductId);
|
|
298
|
-
if (!Number.isFinite(productId)) return failed("primaryProductIdInvalid", "staff");
|
|
299
|
-
try {
|
|
300
|
-
const productResult = yield queryPrimaryProduct(getContext(), String(productId), signal);
|
|
301
|
-
if (productResult.status !== "succeeded") return productResult;
|
|
302
|
-
return {
|
|
303
|
-
status: "succeeded",
|
|
304
|
-
data: productResult.data
|
|
305
|
-
};
|
|
306
|
-
} catch (error) {
|
|
307
|
-
return partialFailure("primaryProductLoadFailed", error);
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
return function loadPrimaryProduct(_x11, _x12) {
|
|
311
|
-
return _ref8.apply(this, arguments);
|
|
312
|
-
};
|
|
313
|
-
}(),
|
|
314
|
-
selectIdentity: function() {
|
|
315
|
-
var _ref9 = _asyncToGenerator(function* (input, signal) {
|
|
316
|
-
if (signal.aborted) return { status: "cancelled" };
|
|
317
|
-
try {
|
|
318
|
-
var _input$customerId, _currentCustomer$id, _selected$id;
|
|
319
|
-
const context = getContext();
|
|
320
|
-
const customerId = (_input$customerId = input.customerId) === null || _input$customerId === void 0 ? void 0 : _input$customerId.trim();
|
|
321
|
-
if (!customerId) {
|
|
322
|
-
context.customer.select(null);
|
|
323
|
-
if (signal.aborted) return unknown("identityAbortedAfterDispatch");
|
|
324
|
-
return {
|
|
325
|
-
status: "succeeded",
|
|
326
|
-
data: {}
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
const authenticatedCustomer = getAuthenticatedCustomer === null || getAuthenticatedCustomer === void 0 ? void 0 : getAuthenticatedCustomer(customerId);
|
|
330
|
-
const currentCustomer = context.customer.selected;
|
|
331
|
-
const selected = authenticatedCustomer !== null && authenticatedCustomer !== void 0 ? authenticatedCustomer : String((_currentCustomer$id = currentCustomer === null || currentCustomer === void 0 ? void 0 : currentCustomer.id) !== null && _currentCustomer$id !== void 0 ? _currentCustomer$id : "") === customerId ? currentCustomer : void 0;
|
|
332
|
-
if (!selected || String(selected.id) !== customerId || [
|
|
333
|
-
"0",
|
|
334
|
-
"1",
|
|
335
|
-
""
|
|
336
|
-
].includes(String((_selected$id = selected.id) !== null && _selected$id !== void 0 ? _selected$id : ""))) return failed("authenticatedCustomerUnavailable", "back");
|
|
337
|
-
context.customer.select(selected);
|
|
338
|
-
if (signal.aborted) return unknown("identityAbortedAfterDispatch");
|
|
339
|
-
return {
|
|
340
|
-
status: "succeeded",
|
|
341
|
-
data: { customer: projectConfirmedCustomer(selected) }
|
|
342
|
-
};
|
|
343
|
-
} catch (error) {
|
|
344
|
-
return partialFailure("identitySelectionFailed", error);
|
|
345
|
-
}
|
|
346
|
-
});
|
|
347
|
-
return function selectIdentity(_x13, _x14) {
|
|
348
|
-
return _ref9.apply(this, arguments);
|
|
349
|
-
};
|
|
350
|
-
}(),
|
|
351
|
-
setFulfillment: function() {
|
|
352
|
-
var _ref10 = _asyncToGenerator(function* (input, signal) {
|
|
353
|
-
if (signal.aborted) return { status: "cancelled" };
|
|
354
|
-
const currentWriteFulfillment = getWriteFulfillment ? getWriteFulfillment() : writeFulfillment;
|
|
355
|
-
if (!currentWriteFulfillment) {
|
|
356
|
-
if (allowSimulatedFulfillment) {
|
|
357
|
-
onSimulatedFulfillment === null || onSimulatedFulfillment === void 0 || onSimulatedFulfillment(input);
|
|
358
|
-
return {
|
|
359
|
-
status: "succeeded",
|
|
360
|
-
data: void 0
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
return failed("fulfillmentHostWriterUnavailable", "staff");
|
|
364
|
-
}
|
|
365
|
-
try {
|
|
366
|
-
return yield currentWriteFulfillment(input, signal);
|
|
367
|
-
} catch (error) {
|
|
368
|
-
return partialFailure("fulfillmentWriteFailed", error);
|
|
369
|
-
}
|
|
370
|
-
});
|
|
371
|
-
return function setFulfillment(_x15, _x16) {
|
|
372
|
-
return _ref10.apply(this, arguments);
|
|
373
|
-
};
|
|
374
|
-
}(),
|
|
375
|
-
syncPrimaryWeightedProduct: function() {
|
|
376
|
-
var _ref12 = _asyncToGenerator(function* (input, signal) {
|
|
377
|
-
if (signal.aborted) return { status: "cancelled" };
|
|
378
|
-
const productId = Number(input.productId);
|
|
379
|
-
if (!Number.isFinite(productId)) return failed("primaryWeightedProductInputInvalid", "staff");
|
|
380
|
-
try {
|
|
381
|
-
const context = getContext();
|
|
382
|
-
const productResult = yield queryPrimaryProduct(context, String(productId), signal);
|
|
383
|
-
if (productResult.status !== "succeeded") return productResult;
|
|
384
|
-
const product = productResult.data;
|
|
385
|
-
const resolved = resolveHDLWeightedProduct(product);
|
|
386
|
-
if (!resolved) return failed("primaryWeightedProductConfigInvalid", "staff");
|
|
387
|
-
const prepared = createHDLPrimaryWeightedPreparedProduct(resolved, input);
|
|
388
|
-
if (!prepared) return failed("primaryWeightedProductSelectionInvalid", "retry");
|
|
389
|
-
if (input.existingLineId) {
|
|
390
|
-
var _cartProduct$_identit, _identity$product_var, _ref11, _productPatch$product;
|
|
391
|
-
const displayLine = findCartLine(context, input.existingLineId);
|
|
392
|
-
const cartProduct = displayLine ? resolveCartProduct(displayLine) : void 0;
|
|
393
|
-
const bookingTicket = context.sales.bookingTicket;
|
|
394
|
-
if (!cartProduct) return failed("primaryWeightedProductLineNotFound", "back");
|
|
395
|
-
if (typeof context.cart.updateItem !== "function" || typeof (bookingTicket === null || bookingTicket === void 0 ? void 0 : bookingTicket.transformDetailToProductAndBooking) !== "function") return failed("primaryWeightedProductUpdateUnavailable", "staff");
|
|
396
|
-
const orderLine = findOrderProduct(context, cartProduct);
|
|
397
|
-
const identity = (_cartProduct$_identit = cartProduct._identity) !== null && _cartProduct$_identit !== void 0 ? _cartProduct$_identit : pickIdentity(orderLine);
|
|
398
|
-
const preparedForUpdate = _objectSpread2(_objectSpread2({}, prepared), {}, { _extend: _objectSpread2(_objectSpread2({}, prepared._extend || {}), identity.unique_identification_number != null ? { unique_identification_number: identity.unique_identification_number } : {}) });
|
|
399
|
-
const transformed = bookingTicket.transformDetailToProductAndBooking({
|
|
400
|
-
item: resolved.product,
|
|
401
|
-
cacheItem: preparedForUpdate
|
|
402
|
-
});
|
|
403
|
-
const productPatch = transformed === null || transformed === void 0 ? void 0 : transformed.product;
|
|
404
|
-
if (!productPatch) return failed("primaryWeightedProductUpdateInvalid", "retry");
|
|
405
|
-
const patchVariantId = Number(productPatch.product_variant_id);
|
|
406
|
-
const nextVariantId = Number.isFinite(patchVariantId) && patchVariantId > 0 ? patchVariantId : Number((_identity$product_var = identity.product_variant_id) !== null && _identity$product_var !== void 0 ? _identity$product_var : 0);
|
|
407
|
-
const nextOptions = resolvePatchProductOptions(orderLine, productPatch);
|
|
408
|
-
const lineUpdates = buildProductLineUpdates(orderLine, productPatch);
|
|
409
|
-
lineUpdates.metadata = _objectSpread2(_objectSpread2({}, lineUpdates.metadata || {}), identity.unique_identification_number != null ? { unique_identification_number: identity.unique_identification_number } : {});
|
|
410
|
-
const updatedProducts = yield context.cart.updateItem({
|
|
411
|
-
product_id: identity.product_id,
|
|
412
|
-
product_variant_id: nextVariantId,
|
|
413
|
-
unique_identification_number: identity.unique_identification_number,
|
|
414
|
-
identity_key: identity.identity_key,
|
|
415
|
-
product_sku: buildProductSkuPatch(orderLine, nextOptions, productPatch.product_sku),
|
|
416
|
-
product_option_item: nextOptions,
|
|
417
|
-
product_bundle: (_ref11 = (_productPatch$product = productPatch.product_bundle) !== null && _productPatch$product !== void 0 ? _productPatch$product : identity.product_bundle) !== null && _ref11 !== void 0 ? _ref11 : [],
|
|
418
|
-
updates: lineUpdates
|
|
419
|
-
});
|
|
420
|
-
if (signal.aborted) return unknown("primaryProductUpdateAbortedAfterDispatch");
|
|
421
|
-
const confirmedLine = projectConfirmedMutationLine(findConfirmedMutationLine(updatedProducts, input.productId, input.measurement.netWeightKg, identity.unique_identification_number));
|
|
422
|
-
return {
|
|
423
|
-
status: "succeeded",
|
|
424
|
-
data: _objectSpread2({ affectedLineId: input.existingLineId }, confirmedLine ? { confirmedLine } : {})
|
|
425
|
-
};
|
|
426
|
-
}
|
|
427
|
-
const result = yield context.cart.addProductWithFlow(product, {
|
|
428
|
-
quantity: 1,
|
|
429
|
-
debounceMs: 0,
|
|
430
|
-
notShowToast: true,
|
|
431
|
-
preparedCacheItem: prepared
|
|
432
|
-
});
|
|
433
|
-
if (signal.aborted) return unknown("primaryProductAddAbortedAfterDispatch");
|
|
434
|
-
if (result.status === "cancelled") return cancelled("userCancelled");
|
|
435
|
-
if (result.status !== "added") return unknown("primaryProductAddAmbiguous");
|
|
436
|
-
const confirmedLine = projectConfirmedMutationLine(findConfirmedMutationLine(result.products, input.productId, input.measurement.netWeightKg));
|
|
437
|
-
return {
|
|
438
|
-
status: "succeeded",
|
|
439
|
-
data: confirmedLine ? {
|
|
440
|
-
affectedLineId: confirmedLine.lineId,
|
|
441
|
-
confirmedLine
|
|
442
|
-
} : {}
|
|
443
|
-
};
|
|
444
|
-
} catch (error) {
|
|
445
|
-
return partialFailure("primaryWeightedProductSyncFailed", error);
|
|
446
|
-
}
|
|
447
|
-
});
|
|
448
|
-
return function syncPrimaryWeightedProduct(_x17, _x18) {
|
|
449
|
-
return _ref12.apply(this, arguments);
|
|
450
|
-
};
|
|
451
|
-
}(),
|
|
452
|
-
consumeBarcode: function() {
|
|
453
|
-
var _ref13 = _asyncToGenerator(function* (code, signal) {
|
|
454
|
-
if (signal.aborted) return { status: "cancelled" };
|
|
455
|
-
if (!code.trim()) return failed("barcodeEmpty", "back");
|
|
456
|
-
try {
|
|
457
|
-
var _scanResult$meta$coun, _scanResult$meta;
|
|
458
|
-
const execution = yield executeScan(code);
|
|
459
|
-
if (signal.aborted) return unknown("barcodeAbortedAfterDispatch");
|
|
460
|
-
const scanResult = execution.scanResult;
|
|
461
|
-
if (!scanResult) return failed("barcodeUnavailable", "staff");
|
|
462
|
-
if (scanResult.status === "cancelled") return {
|
|
463
|
-
status: "cancelled",
|
|
464
|
-
reason: scanResult.reason
|
|
465
|
-
};
|
|
466
|
-
if (scanResult.status === "failed") return failed("barcodeNotResolved", "retry");
|
|
467
|
-
return {
|
|
468
|
-
status: "succeeded",
|
|
469
|
-
data: {
|
|
470
|
-
code: scanResult.status === "pending" ? "requiresSelection" : "added",
|
|
471
|
-
cartChangeConfirmed: scanResult.status === "success" && Number((_scanResult$meta$coun = (_scanResult$meta = scanResult.meta) === null || _scanResult$meta === void 0 ? void 0 : _scanResult$meta.count) !== null && _scanResult$meta$coun !== void 0 ? _scanResult$meta$coun : 0) > 0
|
|
472
|
-
}
|
|
473
|
-
};
|
|
474
|
-
} catch (error) {
|
|
475
|
-
return partialFailure("barcodeDispatchFailed", error);
|
|
476
|
-
}
|
|
477
|
-
});
|
|
478
|
-
return function consumeBarcode(_x19, _x20) {
|
|
479
|
-
return _ref13.apply(this, arguments);
|
|
480
|
-
};
|
|
481
|
-
}(),
|
|
482
|
-
addProduct: function() {
|
|
483
|
-
var _ref14 = _asyncToGenerator(function* (input, signal) {
|
|
484
|
-
if (signal.aborted) return { status: "cancelled" };
|
|
485
|
-
const productId = Number(input.productId);
|
|
486
|
-
const quantity = Number(input.quantity);
|
|
487
|
-
if (!Number.isFinite(productId) || !Number.isFinite(quantity) || quantity <= 0) return failed("productInputInvalid", "back");
|
|
488
|
-
try {
|
|
489
|
-
const context = getContext();
|
|
490
|
-
const product = findCatalogProduct(context, String(productId));
|
|
491
|
-
if (!product) return failed("productNotFound", "back");
|
|
492
|
-
const result = yield context.cart.addProductWithFlow(product, {
|
|
493
|
-
quantity,
|
|
494
|
-
notShowToast: true
|
|
495
|
-
});
|
|
496
|
-
if (signal.aborted) return unknown("addProductAbortedAfterDispatch");
|
|
497
|
-
if (result.status === "cancelled") return cancelled("userCancelled");
|
|
498
|
-
if (result.status !== "added") return failed("productRequiresUnsupportedSelection", "back");
|
|
499
|
-
const confirmedLine = projectConfirmedMutationLine([...Array.isArray(result.products) ? result.products : []].reverse().find((candidate) => {
|
|
500
|
-
var _candidate$product_id2;
|
|
501
|
-
return String((_candidate$product_id2 = candidate.product_id) !== null && _candidate$product_id2 !== void 0 ? _candidate$product_id2 : "") === input.productId;
|
|
502
|
-
}));
|
|
503
|
-
return {
|
|
504
|
-
status: "succeeded",
|
|
505
|
-
data: confirmedLine ? {
|
|
506
|
-
affectedLineId: confirmedLine.lineId,
|
|
507
|
-
confirmedLine
|
|
508
|
-
} : {}
|
|
509
|
-
};
|
|
510
|
-
} catch (error) {
|
|
511
|
-
return partialFailure("addProductFailed", error);
|
|
512
|
-
}
|
|
513
|
-
});
|
|
514
|
-
return function addProduct(_x21, _x22) {
|
|
515
|
-
return _ref14.apply(this, arguments);
|
|
516
|
-
};
|
|
517
|
-
}(),
|
|
518
|
-
updateQuantity: function() {
|
|
519
|
-
var _ref15 = _asyncToGenerator(function* (input, signal) {
|
|
520
|
-
if (signal.aborted) return { status: "cancelled" };
|
|
521
|
-
const quantity = Number(input.quantity);
|
|
522
|
-
if (!Number.isFinite(quantity) || quantity <= 0) return failed("quantityInvalid", "back");
|
|
523
|
-
const context = getContext();
|
|
524
|
-
const line = findCartLine(context, input.lineId);
|
|
525
|
-
if (!line) return failed("cartLineNotFound", "back");
|
|
526
|
-
try {
|
|
527
|
-
const updatedProducts = yield context.cart.updateItemQuantity(line, quantity);
|
|
528
|
-
if (signal.aborted) return unknown("updateQuantityAbortedAfterDispatch");
|
|
529
|
-
const confirmedLine = projectConfirmedCartLineById(Array.isArray(updatedProducts) ? updatedProducts : [], input.lineId);
|
|
530
|
-
return {
|
|
531
|
-
status: "succeeded",
|
|
532
|
-
data: _objectSpread2({ affectedLineId: input.lineId }, confirmedLine ? { confirmedLine } : {})
|
|
533
|
-
};
|
|
534
|
-
} catch (error) {
|
|
535
|
-
return partialFailure("updateQuantityFailed", error);
|
|
536
|
-
}
|
|
537
|
-
});
|
|
538
|
-
return function updateQuantity(_x23, _x24) {
|
|
539
|
-
return _ref15.apply(this, arguments);
|
|
540
|
-
};
|
|
541
|
-
}(),
|
|
542
|
-
removeLine: function() {
|
|
543
|
-
var _ref16 = _asyncToGenerator(function* (input, signal) {
|
|
544
|
-
if (signal.aborted) return { status: "cancelled" };
|
|
545
|
-
const context = getContext();
|
|
546
|
-
const line = findCartLine(context, input.lineId);
|
|
547
|
-
if (!line) return failed("cartLineNotFound", "back");
|
|
548
|
-
try {
|
|
549
|
-
const remainingProducts = yield context.cart.removeItem(line);
|
|
550
|
-
if (signal.aborted) return unknown("removeLineAbortedAfterDispatch");
|
|
551
|
-
return {
|
|
552
|
-
status: "succeeded",
|
|
553
|
-
data: _objectSpread2({ affectedLineId: input.lineId }, Array.isArray(remainingProducts) && !remainingProducts.some((candidate) => resolveBigSaleLineId(candidate) === input.lineId) ? { removedLineId: input.lineId } : {})
|
|
554
|
-
};
|
|
555
|
-
} catch (error) {
|
|
556
|
-
return partialFailure("removeLineFailed", error);
|
|
557
|
-
}
|
|
558
|
-
});
|
|
559
|
-
return function removeLine(_x25, _x26) {
|
|
560
|
-
return _ref16.apply(this, arguments);
|
|
561
|
-
};
|
|
562
|
-
}(),
|
|
563
|
-
waitForCartConsistency: function() {
|
|
564
|
-
var _ref17 = _asyncToGenerator(function* (signal) {
|
|
565
|
-
if (signal.aborted) return { status: "cancelled" };
|
|
566
|
-
try {
|
|
567
|
-
yield getContext().cart.waitForCartConsistency();
|
|
568
|
-
if (signal.aborted) return unknown("consistencyAbortedAfterWait");
|
|
569
|
-
return {
|
|
570
|
-
status: "succeeded",
|
|
571
|
-
data: { observationId: getSnapshot().observationId }
|
|
572
|
-
};
|
|
573
|
-
} catch (error) {
|
|
574
|
-
return failed("cartConsistencyFailed", "retry", error);
|
|
575
|
-
}
|
|
576
|
-
});
|
|
577
|
-
return function waitForCartConsistency(_x27) {
|
|
578
|
-
return _ref17.apply(this, arguments);
|
|
579
|
-
};
|
|
580
|
-
}(),
|
|
581
|
-
recalculateSummary: function() {
|
|
582
|
-
var _ref18 = _asyncToGenerator(function* (signal) {
|
|
583
|
-
if (signal.aborted) return { status: "cancelled" };
|
|
584
|
-
try {
|
|
585
|
-
var _getContext$sales$tem, _getContext$sales$tem2, _getContext$sales$tem3, _getContext$sales$tem4;
|
|
586
|
-
const summary = yield getContext().cart.recalcSummary();
|
|
587
|
-
if (signal.aborted) return unknown("summaryAbortedAfterDispatch");
|
|
588
|
-
if (!summary) return failed("summaryMissing", "retry");
|
|
589
|
-
return {
|
|
590
|
-
status: "succeeded",
|
|
591
|
-
data: {
|
|
592
|
-
observationId: getSnapshot().observationId,
|
|
593
|
-
confirmedSummary: {
|
|
594
|
-
status: "ready",
|
|
595
|
-
currency: String((_getContext$sales$tem = (_getContext$sales$tem2 = getContext().sales.tempOrder) === null || _getContext$sales$tem2 === void 0 ? void 0 : _getContext$sales$tem2.currency_code) !== null && _getContext$sales$tem !== void 0 ? _getContext$sales$tem : ""),
|
|
596
|
-
currencySymbol: String((_getContext$sales$tem3 = (_getContext$sales$tem4 = getContext().sales.tempOrder) === null || _getContext$sales$tem4 === void 0 ? void 0 : _getContext$sales$tem4.currency_symbol) !== null && _getContext$sales$tem3 !== void 0 ? _getContext$sales$tem3 : ""),
|
|
597
|
-
total: String(summary.total_amount),
|
|
598
|
-
due: String(summary.expect_amount)
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
};
|
|
602
|
-
} catch (error) {
|
|
603
|
-
return failed("summaryRecalculationFailed", "retry", error);
|
|
604
|
-
}
|
|
605
|
-
});
|
|
606
|
-
return function recalculateSummary(_x28) {
|
|
607
|
-
return _ref18.apply(this, arguments);
|
|
608
|
-
};
|
|
609
|
-
}(),
|
|
610
|
-
loadPaymentMethods: function() {
|
|
611
|
-
var _ref19 = _asyncToGenerator(function* (signal) {
|
|
612
|
-
if (signal.aborted) return cancelled("paymentMethodsAborted");
|
|
613
|
-
const controller = getPaymentController === null || getPaymentController === void 0 ? void 0 : getPaymentController();
|
|
614
|
-
if (!controller) return failed("paymentRuntimeUnavailable", "staff");
|
|
615
|
-
return controller.loadPaymentMethods();
|
|
616
|
-
});
|
|
617
|
-
return function loadPaymentMethods(_x29) {
|
|
618
|
-
return _ref19.apply(this, arguments);
|
|
619
|
-
};
|
|
620
|
-
}(),
|
|
621
|
-
payEftpos: function() {
|
|
622
|
-
var _ref20 = _asyncToGenerator(function* (input, signal) {
|
|
623
|
-
if (signal.aborted) return cancelled("eftposAborted");
|
|
624
|
-
const controller = getPaymentController === null || getPaymentController === void 0 ? void 0 : getPaymentController();
|
|
625
|
-
if (!controller) return failed("paymentRuntimeUnavailable", "staff");
|
|
626
|
-
return controller.payEftpos(input);
|
|
627
|
-
});
|
|
628
|
-
return function payEftpos(_x30, _x31) {
|
|
629
|
-
return _ref20.apply(this, arguments);
|
|
630
|
-
};
|
|
631
|
-
}(),
|
|
632
|
-
requestStaffPaymentApproval: function() {
|
|
633
|
-
var _ref21 = _asyncToGenerator(function* (input, signal) {
|
|
634
|
-
if (signal.aborted) return cancelled("staffPaymentApprovalAborted");
|
|
635
|
-
const controller = getPaymentController === null || getPaymentController === void 0 ? void 0 : getPaymentController();
|
|
636
|
-
if (!controller) return failed("paymentRuntimeUnavailable", "staff");
|
|
637
|
-
return controller.requestStaffPaymentApproval(input);
|
|
638
|
-
});
|
|
639
|
-
return function requestStaffPaymentApproval(_x32, _x33) {
|
|
640
|
-
return _ref21.apply(this, arguments);
|
|
641
|
-
};
|
|
642
|
-
}(),
|
|
643
|
-
subscribeStaffPaymentAuthorizationResult: (listener) => {
|
|
644
|
-
var _controller$subscribe;
|
|
645
|
-
const controller = getPaymentController === null || getPaymentController === void 0 ? void 0 : getPaymentController();
|
|
646
|
-
return (_controller$subscribe = controller === null || controller === void 0 ? void 0 : controller.subscribeStaffPaymentAuthorizationResult(listener)) !== null && _controller$subscribe !== void 0 ? _controller$subscribe : (() => void 0);
|
|
647
|
-
},
|
|
648
|
-
openCheckout: function() {
|
|
649
|
-
var _ref22 = _asyncToGenerator(function* (signal) {
|
|
650
|
-
if (signal.aborted) return { status: "cancelled" };
|
|
651
|
-
try {
|
|
652
|
-
const snapshotBeforeCheckout = getSnapshot();
|
|
653
|
-
const result = yield getContext().sales.openCheckout({
|
|
654
|
-
paymentResultDisplayMode: "page",
|
|
655
|
-
walletPassMode: "shared"
|
|
656
|
-
});
|
|
657
|
-
if (signal.aborted) return unknown("checkoutAbortedAfterDispatch");
|
|
658
|
-
const checkoutResult = normalizeCheckoutResult(result, snapshotBeforeCheckout);
|
|
659
|
-
yield refreshCheckoutOrderProjection(getContext, getSnapshot, checkoutResult);
|
|
660
|
-
return checkoutResult;
|
|
661
|
-
} catch (error) {
|
|
662
|
-
return unknown("checkoutInvocationFailed", error);
|
|
663
|
-
}
|
|
664
|
-
});
|
|
665
|
-
return function openCheckout(_x34) {
|
|
666
|
-
return _ref22.apply(this, arguments);
|
|
667
|
-
};
|
|
668
|
-
}(),
|
|
669
|
-
clearAndReset: function() {
|
|
670
|
-
var _ref23 = _asyncToGenerator(function* (signal) {
|
|
671
|
-
if (signal.aborted) return { status: "cancelled" };
|
|
672
|
-
try {
|
|
673
|
-
var _resetOrder$products$, _resetOrder$products, _resetOrder$bookings$, _resetOrder$bookings;
|
|
674
|
-
const resetOrder = yield getContext().sales.clearCartAndReset();
|
|
675
|
-
if (signal.aborted) return unknown("resetAbortedAfterDispatch");
|
|
676
|
-
if (!(((_resetOrder$products$ = (_resetOrder$products = resetOrder.products) === null || _resetOrder$products === void 0 ? void 0 : _resetOrder$products.length) !== null && _resetOrder$products$ !== void 0 ? _resetOrder$products$ : 0) === 0 && ((_resetOrder$bookings$ = (_resetOrder$bookings = resetOrder.bookings) === null || _resetOrder$bookings === void 0 ? void 0 : _resetOrder$bookings.length) !== null && _resetOrder$bookings$ !== void 0 ? _resetOrder$bookings$ : 0) === 0)) return unknown("resetHostResultNotEmpty");
|
|
677
|
-
return {
|
|
678
|
-
status: "succeeded",
|
|
679
|
-
data: { cartEmpty: true }
|
|
680
|
-
};
|
|
681
|
-
} catch (error) {
|
|
682
|
-
return partialFailure("resetFailed", error);
|
|
683
|
-
}
|
|
684
|
-
});
|
|
685
|
-
return function clearAndReset(_x35) {
|
|
686
|
-
return _ref23.apply(this, arguments);
|
|
687
|
-
};
|
|
688
|
-
}()
|
|
689
|
-
};
|
|
690
|
-
}
|
|
691
|
-
//#endregion
|
|
692
|
-
export { createBigSaleSalesPort };
|