@shopify/hydrogen-react 2026.1.0 → 2026.1.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 (232) hide show
  1. package/LICENSE.md +7 -0
  2. package/dist/browser-dev/AddToCartButton.mjs.map +1 -1
  3. package/dist/browser-dev/BuyNowButton.mjs.map +1 -1
  4. package/dist/browser-dev/CartCost.mjs.map +1 -1
  5. package/dist/browser-dev/CartLineProvider.mjs +1 -1
  6. package/dist/browser-dev/CartProvider.mjs +1 -1
  7. package/dist/browser-dev/ProductPrice.mjs.map +1 -1
  8. package/dist/browser-dev/ProductProvider.mjs +1 -1
  9. package/dist/browser-dev/ShopifyProvider.mjs +1 -1
  10. package/dist/browser-dev/ShopifyProvider.mjs.map +1 -1
  11. package/dist/browser-dev/_virtual/with-selector.mjs +1 -1
  12. package/dist/browser-dev/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs.map +1 -0
  13. package/dist/{node-prod → browser-dev/node_modules/.pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1}/node_modules/@xstate/react/es/fsm.mjs +2 -2
  14. package/dist/browser-dev/node_modules/.pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate/react/es/fsm.mjs.map +1 -0
  15. package/dist/browser-dev/node_modules/.pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate/react/es/useConstant.mjs.map +1 -0
  16. package/dist/{node-prod → browser-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs +1 -1
  17. package/dist/browser-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs.map +1 -0
  18. package/dist/browser-dev/node_modules/{use-sync-external-store → .pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store}/cjs/use-sync-external-store-shim/with-selector.production.mjs +1 -1
  19. package/dist/browser-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.mjs.map +1 -0
  20. package/dist/{node-prod → browser-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs +1 -1
  21. package/dist/browser-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs.map +1 -0
  22. package/dist/{browser-prod → browser-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.mjs +1 -1
  23. package/dist/browser-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.mjs.map +1 -0
  24. package/dist/{browser-prod → browser-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/shim/index.mjs +1 -1
  25. package/dist/browser-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.mjs.map +1 -0
  26. package/dist/{node-prod → browser-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/shim/with-selector.mjs +1 -1
  27. package/dist/browser-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/shim/with-selector.mjs.map +1 -0
  28. package/dist/browser-dev/packages/hydrogen-react/package.json.mjs +1 -1
  29. package/dist/browser-dev/useCartAPIStateMachine.mjs +2 -2
  30. package/dist/browser-prod/AddToCartButton.mjs.map +1 -1
  31. package/dist/browser-prod/BuyNowButton.mjs.map +1 -1
  32. package/dist/browser-prod/CartCost.mjs.map +1 -1
  33. package/dist/browser-prod/CartLineProvider.mjs +1 -1
  34. package/dist/browser-prod/CartProvider.mjs +1 -1
  35. package/dist/browser-prod/ProductPrice.mjs.map +1 -1
  36. package/dist/browser-prod/ProductProvider.mjs +1 -1
  37. package/dist/browser-prod/ShopifyProvider.mjs +1 -1
  38. package/dist/browser-prod/ShopifyProvider.mjs.map +1 -1
  39. package/dist/browser-prod/_virtual/with-selector.mjs +1 -1
  40. package/dist/browser-prod/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs.map +1 -0
  41. package/dist/browser-prod/node_modules/{@xstate → .pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate}/react/es/fsm.mjs +2 -2
  42. package/dist/browser-prod/node_modules/.pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate/react/es/fsm.mjs.map +1 -0
  43. package/dist/browser-prod/node_modules/.pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate/react/es/useConstant.mjs.map +1 -0
  44. package/dist/{node-dev → browser-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs +1 -1
  45. package/dist/browser-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs.map +1 -0
  46. package/dist/{node-prod → browser-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.mjs +1 -1
  47. package/dist/browser-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.mjs.map +1 -0
  48. package/dist/{browser-dev → browser-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs +1 -1
  49. package/dist/browser-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs.map +1 -0
  50. package/dist/{browser-dev → browser-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.mjs +1 -1
  51. package/dist/browser-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.mjs.map +1 -0
  52. package/dist/{browser-dev → browser-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/shim/index.mjs +1 -1
  53. package/dist/browser-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.mjs.map +1 -0
  54. package/dist/{browser-dev → browser-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/shim/with-selector.mjs +1 -1
  55. package/dist/browser-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/shim/with-selector.mjs.map +1 -0
  56. package/dist/browser-prod/packages/hydrogen-react/package.json.mjs +1 -1
  57. package/dist/browser-prod/useCartAPIStateMachine.mjs +2 -2
  58. package/dist/node-dev/AddToCartButton.js.map +1 -1
  59. package/dist/node-dev/AddToCartButton.mjs.map +1 -1
  60. package/dist/node-dev/BuyNowButton.js.map +1 -1
  61. package/dist/node-dev/BuyNowButton.mjs.map +1 -1
  62. package/dist/node-dev/CartCost.js.map +1 -1
  63. package/dist/node-dev/CartCost.mjs.map +1 -1
  64. package/dist/node-dev/CartLineProvider.mjs +1 -1
  65. package/dist/node-dev/CartProvider.mjs +1 -1
  66. package/dist/node-dev/ProductPrice.js.map +1 -1
  67. package/dist/node-dev/ProductPrice.mjs.map +1 -1
  68. package/dist/node-dev/ProductProvider.mjs +1 -1
  69. package/dist/node-dev/ShopifyProvider.js.map +1 -1
  70. package/dist/node-dev/ShopifyProvider.mjs +1 -1
  71. package/dist/node-dev/ShopifyProvider.mjs.map +1 -1
  72. package/dist/node-dev/_virtual/with-selector.js +1 -1
  73. package/dist/node-dev/_virtual/with-selector.mjs +1 -1
  74. package/dist/node-dev/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.js.map +1 -0
  75. package/dist/node-dev/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs.map +1 -0
  76. package/dist/{node-prod → node-dev/node_modules/.pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1}/node_modules/@xstate/react/es/fsm.js +2 -2
  77. package/dist/node-dev/node_modules/.pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate/react/es/fsm.js.map +1 -0
  78. package/dist/{browser-dev → node-dev/node_modules/.pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1}/node_modules/@xstate/react/es/fsm.mjs +2 -2
  79. package/dist/node-dev/node_modules/.pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate/react/es/fsm.mjs.map +1 -0
  80. package/dist/node-dev/node_modules/.pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate/react/es/useConstant.js.map +1 -0
  81. package/dist/node-dev/node_modules/.pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate/react/es/useConstant.mjs.map +1 -0
  82. package/dist/{node-prod → node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +1 -1
  83. package/dist/node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +1 -0
  84. package/dist/{browser-dev → node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs +1 -1
  85. package/dist/node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs.map +1 -0
  86. package/dist/{node-prod → node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +1 -1
  87. package/dist/node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +1 -0
  88. package/dist/{browser-prod → node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.mjs +1 -1
  89. package/dist/node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.mjs.map +1 -0
  90. package/dist/node-dev/node_modules/{use-sync-external-store → .pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store}/cjs/use-sync-external-store-shim.development.js +1 -1
  91. package/dist/node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -0
  92. package/dist/node-dev/node_modules/{use-sync-external-store → .pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store}/cjs/use-sync-external-store-shim.development.mjs +1 -1
  93. package/dist/node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs.map +1 -0
  94. package/dist/{node-prod → node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +1 -1
  95. package/dist/node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +1 -0
  96. package/dist/{node-prod → node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.mjs +1 -1
  97. package/dist/node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.mjs.map +1 -0
  98. package/dist/node-dev/node_modules/{use-sync-external-store → .pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store}/shim/index.js +1 -1
  99. package/dist/node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.js.map +1 -0
  100. package/dist/{node-prod → node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/shim/index.mjs +1 -1
  101. package/dist/node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.mjs.map +1 -0
  102. package/dist/{node-prod → node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/shim/with-selector.js +1 -1
  103. package/dist/node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/shim/with-selector.js.map +1 -0
  104. package/dist/node-dev/node_modules/{use-sync-external-store → .pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store}/shim/with-selector.mjs +1 -1
  105. package/dist/node-dev/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/shim/with-selector.mjs.map +1 -0
  106. package/dist/node-dev/packages/hydrogen-react/package.json.js +1 -1
  107. package/dist/node-dev/packages/hydrogen-react/package.json.mjs +1 -1
  108. package/dist/node-dev/useCartAPIStateMachine.js +2 -2
  109. package/dist/node-dev/useCartAPIStateMachine.mjs +2 -2
  110. package/dist/node-prod/AddToCartButton.js.map +1 -1
  111. package/dist/node-prod/AddToCartButton.mjs.map +1 -1
  112. package/dist/node-prod/BuyNowButton.js.map +1 -1
  113. package/dist/node-prod/BuyNowButton.mjs.map +1 -1
  114. package/dist/node-prod/CartCost.js.map +1 -1
  115. package/dist/node-prod/CartCost.mjs.map +1 -1
  116. package/dist/node-prod/CartLineProvider.mjs +1 -1
  117. package/dist/node-prod/CartProvider.mjs +1 -1
  118. package/dist/node-prod/ProductPrice.js.map +1 -1
  119. package/dist/node-prod/ProductPrice.mjs.map +1 -1
  120. package/dist/node-prod/ProductProvider.mjs +1 -1
  121. package/dist/node-prod/ShopifyProvider.js.map +1 -1
  122. package/dist/node-prod/ShopifyProvider.mjs +1 -1
  123. package/dist/node-prod/ShopifyProvider.mjs.map +1 -1
  124. package/dist/node-prod/_virtual/with-selector.js +1 -1
  125. package/dist/node-prod/_virtual/with-selector.mjs +1 -1
  126. package/dist/node-prod/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.js.map +1 -0
  127. package/dist/node-prod/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs.map +1 -0
  128. package/dist/{node-dev → node-prod/node_modules/.pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1}/node_modules/@xstate/react/es/fsm.js +2 -2
  129. package/dist/node-prod/node_modules/.pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate/react/es/fsm.js.map +1 -0
  130. package/dist/{node-dev → node-prod/node_modules/.pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1}/node_modules/@xstate/react/es/fsm.mjs +2 -2
  131. package/dist/node-prod/node_modules/.pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate/react/es/fsm.mjs.map +1 -0
  132. package/dist/node-prod/node_modules/.pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate/react/es/useConstant.js.map +1 -0
  133. package/dist/node-prod/node_modules/.pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate/react/es/useConstant.mjs.map +1 -0
  134. package/dist/{node-dev → node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +1 -1
  135. package/dist/node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +1 -0
  136. package/dist/{browser-prod → node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs +1 -1
  137. package/dist/node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs.map +1 -0
  138. package/dist/{node-dev → node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +1 -1
  139. package/dist/node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +1 -0
  140. package/dist/{node-dev → node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.mjs +1 -1
  141. package/dist/node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.mjs.map +1 -0
  142. package/dist/node-prod/node_modules/{use-sync-external-store → .pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store}/cjs/use-sync-external-store-shim.development.js +1 -1
  143. package/dist/node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -0
  144. package/dist/{browser-prod → node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs +1 -1
  145. package/dist/node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs.map +1 -0
  146. package/dist/{node-dev → node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +1 -1
  147. package/dist/node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +1 -0
  148. package/dist/{node-dev → node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.mjs +1 -1
  149. package/dist/node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.mjs.map +1 -0
  150. package/dist/node-prod/node_modules/{use-sync-external-store → .pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store}/shim/index.js +1 -1
  151. package/dist/node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.js.map +1 -0
  152. package/dist/{node-dev → node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/shim/index.mjs +1 -1
  153. package/dist/node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.mjs.map +1 -0
  154. package/dist/{node-dev → node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/shim/with-selector.js +1 -1
  155. package/dist/node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/shim/with-selector.js.map +1 -0
  156. package/dist/{browser-prod → node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1}/node_modules/use-sync-external-store/shim/with-selector.mjs +1 -1
  157. package/dist/node-prod/node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/shim/with-selector.mjs.map +1 -0
  158. package/dist/node-prod/packages/hydrogen-react/package.json.js +1 -1
  159. package/dist/node-prod/packages/hydrogen-react/package.json.mjs +1 -1
  160. package/dist/node-prod/useCartAPIStateMachine.js +2 -2
  161. package/dist/node-prod/useCartAPIStateMachine.mjs +2 -2
  162. package/dist/umd/hydrogen-react.dev.js +1 -1
  163. package/dist/umd/hydrogen-react.dev.js.map +1 -1
  164. package/dist/umd/hydrogen-react.prod.js +1 -1
  165. package/dist/umd/hydrogen-react.prod.js.map +1 -1
  166. package/package.json +39 -37
  167. package/dist/browser-dev/node_modules/@xstate/fsm/es/index.mjs.map +0 -1
  168. package/dist/browser-dev/node_modules/@xstate/react/es/fsm.mjs.map +0 -1
  169. package/dist/browser-dev/node_modules/@xstate/react/es/useConstant.mjs.map +0 -1
  170. package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs.map +0 -1
  171. package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.mjs.map +0 -1
  172. package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs.map +0 -1
  173. package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.mjs.map +0 -1
  174. package/dist/browser-dev/node_modules/use-sync-external-store/shim/index.mjs.map +0 -1
  175. package/dist/browser-dev/node_modules/use-sync-external-store/shim/with-selector.mjs.map +0 -1
  176. package/dist/browser-prod/node_modules/@xstate/fsm/es/index.mjs.map +0 -1
  177. package/dist/browser-prod/node_modules/@xstate/react/es/fsm.mjs.map +0 -1
  178. package/dist/browser-prod/node_modules/@xstate/react/es/useConstant.mjs.map +0 -1
  179. package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs.map +0 -1
  180. package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.mjs.map +0 -1
  181. package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs.map +0 -1
  182. package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.mjs.map +0 -1
  183. package/dist/browser-prod/node_modules/use-sync-external-store/shim/index.mjs.map +0 -1
  184. package/dist/browser-prod/node_modules/use-sync-external-store/shim/with-selector.mjs.map +0 -1
  185. package/dist/node-dev/node_modules/@xstate/fsm/es/index.js.map +0 -1
  186. package/dist/node-dev/node_modules/@xstate/fsm/es/index.mjs.map +0 -1
  187. package/dist/node-dev/node_modules/@xstate/react/es/fsm.js.map +0 -1
  188. package/dist/node-dev/node_modules/@xstate/react/es/fsm.mjs.map +0 -1
  189. package/dist/node-dev/node_modules/@xstate/react/es/useConstant.js.map +0 -1
  190. package/dist/node-dev/node_modules/@xstate/react/es/useConstant.mjs.map +0 -1
  191. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +0 -1
  192. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs.map +0 -1
  193. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +0 -1
  194. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.mjs.map +0 -1
  195. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +0 -1
  196. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs.map +0 -1
  197. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +0 -1
  198. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.mjs.map +0 -1
  199. package/dist/node-dev/node_modules/use-sync-external-store/shim/index.js.map +0 -1
  200. package/dist/node-dev/node_modules/use-sync-external-store/shim/index.mjs.map +0 -1
  201. package/dist/node-dev/node_modules/use-sync-external-store/shim/with-selector.js.map +0 -1
  202. package/dist/node-dev/node_modules/use-sync-external-store/shim/with-selector.mjs.map +0 -1
  203. package/dist/node-prod/node_modules/@xstate/fsm/es/index.js.map +0 -1
  204. package/dist/node-prod/node_modules/@xstate/fsm/es/index.mjs.map +0 -1
  205. package/dist/node-prod/node_modules/@xstate/react/es/fsm.js.map +0 -1
  206. package/dist/node-prod/node_modules/@xstate/react/es/fsm.mjs.map +0 -1
  207. package/dist/node-prod/node_modules/@xstate/react/es/useConstant.js.map +0 -1
  208. package/dist/node-prod/node_modules/@xstate/react/es/useConstant.mjs.map +0 -1
  209. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +0 -1
  210. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs.map +0 -1
  211. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +0 -1
  212. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.mjs.map +0 -1
  213. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +0 -1
  214. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs.map +0 -1
  215. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +0 -1
  216. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.mjs.map +0 -1
  217. package/dist/node-prod/node_modules/use-sync-external-store/shim/index.js.map +0 -1
  218. package/dist/node-prod/node_modules/use-sync-external-store/shim/index.mjs.map +0 -1
  219. package/dist/node-prod/node_modules/use-sync-external-store/shim/with-selector.js.map +0 -1
  220. package/dist/node-prod/node_modules/use-sync-external-store/shim/with-selector.mjs.map +0 -1
  221. /package/dist/browser-dev/node_modules/{@xstate → .pnpm/@xstate_fsm@2.0.0/node_modules/@xstate}/fsm/es/index.mjs +0 -0
  222. /package/dist/browser-dev/node_modules/{@xstate → .pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate}/react/es/useConstant.mjs +0 -0
  223. /package/dist/browser-prod/node_modules/{@xstate → .pnpm/@xstate_fsm@2.0.0/node_modules/@xstate}/fsm/es/index.mjs +0 -0
  224. /package/dist/browser-prod/node_modules/{@xstate → .pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate}/react/es/useConstant.mjs +0 -0
  225. /package/dist/node-dev/node_modules/{@xstate → .pnpm/@xstate_fsm@2.0.0/node_modules/@xstate}/fsm/es/index.js +0 -0
  226. /package/dist/node-dev/node_modules/{@xstate → .pnpm/@xstate_fsm@2.0.0/node_modules/@xstate}/fsm/es/index.mjs +0 -0
  227. /package/dist/node-dev/node_modules/{@xstate → .pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate}/react/es/useConstant.js +0 -0
  228. /package/dist/node-dev/node_modules/{@xstate → .pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate}/react/es/useConstant.mjs +0 -0
  229. /package/dist/node-prod/node_modules/{@xstate → .pnpm/@xstate_fsm@2.0.0/node_modules/@xstate}/fsm/es/index.js +0 -0
  230. /package/dist/node-prod/node_modules/{@xstate → .pnpm/@xstate_fsm@2.0.0/node_modules/@xstate}/fsm/es/index.mjs +0 -0
  231. /package/dist/node-prod/node_modules/{@xstate → .pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate}/react/es/useConstant.js +0 -0
  232. /package/dist/node-prod/node_modules/{@xstate → .pnpm/@xstate_react@3.2.1_@types_react@18.3.28_@xstate_fsm@2.0.0_react@18.3.1/node_modules/@xstate}/react/es/useConstant.mjs +0 -0
@@ -323,7 +323,7 @@
323
323
  height
324
324
  }
325
325
  `,ne="2026-01",Dr="mock.shop",ut=e=>e.includes(Dr);function kr({storeDomain:e,privateStorefrontToken:t,publicStorefrontToken:r,storefrontApiVersion:n=ne,contentType:a}){if(!e)throw new Error(ke+"`storeDomain` is required when creating a new Storefront client in production.");n!==ne&&Ur(`The Storefront API version that you're using is different than the version this build of Hydrogen React is targeting.
326
- You may run into unexpected errors if these versions don't match. Received version: "${n}"; expected version "${ne}"`);const i=o=>{const s=(o==null?void 0:o.storeDomain)??e;return s.includes("://")?s:`https://${s}`};return{getShopifyDomain:i,getStorefrontApiUrl(o){const s=i(o);return`${s+(s.endsWith("/")?"api":"/api")}/${(o==null?void 0:o.storefrontApiVersion)??n}/graphql.json`},getPrivateTokenHeaders(o){if(!t&&!(o!=null&&o.privateStorefrontToken)&&!ut(e))throw new Error(ke+"You did not pass in a `privateStorefrontToken` while using `createStorefrontClient()` or `getPrivateTokenHeaders()`");return{"content-type":((o==null?void 0:o.contentType)??a)==="graphql"?"application/graphql":"application/json","X-SDK-Variant":"hydrogen-react","X-SDK-Variant-Source":"react","X-SDK-Version":n,"Shopify-Storefront-Private-Token":(o==null?void 0:o.privateStorefrontToken)??t??"",...o!=null&&o.buyerIp?{"Shopify-Storefront-Buyer-IP":o.buyerIp}:{}}},getPublicTokenHeaders(o){if(!r&&!(o!=null&&o.publicStorefrontToken)&&!ut(e))throw new Error(ke+"You did not pass in a `publicStorefrontToken` while using `createStorefrontClient()` or `getPublicTokenHeaders()`");const s=(o==null?void 0:o.contentType)??a??"json";return lt(s,n,(o==null?void 0:o.publicStorefrontToken)??r??"")}}}function lt(e,t,r){return{"content-type":e==="graphql"?"application/graphql":"application/json","X-SDK-Variant":"hydrogen-react","X-SDK-Variant-Source":"react","X-SDK-Version":t,"X-Shopify-Storefront-Access-Token":r}}const dt=new Set,ke="[h2:error:createStorefrontClient] ",Ur=(e,t="warn")=>{dt.has(e)||(console[t](`[h2:${t}:createStorefrontClient] `+e),dt.add(e))},ft={storeDomain:"test",storefrontToken:"abc123",storefrontApiVersion:ne,countryIsoCode:"US",languageIsoCode:"EN",getStorefrontApiUrl(){return""},getPublicTokenHeaders(){return{}},getShopifyDomain(){return""}},ht=l.createContext(ft);function Nr(){var e,t,r;if(typeof window>"u")return!1;try{const n=(t=(e=window.performance)==null?void 0:e.getEntriesByType)==null?void 0:t.call(e,"navigation")[0];return!!((r=n==null?void 0:n.serverTiming)!=null&&r.some(a=>a.name==="_sfapi_proxy"))}catch{return!1}}function Mr({children:e,...t}){if(!t.countryIsoCode||!t.languageIsoCode||!t.storeDomain||!t.storefrontToken||!t.storefrontApiVersion)throw new Error("Please provide the necessary props to '<ShopifyProvider/>'");t.storefrontApiVersion!==ne&&console.warn(`<ShopifyProvider/>: This version of Hydrogen React is built for Shopify's Storefront API version ${ne}, but it looks like you're using version ${t.storefrontApiVersion}. There may be issues or bugs if you use a mismatched version of Hydrogen React and the Storefront API.`);const r=l.useMemo(()=>{const n=t.sameDomainForStorefrontApi??Nr();function a(i){const o=(i==null?void 0:i.storeDomain)??t.storeDomain;return o.includes("://")?o:`https://${o}`}return{...t,sameDomainForStorefrontApi:n,getPublicTokenHeaders(i){return lt(i.contentType,t.storefrontApiVersion,i.storefrontToken??t.storefrontToken)},getShopifyDomain:a,getStorefrontApiUrl(i){const o=n&&typeof window<"u"?window.location.origin:a({storeDomain:(i==null?void 0:i.storeDomain)??t.storeDomain});return`${o}${o.endsWith("/")?"":"/"}api/${(i==null?void 0:i.storefrontApiVersion)??t.storefrontApiVersion}/graphql.json`}}},[t]);return React.createElement(ht.Provider,{value:r},e)}function ce(){const e=l.useContext(ht);if(!e)throw new Error("'useShop()' must be a descendent of <ShopifyProvider/>");return e}const Ue="shopifyCartId",yt="Shopify-Storefront-Id",gt="Shopify-Storefront-Y",mt="Shopify-Storefront-S",Ce="_shopify_y",Te="_shopify_s",Ne="X-Shopify-VisitToken",Me="X-Shopify-UniqueToken",Fe={current:null};function ee(){var t,r,n;let e;if(typeof window<"u"&&typeof window.performance<"u")try{const a=/^https?:\/\/([^/]+)(\/api\/(?:unstable|2\d{3}-\d{2})\/graphql\.json(?=$|\?))?/,i=performance.getEntriesByType("resource");let o;for(let s=i.length-1;s>=0;s--){const u=i[s];if(u.initiatorType!=="fetch")continue;const d=window.location.host,y=u.name.match(a);if(!y)continue;const[,f,h]=y;if(f===d||h&&(f==null?void 0:f.endsWith(`.${d}`))){const c=pt(u);if(c){o=c;break}}}if(o&&(e=o),e?Fe.current=e:Fe.current&&(e=Fe.current),!e){const s=performance.getEntriesByType("navigation")[0];e=pt(s,!1)}}catch{}if(!e){const a=typeof arguments[0]=="string"?arguments[0]:typeof document<"u"?document.cookie:"";e={uniqueToken:((t=a.match(/\b_shopify_y=([^;]+)/))==null?void 0:t[1])||"",visitToken:((r=a.match(/\b_shopify_s=([^;]+)/))==null?void 0:r[1])||"",consent:((n=a.match(/\b_tracking_consent=([^;]+)/))==null?void 0:n[1])||""}}return e}function pt(e,t=!0){let r="",n="",a="";const i=e.serverTiming;if(i&&i.length>=3)for(let o=i.length-1;o>=0;o--){const{name:s,description:u}=i[o];if(!(!s||!u)&&(s==="_y"?r=u:s==="_s"?n=u:s==="_cmp"&&(a=u),r&&n&&a))break}return r&&n&&(!t||a)?{uniqueToken:r,visitToken:n,consent:a}:void 0}function Fr(){const{storefrontId:e,getPublicTokenHeaders:t,getStorefrontApiUrl:r,sameDomainForStorefrontApi:n}=ce();return l.useCallback(({query:a,variables:i})=>{const o=t({contentType:"json"});if(e&&(o[yt]=e),!n){const{uniqueToken:s,visitToken:u}=ee();s&&(o[gt]=s,o[Me]=s),u&&(o[mt]=u,o[Ne]=u)}return fetch(r(),{method:"POST",headers:o,body:JSON.stringify({query:a.toString(),variables:i})}).then(s=>s.json()).catch(s=>({data:void 0,errors:s==null?void 0:s.toString()}))},[t,e,r,n])}function Lr({numCartLines:e,cartFragment:t,countryCode:r="US",languageCode:n="EN"}){const a=Fr(),i=l.useCallback(c=>a({query:Rr(t),variables:{id:c,numCartLines:e,country:r,language:n}}),[a,t,e,r,n]),o=l.useCallback(c=>a({query:br(t),variables:{input:c,numCartLines:e,country:r,language:n}}),[t,r,a,e,n]),s=l.useCallback((c,_)=>a({query:Tr(t),variables:{cartId:c,lines:_,numCartLines:e,country:r,language:n}}),[t,r,a,e,n]),u=l.useCallback((c,_)=>a({query:wr(t),variables:{cartId:c,lines:_,numCartLines:e,country:r,language:n}}),[t,r,a,e,n]),d=l.useCallback((c,_)=>a({query:vr(t),variables:{cartId:c,lines:_,numCartLines:e,country:r,language:n}}),[t,r,a,e,n]),y=l.useCallback((c,_)=>a({query:Ar(t),variables:{cartId:c,note:_,numCartLines:e,country:r,language:n}}),[a,t,e,r,n]),f=l.useCallback((c,_)=>a({query:Ir(t),variables:{cartId:c,buyerIdentity:_,numCartLines:e,country:r,language:n}}),[t,r,a,e,n]),h=l.useCallback((c,_)=>a({query:Pr(t),variables:{cartId:c,attributes:_,numCartLines:e,country:r,language:n}}),[t,r,a,e,n]),g=l.useCallback((c,_)=>a({query:Or(t),variables:{cartId:c,discountCodes:_,numCartLines:e,country:r,language:n}}),[t,r,a,e,n]);return l.useMemo(()=>({cartFetch:i,cartCreate:o,cartLineAdd:s,cartLineUpdate:u,cartLineRemove:d,noteUpdate:y,buyerIdentityUpdate:f,cartAttributesUpdate:h,discountCodesUpdate:g,cartFragment:t}),[i,o,s,u,d,y,f,h,g,t])}function Y(e,t){return{entry:[...(t==null?void 0:t.entryActions)||[],re({lastValidCart:r=>r==null?void 0:r.cart}),"onCartActionEntry","onCartActionOptimisticUI",e],on:{RESOLVE:{target:(t==null?void 0:t.resolveTarget)||"idle",actions:[re({prevCart:r=>r==null?void 0:r.lastValidCart,cart:(r,n)=>{var a;return(a=n==null?void 0:n.payload)==null?void 0:a.cart},rawCartResult:(r,n)=>{var a;return(a=n==null?void 0:n.payload)==null?void 0:a.rawCartResult},errors:r=>{}})]},ERROR:{target:(t==null?void 0:t.errorTarget)||"error",actions:[re({prevCart:r=>r==null?void 0:r.lastValidCart,cart:r=>r==null?void 0:r.lastValidCart,errors:(r,n)=>{var a;return(a=n==null?void 0:n.payload)==null?void 0:a.errors}})]},CART_COMPLETED:{target:"cartCompleted",actions:re({prevCart:r=>{},cart:r=>{},lastValidCart:r=>{},rawCartResult:r=>{},errors:r=>{}})}},exit:["onCartActionComplete",...(t==null?void 0:t.exitActions)||[]]}}const ue={CART_FETCH:{target:"cartFetching"},CART_CREATE:{target:"cartCreating"},CART_SET:{target:"idle",actions:[re({rawCartResult:(e,t)=>t.payload.cart,cart:(e,t)=>Le(t.payload.cart)})]}},Et={CARTLINE_ADD:{target:"cartLineAdding"},CARTLINE_UPDATE:{target:"cartLineUpdating"},CARTLINE_REMOVE:{target:"cartLineRemoving"},NOTE_UPDATE:{target:"noteUpdating"},BUYER_IDENTITY_UPDATE:{target:"buyerIdentityUpdating"},CART_ATTRIBUTES_UPDATE:{target:"cartAttributesUpdating"},DISCOUNT_CODES_UPDATE:{target:"discountCodesUpdating"}};function $r(e){return nt({id:"Cart",initial:e?"idle":"uninitialized",context:{cart:e&&Le(e)},states:{uninitialized:{on:ue},cartCompleted:{on:ue},initializationError:{on:ue},idle:{on:{...ue,...Et}},error:{on:{...ue,...Et}},cartFetching:Y("cartFetchAction",{errorTarget:"initializationError"}),cartCreating:Y("cartCreateAction",{errorTarget:"initializationError"}),cartLineRemoving:Y("cartLineRemoveAction"),cartLineUpdating:Y("cartLineUpdateAction"),cartLineAdding:Y("cartLineAddAction"),noteUpdating:Y("noteUpdateAction"),buyerIdentityUpdating:Y("buyerIdentityUpdateAction"),cartAttributesUpdating:Y("cartAttributesUpdateAction"),discountCodesUpdating:Y("discountCodesUpdateAction")}})}function xr({numCartLines:e,onCartActionEntry:t,onCartActionOptimisticUI:r,onCartActionComplete:n,data:a,cartFragment:i,countryCode:o,languageCode:s}){const{cartFetch:u,cartCreate:d,cartLineAdd:y,cartLineUpdate:f,cartLineRemove:h,noteUpdate:g,buyerIdentityUpdate:c,cartAttributesUpdate:_,discountCodesUpdate:C}=Lr({numCartLines:e,cartFragment:i,countryCode:o,languageCode:s}),v=l.useMemo(()=>$r(a),[a]),[A,w,I]=_r(v,{actions:{cartFetchAction:async(p,m)=>{var b;if(m.type!=="CART_FETCH")return;const{data:E,errors:P}=await u((b=m==null?void 0:m.payload)==null?void 0:b.cartId),R=W(m,E==null?void 0:E.cart,P);w(R)},cartCreateAction:async(p,m)=>{var b;if(m.type!=="CART_CREATE")return;const{data:E,errors:P}=await d(m==null?void 0:m.payload),R=W(m,(b=E==null?void 0:E.cartCreate)==null?void 0:b.cart,P);w(R)},cartLineAddAction:async(p,m)=>{var b,O;if(m.type!=="CARTLINE_ADD"||!((b=p==null?void 0:p.cart)!=null&&b.id))return;const{data:E,errors:P}=await y(p.cart.id,m.payload.lines),R=W(m,(O=E==null?void 0:E.cartLinesAdd)==null?void 0:O.cart,P);w(R)},cartLineUpdateAction:async(p,m)=>{var b,O;if(m.type!=="CARTLINE_UPDATE"||!((b=p==null?void 0:p.cart)!=null&&b.id))return;const{data:E,errors:P}=await f(p.cart.id,m.payload.lines),R=W(m,(O=E==null?void 0:E.cartLinesUpdate)==null?void 0:O.cart,P);w(R)},cartLineRemoveAction:async(p,m)=>{var b,O;if(m.type!=="CARTLINE_REMOVE"||!((b=p==null?void 0:p.cart)!=null&&b.id))return;const{data:E,errors:P}=await h(p.cart.id,m.payload.lines),R=W(m,(O=E==null?void 0:E.cartLinesRemove)==null?void 0:O.cart,P);w(R)},noteUpdateAction:async(p,m)=>{var b,O;if(m.type!=="NOTE_UPDATE"||!((b=p==null?void 0:p.cart)!=null&&b.id))return;const{data:E,errors:P}=await g(p.cart.id,m.payload.note),R=W(m,(O=E==null?void 0:E.cartNoteUpdate)==null?void 0:O.cart,P);w(R)},buyerIdentityUpdateAction:async(p,m)=>{var b,O;if(m.type!=="BUYER_IDENTITY_UPDATE"||!((b=p==null?void 0:p.cart)!=null&&b.id))return;const{data:E,errors:P}=await c(p.cart.id,m.payload.buyerIdentity),R=W(m,(O=E==null?void 0:E.cartBuyerIdentityUpdate)==null?void 0:O.cart,P);w(R)},cartAttributesUpdateAction:async(p,m)=>{var b,O;if(m.type!=="CART_ATTRIBUTES_UPDATE"||!((b=p==null?void 0:p.cart)!=null&&b.id))return;const{data:E,errors:P}=await _(p.cart.id,m.payload.attributes),R=W(m,(O=E==null?void 0:E.cartAttributesUpdate)==null?void 0:O.cart,P);w(R)},discountCodesUpdateAction:async(p,m)=>{var b,O;if(m.type!=="DISCOUNT_CODES_UPDATE"||!((b=p==null?void 0:p.cart)!=null&&b.id))return;const{data:E,errors:P}=await C(p.cart.id,m.payload.discountCodes),R=W(m,(O=E==null?void 0:E.cartDiscountCodesUpdate)==null?void 0:O.cart,P);w(R)},...t&&{onCartActionEntry:(p,m)=>{jr(m)&&t(p,m)}},...r&&{onCartActionOptimisticUI:re((p,m)=>r(p,m))},...n&&{onCartActionComplete:(p,m)=>{qr(m)&&n(p,m)}}}});return l.useMemo(()=>[A,w,I],[A,w,I])}function Le(e){return{...e,lines:Q(e==null?void 0:e.lines),note:e.note??void 0}}function W(e,t,r){return r?{type:"ERROR",payload:{errors:r,cartActionEvent:e}}:t?{type:"RESOLVE",payload:{cart:Le(t),rawCartResult:t,cartActionEvent:e}}:{type:"CART_COMPLETED",payload:{cartActionEvent:e}}}function jr(e){return e.type==="CART_CREATE"||e.type==="CARTLINE_ADD"||e.type==="CARTLINE_UPDATE"||e.type==="CARTLINE_REMOVE"||e.type==="NOTE_UPDATE"||e.type==="BUYER_IDENTITY_UPDATE"||e.type==="CART_ATTRIBUTES_UPDATE"||e.type==="DISCOUNT_CODES_UPDATE"}function qr(e){return e.type==="RESOLVE"||e.type==="ERROR"||e.type==="CART_COMPLETED"}const _t=l.createContext(null);function ae(){const e=l.useContext(_t);if(!e)throw new Error("Expected a Cart Context, but no Cart Context was found");return e}function Hr({children:e,numCartLines:t,onCreate:r,onLineAdd:n,onLineRemove:a,onLineUpdate:i,onNoteUpdate:o,onBuyerIdentityUpdate:s,onAttributesUpdate:u,onDiscountCodesUpdate:d,onCreateComplete:y,onLineAddComplete:f,onLineRemoveComplete:h,onLineUpdateComplete:g,onNoteUpdateComplete:c,onBuyerIdentityUpdateComplete:_,onAttributesUpdateComplete:C,onDiscountCodesUpdateComplete:v,data:A,cartFragment:w=Vr,customerAccessToken:I,countryCode:p,languageCode:m}){var er,tr,rr,nr,ar,ir,or;const E=ce();if(!E)throw new Error("<CartProvider> needs to be a descendant of <ShopifyProvider>");p=(p??E.countryIsoCode??"US").toUpperCase(),m=(m??E.languageIsoCode??"EN").toUpperCase(),p&&(p=p.toUpperCase());const[P,R]=l.useState(p),[b,O]=l.useState(I),q=l.useRef(!1);(P!==p||b!==I)&&(R(p),O(I),q.current=!1);const[V,H]=xr({numCartLines:t,data:A,cartFragment:w,countryCode:p,languageCode:m,onCartActionEntry(T,N){try{switch(N.type){case"CART_CREATE":return r==null?void 0:r();case"CARTLINE_ADD":return n==null?void 0:n();case"CARTLINE_REMOVE":return a==null?void 0:a();case"CARTLINE_UPDATE":return i==null?void 0:i();case"NOTE_UPDATE":return o==null?void 0:o();case"BUYER_IDENTITY_UPDATE":return s==null?void 0:s();case"CART_ATTRIBUTES_UPDATE":return u==null?void 0:u();case"DISCOUNT_CODES_UPDATE":return d==null?void 0:d()}}catch(F){console.error("Cart entry action failed",F)}},onCartActionOptimisticUI(T,N){var F,K,M,_e;if(!T.cart)return{...T};switch(N.type){case"CARTLINE_REMOVE":return{...T,cart:{...T.cart,lines:(K=(F=T==null?void 0:T.cart)==null?void 0:F.lines)==null?void 0:K.filter(L=>(L==null?void 0:L.id)&&!N.payload.lines.includes(L==null?void 0:L.id))}};case"CARTLINE_UPDATE":return{...T,cart:{...T.cart,lines:(_e=(M=T==null?void 0:T.cart)==null?void 0:M.lines)==null?void 0:_e.map(L=>{const Qe=N.payload.lines.find(({id:ya})=>ya===(L==null?void 0:L.id));return Qe&&Qe.quantity?{...L,quantity:Qe.quantity}:L})}}}return{...T}},onCartActionComplete(T,N){const F=N.payload.cartActionEvent;try{switch(N.type){case"RESOLVE":switch(F.type){case"CART_CREATE":return y==null?void 0:y();case"CARTLINE_ADD":return f==null?void 0:f();case"CARTLINE_REMOVE":return h==null?void 0:h();case"CARTLINE_UPDATE":return g==null?void 0:g();case"NOTE_UPDATE":return c==null?void 0:c();case"BUYER_IDENTITY_UPDATE":return Wr(T,F)&&(q.current=!0),_==null?void 0:_();case"CART_ATTRIBUTES_UPDATE":return C==null?void 0:C();case"DISCOUNT_CODES_UPDATE":return v==null?void 0:v()}}}catch(K){console.error("onCartActionComplete failed",K)}}}),X=l.useRef(!1),[me,k]=l.useState(!1),se=V.matches("cartCompleted"),pe=(V.value==="idle"||V.value==="error"||V.value==="cartCompleted")&&p!==((rr=(tr=(er=V==null?void 0:V.context)==null?void 0:er.cart)==null?void 0:tr.buyerIdentity)==null?void 0:rr.countryCode)&&!V.context.errors,Ee=l.useRef(!1);l.useEffect(()=>{if(!X.current&&!Ee.current){if(!A&&$e("localStorage")){Ee.current=!0;try{const T=window.localStorage.getItem(Ue);T&&H({type:"CART_FETCH",payload:{cartId:T}})}catch(T){console.warn("error fetching cartId"),console.warn(T)}}X.current=!0,k(!0)}},[A,X,H]),l.useEffect(()=>{!pe||q.current||H({type:"BUYER_IDENTITY_UPDATE",payload:{buyerIdentity:{countryCode:p,customerAccessToken:I}}})},[p,I,pe,q,H]);const B=l.useCallback(T=>{if(!X.current)return console.warn("Cart isn't ready yet");H(T)},[H]);l.useEffect(()=>{var T,N,F;if((N=(T=V==null?void 0:V.context)==null?void 0:T.cart)!=null&&N.id&&$e("localStorage"))try{window.localStorage.setItem(Ue,(F=V.context.cart)==null?void 0:F.id)}catch(K){console.warn("Failed to save cartId to localStorage",K)}},[(ar=(nr=V==null?void 0:V.context)==null?void 0:nr.cart)==null?void 0:ar.id]),l.useEffect(()=>{if(se&&$e("localStorage"))try{window.localStorage.removeItem(Ue)}catch(T){console.warn("Failed to delete cartId from localStorage",T)}},[se]);const Ke=l.useCallback(T=>{var N,F;p&&!((N=T.buyerIdentity)!=null&&N.countryCode)&&(T.buyerIdentity==null&&(T.buyerIdentity={}),T.buyerIdentity.countryCode=p),I&&!((F=T.buyerIdentity)!=null&&F.customerAccessToken)&&(T.buyerIdentity==null&&(T.buyerIdentity={}),T.buyerIdentity.customerAccessToken=I),B({type:"CART_CREATE",payload:T})},[p,I,B]),D=Yr(V),ha=l.useMemo(()=>{var T,N,F,K;return{...((T=D==null?void 0:D.context)==null?void 0:T.cart)??{lines:[],attributes:[]},status:Br(D.value),error:(N=D==null?void 0:D.context)==null?void 0:N.errors,totalQuantity:((K=(F=D==null?void 0:D.context)==null?void 0:F.cart)==null?void 0:K.totalQuantity)??0,cartCreate:Ke,cartReady:me,linesAdd(M){var _e,L;(L=(_e=D==null?void 0:D.context)==null?void 0:_e.cart)!=null&&L.id?B({type:"CARTLINE_ADD",payload:{lines:M}}):Ke({lines:M})},linesRemove(M){B({type:"CARTLINE_REMOVE",payload:{lines:M}})},linesUpdate(M){B({type:"CARTLINE_UPDATE",payload:{lines:M}})},noteUpdate(M){B({type:"NOTE_UPDATE",payload:{note:M}})},buyerIdentityUpdate(M){B({type:"BUYER_IDENTITY_UPDATE",payload:{buyerIdentity:M}})},cartAttributesUpdate(M){B({type:"CART_ATTRIBUTES_UPDATE",payload:{attributes:M}})},discountCodesUpdate(M){B({type:"DISCOUNT_CODES_UPDATE",payload:{discountCodes:M}})},cartFragment:w}},[Ke,me,(ir=D==null?void 0:D.context)==null?void 0:ir.cart,(or=D==null?void 0:D.context)==null?void 0:or.errors,D.value,w,B]);return React.createElement(_t.Provider,{value:ha},e)}function Br(e){switch(e){case"uninitialized":case"initializationError":return"uninitialized";case"idle":case"cartCompleted":case"error":return"idle";case"cartFetching":return"fetching";case"cartCreating":return"creating";case"cartLineAdding":case"cartLineRemoving":case"cartLineUpdating":case"noteUpdating":case"buyerIdentityUpdating":case"cartAttributesUpdating":case"discountCodesUpdating":return"updating"}}function Yr(e){const[t,r]=l.useTransition(),[n,a]=l.useState(e),i=l.useRef(!1);t&&(i.current=!0);const o=l.useRef(!1);return!t&&i.current&&(o.current=!0),l.useEffect(()=>{r(()=>{o.current||a(e)})},[e]),o.current?e:n}function $e(e){let t;try{t=window[e];const r="__storage_test__";return t.setItem(r,r),t.removeItem(r),!0}catch(r){return!!(r instanceof DOMException&&(r.code===22||r.code===1014||r.name==="QuotaExceededError"||r.name==="NS_ERROR_DOM_QUOTA_REACHED")&&t&&t.length!==0)}}function Wr(e,t){var r,n;return!!(t.payload.buyerIdentity.countryCode&&((n=(r=e.cart)==null?void 0:r.buyerIdentity)==null?void 0:n.countryCode)!==t.payload.buyerIdentity.countryCode)}const St=l.createContext(null);function Gr({children:e,data:t,initialVariantId:r}){const n=l.useMemo(()=>Q(t.variants??{}),[t.variants]);if(!Kr(n))throw new Error("<ProductProvider/> requires 'product.variants.nodes' or 'product.variants.edges'");const a=l.useMemo(()=>Zr(n),[n]),[i,o]=l.useState(()=>bt(r,n)),[s,u]=l.useState(()=>vt(i));l.useEffect(()=>{const C=bt(r,n);o(C),u(vt(C))},[r,n]);const d=l.useCallback((C,v)=>{u(A=>{const w={...A,[C]:v};return o(Tt(n,w)),w})},[u,n]),y=l.useCallback((C,v)=>{const A=Tt(n,{...s,[C]:v});return(A==null?void 0:A.availableForSale)??!0},[s,n]),f=l.useMemo(()=>Q(t.sellingPlanGroups??{}).map(C=>({...C,sellingPlans:Q((C==null?void 0:C.sellingPlans)??{})})),[t.sellingPlanGroups]),[h,g]=l.useState(void 0),c=l.useMemo(()=>{var C,v;if(!(!i||!h)){if(!((C=i.sellingPlanAllocations)!=null&&C.nodes)&&!((v=i.sellingPlanAllocations)!=null&&v.edges))throw new Error("<ProductProvider/>: You must include 'sellingPlanAllocations.nodes' or 'sellingPlanAllocations.edges' in your variants in order to calculate selectedSellingPlanAllocation");return Q(i.sellingPlanAllocations).find(A=>{var w;return((w=A==null?void 0:A.sellingPlan)==null?void 0:w.id)===h.id})}},[i,h]),_=l.useMemo(()=>({product:t,variants:n,variantsConnection:t.variants,options:a,selectedVariant:i,setSelectedVariant:o,selectedOptions:s,setSelectedOption:d,setSelectedOptions:u,isOptionInStock:y,selectedSellingPlan:h,setSelectedSellingPlan:g,selectedSellingPlanAllocation:c,sellingPlanGroups:f,sellingPlanGroupsConnection:t.sellingPlanGroups}),[t,y,a,s,h,c,i,f,d,n]);return React.createElement(St.Provider,{value:_},e)}function Ct(){const e=l.useContext(St);if(!e)throw new Error("'useProduct' must be a child of <ProductProvider />");return e}function Tt(e,t){var r,n;if(!(!e.length||((n=(r=e==null?void 0:e[0])==null?void 0:r.selectedOptions)==null?void 0:n.length)!==Object.keys(t).length))return e==null?void 0:e.find(a=>Object.entries(t).every(([i,o])=>{var s;return(s=a==null?void 0:a.selectedOptions)==null?void 0:s.some(u=>(u==null?void 0:u.name)===i&&(u==null?void 0:u.value)===o)}))}function Zr(e){const t=e.reduce((r,n)=>{var a;if(!n.selectedOptions)throw new Error("'getOptions' requires 'variant.selectedOptions'");return(a=n==null?void 0:n.selectedOptions)==null||a.forEach(i=>{r[(i==null?void 0:i.name)??""]=r[(i==null?void 0:i.name)??""]||new Set,r[(i==null?void 0:i.name)??""].add((i==null?void 0:i.value)??"")}),r},{});return Object.keys(t).map(r=>({name:r,values:Array.from(t[r])}))}function bt(e,t){if(e){const r=t.find(n=>(n==null?void 0:n.id)===e);return r||console.warn("<ProductProvider/> received a 'initialVariantId' prop, but could not actually find a variant with that ID"),r}if(e===null)return null;if(e===void 0)return t.find(r=>r==null?void 0:r.availableForSale)||t[0]}function vt(e){return e!=null&&e.selectedOptions?e.selectedOptions.reduce((t,r)=>(t[(r==null?void 0:r.name)??""]=(r==null?void 0:r.value)??"",t),{}):{}}function Kr(e){return!(!e||!Array.isArray(e))}function be(e){const{as:t,onClick:r,defaultOnClick:n,children:a,buttonRef:i,...o}=e,s=l.useCallback(d=>{if(r){const y=r(d);if(typeof y=="boolean"&&y===!1||d!=null&&d.defaultPrevented)return}n==null||n(d)},[n,r]),u=t||"button";return React.createElement(u,{ref:i,onClick:s,...o},a)}function Qr(e){const[t,r]=l.useState(!1),{variantId:n,quantity:a=1,attributes:i,sellingPlanId:o,onClick:s,children:u,accessibleAddingToCartLabel:d,parent:y,...f}=e,{status:h,linesAdd:g}=ae(),{selectedVariant:c}=Ct(),_=n??(c==null?void 0:c.id)??"",C=n===null||_===""||c===null||t||f.disabled;l.useEffect(()=>{t&&h==="idle"&&r(!1)},[h,t]);const v=l.useCallback(()=>{r(!0),g([{quantity:a,merchandiseId:_||"",attributes:i,parent:y,sellingPlanId:o}])},[g,a,_,i,o,y]);return U.createElement(U.Fragment,null,U.createElement(be,{...f,disabled:C,onClick:s,defaultOnClick:v},u),d?U.createElement("p",{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},role:"alert","aria-live":"assertive"},t?d:null):null)}const te={PAGE_VIEW:"PAGE_VIEW",ADD_TO_CART:"ADD_TO_CART",PAGE_VIEW_2:"PAGE_VIEW_2",COLLECTION_VIEW:"COLLECTION_VIEW",PRODUCT_VIEW:"PRODUCT_VIEW",SEARCH_VIEW:"SEARCH_VIEW"},ve={article:"article",blog:"blog",captcha:"captcha",cart:"cart",collection:"collection",customersAccount:"customers/account",customersActivateAccount:"customers/activate_account",customersAddresses:"customers/addresses",customersLogin:"customers/login",customersOrder:"customers/order",customersRegister:"customers/register",customersResetPassword:"customers/reset_password",giftCard:"gift_card",home:"index",listCollections:"list-collections",forbidden:"403",notFound:"404",page:"page",password:"password",product:"product",policy:"policy",search:"search"},wt={hydrogen:"hydrogen",headless:"headless"},At={hydrogen:"6167201",headless:"12875497473"};function j(e,t){return{schema_id:e,payload:t,metadata:{event_created_at_ms:Date.now()}}}function $(e){const t={id:"",resource:null,resourceId:null,search:"",searchParams:new URLSearchParams,hash:""};if(typeof e!="string")return t;try{const{search:r,searchParams:n,pathname:a,hash:i}=new URL(e),o=a.split("/"),s=o[o.length-1],u=o[o.length-2];return!s||!u?t:{id:`${s}${r}${i}`||"",resource:u??null,resourceId:s||null,search:r,searchParams:n,hash:i}}catch{return t}}function x(e,t){return typeof e!="object"?{}:(Object.entries(e).forEach(([r,n])=>{n&&(t[r]=n)}),t)}function Jr(e){return typeof document>"u"?(console.error(`${e} should only be used within the useEffect callback or event handlers`),!0):!1}const It="xxxx-4xxx-xxxx-xxxxxxxxxxxx";function we(){let e="";try{const t=window.crypto,r=new Uint16Array(31);t.getRandomValues(r);let n=0;e=It.replace(/[x]/g,a=>{const i=r[n]%16,o=a==="x"?i:i&3|8;return n++,o.toString(16)}).toUpperCase()}catch{e=It.replace(/[x]/g,r=>{const n=Math.random()*16|0;return(r==="x"?n:n&3|8).toString(16)}).toUpperCase()}return`${Xr()}-${e}`}function Xr(){let e=0,t=0;e=new Date().getTime()>>>0;try{t=performance.now()>>>0}catch{t=0}return Math.abs(e+t).toString(16).toLowerCase().padStart(8,"0")}function zr(e){const t=ee(e);return{[Ce]:t.uniqueToken,[Te]:t.visitToken}}const en="trekkie_storefront_page_view/1.4",tn="myshopify.dev";function Pt(e){const t=e,{id:r,resource:n}=$(t.resourceId),a=n?n.toLowerCase():void 0;return[j(en,x({pageType:t.pageType,customerId:parseInt($(t.customerId).id||"0"),resourceType:a,resourceId:parseInt(r)},rn(t)))]}function rn(e){return{appClientId:e.shopifySalesChannel?At[e.shopifySalesChannel]:At.headless,isMerchantRequest:nn(e.url),hydrogenSubchannelId:e.storefrontId||e.hydrogenSubchannelId||"0",isPersistentCookie:e.hasUserConsent,uniqToken:e.uniqueToken,visitToken:e.visitToken,microSessionId:we(),microSessionCount:1,url:e.url,path:e.path,search:e.search,referrer:e.referrer,title:e.title,shopId:parseInt($(e.shopId).id),currency:e.currency,contentLanguage:e.acceptedLanguage||"en"}}function nn(e){if(typeof e!="string")return!1;const t=new URL(e).hostname;return t.indexOf(tn)!==-1||t==="localhost"}const an="2026.1.0",G="custom_storefront_customer_tracking/1.2",Ot="page_rendered",Rt="collection_page_rendered",Vt="product_page_rendered",on="product_added_to_cart",Dt="search_submitted";function le(e){return{canonical_url:e.canonicalUrl||e.url,customer_id:parseInt($(e.customerId).id||"0")}}function sn(e){const t=e,r=le(t),n=t.pageType,a=[];switch(a.push(j(G,x({event_name:Ot,...r},Z(t)))),n){case ve.collection:a.push(j(G,x({event_name:Rt,...r,collection_name:t.collectionHandle,collection_id:parseInt($(t.collectionId).id)},Z(t))));break;case ve.product:a.push(j(G,x({event_name:Vt,...r,products:xe(t.products),total_value:t.totalValue},Z(t))));break;case ve.search:a.push(j(G,x({event_name:Dt,...r,search_string:t.searchString},Z(t))));break}return a}function cn(e){const t=e,r=le(t);return[j(G,x({event_name:Ot,...r},Z(t)))]}function un(e){const t=e,r=le(t);return[j(G,x({event_name:Rt,...r,collection_name:t.collectionHandle,collection_id:parseInt($(t.collectionId).id)},Z(t)))]}function ln(e){const t=e,r=le(t);return[j(G,x({event_name:Vt,...r,products:xe(t.products),total_value:t.totalValue},Z(t)))]}function dn(e){const t=e,r=le(t);return[j(G,x({event_name:Dt,...r,search_string:t.searchString},Z(t)))]}function fn(e){const t=e,r=$(t.cartId);return[j(G,x({event_name:on,customerId:t.customerId,cart_token:r!=null&&r.id?`${r.id}`:null,total_value:t.totalValue,products:xe(t.products),customer_id:parseInt($(t.customerId).id||"0")},Z(t)))]}function Z(e){const t=e;return{source:e.shopifySalesChannel||wt.headless,asset_version_id:e.assetVersionId||an,hydrogenSubchannelId:e.storefrontId||e.hydrogenSubchannelId||"0",is_persistent_cookie:e.hasUserConsent,deprecated_visit_token:e.visitToken,unique_token:e.uniqueToken,event_time:Date.now(),event_id:we(),event_source_url:e.url,referrer:e.referrer,user_agent:e.userAgent,navigation_type:e.navigationType,navigation_api:e.navigationApi,shop_id:parseInt($(e.shopId).id),currency:e.currency,ccpa_enforced:t.ccpaEnforced||!1,gdpr_enforced:t.gdprEnforced||!1,gdpr_enforced_as_string:t.gdprEnforced?"true":"false",analytics_allowed:e.analyticsAllowed||!1,marketing_allowed:e.marketingAllowed||!1,sale_of_data_allowed:e.saleOfDataAllowed||!1}}function xe(e){return e?e.map(t=>{const r=x({variant_gid:t.variantGid,category:t.category,sku:t.sku,product_id:parseInt($(t.productGid).id),variant_id:parseInt($(t.variantGid).id)},{product_gid:t.productGid,name:t.name,variant:t.variantName||"",brand:t.brand,price:parseFloat(t.price),quantity:Number(t.quantity||0)});return JSON.stringify(r)}):[]}function hn(e,t){const{eventName:r,payload:n}=e;if(!n.hasUserConsent)return Promise.resolve();let a=[];const i=n;return r===te.PAGE_VIEW?a=a.concat(Pt(i),sn(i)):r===te.ADD_TO_CART?a=a.concat(fn(n)):r===te.PAGE_VIEW_2?a=a.concat(Pt(i),cn(i)):r===te.COLLECTION_VIEW?a=a.concat(un(i)):r===te.PRODUCT_VIEW?a=a.concat(ln(i)):r===te.SEARCH_VIEW&&(a=a.concat(dn(i))),a.length?gn(a,t):Promise.resolve()}function yn(){return typeof window>"u"||!window.navigator?!1:/Chrome-Lighthouse/.test(window.navigator.userAgent)}const kt="sendShopifyAnalytics request is unsuccessful";function gn(e,t){if(yn())return Promise.resolve();const r={events:e,metadata:{event_sent_at_ms:Date.now()}};try{return fetch(t?`https://${t}/.well-known/shopify/monorail/unstable/produce_batch`:"https://monorail-edge.shopifysvc.com/unstable/produce_batch",{method:"post",headers:{"content-type":"text/plain"},body:JSON.stringify(r)}).then(n=>{if(!n.ok)throw new Error("Response failed");return n.text()}).then(n=>{n&&JSON.parse(n).result.forEach(i=>{i.status!==200&&console.error(kt,`
326
+ You may run into unexpected errors if these versions don't match. Received version: "${n}"; expected version "${ne}"`);const i=o=>{const s=(o==null?void 0:o.storeDomain)??e;return s.includes("://")?s:`https://${s}`};return{getShopifyDomain:i,getStorefrontApiUrl(o){const s=i(o);return`${s+(s.endsWith("/")?"api":"/api")}/${(o==null?void 0:o.storefrontApiVersion)??n}/graphql.json`},getPrivateTokenHeaders(o){if(!t&&!(o!=null&&o.privateStorefrontToken)&&!ut(e))throw new Error(ke+"You did not pass in a `privateStorefrontToken` while using `createStorefrontClient()` or `getPrivateTokenHeaders()`");return{"content-type":((o==null?void 0:o.contentType)??a)==="graphql"?"application/graphql":"application/json","X-SDK-Variant":"hydrogen-react","X-SDK-Variant-Source":"react","X-SDK-Version":n,"Shopify-Storefront-Private-Token":(o==null?void 0:o.privateStorefrontToken)??t??"",...o!=null&&o.buyerIp?{"Shopify-Storefront-Buyer-IP":o.buyerIp}:{}}},getPublicTokenHeaders(o){if(!r&&!(o!=null&&o.publicStorefrontToken)&&!ut(e))throw new Error(ke+"You did not pass in a `publicStorefrontToken` while using `createStorefrontClient()` or `getPublicTokenHeaders()`");const s=(o==null?void 0:o.contentType)??a??"json";return lt(s,n,(o==null?void 0:o.publicStorefrontToken)??r??"")}}}function lt(e,t,r){return{"content-type":e==="graphql"?"application/graphql":"application/json","X-SDK-Variant":"hydrogen-react","X-SDK-Variant-Source":"react","X-SDK-Version":t,"X-Shopify-Storefront-Access-Token":r}}const dt=new Set,ke="[h2:error:createStorefrontClient] ",Ur=(e,t="warn")=>{dt.has(e)||(console[t](`[h2:${t}:createStorefrontClient] `+e),dt.add(e))},ft={storeDomain:"test",storefrontToken:"abc123",storefrontApiVersion:ne,countryIsoCode:"US",languageIsoCode:"EN",getStorefrontApiUrl(){return""},getPublicTokenHeaders(){return{}},getShopifyDomain(){return""}},ht=l.createContext(ft);function Nr(){var e,t,r;if(typeof window>"u")return!1;try{const n=(t=(e=window.performance)==null?void 0:e.getEntriesByType)==null?void 0:t.call(e,"navigation")[0];return!!((r=n==null?void 0:n.serverTiming)!=null&&r.some(a=>a.name==="_sfapi_proxy"))}catch{return!1}}function Mr({children:e,...t}){if(!t.countryIsoCode||!t.languageIsoCode||!t.storeDomain||!t.storefrontToken||!t.storefrontApiVersion)throw new Error("Please provide the necessary props to '<ShopifyProvider/>'");t.storefrontApiVersion!==ne&&console.warn(`<ShopifyProvider/>: This version of Hydrogen React is built for Shopify's Storefront API version ${ne}, but it looks like you're using version ${t.storefrontApiVersion}. There may be issues or bugs if you use a mismatched version of Hydrogen React and the Storefront API.`);const r=l.useMemo(()=>{const n=t.sameDomainForStorefrontApi??Nr();function a(i){const o=(i==null?void 0:i.storeDomain)??t.storeDomain;return o.includes("://")?o:`https://${o}`}return{...t,sameDomainForStorefrontApi:n,getPublicTokenHeaders(i){return lt(i.contentType,t.storefrontApiVersion,i.storefrontToken??t.storefrontToken)},getShopifyDomain:a,getStorefrontApiUrl(i){const o=n&&typeof window<"u"?window.location.origin:a({storeDomain:(i==null?void 0:i.storeDomain)??t.storeDomain});return`${o}${o.endsWith("/")?"":"/"}api/${(i==null?void 0:i.storefrontApiVersion)??t.storefrontApiVersion}/graphql.json`}}},[t]);return React.createElement(ht.Provider,{value:r},e)}function ce(){const e=l.useContext(ht);if(!e)throw new Error("'useShop()' must be a descendent of <ShopifyProvider/>");return e}const Ue="shopifyCartId",yt="Shopify-Storefront-Id",gt="Shopify-Storefront-Y",mt="Shopify-Storefront-S",Ce="_shopify_y",Te="_shopify_s",Ne="X-Shopify-VisitToken",Me="X-Shopify-UniqueToken",Fe={current:null};function ee(){var t,r,n;let e;if(typeof window<"u"&&typeof window.performance<"u")try{const a=/^https?:\/\/([^/]+)(\/api\/(?:unstable|2\d{3}-\d{2})\/graphql\.json(?=$|\?))?/,i=performance.getEntriesByType("resource");let o;for(let s=i.length-1;s>=0;s--){const u=i[s];if(u.initiatorType!=="fetch")continue;const d=window.location.host,y=u.name.match(a);if(!y)continue;const[,f,h]=y;if(f===d||h&&(f==null?void 0:f.endsWith(`.${d}`))){const c=pt(u);if(c){o=c;break}}}if(o&&(e=o),e?Fe.current=e:Fe.current&&(e=Fe.current),!e){const s=performance.getEntriesByType("navigation")[0];e=pt(s,!1)}}catch{}if(!e){const a=typeof arguments[0]=="string"?arguments[0]:typeof document<"u"?document.cookie:"";e={uniqueToken:((t=a.match(/\b_shopify_y=([^;]+)/))==null?void 0:t[1])||"",visitToken:((r=a.match(/\b_shopify_s=([^;]+)/))==null?void 0:r[1])||"",consent:((n=a.match(/\b_tracking_consent=([^;]+)/))==null?void 0:n[1])||""}}return e}function pt(e,t=!0){let r="",n="",a="";const i=e.serverTiming;if(i&&i.length>=3)for(let o=i.length-1;o>=0;o--){const{name:s,description:u}=i[o];if(!(!s||!u)&&(s==="_y"?r=u:s==="_s"?n=u:s==="_cmp"&&(a=u),r&&n&&a))break}return r&&n&&(!t||a)?{uniqueToken:r,visitToken:n,consent:a}:void 0}function Fr(){const{storefrontId:e,getPublicTokenHeaders:t,getStorefrontApiUrl:r,sameDomainForStorefrontApi:n}=ce();return l.useCallback(({query:a,variables:i})=>{const o=t({contentType:"json"});if(e&&(o[yt]=e),!n){const{uniqueToken:s,visitToken:u}=ee();s&&(o[gt]=s,o[Me]=s),u&&(o[mt]=u,o[Ne]=u)}return fetch(r(),{method:"POST",headers:o,body:JSON.stringify({query:a.toString(),variables:i})}).then(s=>s.json()).catch(s=>({data:void 0,errors:s==null?void 0:s.toString()}))},[t,e,r,n])}function Lr({numCartLines:e,cartFragment:t,countryCode:r="US",languageCode:n="EN"}){const a=Fr(),i=l.useCallback(c=>a({query:Rr(t),variables:{id:c,numCartLines:e,country:r,language:n}}),[a,t,e,r,n]),o=l.useCallback(c=>a({query:br(t),variables:{input:c,numCartLines:e,country:r,language:n}}),[t,r,a,e,n]),s=l.useCallback((c,_)=>a({query:Tr(t),variables:{cartId:c,lines:_,numCartLines:e,country:r,language:n}}),[t,r,a,e,n]),u=l.useCallback((c,_)=>a({query:wr(t),variables:{cartId:c,lines:_,numCartLines:e,country:r,language:n}}),[t,r,a,e,n]),d=l.useCallback((c,_)=>a({query:vr(t),variables:{cartId:c,lines:_,numCartLines:e,country:r,language:n}}),[t,r,a,e,n]),y=l.useCallback((c,_)=>a({query:Ar(t),variables:{cartId:c,note:_,numCartLines:e,country:r,language:n}}),[a,t,e,r,n]),f=l.useCallback((c,_)=>a({query:Ir(t),variables:{cartId:c,buyerIdentity:_,numCartLines:e,country:r,language:n}}),[t,r,a,e,n]),h=l.useCallback((c,_)=>a({query:Pr(t),variables:{cartId:c,attributes:_,numCartLines:e,country:r,language:n}}),[t,r,a,e,n]),g=l.useCallback((c,_)=>a({query:Or(t),variables:{cartId:c,discountCodes:_,numCartLines:e,country:r,language:n}}),[t,r,a,e,n]);return l.useMemo(()=>({cartFetch:i,cartCreate:o,cartLineAdd:s,cartLineUpdate:u,cartLineRemove:d,noteUpdate:y,buyerIdentityUpdate:f,cartAttributesUpdate:h,discountCodesUpdate:g,cartFragment:t}),[i,o,s,u,d,y,f,h,g,t])}function Y(e,t){return{entry:[...(t==null?void 0:t.entryActions)||[],re({lastValidCart:r=>r==null?void 0:r.cart}),"onCartActionEntry","onCartActionOptimisticUI",e],on:{RESOLVE:{target:(t==null?void 0:t.resolveTarget)||"idle",actions:[re({prevCart:r=>r==null?void 0:r.lastValidCart,cart:(r,n)=>{var a;return(a=n==null?void 0:n.payload)==null?void 0:a.cart},rawCartResult:(r,n)=>{var a;return(a=n==null?void 0:n.payload)==null?void 0:a.rawCartResult},errors:r=>{}})]},ERROR:{target:(t==null?void 0:t.errorTarget)||"error",actions:[re({prevCart:r=>r==null?void 0:r.lastValidCart,cart:r=>r==null?void 0:r.lastValidCart,errors:(r,n)=>{var a;return(a=n==null?void 0:n.payload)==null?void 0:a.errors}})]},CART_COMPLETED:{target:"cartCompleted",actions:re({prevCart:r=>{},cart:r=>{},lastValidCart:r=>{},rawCartResult:r=>{},errors:r=>{}})}},exit:["onCartActionComplete",...(t==null?void 0:t.exitActions)||[]]}}const ue={CART_FETCH:{target:"cartFetching"},CART_CREATE:{target:"cartCreating"},CART_SET:{target:"idle",actions:[re({rawCartResult:(e,t)=>t.payload.cart,cart:(e,t)=>Le(t.payload.cart)})]}},Et={CARTLINE_ADD:{target:"cartLineAdding"},CARTLINE_UPDATE:{target:"cartLineUpdating"},CARTLINE_REMOVE:{target:"cartLineRemoving"},NOTE_UPDATE:{target:"noteUpdating"},BUYER_IDENTITY_UPDATE:{target:"buyerIdentityUpdating"},CART_ATTRIBUTES_UPDATE:{target:"cartAttributesUpdating"},DISCOUNT_CODES_UPDATE:{target:"discountCodesUpdating"}};function $r(e){return nt({id:"Cart",initial:e?"idle":"uninitialized",context:{cart:e&&Le(e)},states:{uninitialized:{on:ue},cartCompleted:{on:ue},initializationError:{on:ue},idle:{on:{...ue,...Et}},error:{on:{...ue,...Et}},cartFetching:Y("cartFetchAction",{errorTarget:"initializationError"}),cartCreating:Y("cartCreateAction",{errorTarget:"initializationError"}),cartLineRemoving:Y("cartLineRemoveAction"),cartLineUpdating:Y("cartLineUpdateAction"),cartLineAdding:Y("cartLineAddAction"),noteUpdating:Y("noteUpdateAction"),buyerIdentityUpdating:Y("buyerIdentityUpdateAction"),cartAttributesUpdating:Y("cartAttributesUpdateAction"),discountCodesUpdating:Y("discountCodesUpdateAction")}})}function xr({numCartLines:e,onCartActionEntry:t,onCartActionOptimisticUI:r,onCartActionComplete:n,data:a,cartFragment:i,countryCode:o,languageCode:s}){const{cartFetch:u,cartCreate:d,cartLineAdd:y,cartLineUpdate:f,cartLineRemove:h,noteUpdate:g,buyerIdentityUpdate:c,cartAttributesUpdate:_,discountCodesUpdate:C}=Lr({numCartLines:e,cartFragment:i,countryCode:o,languageCode:s}),v=l.useMemo(()=>$r(a),[a]),[A,w,I]=_r(v,{actions:{cartFetchAction:async(p,m)=>{var b;if(m.type!=="CART_FETCH")return;const{data:E,errors:P}=await u((b=m==null?void 0:m.payload)==null?void 0:b.cartId),R=W(m,E==null?void 0:E.cart,P);w(R)},cartCreateAction:async(p,m)=>{var b;if(m.type!=="CART_CREATE")return;const{data:E,errors:P}=await d(m==null?void 0:m.payload),R=W(m,(b=E==null?void 0:E.cartCreate)==null?void 0:b.cart,P);w(R)},cartLineAddAction:async(p,m)=>{var b,O;if(m.type!=="CARTLINE_ADD"||!((b=p==null?void 0:p.cart)!=null&&b.id))return;const{data:E,errors:P}=await y(p.cart.id,m.payload.lines),R=W(m,(O=E==null?void 0:E.cartLinesAdd)==null?void 0:O.cart,P);w(R)},cartLineUpdateAction:async(p,m)=>{var b,O;if(m.type!=="CARTLINE_UPDATE"||!((b=p==null?void 0:p.cart)!=null&&b.id))return;const{data:E,errors:P}=await f(p.cart.id,m.payload.lines),R=W(m,(O=E==null?void 0:E.cartLinesUpdate)==null?void 0:O.cart,P);w(R)},cartLineRemoveAction:async(p,m)=>{var b,O;if(m.type!=="CARTLINE_REMOVE"||!((b=p==null?void 0:p.cart)!=null&&b.id))return;const{data:E,errors:P}=await h(p.cart.id,m.payload.lines),R=W(m,(O=E==null?void 0:E.cartLinesRemove)==null?void 0:O.cart,P);w(R)},noteUpdateAction:async(p,m)=>{var b,O;if(m.type!=="NOTE_UPDATE"||!((b=p==null?void 0:p.cart)!=null&&b.id))return;const{data:E,errors:P}=await g(p.cart.id,m.payload.note),R=W(m,(O=E==null?void 0:E.cartNoteUpdate)==null?void 0:O.cart,P);w(R)},buyerIdentityUpdateAction:async(p,m)=>{var b,O;if(m.type!=="BUYER_IDENTITY_UPDATE"||!((b=p==null?void 0:p.cart)!=null&&b.id))return;const{data:E,errors:P}=await c(p.cart.id,m.payload.buyerIdentity),R=W(m,(O=E==null?void 0:E.cartBuyerIdentityUpdate)==null?void 0:O.cart,P);w(R)},cartAttributesUpdateAction:async(p,m)=>{var b,O;if(m.type!=="CART_ATTRIBUTES_UPDATE"||!((b=p==null?void 0:p.cart)!=null&&b.id))return;const{data:E,errors:P}=await _(p.cart.id,m.payload.attributes),R=W(m,(O=E==null?void 0:E.cartAttributesUpdate)==null?void 0:O.cart,P);w(R)},discountCodesUpdateAction:async(p,m)=>{var b,O;if(m.type!=="DISCOUNT_CODES_UPDATE"||!((b=p==null?void 0:p.cart)!=null&&b.id))return;const{data:E,errors:P}=await C(p.cart.id,m.payload.discountCodes),R=W(m,(O=E==null?void 0:E.cartDiscountCodesUpdate)==null?void 0:O.cart,P);w(R)},...t&&{onCartActionEntry:(p,m)=>{jr(m)&&t(p,m)}},...r&&{onCartActionOptimisticUI:re((p,m)=>r(p,m))},...n&&{onCartActionComplete:(p,m)=>{qr(m)&&n(p,m)}}}});return l.useMemo(()=>[A,w,I],[A,w,I])}function Le(e){return{...e,lines:Q(e==null?void 0:e.lines),note:e.note??void 0}}function W(e,t,r){return r?{type:"ERROR",payload:{errors:r,cartActionEvent:e}}:t?{type:"RESOLVE",payload:{cart:Le(t),rawCartResult:t,cartActionEvent:e}}:{type:"CART_COMPLETED",payload:{cartActionEvent:e}}}function jr(e){return e.type==="CART_CREATE"||e.type==="CARTLINE_ADD"||e.type==="CARTLINE_UPDATE"||e.type==="CARTLINE_REMOVE"||e.type==="NOTE_UPDATE"||e.type==="BUYER_IDENTITY_UPDATE"||e.type==="CART_ATTRIBUTES_UPDATE"||e.type==="DISCOUNT_CODES_UPDATE"}function qr(e){return e.type==="RESOLVE"||e.type==="ERROR"||e.type==="CART_COMPLETED"}const _t=l.createContext(null);function ae(){const e=l.useContext(_t);if(!e)throw new Error("Expected a Cart Context, but no Cart Context was found");return e}function Hr({children:e,numCartLines:t,onCreate:r,onLineAdd:n,onLineRemove:a,onLineUpdate:i,onNoteUpdate:o,onBuyerIdentityUpdate:s,onAttributesUpdate:u,onDiscountCodesUpdate:d,onCreateComplete:y,onLineAddComplete:f,onLineRemoveComplete:h,onLineUpdateComplete:g,onNoteUpdateComplete:c,onBuyerIdentityUpdateComplete:_,onAttributesUpdateComplete:C,onDiscountCodesUpdateComplete:v,data:A,cartFragment:w=Vr,customerAccessToken:I,countryCode:p,languageCode:m}){var er,tr,rr,nr,ar,ir,or;const E=ce();if(!E)throw new Error("<CartProvider> needs to be a descendant of <ShopifyProvider>");p=(p??E.countryIsoCode??"US").toUpperCase(),m=(m??E.languageIsoCode??"EN").toUpperCase(),p&&(p=p.toUpperCase());const[P,R]=l.useState(p),[b,O]=l.useState(I),q=l.useRef(!1);(P!==p||b!==I)&&(R(p),O(I),q.current=!1);const[V,H]=xr({numCartLines:t,data:A,cartFragment:w,countryCode:p,languageCode:m,onCartActionEntry(T,N){try{switch(N.type){case"CART_CREATE":return r==null?void 0:r();case"CARTLINE_ADD":return n==null?void 0:n();case"CARTLINE_REMOVE":return a==null?void 0:a();case"CARTLINE_UPDATE":return i==null?void 0:i();case"NOTE_UPDATE":return o==null?void 0:o();case"BUYER_IDENTITY_UPDATE":return s==null?void 0:s();case"CART_ATTRIBUTES_UPDATE":return u==null?void 0:u();case"DISCOUNT_CODES_UPDATE":return d==null?void 0:d()}}catch(F){console.error("Cart entry action failed",F)}},onCartActionOptimisticUI(T,N){var F,K,M,_e;if(!T.cart)return{...T};switch(N.type){case"CARTLINE_REMOVE":return{...T,cart:{...T.cart,lines:(K=(F=T==null?void 0:T.cart)==null?void 0:F.lines)==null?void 0:K.filter(L=>(L==null?void 0:L.id)&&!N.payload.lines.includes(L==null?void 0:L.id))}};case"CARTLINE_UPDATE":return{...T,cart:{...T.cart,lines:(_e=(M=T==null?void 0:T.cart)==null?void 0:M.lines)==null?void 0:_e.map(L=>{const Qe=N.payload.lines.find(({id:ya})=>ya===(L==null?void 0:L.id));return Qe&&Qe.quantity?{...L,quantity:Qe.quantity}:L})}}}return{...T}},onCartActionComplete(T,N){const F=N.payload.cartActionEvent;try{switch(N.type){case"RESOLVE":switch(F.type){case"CART_CREATE":return y==null?void 0:y();case"CARTLINE_ADD":return f==null?void 0:f();case"CARTLINE_REMOVE":return h==null?void 0:h();case"CARTLINE_UPDATE":return g==null?void 0:g();case"NOTE_UPDATE":return c==null?void 0:c();case"BUYER_IDENTITY_UPDATE":return Wr(T,F)&&(q.current=!0),_==null?void 0:_();case"CART_ATTRIBUTES_UPDATE":return C==null?void 0:C();case"DISCOUNT_CODES_UPDATE":return v==null?void 0:v()}}}catch(K){console.error("onCartActionComplete failed",K)}}}),X=l.useRef(!1),[me,k]=l.useState(!1),se=V.matches("cartCompleted"),pe=(V.value==="idle"||V.value==="error"||V.value==="cartCompleted")&&p!==((rr=(tr=(er=V==null?void 0:V.context)==null?void 0:er.cart)==null?void 0:tr.buyerIdentity)==null?void 0:rr.countryCode)&&!V.context.errors,Ee=l.useRef(!1);l.useEffect(()=>{if(!X.current&&!Ee.current){if(!A&&$e("localStorage")){Ee.current=!0;try{const T=window.localStorage.getItem(Ue);T&&H({type:"CART_FETCH",payload:{cartId:T}})}catch(T){console.warn("error fetching cartId"),console.warn(T)}}X.current=!0,k(!0)}},[A,X,H]),l.useEffect(()=>{!pe||q.current||H({type:"BUYER_IDENTITY_UPDATE",payload:{buyerIdentity:{countryCode:p,customerAccessToken:I}}})},[p,I,pe,q,H]);const B=l.useCallback(T=>{if(!X.current)return console.warn("Cart isn't ready yet");H(T)},[H]);l.useEffect(()=>{var T,N,F;if((N=(T=V==null?void 0:V.context)==null?void 0:T.cart)!=null&&N.id&&$e("localStorage"))try{window.localStorage.setItem(Ue,(F=V.context.cart)==null?void 0:F.id)}catch(K){console.warn("Failed to save cartId to localStorage",K)}},[(ar=(nr=V==null?void 0:V.context)==null?void 0:nr.cart)==null?void 0:ar.id]),l.useEffect(()=>{if(se&&$e("localStorage"))try{window.localStorage.removeItem(Ue)}catch(T){console.warn("Failed to delete cartId from localStorage",T)}},[se]);const Ke=l.useCallback(T=>{var N,F;p&&!((N=T.buyerIdentity)!=null&&N.countryCode)&&(T.buyerIdentity==null&&(T.buyerIdentity={}),T.buyerIdentity.countryCode=p),I&&!((F=T.buyerIdentity)!=null&&F.customerAccessToken)&&(T.buyerIdentity==null&&(T.buyerIdentity={}),T.buyerIdentity.customerAccessToken=I),B({type:"CART_CREATE",payload:T})},[p,I,B]),D=Yr(V),ha=l.useMemo(()=>{var T,N,F,K;return{...((T=D==null?void 0:D.context)==null?void 0:T.cart)??{lines:[],attributes:[]},status:Br(D.value),error:(N=D==null?void 0:D.context)==null?void 0:N.errors,totalQuantity:((K=(F=D==null?void 0:D.context)==null?void 0:F.cart)==null?void 0:K.totalQuantity)??0,cartCreate:Ke,cartReady:me,linesAdd(M){var _e,L;(L=(_e=D==null?void 0:D.context)==null?void 0:_e.cart)!=null&&L.id?B({type:"CARTLINE_ADD",payload:{lines:M}}):Ke({lines:M})},linesRemove(M){B({type:"CARTLINE_REMOVE",payload:{lines:M}})},linesUpdate(M){B({type:"CARTLINE_UPDATE",payload:{lines:M}})},noteUpdate(M){B({type:"NOTE_UPDATE",payload:{note:M}})},buyerIdentityUpdate(M){B({type:"BUYER_IDENTITY_UPDATE",payload:{buyerIdentity:M}})},cartAttributesUpdate(M){B({type:"CART_ATTRIBUTES_UPDATE",payload:{attributes:M}})},discountCodesUpdate(M){B({type:"DISCOUNT_CODES_UPDATE",payload:{discountCodes:M}})},cartFragment:w}},[Ke,me,(ir=D==null?void 0:D.context)==null?void 0:ir.cart,(or=D==null?void 0:D.context)==null?void 0:or.errors,D.value,w,B]);return React.createElement(_t.Provider,{value:ha},e)}function Br(e){switch(e){case"uninitialized":case"initializationError":return"uninitialized";case"idle":case"cartCompleted":case"error":return"idle";case"cartFetching":return"fetching";case"cartCreating":return"creating";case"cartLineAdding":case"cartLineRemoving":case"cartLineUpdating":case"noteUpdating":case"buyerIdentityUpdating":case"cartAttributesUpdating":case"discountCodesUpdating":return"updating"}}function Yr(e){const[t,r]=l.useTransition(),[n,a]=l.useState(e),i=l.useRef(!1);t&&(i.current=!0);const o=l.useRef(!1);return!t&&i.current&&(o.current=!0),l.useEffect(()=>{r(()=>{o.current||a(e)})},[e]),o.current?e:n}function $e(e){let t;try{t=window[e];const r="__storage_test__";return t.setItem(r,r),t.removeItem(r),!0}catch(r){return!!(r instanceof DOMException&&(r.code===22||r.code===1014||r.name==="QuotaExceededError"||r.name==="NS_ERROR_DOM_QUOTA_REACHED")&&t&&t.length!==0)}}function Wr(e,t){var r,n;return!!(t.payload.buyerIdentity.countryCode&&((n=(r=e.cart)==null?void 0:r.buyerIdentity)==null?void 0:n.countryCode)!==t.payload.buyerIdentity.countryCode)}const St=l.createContext(null);function Gr({children:e,data:t,initialVariantId:r}){const n=l.useMemo(()=>Q(t.variants??{}),[t.variants]);if(!Kr(n))throw new Error("<ProductProvider/> requires 'product.variants.nodes' or 'product.variants.edges'");const a=l.useMemo(()=>Zr(n),[n]),[i,o]=l.useState(()=>bt(r,n)),[s,u]=l.useState(()=>vt(i));l.useEffect(()=>{const C=bt(r,n);o(C),u(vt(C))},[r,n]);const d=l.useCallback((C,v)=>{u(A=>{const w={...A,[C]:v};return o(Tt(n,w)),w})},[u,n]),y=l.useCallback((C,v)=>{const A=Tt(n,{...s,[C]:v});return(A==null?void 0:A.availableForSale)??!0},[s,n]),f=l.useMemo(()=>Q(t.sellingPlanGroups??{}).map(C=>({...C,sellingPlans:Q((C==null?void 0:C.sellingPlans)??{})})),[t.sellingPlanGroups]),[h,g]=l.useState(void 0),c=l.useMemo(()=>{var C,v;if(!(!i||!h)){if(!((C=i.sellingPlanAllocations)!=null&&C.nodes)&&!((v=i.sellingPlanAllocations)!=null&&v.edges))throw new Error("<ProductProvider/>: You must include 'sellingPlanAllocations.nodes' or 'sellingPlanAllocations.edges' in your variants in order to calculate selectedSellingPlanAllocation");return Q(i.sellingPlanAllocations).find(A=>{var w;return((w=A==null?void 0:A.sellingPlan)==null?void 0:w.id)===h.id})}},[i,h]),_=l.useMemo(()=>({product:t,variants:n,variantsConnection:t.variants,options:a,selectedVariant:i,setSelectedVariant:o,selectedOptions:s,setSelectedOption:d,setSelectedOptions:u,isOptionInStock:y,selectedSellingPlan:h,setSelectedSellingPlan:g,selectedSellingPlanAllocation:c,sellingPlanGroups:f,sellingPlanGroupsConnection:t.sellingPlanGroups}),[t,y,a,s,h,c,i,f,d,n]);return React.createElement(St.Provider,{value:_},e)}function Ct(){const e=l.useContext(St);if(!e)throw new Error("'useProduct' must be a child of <ProductProvider />");return e}function Tt(e,t){var r,n;if(!(!e.length||((n=(r=e==null?void 0:e[0])==null?void 0:r.selectedOptions)==null?void 0:n.length)!==Object.keys(t).length))return e==null?void 0:e.find(a=>Object.entries(t).every(([i,o])=>{var s;return(s=a==null?void 0:a.selectedOptions)==null?void 0:s.some(u=>(u==null?void 0:u.name)===i&&(u==null?void 0:u.value)===o)}))}function Zr(e){const t=e.reduce((r,n)=>{var a;if(!n.selectedOptions)throw new Error("'getOptions' requires 'variant.selectedOptions'");return(a=n==null?void 0:n.selectedOptions)==null||a.forEach(i=>{r[(i==null?void 0:i.name)??""]=r[(i==null?void 0:i.name)??""]||new Set,r[(i==null?void 0:i.name)??""].add((i==null?void 0:i.value)??"")}),r},{});return Object.keys(t).map(r=>({name:r,values:Array.from(t[r])}))}function bt(e,t){if(e){const r=t.find(n=>(n==null?void 0:n.id)===e);return r||console.warn("<ProductProvider/> received a 'initialVariantId' prop, but could not actually find a variant with that ID"),r}if(e===null)return null;if(e===void 0)return t.find(r=>r==null?void 0:r.availableForSale)||t[0]}function vt(e){return e!=null&&e.selectedOptions?e.selectedOptions.reduce((t,r)=>(t[(r==null?void 0:r.name)??""]=(r==null?void 0:r.value)??"",t),{}):{}}function Kr(e){return!(!e||!Array.isArray(e))}function be(e){const{as:t,onClick:r,defaultOnClick:n,children:a,buttonRef:i,...o}=e,s=l.useCallback(d=>{if(r){const y=r(d);if(typeof y=="boolean"&&y===!1||d!=null&&d.defaultPrevented)return}n==null||n(d)},[n,r]),u=t||"button";return React.createElement(u,{ref:i,onClick:s,...o},a)}function Qr(e){const[t,r]=l.useState(!1),{variantId:n,quantity:a=1,attributes:i,sellingPlanId:o,onClick:s,children:u,accessibleAddingToCartLabel:d,parent:y,...f}=e,{status:h,linesAdd:g}=ae(),{selectedVariant:c}=Ct(),_=n??(c==null?void 0:c.id)??"",C=n===null||_===""||c===null||t||f.disabled;l.useEffect(()=>{t&&h==="idle"&&r(!1)},[h,t]);const v=l.useCallback(()=>{r(!0),g([{quantity:a,merchandiseId:_||"",attributes:i,parent:y,sellingPlanId:o}])},[g,a,_,i,o,y]);return U.createElement(U.Fragment,null,U.createElement(be,{...f,disabled:C,onClick:s,defaultOnClick:v},u),d?U.createElement("p",{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},role:"alert","aria-live":"assertive"},t?d:null):null)}const te={PAGE_VIEW:"PAGE_VIEW",ADD_TO_CART:"ADD_TO_CART",PAGE_VIEW_2:"PAGE_VIEW_2",COLLECTION_VIEW:"COLLECTION_VIEW",PRODUCT_VIEW:"PRODUCT_VIEW",SEARCH_VIEW:"SEARCH_VIEW"},ve={article:"article",blog:"blog",captcha:"captcha",cart:"cart",collection:"collection",customersAccount:"customers/account",customersActivateAccount:"customers/activate_account",customersAddresses:"customers/addresses",customersLogin:"customers/login",customersOrder:"customers/order",customersRegister:"customers/register",customersResetPassword:"customers/reset_password",giftCard:"gift_card",home:"index",listCollections:"list-collections",forbidden:"403",notFound:"404",page:"page",password:"password",product:"product",policy:"policy",search:"search"},wt={hydrogen:"hydrogen",headless:"headless"},At={hydrogen:"6167201",headless:"12875497473"};function j(e,t){return{schema_id:e,payload:t,metadata:{event_created_at_ms:Date.now()}}}function $(e){const t={id:"",resource:null,resourceId:null,search:"",searchParams:new URLSearchParams,hash:""};if(typeof e!="string")return t;try{const{search:r,searchParams:n,pathname:a,hash:i}=new URL(e),o=a.split("/"),s=o[o.length-1],u=o[o.length-2];return!s||!u?t:{id:`${s}${r}${i}`||"",resource:u??null,resourceId:s||null,search:r,searchParams:n,hash:i}}catch{return t}}function x(e,t){return typeof e!="object"?{}:(Object.entries(e).forEach(([r,n])=>{n&&(t[r]=n)}),t)}function Jr(e){return typeof document>"u"?(console.error(`${e} should only be used within the useEffect callback or event handlers`),!0):!1}const It="xxxx-4xxx-xxxx-xxxxxxxxxxxx";function we(){let e="";try{const t=window.crypto,r=new Uint16Array(31);t.getRandomValues(r);let n=0;e=It.replace(/[x]/g,a=>{const i=r[n]%16,o=a==="x"?i:i&3|8;return n++,o.toString(16)}).toUpperCase()}catch{e=It.replace(/[x]/g,r=>{const n=Math.random()*16|0;return(r==="x"?n:n&3|8).toString(16)}).toUpperCase()}return`${Xr()}-${e}`}function Xr(){let e=0,t=0;e=new Date().getTime()>>>0;try{t=performance.now()>>>0}catch{t=0}return Math.abs(e+t).toString(16).toLowerCase().padStart(8,"0")}function zr(e){const t=ee(e);return{[Ce]:t.uniqueToken,[Te]:t.visitToken}}const en="trekkie_storefront_page_view/1.4",tn="myshopify.dev";function Pt(e){const t=e,{id:r,resource:n}=$(t.resourceId),a=n?n.toLowerCase():void 0;return[j(en,x({pageType:t.pageType,customerId:parseInt($(t.customerId).id||"0"),resourceType:a,resourceId:parseInt(r)},rn(t)))]}function rn(e){return{appClientId:e.shopifySalesChannel?At[e.shopifySalesChannel]:At.headless,isMerchantRequest:nn(e.url),hydrogenSubchannelId:e.storefrontId||e.hydrogenSubchannelId||"0",isPersistentCookie:e.hasUserConsent,uniqToken:e.uniqueToken,visitToken:e.visitToken,microSessionId:we(),microSessionCount:1,url:e.url,path:e.path,search:e.search,referrer:e.referrer,title:e.title,shopId:parseInt($(e.shopId).id),currency:e.currency,contentLanguage:e.acceptedLanguage||"en"}}function nn(e){if(typeof e!="string")return!1;const t=new URL(e).hostname;return t.indexOf(tn)!==-1||t==="localhost"}const an="2026.1.1",G="custom_storefront_customer_tracking/1.2",Ot="page_rendered",Rt="collection_page_rendered",Vt="product_page_rendered",on="product_added_to_cart",Dt="search_submitted";function le(e){return{canonical_url:e.canonicalUrl||e.url,customer_id:parseInt($(e.customerId).id||"0")}}function sn(e){const t=e,r=le(t),n=t.pageType,a=[];switch(a.push(j(G,x({event_name:Ot,...r},Z(t)))),n){case ve.collection:a.push(j(G,x({event_name:Rt,...r,collection_name:t.collectionHandle,collection_id:parseInt($(t.collectionId).id)},Z(t))));break;case ve.product:a.push(j(G,x({event_name:Vt,...r,products:xe(t.products),total_value:t.totalValue},Z(t))));break;case ve.search:a.push(j(G,x({event_name:Dt,...r,search_string:t.searchString},Z(t))));break}return a}function cn(e){const t=e,r=le(t);return[j(G,x({event_name:Ot,...r},Z(t)))]}function un(e){const t=e,r=le(t);return[j(G,x({event_name:Rt,...r,collection_name:t.collectionHandle,collection_id:parseInt($(t.collectionId).id)},Z(t)))]}function ln(e){const t=e,r=le(t);return[j(G,x({event_name:Vt,...r,products:xe(t.products),total_value:t.totalValue},Z(t)))]}function dn(e){const t=e,r=le(t);return[j(G,x({event_name:Dt,...r,search_string:t.searchString},Z(t)))]}function fn(e){const t=e,r=$(t.cartId);return[j(G,x({event_name:on,customerId:t.customerId,cart_token:r!=null&&r.id?`${r.id}`:null,total_value:t.totalValue,products:xe(t.products),customer_id:parseInt($(t.customerId).id||"0")},Z(t)))]}function Z(e){const t=e;return{source:e.shopifySalesChannel||wt.headless,asset_version_id:e.assetVersionId||an,hydrogenSubchannelId:e.storefrontId||e.hydrogenSubchannelId||"0",is_persistent_cookie:e.hasUserConsent,deprecated_visit_token:e.visitToken,unique_token:e.uniqueToken,event_time:Date.now(),event_id:we(),event_source_url:e.url,referrer:e.referrer,user_agent:e.userAgent,navigation_type:e.navigationType,navigation_api:e.navigationApi,shop_id:parseInt($(e.shopId).id),currency:e.currency,ccpa_enforced:t.ccpaEnforced||!1,gdpr_enforced:t.gdprEnforced||!1,gdpr_enforced_as_string:t.gdprEnforced?"true":"false",analytics_allowed:e.analyticsAllowed||!1,marketing_allowed:e.marketingAllowed||!1,sale_of_data_allowed:e.saleOfDataAllowed||!1}}function xe(e){return e?e.map(t=>{const r=x({variant_gid:t.variantGid,category:t.category,sku:t.sku,product_id:parseInt($(t.productGid).id),variant_id:parseInt($(t.variantGid).id)},{product_gid:t.productGid,name:t.name,variant:t.variantName||"",brand:t.brand,price:parseFloat(t.price),quantity:Number(t.quantity||0)});return JSON.stringify(r)}):[]}function hn(e,t){const{eventName:r,payload:n}=e;if(!n.hasUserConsent)return Promise.resolve();let a=[];const i=n;return r===te.PAGE_VIEW?a=a.concat(Pt(i),sn(i)):r===te.ADD_TO_CART?a=a.concat(fn(n)):r===te.PAGE_VIEW_2?a=a.concat(Pt(i),cn(i)):r===te.COLLECTION_VIEW?a=a.concat(un(i)):r===te.PRODUCT_VIEW?a=a.concat(ln(i)):r===te.SEARCH_VIEW&&(a=a.concat(dn(i))),a.length?gn(a,t):Promise.resolve()}function yn(){return typeof window>"u"||!window.navigator?!1:/Chrome-Lighthouse/.test(window.navigator.userAgent)}const kt="sendShopifyAnalytics request is unsuccessful";function gn(e,t){if(yn())return Promise.resolve();const r={events:e,metadata:{event_sent_at_ms:Date.now()}};try{return fetch(t?`https://${t}/.well-known/shopify/monorail/unstable/produce_batch`:"https://monorail-edge.shopifysvc.com/unstable/produce_batch",{method:"post",headers:{"content-type":"text/plain"},body:JSON.stringify(r)}).then(n=>{if(!n.ok)throw new Error("Response failed");return n.text()}).then(n=>{n&&JSON.parse(n).result.forEach(i=>{i.status!==200&&console.error(kt,`
327
327
 
328
328
  `,i.message)})}).catch(n=>{console.error(kt,n)})}catch{return Promise.resolve()}}function mn(){if(Jr("getClientBrowserParameters"))return{uniqueToken:"",visitToken:"",url:"",path:"",search:"",referrer:"",title:"",userAgent:"",navigationType:"",navigationApi:""};const[e,t]=_n(),r=ee();return{uniqueToken:r.uniqueToken,visitToken:r.visitToken,url:location.href,path:location.pathname,search:location.search,referrer:document.referrer,title:document.title,userAgent:navigator.userAgent,navigationType:e,navigationApi:t}}function pn(){try{const e=(performance==null?void 0:performance.getEntriesByType)&&(performance==null?void 0:performance.getEntriesByType("navigation"));if(e&&e[0]){const t=window.performance.getEntriesByType("navigation")[0].type;return t&&t.toString()}}catch{}}function En(){var e,t;try{if(PerformanceNavigation&&((e=performance==null?void 0:performance.navigation)==null?void 0:e.type)!==null&&((t=performance==null?void 0:performance.navigation)==null?void 0:t.type)!==void 0){const r=performance.navigation.type;switch(r){case PerformanceNavigation.TYPE_NAVIGATE:return"navigate";case PerformanceNavigation.TYPE_RELOAD:return"reload";case PerformanceNavigation.TYPE_BACK_FORWARD:return"back_forward";default:return`unknown: ${r}`}}}catch{}}function _n(){try{let e="PerformanceNavigationTiming",t=pn();return t||(t=En(),e="performance.navigation"),t?[t,e]:["unknown","unknown"]}catch{}return["error","error"]}function Sn(e){const{cartCreate:t,checkoutUrl:r}=ae(),[n,a]=l.useState(!1),{quantity:i,variantId:o,sellingPlanId:s,onClick:u,attributes:d,children:y,...f}=e;l.useEffect(()=>{n&&r&&(window.location.href=r)},[n,r]);const h=l.useCallback(()=>{a(!0),t({lines:[{quantity:i??1,merchandiseId:o,attributes:d,sellingPlanId:s}]})},[t,i,o,d,s]);return React.createElement(be,{disabled:n??f.disabled,...f,onClick:u,defaultOnClick:h},y)}function Cn(e){const[t,r]=l.useState(!1),{status:n,checkoutUrl:a}=ae(),{children:i,...o}=e;return l.useEffect(()=>{t&&a&&n==="idle"&&(window.location.href=a)},[t,n,a]),React.createElement(be,{...o,disabled:t||o.disabled,onClick:()=>r(!0)},i)}function Ut(e){const{countryIsoCode:t,languageIsoCode:r}=ce(),n=r.includes("_")?r.replace("_","-"):`${r}-${t}`;if(!n)throw new Error("useMoney(): Unable to get 'locale' from 'useShop()', which means that 'locale' was not passed to '<ShopifyProvider/>'. 'locale' is required for 'useMoney()' to work");const a=parseFloat(e.amount);let i=!0;try{new Intl.NumberFormat(n,{style:"currency",currency:e.currencyCode})}catch(c){c instanceof RangeError&&c.message.includes("currency")&&(i=!1)}const{defaultFormatter:o,nameFormatter:s,narrowSymbolFormatter:u,withoutTrailingZerosFormatter:d,withoutCurrencyFormatter:y,withoutTrailingZerosOrCurrencyFormatter:f}=l.useMemo(()=>{const c=i?{style:"currency",currency:e.currencyCode}:{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2};return{defaultFormatter:ie(n,c),nameFormatter:ie(n,{...c,currencyDisplay:"name"}),narrowSymbolFormatter:ie(n,{...c,currencyDisplay:"narrowSymbol"}),withoutTrailingZerosFormatter:ie(n,{...c,minimumFractionDigits:0,maximumFractionDigits:0}),withoutCurrencyFormatter:ie(n,{minimumFractionDigits:2,maximumFractionDigits:2}),withoutTrailingZerosOrCurrencyFormatter:ie(n,{minimumFractionDigits:0,maximumFractionDigits:0})}},[e.currencyCode,n,i]),h=c=>c.type==="currency",g=l.useMemo(()=>({original:()=>e,currencyCode:()=>e.currencyCode,localizedString:()=>{const c=o().format(a);return i?c:`${c} ${e.currencyCode}`},parts:()=>{const c=o().formatToParts(a);return i||c.push({type:"literal",value:" "},{type:"currency",value:e.currencyCode}),c},withoutTrailingZeros:()=>{const c=a%1===0?d().format(a):o().format(a);return i?c:`${c} ${e.currencyCode}`},withoutTrailingZerosAndCurrency:()=>a%1===0?f().format(a):y().format(a),currencyName:()=>{var c;return((c=s().formatToParts(a).find(h))==null?void 0:c.value)??e.currencyCode},currencySymbol:()=>{var c;return((c=o().formatToParts(a).find(h))==null?void 0:c.value)??e.currencyCode},currencyNarrowSymbol:()=>{var c;return((c=u().formatToParts(a).find(h))==null?void 0:c.value)??""},amount:()=>o().formatToParts(a).filter(c=>["decimal","fraction","group","integer","literal"].includes(c.type)).map(c=>c.value).join("")}),[e,a,i,s,o,u,y,d,f]);return l.useMemo(()=>new Proxy(g,{get:(c,_)=>{var C;return(C=Reflect.get(c,_))==null?void 0:C.call(null)}}),[g])}const Nt=new Map;function ie(e,t){const r=JSON.stringify([e,t]);return function(){let n=Nt.get(r);if(!n){try{n=new Intl.NumberFormat(e,t)}catch(a){if(a instanceof RangeError&&a.message.includes("currency")){const i={...t};delete i.currency,delete i.currencyDisplay,delete i.currencySign,n=new Intl.NumberFormat(e,i)}else throw a}Nt.set(r,n)}return n}}function Ae({data:e,as:t,withoutCurrency:r,withoutTrailingZeros:n,measurement:a,measurementSeparator:i="/",...o}){if(!Tn(e))throw new Error("<Money/> needs a valid 'data' prop that has 'amount' and 'currencyCode'");const s=Ut(e),u=t??"div";let d=s.localizedString;return(r||n)&&(r&&!n?d=s.amount:!r&&n?d=s.withoutTrailingZeros:d=s.withoutTrailingZerosAndCurrency),React.createElement(u,{...o},d,a&&a.referenceUnit&&React.createElement(React.Fragment,null,i,a.referenceUnit))}function Tn(e){return typeof e.amount=="string"&&!!e.amount&&typeof e.currencyCode=="string"&&!!e.currencyCode}function bn(e){const{cost:t}=ae(),{amountType:r="total",children:n,...a}=e;let i;return r=="total"?i=t==null?void 0:t.totalAmount:r=="subtotal"?i=t==null?void 0:t.subtotalAmount:r=="tax"?i=t==null?void 0:t.totalTaxAmount:r=="duty"&&(i=t==null?void 0:t.totalDutyAmount),i==null?null:React.createElement(Ae,{...a,data:i},n)}const Mt=l.createContext(null);function je(){const e=l.useContext(Mt);if(e==null)throw new Error("Expected a cart line context but none was found");return e}function vn({children:e,line:t}){return React.createElement(Mt.Provider,{value:t},e)}function wn(e){const t=je(),{as:r,...n}=e,a=r||"span";return React.createElement(a,{...n},t.quantity)}function An(e){const{status:t,linesRemove:r,linesUpdate:n}=ae(),a=je(),{children:i,adjust:o,onClick:s,...u}=e,d=l.useCallback(()=>{if(o==="remove"){r([(a==null?void 0:a.id)??""]);return}const f=o==="decrease"?((a==null?void 0:a.quantity)??0)-1:((a==null?void 0:a.quantity)??0)+1;if(f<=0){r([(a==null?void 0:a.id)??""]);return}const h={id:(a==null?void 0:a.id)??"",quantity:f,attributes:(a==null?void 0:a.attributes)??[]};n([h])},[o,a==null?void 0:a.attributes,a==null?void 0:a.id,a==null?void 0:a.quantity,r,n]),y=u.disabled;return React.createElement(be,{...u,onClick:s,defaultOnClick:d,disabled:typeof y<"u"?y:t!=="idle"},i)}const In={DateTime:"string",Decimal:"string",HTML:"string",URL:"string",Color:"string",UnsignedInt64:"string"},Pn={DateTime:"string",Decimal:"string",HTML:"string",ISO8601DateTime:"string",URL:"string",UnsignedInt64:"string"},Ft=l.forwardRef((e,t)=>{const{data:r,options:n,id:a=r.id,frameBorder:i="0",allow:o="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:s=!0,loading:u="lazy",...d}=e;if(!r.embedUrl)throw new Error("<ExternalVideo/> requires the 'embedUrl' property");let y=r.embedUrl;if(n){const f=new URL(r.embedUrl);for(const[h,g]of Object.entries(n))typeof g>"u"||f.searchParams.set(h,g.toString());y=f.toString()}return React.createElement("iframe",{...d,id:a??r.embedUrl,title:r.alt??r.id??"external video",frameBorder:i,allow:o,allowFullScreen:s,src:y,loading:u,ref:t})}),qe=",",oe={OPTION:":",END_OF_PREFIX:",",SEQUENCE_GAP:" ",RANGE:"-"},He=(()=>{const e=new Map;return function(t,r){var n;if(t.length===0)return!1;if(!e.has(r)){const a=new Set;for(const i of Lt(r)){a.add(i.join(qe));for(let o=0;o<i.length;o++)a.add(i.slice(0,o+1).join(qe))}e.set(r,a)}return!!((n=e.get(r))!=null&&n.has(t.join(qe)))}})();function Lt(e){if(!e)return[];if(e.startsWith("v1_"))return Rn(On(e));throw new Error("Unsupported option value encoding")}const On=e=>e.replace(/^v1_/,"");function Rn(e){const t=/[ :,-]/g;let r=0,n;const a=[],i=[];let o=0,s=null;for(;n=t.exec(e);){const d=n[0],y=Number.parseInt(e.slice(r,n.index))||0;if(s!==null){for(;s<y;s++)i[o]=s,a.push([...i]);s=null}i[o]=y,d===oe.RANGE?s=y:d===oe.OPTION?o++:((d===oe.SEQUENCE_GAP||d===oe.END_OF_PREFIX&&e[n.index-1]!==oe.END_OF_PREFIX)&&a.push([...i]),d===oe.END_OF_PREFIX&&(i.pop(),o--)),r=t.lastIndex}const u=e.match(/\d+$/g);if(u){const d=parseInt(u[0]);if(s!=null)for(;s<=d;s++)i[o]=s,a.push([...i]);else a.push([d])}return a}function Vn(e){return Object.assign({},...e.map(t=>({[t.name]:Object.assign({},...t!=null&&t.optionValues?t.optionValues.map((r,n)=>({[r.name]:n})):[])})))}function de(e){return Object.assign({},...e.map(t=>({[t.name]:t.value})))}function Be(e){return JSON.stringify(de(e))}function $t(e){return Array.isArray(e)?JSON.stringify(Object.assign({},...e.map(t=>({[t.name]:t.value})))):JSON.stringify(e)}function Dn(e,t){return Object.keys(e).map(n=>t[n]?t[n][e[n]]:null).filter(n=>n!==null)}function kn(e){return Object.assign({},...e.map(t=>({[$t(t.selectedOptions||[])]:t})))}const xt=["options","selectedOrFirstAvailableVariant","adjacentVariants"],Un=["handle","encodedVariantExistence","encodedVariantAvailability"];function J(e){return console.error(`[h2:error:getProductOptions] product.${e} is missing. Make sure you query for this field from the Storefront API.`),!1}function jt(e,t=!1){var a;let r=!0;const n=Object.keys(e);if((t?[...xt,...Un]:xt).forEach(i=>{n.includes(i)||(r=J(i))}),e.options){const i=e==null?void 0:e.options[0];if(t&&!(i!=null&&i.name)&&(r=J("options.name")),(a=e==null?void 0:e.options[0])!=null&&a.optionValues){let o=e.options[0].optionValues[0];t&&!(o!=null&&o.name)&&(r=J("options.optionValues.name")),o=e.options[0].optionValues.filter(s=>!!(s!=null&&s.firstSelectableVariant))[0],o!=null&&o.firstSelectableVariant&&(r=Ye(o.firstSelectableVariant,"options.optionValues.firstSelectableVariant",r,t))}else r=J("options.optionValues")}return e.selectedOrFirstAvailableVariant&&(r=Ye(e.selectedOrFirstAvailableVariant,"selectedOrFirstAvailableVariant",r,t)),e.adjacentVariants&&e.adjacentVariants[0]&&(r=Ye(e.adjacentVariants[0],"adjacentVariants",r,t)),r?e:{}}function Ye(e,t,r,n){var i;let a=r;if(n&&!((i=e.product)!=null&&i.handle)&&(a=J(`${t}.product.handle`)),e.selectedOptions){const o=e.selectedOptions[0];o!=null&&o.name||(a=J(`${t}.selectedOptions.name`)),o!=null&&o.value||(a=J(`${t}.selectedOptions.value`))}else a=J(`${t}.selectedOptions`);return a}function Nn(e){const t=jt(e);if(!t.options)return[];const r={};t.options.map(a=>{var i;(i=a.optionValues)==null||i.map(o=>{if(o.firstSelectableVariant){const s=Be(o.firstSelectableVariant.selectedOptions);r[s]=o.firstSelectableVariant}})}),t.adjacentVariants.map(a=>{const i=Be(a.selectedOptions);r[i]=a});const n=t.selectedOrFirstAvailableVariant;if(n){const a=Be(n.selectedOptions);r[a]=n}return Object.values(r)}function Mn(e){const t=jt(e,!0);if(!t.options)return[];const{options:r,selectedOrFirstAvailableVariant:n,adjacentVariants:a,encodedVariantExistence:i,encodedVariantAvailability:o,handle:s}=t,u=n==null?void 0:n.selectedOptions.map(c=>c.name),d=r.filter(c=>u&&u.indexOf(c.name)>=0),y=Vn(r),f=kn(n?[n,...a]:a),h=de(n?n.selectedOptions:[]);return d.map((c,_)=>({...c,optionValues:c.optionValues.map(C=>{var O;const v={...h};v[c.name]=C.name;const A=$t(v||[]),I=Dn(v||[],y).slice(0,_+1),p=He(I,i||""),m=He(I,o||""),E=f[A]||C.firstSelectableVariant;let P={};E&&(P=de(E.selectedOptions||[]));const R=new URLSearchParams(P),b=((O=E==null?void 0:E.product)==null?void 0:O.handle)||s;return{...C,variant:E,handle:b,variantUriQuery:R.toString(),selected:h[c.name]===C.name,exists:p,available:m,isDifferentProduct:b!==s}})}))}const Fn=`#graphql
329
329
  fragment Image on Image {