@shopify/hydrogen-react 2026.1.1 → 2026.1.2

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 (240) hide show
  1. package/dist/browser-dev/analytics-schema-custom-storefront-customer-tracking.mjs +1 -1
  2. package/dist/{node-dev/packages/hydrogen-react → browser-dev}/package.json.mjs +1 -1
  3. package/dist/browser-dev/useCartAPIStateMachine.mjs +9 -9
  4. package/dist/browser-dev/useCartAPIStateMachine.mjs.map +1 -1
  5. package/dist/browser-dev/useMachine.mjs +68 -0
  6. package/dist/browser-dev/useMachine.mjs.map +1 -0
  7. package/dist/browser-prod/analytics-schema-custom-storefront-customer-tracking.mjs +1 -1
  8. package/dist/browser-prod/{packages/hydrogen-react/package.json.mjs → package.json.mjs} +1 -1
  9. package/dist/browser-prod/useCartAPIStateMachine.mjs +9 -9
  10. package/dist/browser-prod/useCartAPIStateMachine.mjs.map +1 -1
  11. package/dist/browser-prod/useMachine.mjs +68 -0
  12. package/dist/browser-prod/useMachine.mjs.map +1 -0
  13. package/dist/node-dev/analytics-schema-custom-storefront-customer-tracking.js +1 -1
  14. package/dist/node-dev/analytics-schema-custom-storefront-customer-tracking.mjs +1 -1
  15. package/dist/{node-prod/packages/hydrogen-react → node-dev}/package.json.js +1 -1
  16. package/dist/{node-prod/packages/hydrogen-react → node-dev}/package.json.mjs +1 -1
  17. package/dist/node-dev/useCartAPIStateMachine.js +10 -10
  18. package/dist/node-dev/useCartAPIStateMachine.js.map +1 -1
  19. package/dist/node-dev/useCartAPIStateMachine.mjs +9 -9
  20. package/dist/node-dev/useCartAPIStateMachine.mjs.map +1 -1
  21. package/dist/node-dev/useMachine.js +68 -0
  22. package/dist/node-dev/useMachine.js.map +1 -0
  23. package/dist/node-dev/useMachine.mjs +68 -0
  24. package/dist/node-dev/useMachine.mjs.map +1 -0
  25. package/dist/node-prod/analytics-schema-custom-storefront-customer-tracking.js +1 -1
  26. package/dist/node-prod/analytics-schema-custom-storefront-customer-tracking.mjs +1 -1
  27. package/dist/{node-dev/packages/hydrogen-react → node-prod}/package.json.js +1 -1
  28. package/dist/{browser-dev/packages/hydrogen-react → node-prod}/package.json.mjs +1 -1
  29. package/dist/node-prod/useCartAPIStateMachine.js +10 -10
  30. package/dist/node-prod/useCartAPIStateMachine.js.map +1 -1
  31. package/dist/node-prod/useCartAPIStateMachine.mjs +9 -9
  32. package/dist/node-prod/useCartAPIStateMachine.mjs.map +1 -1
  33. package/dist/node-prod/useMachine.js +68 -0
  34. package/dist/node-prod/useMachine.js.map +1 -0
  35. package/dist/node-prod/useMachine.mjs +68 -0
  36. package/dist/node-prod/useMachine.mjs.map +1 -0
  37. package/dist/types/useMachine.d.ts +11 -0
  38. package/dist/umd/hydrogen-react.dev.js +56 -251
  39. package/dist/umd/hydrogen-react.dev.js.map +1 -1
  40. package/dist/umd/hydrogen-react.prod.js +16 -32
  41. package/dist/umd/hydrogen-react.prod.js.map +1 -1
  42. package/package.json +4 -12
  43. package/dist/browser-dev/_virtual/index.mjs +0 -5
  44. package/dist/browser-dev/_virtual/index.mjs.map +0 -1
  45. package/dist/browser-dev/_virtual/use-sync-external-store-shim.development.mjs +0 -5
  46. package/dist/browser-dev/_virtual/use-sync-external-store-shim.development.mjs.map +0 -1
  47. package/dist/browser-dev/_virtual/use-sync-external-store-shim.production.mjs +0 -5
  48. package/dist/browser-dev/_virtual/use-sync-external-store-shim.production.mjs.map +0 -1
  49. package/dist/browser-dev/_virtual/with-selector.development.mjs +0 -5
  50. package/dist/browser-dev/_virtual/with-selector.development.mjs.map +0 -1
  51. package/dist/browser-dev/_virtual/with-selector.mjs +0 -6
  52. package/dist/browser-dev/_virtual/with-selector.mjs.map +0 -1
  53. package/dist/browser-dev/_virtual/with-selector.production.mjs +0 -5
  54. package/dist/browser-dev/_virtual/with-selector.production.mjs.map +0 -1
  55. package/dist/browser-dev/_virtual/with-selector2.mjs +0 -5
  56. package/dist/browser-dev/_virtual/with-selector2.mjs.map +0 -1
  57. package/dist/browser-dev/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs +0 -151
  58. package/dist/browser-dev/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs.map +0 -1
  59. 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 +0 -89
  60. 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 +0 -1
  61. 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 +0 -12
  62. 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 +0 -1
  63. 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 +0 -82
  64. 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 +0 -1
  65. 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 +0 -78
  66. 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 +0 -1
  67. 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 +0 -78
  68. 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 +0 -1
  69. 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 +0 -63
  70. 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 +0 -1
  71. 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 +0 -18
  72. 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 +0 -1
  73. 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 +0 -18
  74. 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 +0 -1
  75. package/dist/browser-prod/_virtual/index.mjs +0 -5
  76. package/dist/browser-prod/_virtual/index.mjs.map +0 -1
  77. package/dist/browser-prod/_virtual/use-sync-external-store-shim.development.mjs +0 -5
  78. package/dist/browser-prod/_virtual/use-sync-external-store-shim.development.mjs.map +0 -1
  79. package/dist/browser-prod/_virtual/use-sync-external-store-shim.production.mjs +0 -5
  80. package/dist/browser-prod/_virtual/use-sync-external-store-shim.production.mjs.map +0 -1
  81. package/dist/browser-prod/_virtual/with-selector.development.mjs +0 -5
  82. package/dist/browser-prod/_virtual/with-selector.development.mjs.map +0 -1
  83. package/dist/browser-prod/_virtual/with-selector.mjs +0 -6
  84. package/dist/browser-prod/_virtual/with-selector.mjs.map +0 -1
  85. package/dist/browser-prod/_virtual/with-selector.production.mjs +0 -5
  86. package/dist/browser-prod/_virtual/with-selector.production.mjs.map +0 -1
  87. package/dist/browser-prod/_virtual/with-selector2.mjs +0 -5
  88. package/dist/browser-prod/_virtual/with-selector2.mjs.map +0 -1
  89. package/dist/browser-prod/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs +0 -151
  90. package/dist/browser-prod/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs.map +0 -1
  91. 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 +0 -89
  92. 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 +0 -1
  93. 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 +0 -12
  94. 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 +0 -1
  95. 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 +0 -82
  96. 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 +0 -1
  97. 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 +0 -78
  98. 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 +0 -1
  99. 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 +0 -78
  100. 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 +0 -1
  101. 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 +0 -63
  102. 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 +0 -1
  103. 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 +0 -18
  104. 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 +0 -1
  105. 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 +0 -18
  106. 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 +0 -1
  107. package/dist/node-dev/_virtual/index.js +0 -5
  108. package/dist/node-dev/_virtual/index.js.map +0 -1
  109. package/dist/node-dev/_virtual/index.mjs +0 -5
  110. package/dist/node-dev/_virtual/index.mjs.map +0 -1
  111. package/dist/node-dev/_virtual/use-sync-external-store-shim.development.js +0 -5
  112. package/dist/node-dev/_virtual/use-sync-external-store-shim.development.js.map +0 -1
  113. package/dist/node-dev/_virtual/use-sync-external-store-shim.development.mjs +0 -5
  114. package/dist/node-dev/_virtual/use-sync-external-store-shim.development.mjs.map +0 -1
  115. package/dist/node-dev/_virtual/use-sync-external-store-shim.production.js +0 -5
  116. package/dist/node-dev/_virtual/use-sync-external-store-shim.production.js.map +0 -1
  117. package/dist/node-dev/_virtual/use-sync-external-store-shim.production.mjs +0 -5
  118. package/dist/node-dev/_virtual/use-sync-external-store-shim.production.mjs.map +0 -1
  119. package/dist/node-dev/_virtual/with-selector.development.js +0 -5
  120. package/dist/node-dev/_virtual/with-selector.development.js.map +0 -1
  121. package/dist/node-dev/_virtual/with-selector.development.mjs +0 -5
  122. package/dist/node-dev/_virtual/with-selector.development.mjs.map +0 -1
  123. package/dist/node-dev/_virtual/with-selector.js +0 -6
  124. package/dist/node-dev/_virtual/with-selector.js.map +0 -1
  125. package/dist/node-dev/_virtual/with-selector.mjs +0 -6
  126. package/dist/node-dev/_virtual/with-selector.mjs.map +0 -1
  127. package/dist/node-dev/_virtual/with-selector.production.js +0 -5
  128. package/dist/node-dev/_virtual/with-selector.production.js.map +0 -1
  129. package/dist/node-dev/_virtual/with-selector.production.mjs +0 -5
  130. package/dist/node-dev/_virtual/with-selector.production.mjs.map +0 -1
  131. package/dist/node-dev/_virtual/with-selector2.js +0 -5
  132. package/dist/node-dev/_virtual/with-selector2.js.map +0 -1
  133. package/dist/node-dev/_virtual/with-selector2.mjs +0 -5
  134. package/dist/node-dev/_virtual/with-selector2.mjs.map +0 -1
  135. package/dist/node-dev/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.js +0 -150
  136. package/dist/node-dev/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.js.map +0 -1
  137. package/dist/node-dev/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs +0 -151
  138. package/dist/node-dev/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs.map +0 -1
  139. 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 +0 -89
  140. 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 +0 -1
  141. 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 +0 -89
  142. 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 +0 -1
  143. 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 +0 -28
  144. 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 +0 -1
  145. 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 +0 -12
  146. 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 +0 -1
  147. 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 +0 -82
  148. 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 +0 -1
  149. 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 +0 -82
  150. 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 +0 -1
  151. 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 +0 -78
  152. 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 +0 -1
  153. 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 +0 -78
  154. 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 +0 -1
  155. 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 +0 -78
  156. 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 +0 -1
  157. 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 +0 -78
  158. 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 +0 -1
  159. 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 +0 -63
  160. 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 +0 -1
  161. 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 +0 -63
  162. 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 +0 -1
  163. 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 +0 -18
  164. 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 +0 -1
  165. 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 +0 -18
  166. 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 +0 -1
  167. 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 +0 -18
  168. 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 +0 -1
  169. 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 +0 -18
  170. 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 +0 -1
  171. package/dist/node-prod/_virtual/index.js +0 -5
  172. package/dist/node-prod/_virtual/index.js.map +0 -1
  173. package/dist/node-prod/_virtual/index.mjs +0 -5
  174. package/dist/node-prod/_virtual/index.mjs.map +0 -1
  175. package/dist/node-prod/_virtual/use-sync-external-store-shim.development.js +0 -5
  176. package/dist/node-prod/_virtual/use-sync-external-store-shim.development.js.map +0 -1
  177. package/dist/node-prod/_virtual/use-sync-external-store-shim.development.mjs +0 -5
  178. package/dist/node-prod/_virtual/use-sync-external-store-shim.development.mjs.map +0 -1
  179. package/dist/node-prod/_virtual/use-sync-external-store-shim.production.js +0 -5
  180. package/dist/node-prod/_virtual/use-sync-external-store-shim.production.js.map +0 -1
  181. package/dist/node-prod/_virtual/use-sync-external-store-shim.production.mjs +0 -5
  182. package/dist/node-prod/_virtual/use-sync-external-store-shim.production.mjs.map +0 -1
  183. package/dist/node-prod/_virtual/with-selector.development.js +0 -5
  184. package/dist/node-prod/_virtual/with-selector.development.js.map +0 -1
  185. package/dist/node-prod/_virtual/with-selector.development.mjs +0 -5
  186. package/dist/node-prod/_virtual/with-selector.development.mjs.map +0 -1
  187. package/dist/node-prod/_virtual/with-selector.js +0 -6
  188. package/dist/node-prod/_virtual/with-selector.js.map +0 -1
  189. package/dist/node-prod/_virtual/with-selector.mjs +0 -6
  190. package/dist/node-prod/_virtual/with-selector.mjs.map +0 -1
  191. package/dist/node-prod/_virtual/with-selector.production.js +0 -5
  192. package/dist/node-prod/_virtual/with-selector.production.js.map +0 -1
  193. package/dist/node-prod/_virtual/with-selector.production.mjs +0 -5
  194. package/dist/node-prod/_virtual/with-selector.production.mjs.map +0 -1
  195. package/dist/node-prod/_virtual/with-selector2.js +0 -5
  196. package/dist/node-prod/_virtual/with-selector2.js.map +0 -1
  197. package/dist/node-prod/_virtual/with-selector2.mjs +0 -5
  198. package/dist/node-prod/_virtual/with-selector2.mjs.map +0 -1
  199. package/dist/node-prod/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.js +0 -150
  200. package/dist/node-prod/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.js.map +0 -1
  201. package/dist/node-prod/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs +0 -151
  202. package/dist/node-prod/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs.map +0 -1
  203. 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 +0 -89
  204. 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 +0 -1
  205. 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 +0 -89
  206. 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 +0 -1
  207. 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 +0 -28
  208. 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 +0 -1
  209. 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 +0 -12
  210. 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 +0 -1
  211. 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 +0 -82
  212. 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 +0 -1
  213. 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 +0 -82
  214. 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 +0 -1
  215. 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 +0 -78
  216. 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 +0 -1
  217. 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 +0 -78
  218. 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 +0 -1
  219. 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 +0 -78
  220. 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 +0 -1
  221. 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 +0 -78
  222. 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 +0 -1
  223. 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 +0 -63
  224. 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 +0 -1
  225. 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 +0 -63
  226. 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 +0 -1
  227. 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 +0 -18
  228. 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 +0 -1
  229. 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 +0 -18
  230. 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 +0 -1
  231. 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 +0 -18
  232. 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 +0 -1
  233. 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 +0 -18
  234. 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 +0 -1
  235. /package/dist/browser-dev/{packages/hydrogen-react/package.json.mjs.map → package.json.mjs.map} +0 -0
  236. /package/dist/browser-prod/{packages/hydrogen-react/package.json.mjs.map → package.json.mjs.map} +0 -0
  237. /package/dist/node-dev/{packages/hydrogen-react/package.json.js.map → package.json.js.map} +0 -0
  238. /package/dist/node-dev/{packages/hydrogen-react/package.json.mjs.map → package.json.mjs.map} +0 -0
  239. /package/dist/node-prod/{packages/hydrogen-react/package.json.js.map → package.json.js.map} +0 -0
  240. /package/dist/node-prod/{packages/hydrogen-react/package.json.mjs.map → package.json.mjs.map} +0 -0
@@ -1,4 +1,4 @@
1
- (function(S,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],l):(S=typeof globalThis<"u"?globalThis:S||self,l(S.hydrogenreact={},S.React))})(this,(function(S,l){"use strict";function sr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const U=sr(l);/*! *****************************************************************************
1
+ (function(p,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],l):(p=typeof globalThis<"u"?globalThis:p||self,l(p.hydrogenreact={},p.React))})(this,(function(p,l){"use strict";function zt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const M=zt(l);/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -11,23 +11,7 @@
11
11
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
12
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
13
  PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */function Je(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(s){a={error:s}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o}var z;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(z||(z={}));var Xe={type:"xstate.init"};function Pe(e){return e===void 0?[]:[].concat(e)}function re(e){return{type:"xstate.assign",assignment:e}}function ze(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function Se(e){return function(t){return e===t}}function et(e){return typeof e=="string"?{type:e}:e}function tt(e,t){return{value:e,context:t,actions:[],changed:!1,matches:Se(e)}}function rt(e,t,r){var n=t,a=!1;return[e.filter((function(i){if(i.type==="xstate.assign"){a=!0;var o=Object.assign({},n);return typeof i.assignment=="function"?o=i.assignment(n,r):Object.keys(i.assignment).forEach((function(s){o[s]=typeof i.assignment[s]=="function"?i.assignment[s](n,r):i.assignment[s]})),n=o,!1}return!0})),n,a]}function nt(e,t){t===void 0&&(t={});var r=Je(rt(Pe(e.states[e.initial].entry).map((function(o){return ze(o,t.actions)})),e.context,Xe),2),n=r[0],a=r[1],i={config:e,_options:t,initialState:{value:e.initial,actions:n,context:a,matches:Se(e.initial)},transition:function(o,s){var u,d,y=typeof o=="string"?{value:o,context:e.context}:o,f=y.value,h=y.context,g=et(s),c=e.states[f];if(c.on){var _=Pe(c.on[g.type]);try{for(var C=(function(k){var se=typeof Symbol=="function"&&Symbol.iterator,pe=se&&k[se],Ee=0;if(pe)return pe.call(k);if(k&&typeof k.length=="number")return{next:function(){return k&&Ee>=k.length&&(k=void 0),{value:k&&k[Ee++],done:!k}}};throw new TypeError(se?"Object is not iterable.":"Symbol.iterator is not defined.")})(_),v=C.next();!v.done;v=C.next()){var A=v.value;if(A===void 0)return tt(f,h);var w=typeof A=="string"?{target:A}:A,I=w.target,p=w.actions,m=p===void 0?[]:p,E=w.cond,P=E===void 0?function(){return!0}:E,R=I===void 0,b=I??f,O=e.states[b];if(P(h,g)){var q=Je(rt((R?Pe(m):[].concat(c.exit,m,O.entry).filter((function(k){return k}))).map((function(k){return ze(k,i._options.actions)})),h,g),3),V=q[0],H=q[1],X=q[2],me=I??f;return{value:me,context:H,actions:V,changed:I!==f||V.length>0||X,matches:Se(me)}}}}catch(k){u={error:k}}finally{try{v&&!v.done&&(d=C.return)&&d.call(C)}finally{if(u)throw u.error}}}return tt(f,h)}};return i}var at=function(e,t){return e.actions.forEach((function(r){var n=r.exec;return n&&n(e.context,t)}))};function cr(e){var t=e.initialState,r=z.NotStarted,n=new Set,a={_machine:e,send:function(i){r===z.Running&&(t=e.transition(t,i),at(t,et(i)),n.forEach((function(o){return o(t)})))},subscribe:function(i){return n.add(i),i(t),{unsubscribe:function(){return n.delete(i)}}},start:function(i){if(i){var o=typeof i=="object"?i:{context:e.config.context,value:i};t={value:o.value,actions:[],context:o.context,matches:Se(o.value)}}else t=e.initialState;return r=z.Running,at(t,Xe),a},stop:function(){return r=z.Stopped,n.clear(),a},get state(){return t},get status(){return r}};return a}var ur=l.useLayoutEffect,Oe={exports:{}},Re={},Ve={exports:{}},De={};/**
15
- * @license React
16
- * use-sync-external-store-shim.production.js
17
- *
18
- * Copyright (c) Meta Platforms, Inc. and affiliates.
19
- *
20
- * This source code is licensed under the MIT license found in the
21
- * LICENSE file in the root directory of this source tree.
22
- */var it;function lr(){if(it)return De;it=1;var e=l;function t(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,a=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function s(f,h){var g=h(),c=n({inst:{value:g,getSnapshot:h}}),_=c[0].inst,C=c[1];return i(function(){_.value=g,_.getSnapshot=h,u(_)&&C({inst:_})},[f,g,h]),a(function(){return u(_)&&C({inst:_}),f(function(){u(_)&&C({inst:_})})},[f]),o(g),g}function u(f){var h=f.getSnapshot;f=f.value;try{var g=h();return!r(f,g)}catch{return!0}}function d(f,h){return h()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:s;return De.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,De}var ot;function dr(){return ot||(ot=1,Ve.exports=lr()),Ve.exports}/**
23
- * @license React
24
- * use-sync-external-store-shim/with-selector.production.js
25
- *
26
- * Copyright (c) Meta Platforms, Inc. and affiliates.
27
- *
28
- * This source code is licensed under the MIT license found in the
29
- * LICENSE file in the root directory of this source tree.
30
- */var st;function fr(){if(st)return Re;st=1;var e=l,t=dr();function r(d,y){return d===y&&(d!==0||1/d===1/y)||d!==d&&y!==y}var n=typeof Object.is=="function"?Object.is:r,a=t.useSyncExternalStore,i=e.useRef,o=e.useEffect,s=e.useMemo,u=e.useDebugValue;return Re.useSyncExternalStoreWithSelector=function(d,y,f,h,g){var c=i(null);if(c.current===null){var _={hasValue:!1,value:null};c.current=_}else _=c.current;c=s(function(){function v(m){if(!A){if(A=!0,w=m,m=h(m),g!==void 0&&_.hasValue){var E=_.value;if(g(E,m))return I=E}return I=m}if(E=I,n(w,m))return E;var P=h(m);return g!==void 0&&g(E,P)?(w=m,E):(w=m,I=P)}var A=!1,w,I,p=f===void 0?null:f;return[function(){return v(y())},p===null?void 0:function(){return v(p())}]},[y,f,h,g]);var C=a(d,c[0],c[1]);return o(function(){_.hasValue=!0,_.value=C},[C]),u(C),C},Re}var ct;function hr(){return ct||(ct=1,Oe.exports=fr()),Oe.exports}var yr=hr();function gr(e){var t=U.useRef();return t.current||(t.current={v:e()}),t.current.v}var mr=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),a,i=[],o;try{for(;(t===void 0||t-- >0)&&!(a=n.next()).done;)i.push(a.value)}catch(s){o={error:s}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return i};function pr(e){return e}var Er=function(e){var t;return e.subscribe(function(r){t=r}).unsubscribe(),t};function _r(e,t){var r=l.useRef(),n=mr(gr(function(){var s=[],u=cr(nt(e.config,t||e._options)),d=u.send;return u.send=function(y){if(u.status===z.NotStarted){s.push(y);return}d(y),r.current=u.state},[u,s]}),2),a=n[0],i=n[1];ur(function(){t&&(a._machine._options=t)});var o=Cr(a);return l.useEffect(function(){return a.start(r.current),i.forEach(a.send),r.current=a.state,function(){a.stop()}},[]),o}var Sr=function(e,t){return t.changed===!1};function Cr(e){var t=l.useCallback(function(){return Er(e)},[e]),r=l.useCallback(function(a){var i=e.subscribe(a).unsubscribe;return i},[e]),n=yr.useSyncExternalStoreWithSelector(r,t,t,pr,Sr);return[n,e.send,e]}function Q(e){if(!e){const t=`flattenConnection(): needs a 'connection' to flatten, but received '${e??""}' instead.`;return console.error(t+" Returning an empty array"),[]}return"nodes"in e?e.nodes:"edges"in e&&Array.isArray(e.edges)?e.edges.map(t=>{if(!(t!=null&&t.node))throw new Error("flattenConnection(): Connection edges must contain nodes");return t.node}):[]}const Tr=e=>`
14
+ ***************************************************************************** */function Ge(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,a,i=n.call(e),o=[];try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o}var z;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(z||(z={}));var Ze={type:"xstate.init"};function Pe(e){return e===void 0?[]:[].concat(e)}function ne(e){return{type:"xstate.assign",assignment:e}}function Ke(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function Ce(e){return function(t){return e===t}}function Qe(e){return typeof e=="string"?{type:e}:e}function Je(e,t){return{value:e,context:t,actions:[],changed:!1,matches:Ce(e)}}function Xe(e,t,n){var r=t,a=!1;return[e.filter((function(i){if(i.type==="xstate.assign"){a=!0;var o=Object.assign({},r);return typeof i.assignment=="function"?o=i.assignment(r,n):Object.keys(i.assignment).forEach((function(s){o[s]=typeof i.assignment[s]=="function"?i.assignment[s](r,n):i.assignment[s]})),r=o,!1}return!0})),r,a]}function ze(e,t){t===void 0&&(t={});var n=Ge(Xe(Pe(e.states[e.initial].entry).map((function(o){return Ke(o,t.actions)})),e.context,Ze),2),r=n[0],a=n[1],i={config:e,_options:t,initialState:{value:e.initial,actions:r,context:a,matches:Ce(e.initial)},transition:function(o,s){var u,d,g=typeof o=="string"?{value:o,context:e.context}:o,f=g.value,h=g.context,E=Qe(s),c=e.states[f];if(c.on){var T=Pe(c.on[E.type]);try{for(var C=(function(D){var se=typeof Symbol=="function"&&Symbol.iterator,pe=se&&D[se],Ee=0;if(pe)return pe.call(D);if(D&&typeof D.length=="number")return{next:function(){return D&&Ee>=D.length&&(D=void 0),{value:D&&D[Ee++],done:!D}}};throw new TypeError(se?"Object is not iterable.":"Symbol.iterator is not defined.")})(T),A=C.next();!A.done;A=C.next()){var v=A.value;if(v===void 0)return Je(f,h);var w=typeof v=="string"?{target:v}:v,R=w.target,y=w.actions,m=y===void 0?[]:y,_=w.cond,P=_===void 0?function(){return!0}:_,O=R===void 0,b=R??f,I=e.states[b];if(P(h,E)){var q=Ge(Xe((O?Pe(m):[].concat(c.exit,m,I.entry).filter((function(D){return D}))).map((function(D){return Ke(D,i._options.actions)})),h,E),3),V=q[0],H=q[1],X=q[2],me=R??f;return{value:me,context:H,actions:V,changed:R!==f||V.length>0||X,matches:Ce(me)}}}}catch(D){u={error:D}}finally{try{A&&!A.done&&(d=C.return)&&d.call(C)}finally{if(u)throw u.error}}}return Je(f,h)}};return i}var et=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))};function en(e){var t=e.initialState,n=z.NotStarted,r=new Set,a={_machine:e,send:function(i){n===z.Running&&(t=e.transition(t,i),et(t,Qe(i)),r.forEach((function(o){return o(t)})))},subscribe:function(i){return r.add(i),i(t),{unsubscribe:function(){return r.delete(i)}}},start:function(i){if(i){var o=typeof i=="object"?i:{context:e.config.context,value:i};t={value:o.value,actions:[],context:o.context,matches:Ce(o.value)}}else t=e.initialState;return n=z.Running,et(t,Ze),a},stop:function(){return n=z.Stopped,r.clear(),a},get state(){return t},get status(){return n}};return a}const tn=typeof window<"u"?l.useLayoutEffect:l.useEffect;function nn(e){const t=l.useRef();return t.current||(t.current={v:e()}),t.current.v}function rn(e){let t;return e.subscribe(n=>t=n).unsubscribe(),t}function an(e,t){const n=l.useRef(),[r,a]=nn(()=>{const u=[],d=en(ze(e.config,t||e._options)),g=d.send;return d.send=f=>{if(d.status===z.NotStarted){u.push(f);return}g(f),n.current=d.state},[d,u]});tn(()=>{t&&(r._machine._options=t)});const i=l.useCallback(()=>rn(r),[r]),o=l.useCallback(u=>{const{unsubscribe:d}=r.subscribe(u);return d},[r]),s=l.useSyncExternalStore(o,i,i);return l.useEffect(()=>(r.start(n.current),a.forEach(r.send),n.current=r.state,()=>{r.stop()}),[]),[s,r.send,r]}function Q(e){if(!e){const t=`flattenConnection(): needs a 'connection' to flatten, but received '${e??""}' instead.`;return console.error(t+" Returning an empty array"),[]}return"nodes"in e?e.nodes:"edges"in e&&Array.isArray(e.edges)?e.edges.map(t=>{if(!(t!=null&&t.node))throw new Error("flattenConnection(): Connection edges must contain nodes");return t.node}):[]}const on=e=>`
31
15
  mutation CartLineAdd(
32
16
  $cartId: ID!
33
17
  $lines: [CartLineInput!]!
@@ -49,7 +33,7 @@
49
33
  }
50
34
 
51
35
  ${e}
52
- `,br=e=>`
36
+ `,sn=e=>`
53
37
  mutation CartCreate(
54
38
  $input: CartInput!
55
39
  $numCartLines: Int = 250
@@ -70,7 +54,7 @@
70
54
  }
71
55
 
72
56
  ${e}
73
- `,vr=e=>`
57
+ `,cn=e=>`
74
58
  mutation CartLineRemove(
75
59
  $cartId: ID!
76
60
  $lines: [ID!]!
@@ -92,7 +76,7 @@
92
76
  }
93
77
 
94
78
  ${e}
95
- `,wr=e=>`
79
+ `,un=e=>`
96
80
  mutation CartLineUpdate(
97
81
  $cartId: ID!
98
82
  $lines: [CartLineUpdateInput!]!
@@ -114,7 +98,7 @@
114
98
  }
115
99
 
116
100
  ${e}
117
- `,Ar=e=>`
101
+ `,ln=e=>`
118
102
  mutation CartNoteUpdate(
119
103
  $cartId: ID!
120
104
  $note: String!
@@ -136,7 +120,7 @@
136
120
  }
137
121
 
138
122
  ${e}
139
- `,Ir=e=>`
123
+ `,dn=e=>`
140
124
  mutation CartBuyerIdentityUpdate(
141
125
  $cartId: ID!
142
126
  $buyerIdentity: CartBuyerIdentityInput!
@@ -158,7 +142,7 @@
158
142
  }
159
143
 
160
144
  ${e}
161
- `,Pr=e=>`
145
+ `,fn=e=>`
162
146
  mutation CartAttributesUpdate(
163
147
  $attributes: [AttributeInput!]!
164
148
  $cartId: ID!
@@ -180,7 +164,7 @@
180
164
  }
181
165
 
182
166
  ${e}
183
- `,Or=e=>`
167
+ `,gn=e=>`
184
168
  mutation CartDiscountCodesUpdate(
185
169
  $cartId: ID!
186
170
  $discountCodes: [String!]!
@@ -202,7 +186,7 @@
202
186
  }
203
187
 
204
188
  ${e}
205
- `,Rr=e=>`
189
+ `,hn=e=>`
206
190
  query CartQuery(
207
191
  $id: ID!
208
192
  $numCartLines: Int = 250
@@ -221,7 +205,7 @@
221
205
  }
222
206
 
223
207
  ${e}
224
- `,Vr=`
208
+ `,yn=`
225
209
  fragment CartFragment on Cart {
226
210
  id
227
211
  checkoutUrl
@@ -322,16 +306,16 @@
322
306
  width
323
307
  height
324
308
  }
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.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,`
309
+ `,re="2026-01",mn="mock.shop",tt=e=>e.includes(mn);function pn({storeDomain:e,privateStorefrontToken:t,publicStorefrontToken:n,storefrontApiVersion:r=re,contentType:a}){if(!e)throw new Error(Oe+"`storeDomain` is required when creating a new Storefront client in production.");r!==re&&En(`The Storefront API version that you're using is different than the version this build of Hydrogen React is targeting.
310
+ You may run into unexpected errors if these versions don't match. Received version: "${r}"; expected version "${re}"`);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)??r}/graphql.json`},getPrivateTokenHeaders(o){if(!t&&!(o!=null&&o.privateStorefrontToken)&&!tt(e))throw new Error(Oe+"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":r,"Shopify-Storefront-Private-Token":(o==null?void 0:o.privateStorefrontToken)??t??"",...o!=null&&o.buyerIp?{"Shopify-Storefront-Buyer-IP":o.buyerIp}:{}}},getPublicTokenHeaders(o){if(!n&&!(o!=null&&o.publicStorefrontToken)&&!tt(e))throw new Error(Oe+"You did not pass in a `publicStorefrontToken` while using `createStorefrontClient()` or `getPublicTokenHeaders()`");const s=(o==null?void 0:o.contentType)??a??"json";return nt(s,r,(o==null?void 0:o.publicStorefrontToken)??n??"")}}}function nt(e,t,n){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":n}}const rt=new Set,Oe="[h2:error:createStorefrontClient] ",En=(e,t="warn")=>{rt.has(e)||(console[t](`[h2:${t}:createStorefrontClient] `+e),rt.add(e))},at={storeDomain:"test",storefrontToken:"abc123",storefrontApiVersion:re,countryIsoCode:"US",languageIsoCode:"EN",getStorefrontApiUrl(){return""},getPublicTokenHeaders(){return{}},getShopifyDomain(){return""}},it=l.createContext(at);function _n(){var e,t,n;if(typeof window>"u")return!1;try{const r=(t=(e=window.performance)==null?void 0:e.getEntriesByType)==null?void 0:t.call(e,"navigation")[0];return!!((n=r==null?void 0:r.serverTiming)!=null&&n.some(a=>a.name==="_sfapi_proxy"))}catch{return!1}}function Cn({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!==re&&console.warn(`<ShopifyProvider/>: This version of Hydrogen React is built for Shopify's Storefront API version ${re}, 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 n=l.useMemo(()=>{const r=t.sameDomainForStorefrontApi??_n();function a(i){const o=(i==null?void 0:i.storeDomain)??t.storeDomain;return o.includes("://")?o:`https://${o}`}return{...t,sameDomainForStorefrontApi:r,getPublicTokenHeaders(i){return nt(i.contentType,t.storefrontApiVersion,i.storefrontToken??t.storefrontToken)},getShopifyDomain:a,getStorefrontApiUrl(i){const o=r&&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(it.Provider,{value:n},e)}function ce(){const e=l.useContext(it);if(!e)throw new Error("'useShop()' must be a descendent of <ShopifyProvider/>");return e}const Re="shopifyCartId",ot="Shopify-Storefront-Id",st="Shopify-Storefront-Y",ct="Shopify-Storefront-S",Te="_shopify_y",Se="_shopify_s",Ve="X-Shopify-VisitToken",ke="X-Shopify-UniqueToken",De={current:null};function ee(){var t,n,r;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,g=u.name.match(a);if(!g)continue;const[,f,h]=g;if(f===d||h&&(f==null?void 0:f.endsWith(`.${d}`))){const c=ut(u);if(c){o=c;break}}}if(o&&(e=o),e?De.current=e:De.current&&(e=De.current),!e){const s=performance.getEntriesByType("navigation")[0];e=ut(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:((n=a.match(/\b_shopify_s=([^;]+)/))==null?void 0:n[1])||"",consent:((r=a.match(/\b_tracking_consent=([^;]+)/))==null?void 0:r[1])||""}}return e}function ut(e,t=!0){let n="",r="",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"?n=u:s==="_s"?r=u:s==="_cmp"&&(a=u),n&&r&&a))break}return n&&r&&(!t||a)?{uniqueToken:n,visitToken:r,consent:a}:void 0}function Tn(){const{storefrontId:e,getPublicTokenHeaders:t,getStorefrontApiUrl:n,sameDomainForStorefrontApi:r}=ce();return l.useCallback(({query:a,variables:i})=>{const o=t({contentType:"json"});if(e&&(o[ot]=e),!r){const{uniqueToken:s,visitToken:u}=ee();s&&(o[st]=s,o[ke]=s),u&&(o[ct]=u,o[Ve]=u)}return fetch(n(),{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,n,r])}function Sn({numCartLines:e,cartFragment:t,countryCode:n="US",languageCode:r="EN"}){const a=Tn(),i=l.useCallback(c=>a({query:hn(t),variables:{id:c,numCartLines:e,country:n,language:r}}),[a,t,e,n,r]),o=l.useCallback(c=>a({query:sn(t),variables:{input:c,numCartLines:e,country:n,language:r}}),[t,n,a,e,r]),s=l.useCallback((c,T)=>a({query:on(t),variables:{cartId:c,lines:T,numCartLines:e,country:n,language:r}}),[t,n,a,e,r]),u=l.useCallback((c,T)=>a({query:un(t),variables:{cartId:c,lines:T,numCartLines:e,country:n,language:r}}),[t,n,a,e,r]),d=l.useCallback((c,T)=>a({query:cn(t),variables:{cartId:c,lines:T,numCartLines:e,country:n,language:r}}),[t,n,a,e,r]),g=l.useCallback((c,T)=>a({query:ln(t),variables:{cartId:c,note:T,numCartLines:e,country:n,language:r}}),[a,t,e,n,r]),f=l.useCallback((c,T)=>a({query:dn(t),variables:{cartId:c,buyerIdentity:T,numCartLines:e,country:n,language:r}}),[t,n,a,e,r]),h=l.useCallback((c,T)=>a({query:fn(t),variables:{cartId:c,attributes:T,numCartLines:e,country:n,language:r}}),[t,n,a,e,r]),E=l.useCallback((c,T)=>a({query:gn(t),variables:{cartId:c,discountCodes:T,numCartLines:e,country:n,language:r}}),[t,n,a,e,r]);return l.useMemo(()=>({cartFetch:i,cartCreate:o,cartLineAdd:s,cartLineUpdate:u,cartLineRemove:d,noteUpdate:g,buyerIdentityUpdate:f,cartAttributesUpdate:h,discountCodesUpdate:E,cartFragment:t}),[i,o,s,u,d,g,f,h,E,t])}function Y(e,t){return{entry:[...(t==null?void 0:t.entryActions)||[],ne({lastValidCart:n=>n==null?void 0:n.cart}),"onCartActionEntry","onCartActionOptimisticUI",e],on:{RESOLVE:{target:(t==null?void 0:t.resolveTarget)||"idle",actions:[ne({prevCart:n=>n==null?void 0:n.lastValidCart,cart:(n,r)=>{var a;return(a=r==null?void 0:r.payload)==null?void 0:a.cart},rawCartResult:(n,r)=>{var a;return(a=r==null?void 0:r.payload)==null?void 0:a.rawCartResult},errors:n=>{}})]},ERROR:{target:(t==null?void 0:t.errorTarget)||"error",actions:[ne({prevCart:n=>n==null?void 0:n.lastValidCart,cart:n=>n==null?void 0:n.lastValidCart,errors:(n,r)=>{var a;return(a=r==null?void 0:r.payload)==null?void 0:a.errors}})]},CART_COMPLETED:{target:"cartCompleted",actions:ne({prevCart:n=>{},cart:n=>{},lastValidCart:n=>{},rawCartResult:n=>{},errors:n=>{}})}},exit:["onCartActionComplete",...(t==null?void 0:t.exitActions)||[]]}}const ue={CART_FETCH:{target:"cartFetching"},CART_CREATE:{target:"cartCreating"},CART_SET:{target:"idle",actions:[ne({rawCartResult:(e,t)=>t.payload.cart,cart:(e,t)=>Ue(t.payload.cart)})]}},lt={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 bn(e){return ze({id:"Cart",initial:e?"idle":"uninitialized",context:{cart:e&&Ue(e)},states:{uninitialized:{on:ue},cartCompleted:{on:ue},initializationError:{on:ue},idle:{on:{...ue,...lt}},error:{on:{...ue,...lt}},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 An({numCartLines:e,onCartActionEntry:t,onCartActionOptimisticUI:n,onCartActionComplete:r,data:a,cartFragment:i,countryCode:o,languageCode:s}){const{cartFetch:u,cartCreate:d,cartLineAdd:g,cartLineUpdate:f,cartLineRemove:h,noteUpdate:E,buyerIdentityUpdate:c,cartAttributesUpdate:T,discountCodesUpdate:C}=Sn({numCartLines:e,cartFragment:i,countryCode:o,languageCode:s}),A=l.useMemo(()=>bn(a),[a]),[v,w,R]=an(A,{actions:{cartFetchAction:async(y,m)=>{var b;if(m.type!=="CART_FETCH")return;const{data:_,errors:P}=await u((b=m==null?void 0:m.payload)==null?void 0:b.cartId),O=W(m,_==null?void 0:_.cart,P);w(O)},cartCreateAction:async(y,m)=>{var b;if(m.type!=="CART_CREATE")return;const{data:_,errors:P}=await d(m==null?void 0:m.payload),O=W(m,(b=_==null?void 0:_.cartCreate)==null?void 0:b.cart,P);w(O)},cartLineAddAction:async(y,m)=>{var b,I;if(m.type!=="CARTLINE_ADD"||!((b=y==null?void 0:y.cart)!=null&&b.id))return;const{data:_,errors:P}=await g(y.cart.id,m.payload.lines),O=W(m,(I=_==null?void 0:_.cartLinesAdd)==null?void 0:I.cart,P);w(O)},cartLineUpdateAction:async(y,m)=>{var b,I;if(m.type!=="CARTLINE_UPDATE"||!((b=y==null?void 0:y.cart)!=null&&b.id))return;const{data:_,errors:P}=await f(y.cart.id,m.payload.lines),O=W(m,(I=_==null?void 0:_.cartLinesUpdate)==null?void 0:I.cart,P);w(O)},cartLineRemoveAction:async(y,m)=>{var b,I;if(m.type!=="CARTLINE_REMOVE"||!((b=y==null?void 0:y.cart)!=null&&b.id))return;const{data:_,errors:P}=await h(y.cart.id,m.payload.lines),O=W(m,(I=_==null?void 0:_.cartLinesRemove)==null?void 0:I.cart,P);w(O)},noteUpdateAction:async(y,m)=>{var b,I;if(m.type!=="NOTE_UPDATE"||!((b=y==null?void 0:y.cart)!=null&&b.id))return;const{data:_,errors:P}=await E(y.cart.id,m.payload.note),O=W(m,(I=_==null?void 0:_.cartNoteUpdate)==null?void 0:I.cart,P);w(O)},buyerIdentityUpdateAction:async(y,m)=>{var b,I;if(m.type!=="BUYER_IDENTITY_UPDATE"||!((b=y==null?void 0:y.cart)!=null&&b.id))return;const{data:_,errors:P}=await c(y.cart.id,m.payload.buyerIdentity),O=W(m,(I=_==null?void 0:_.cartBuyerIdentityUpdate)==null?void 0:I.cart,P);w(O)},cartAttributesUpdateAction:async(y,m)=>{var b,I;if(m.type!=="CART_ATTRIBUTES_UPDATE"||!((b=y==null?void 0:y.cart)!=null&&b.id))return;const{data:_,errors:P}=await T(y.cart.id,m.payload.attributes),O=W(m,(I=_==null?void 0:_.cartAttributesUpdate)==null?void 0:I.cart,P);w(O)},discountCodesUpdateAction:async(y,m)=>{var b,I;if(m.type!=="DISCOUNT_CODES_UPDATE"||!((b=y==null?void 0:y.cart)!=null&&b.id))return;const{data:_,errors:P}=await C(y.cart.id,m.payload.discountCodes),O=W(m,(I=_==null?void 0:_.cartDiscountCodesUpdate)==null?void 0:I.cart,P);w(O)},...t&&{onCartActionEntry:(y,m)=>{wn(m)&&t(y,m)}},...n&&{onCartActionOptimisticUI:ne((y,m)=>n(y,m))},...r&&{onCartActionComplete:(y,m)=>{In(m)&&r(y,m)}}}});return l.useMemo(()=>[v,w,R],[v,w,R])}function Ue(e){return{...e,lines:Q(e==null?void 0:e.lines),note:e.note??void 0}}function W(e,t,n){return n?{type:"ERROR",payload:{errors:n,cartActionEvent:e}}:t?{type:"RESOLVE",payload:{cart:Ue(t),rawCartResult:t,cartActionEvent:e}}:{type:"CART_COMPLETED",payload:{cartActionEvent:e}}}function wn(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 In(e){return e.type==="RESOLVE"||e.type==="ERROR"||e.type==="CART_COMPLETED"}const dt=l.createContext(null);function ae(){const e=l.useContext(dt);if(!e)throw new Error("Expected a Cart Context, but no Cart Context was found");return e}function vn({children:e,numCartLines:t,onCreate:n,onLineAdd:r,onLineRemove:a,onLineUpdate:i,onNoteUpdate:o,onBuyerIdentityUpdate:s,onAttributesUpdate:u,onDiscountCodesUpdate:d,onCreateComplete:g,onLineAddComplete:f,onLineRemoveComplete:h,onLineUpdateComplete:E,onNoteUpdateComplete:c,onBuyerIdentityUpdateComplete:T,onAttributesUpdateComplete:C,onDiscountCodesUpdateComplete:A,data:v,cartFragment:w=yn,customerAccessToken:R,countryCode:y,languageCode:m}){var Wt,Gt,Zt,Kt,Qt,Jt,Xt;const _=ce();if(!_)throw new Error("<CartProvider> needs to be a descendant of <ShopifyProvider>");y=(y??_.countryIsoCode??"US").toUpperCase(),m=(m??_.languageIsoCode??"EN").toUpperCase(),y&&(y=y.toUpperCase());const[P,O]=l.useState(y),[b,I]=l.useState(R),q=l.useRef(!1);(P!==y||b!==R)&&(O(y),I(R),q.current=!1);const[V,H]=An({numCartLines:t,data:v,cartFragment:w,countryCode:y,languageCode:m,onCartActionEntry(S,U){try{switch(U.type){case"CART_CREATE":return n==null?void 0:n();case"CARTLINE_ADD":return r==null?void 0:r();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(S,U){var F,K,N,_e;if(!S.cart)return{...S};switch(U.type){case"CARTLINE_REMOVE":return{...S,cart:{...S.cart,lines:(K=(F=S==null?void 0:S.cart)==null?void 0:F.lines)==null?void 0:K.filter(L=>(L==null?void 0:L.id)&&!U.payload.lines.includes(L==null?void 0:L.id))}};case"CARTLINE_UPDATE":return{...S,cart:{...S.cart,lines:(_e=(N=S==null?void 0:S.cart)==null?void 0:N.lines)==null?void 0:_e.map(L=>{const We=U.payload.lines.find(({id:Jr})=>Jr===(L==null?void 0:L.id));return We&&We.quantity?{...L,quantity:We.quantity}:L})}}}return{...S}},onCartActionComplete(S,U){const F=U.payload.cartActionEvent;try{switch(U.type){case"RESOLVE":switch(F.type){case"CART_CREATE":return g==null?void 0:g();case"CARTLINE_ADD":return f==null?void 0:f();case"CARTLINE_REMOVE":return h==null?void 0:h();case"CARTLINE_UPDATE":return E==null?void 0:E();case"NOTE_UPDATE":return c==null?void 0:c();case"BUYER_IDENTITY_UPDATE":return Rn(S,F)&&(q.current=!0),T==null?void 0:T();case"CART_ATTRIBUTES_UPDATE":return C==null?void 0:C();case"DISCOUNT_CODES_UPDATE":return A==null?void 0:A()}}}catch(K){console.error("onCartActionComplete failed",K)}}}),X=l.useRef(!1),[me,D]=l.useState(!1),se=V.matches("cartCompleted"),pe=(V.value==="idle"||V.value==="error"||V.value==="cartCompleted")&&y!==((Zt=(Gt=(Wt=V==null?void 0:V.context)==null?void 0:Wt.cart)==null?void 0:Gt.buyerIdentity)==null?void 0:Zt.countryCode)&&!V.context.errors,Ee=l.useRef(!1);l.useEffect(()=>{if(!X.current&&!Ee.current){if(!v&&Ne("localStorage")){Ee.current=!0;try{const S=window.localStorage.getItem(Re);S&&H({type:"CART_FETCH",payload:{cartId:S}})}catch(S){console.warn("error fetching cartId"),console.warn(S)}}X.current=!0,D(!0)}},[v,X,H]),l.useEffect(()=>{!pe||q.current||H({type:"BUYER_IDENTITY_UPDATE",payload:{buyerIdentity:{countryCode:y,customerAccessToken:R}}})},[y,R,pe,q,H]);const B=l.useCallback(S=>{if(!X.current)return console.warn("Cart isn't ready yet");H(S)},[H]);l.useEffect(()=>{var S,U,F;if((U=(S=V==null?void 0:V.context)==null?void 0:S.cart)!=null&&U.id&&Ne("localStorage"))try{window.localStorage.setItem(Re,(F=V.context.cart)==null?void 0:F.id)}catch(K){console.warn("Failed to save cartId to localStorage",K)}},[(Qt=(Kt=V==null?void 0:V.context)==null?void 0:Kt.cart)==null?void 0:Qt.id]),l.useEffect(()=>{if(se&&Ne("localStorage"))try{window.localStorage.removeItem(Re)}catch(S){console.warn("Failed to delete cartId from localStorage",S)}},[se]);const Ye=l.useCallback(S=>{var U,F;y&&!((U=S.buyerIdentity)!=null&&U.countryCode)&&(S.buyerIdentity==null&&(S.buyerIdentity={}),S.buyerIdentity.countryCode=y),R&&!((F=S.buyerIdentity)!=null&&F.customerAccessToken)&&(S.buyerIdentity==null&&(S.buyerIdentity={}),S.buyerIdentity.customerAccessToken=R),B({type:"CART_CREATE",payload:S})},[y,R,B]),k=On(V),Qr=l.useMemo(()=>{var S,U,F,K;return{...((S=k==null?void 0:k.context)==null?void 0:S.cart)??{lines:[],attributes:[]},status:Pn(k.value),error:(U=k==null?void 0:k.context)==null?void 0:U.errors,totalQuantity:((K=(F=k==null?void 0:k.context)==null?void 0:F.cart)==null?void 0:K.totalQuantity)??0,cartCreate:Ye,cartReady:me,linesAdd(N){var _e,L;(L=(_e=k==null?void 0:k.context)==null?void 0:_e.cart)!=null&&L.id?B({type:"CARTLINE_ADD",payload:{lines:N}}):Ye({lines:N})},linesRemove(N){B({type:"CARTLINE_REMOVE",payload:{lines:N}})},linesUpdate(N){B({type:"CARTLINE_UPDATE",payload:{lines:N}})},noteUpdate(N){B({type:"NOTE_UPDATE",payload:{note:N}})},buyerIdentityUpdate(N){B({type:"BUYER_IDENTITY_UPDATE",payload:{buyerIdentity:N}})},cartAttributesUpdate(N){B({type:"CART_ATTRIBUTES_UPDATE",payload:{attributes:N}})},discountCodesUpdate(N){B({type:"DISCOUNT_CODES_UPDATE",payload:{discountCodes:N}})},cartFragment:w}},[Ye,me,(Jt=k==null?void 0:k.context)==null?void 0:Jt.cart,(Xt=k==null?void 0:k.context)==null?void 0:Xt.errors,k.value,w,B]);return React.createElement(dt.Provider,{value:Qr},e)}function Pn(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 On(e){const[t,n]=l.useTransition(),[r,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(()=>{n(()=>{o.current||a(e)})},[e]),o.current?e:r}function Ne(e){let t;try{t=window[e];const n="__storage_test__";return t.setItem(n,n),t.removeItem(n),!0}catch(n){return!!(n instanceof DOMException&&(n.code===22||n.code===1014||n.name==="QuotaExceededError"||n.name==="NS_ERROR_DOM_QUOTA_REACHED")&&t&&t.length!==0)}}function Rn(e,t){var n,r;return!!(t.payload.buyerIdentity.countryCode&&((r=(n=e.cart)==null?void 0:n.buyerIdentity)==null?void 0:r.countryCode)!==t.payload.buyerIdentity.countryCode)}const ft=l.createContext(null);function Vn({children:e,data:t,initialVariantId:n}){const r=l.useMemo(()=>Q(t.variants??{}),[t.variants]);if(!Dn(r))throw new Error("<ProductProvider/> requires 'product.variants.nodes' or 'product.variants.edges'");const a=l.useMemo(()=>kn(r),[r]),[i,o]=l.useState(()=>yt(n,r)),[s,u]=l.useState(()=>mt(i));l.useEffect(()=>{const C=yt(n,r);o(C),u(mt(C))},[n,r]);const d=l.useCallback((C,A)=>{u(v=>{const w={...v,[C]:A};return o(ht(r,w)),w})},[u,r]),g=l.useCallback((C,A)=>{const v=ht(r,{...s,[C]:A});return(v==null?void 0:v.availableForSale)??!0},[s,r]),f=l.useMemo(()=>Q(t.sellingPlanGroups??{}).map(C=>({...C,sellingPlans:Q((C==null?void 0:C.sellingPlans)??{})})),[t.sellingPlanGroups]),[h,E]=l.useState(void 0),c=l.useMemo(()=>{var C,A;if(!(!i||!h)){if(!((C=i.sellingPlanAllocations)!=null&&C.nodes)&&!((A=i.sellingPlanAllocations)!=null&&A.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(v=>{var w;return((w=v==null?void 0:v.sellingPlan)==null?void 0:w.id)===h.id})}},[i,h]),T=l.useMemo(()=>({product:t,variants:r,variantsConnection:t.variants,options:a,selectedVariant:i,setSelectedVariant:o,selectedOptions:s,setSelectedOption:d,setSelectedOptions:u,isOptionInStock:g,selectedSellingPlan:h,setSelectedSellingPlan:E,selectedSellingPlanAllocation:c,sellingPlanGroups:f,sellingPlanGroupsConnection:t.sellingPlanGroups}),[t,g,a,s,h,c,i,f,d,r]);return React.createElement(ft.Provider,{value:T},e)}function gt(){const e=l.useContext(ft);if(!e)throw new Error("'useProduct' must be a child of <ProductProvider />");return e}function ht(e,t){var n,r;if(!(!e.length||((r=(n=e==null?void 0:e[0])==null?void 0:n.selectedOptions)==null?void 0:r.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 kn(e){const t=e.reduce((n,r)=>{var a;if(!r.selectedOptions)throw new Error("'getOptions' requires 'variant.selectedOptions'");return(a=r==null?void 0:r.selectedOptions)==null||a.forEach(i=>{n[(i==null?void 0:i.name)??""]=n[(i==null?void 0:i.name)??""]||new Set,n[(i==null?void 0:i.name)??""].add((i==null?void 0:i.value)??"")}),n},{});return Object.keys(t).map(n=>({name:n,values:Array.from(t[n])}))}function yt(e,t){if(e){const n=t.find(r=>(r==null?void 0:r.id)===e);return n||console.warn("<ProductProvider/> received a 'initialVariantId' prop, but could not actually find a variant with that ID"),n}if(e===null)return null;if(e===void 0)return t.find(n=>n==null?void 0:n.availableForSale)||t[0]}function mt(e){return e!=null&&e.selectedOptions?e.selectedOptions.reduce((t,n)=>(t[(n==null?void 0:n.name)??""]=(n==null?void 0:n.value)??"",t),{}):{}}function Dn(e){return!(!e||!Array.isArray(e))}function be(e){const{as:t,onClick:n,defaultOnClick:r,children:a,buttonRef:i,...o}=e,s=l.useCallback(d=>{if(n){const g=n(d);if(typeof g=="boolean"&&g===!1||d!=null&&d.defaultPrevented)return}r==null||r(d)},[r,n]),u=t||"button";return React.createElement(u,{ref:i,onClick:s,...o},a)}function Un(e){const[t,n]=l.useState(!1),{variantId:r,quantity:a=1,attributes:i,sellingPlanId:o,onClick:s,children:u,accessibleAddingToCartLabel:d,parent:g,...f}=e,{status:h,linesAdd:E}=ae(),{selectedVariant:c}=gt(),T=r??(c==null?void 0:c.id)??"",C=r===null||T===""||c===null||t||f.disabled;l.useEffect(()=>{t&&h==="idle"&&n(!1)},[h,t]);const A=l.useCallback(()=>{n(!0),E([{quantity:a,merchandiseId:T||"",attributes:i,parent:g,sellingPlanId:o}])},[E,a,T,i,o,g]);return M.createElement(M.Fragment,null,M.createElement(be,{...f,disabled:C,onClick:s,defaultOnClick:A},u),d?M.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"},Ae={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"},pt={hydrogen:"hydrogen",headless:"headless"},Et={hydrogen:"6167201",headless:"12875497473"};function x(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:n,searchParams:r,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}${n}${i}`||"",resource:u??null,resourceId:s||null,search:n,searchParams:r,hash:i}}catch{return t}}function j(e,t){return typeof e!="object"?{}:(Object.entries(e).forEach(([n,r])=>{r&&(t[n]=r)}),t)}function Nn(e){return typeof document>"u"?(console.error(`${e} should only be used within the useEffect callback or event handlers`),!0):!1}const _t="xxxx-4xxx-xxxx-xxxxxxxxxxxx";function we(){let e="";try{const t=window.crypto,n=new Uint16Array(31);t.getRandomValues(n);let r=0;e=_t.replace(/[x]/g,a=>{const i=n[r]%16,o=a==="x"?i:i&3|8;return r++,o.toString(16)}).toUpperCase()}catch{e=_t.replace(/[x]/g,n=>{const r=Math.random()*16|0;return(n==="x"?r:r&3|8).toString(16)}).toUpperCase()}return`${Mn()}-${e}`}function Mn(){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 Fn(e){const t=ee(e);return{[Te]:t.uniqueToken,[Se]:t.visitToken}}const Ln="trekkie_storefront_page_view/1.4",$n="myshopify.dev";function Ct(e){const t=e,{id:n,resource:r}=$(t.resourceId),a=r?r.toLowerCase():void 0;return[x(Ln,j({pageType:t.pageType,customerId:parseInt($(t.customerId).id||"0"),resourceType:a,resourceId:parseInt(n)},jn(t)))]}function jn(e){return{appClientId:e.shopifySalesChannel?Et[e.shopifySalesChannel]:Et.headless,isMerchantRequest:xn(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 xn(e){if(typeof e!="string")return!1;const t=new URL(e).hostname;return t.indexOf($n)!==-1||t==="localhost"}const qn="2026.1.2",G="custom_storefront_customer_tracking/1.2",Tt="page_rendered",St="collection_page_rendered",bt="product_page_rendered",Hn="product_added_to_cart",At="search_submitted";function le(e){return{canonical_url:e.canonicalUrl||e.url,customer_id:parseInt($(e.customerId).id||"0")}}function Bn(e){const t=e,n=le(t),r=t.pageType,a=[];switch(a.push(x(G,j({event_name:Tt,...n},Z(t)))),r){case Ae.collection:a.push(x(G,j({event_name:St,...n,collection_name:t.collectionHandle,collection_id:parseInt($(t.collectionId).id)},Z(t))));break;case Ae.product:a.push(x(G,j({event_name:bt,...n,products:Me(t.products),total_value:t.totalValue},Z(t))));break;case Ae.search:a.push(x(G,j({event_name:At,...n,search_string:t.searchString},Z(t))));break}return a}function Yn(e){const t=e,n=le(t);return[x(G,j({event_name:Tt,...n},Z(t)))]}function Wn(e){const t=e,n=le(t);return[x(G,j({event_name:St,...n,collection_name:t.collectionHandle,collection_id:parseInt($(t.collectionId).id)},Z(t)))]}function Gn(e){const t=e,n=le(t);return[x(G,j({event_name:bt,...n,products:Me(t.products),total_value:t.totalValue},Z(t)))]}function Zn(e){const t=e,n=le(t);return[x(G,j({event_name:At,...n,search_string:t.searchString},Z(t)))]}function Kn(e){const t=e,n=$(t.cartId);return[x(G,j({event_name:Hn,customerId:t.customerId,cart_token:n!=null&&n.id?`${n.id}`:null,total_value:t.totalValue,products:Me(t.products),customer_id:parseInt($(t.customerId).id||"0")},Z(t)))]}function Z(e){const t=e;return{source:e.shopifySalesChannel||pt.headless,asset_version_id:e.assetVersionId||qn,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 Me(e){return e?e.map(t=>{const n=j({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(n)}):[]}function Qn(e,t){const{eventName:n,payload:r}=e;if(!r.hasUserConsent)return Promise.resolve();let a=[];const i=r;return n===te.PAGE_VIEW?a=a.concat(Ct(i),Bn(i)):n===te.ADD_TO_CART?a=a.concat(Kn(r)):n===te.PAGE_VIEW_2?a=a.concat(Ct(i),Yn(i)):n===te.COLLECTION_VIEW?a=a.concat(Wn(i)):n===te.PRODUCT_VIEW?a=a.concat(Gn(i)):n===te.SEARCH_VIEW&&(a=a.concat(Zn(i))),a.length?Xn(a,t):Promise.resolve()}function Jn(){return typeof window>"u"||!window.navigator?!1:/Chrome-Lighthouse/.test(window.navigator.userAgent)}const wt="sendShopifyAnalytics request is unsuccessful";function Xn(e,t){if(Jn())return Promise.resolve();const n={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(n)}).then(r=>{if(!r.ok)throw new Error("Response failed");return r.text()}).then(r=>{r&&JSON.parse(r).result.forEach(i=>{i.status!==200&&console.error(wt,`
327
311
 
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
312
+ `,i.message)})}).catch(r=>{console.error(wt,r)})}catch{return Promise.resolve()}}function zn(){if(Nn("getClientBrowserParameters"))return{uniqueToken:"",visitToken:"",url:"",path:"",search:"",referrer:"",title:"",userAgent:"",navigationType:"",navigationApi:""};const[e,t]=nr(),n=ee();return{uniqueToken:n.uniqueToken,visitToken:n.visitToken,url:location.href,path:location.pathname,search:location.search,referrer:document.referrer,title:document.title,userAgent:navigator.userAgent,navigationType:e,navigationApi:t}}function er(){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 tr(){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 n=performance.navigation.type;switch(n){case PerformanceNavigation.TYPE_NAVIGATE:return"navigate";case PerformanceNavigation.TYPE_RELOAD:return"reload";case PerformanceNavigation.TYPE_BACK_FORWARD:return"back_forward";default:return`unknown: ${n}`}}}catch{}}function nr(){try{let e="PerformanceNavigationTiming",t=er();return t||(t=tr(),e="performance.navigation"),t?[t,e]:["unknown","unknown"]}catch{}return["error","error"]}function rr(e){const{cartCreate:t,checkoutUrl:n}=ae(),[r,a]=l.useState(!1),{quantity:i,variantId:o,sellingPlanId:s,onClick:u,attributes:d,children:g,...f}=e;l.useEffect(()=>{r&&n&&(window.location.href=n)},[r,n]);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:r??f.disabled,...f,onClick:u,defaultOnClick:h},g)}function ar(e){const[t,n]=l.useState(!1),{status:r,checkoutUrl:a}=ae(),{children:i,...o}=e;return l.useEffect(()=>{t&&a&&r==="idle"&&(window.location.href=a)},[t,r,a]),React.createElement(be,{...o,disabled:t||o.disabled,onClick:()=>n(!0)},i)}function It(e){const{countryIsoCode:t,languageIsoCode:n}=ce(),r=n.includes("_")?n.replace("_","-"):`${n}-${t}`;if(!r)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(r,{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:g,withoutTrailingZerosOrCurrencyFormatter:f}=l.useMemo(()=>{const c=i?{style:"currency",currency:e.currencyCode}:{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2};return{defaultFormatter:ie(r,c),nameFormatter:ie(r,{...c,currencyDisplay:"name"}),narrowSymbolFormatter:ie(r,{...c,currencyDisplay:"narrowSymbol"}),withoutTrailingZerosFormatter:ie(r,{...c,minimumFractionDigits:0,maximumFractionDigits:0}),withoutCurrencyFormatter:ie(r,{minimumFractionDigits:2,maximumFractionDigits:2}),withoutTrailingZerosOrCurrencyFormatter:ie(r,{minimumFractionDigits:0,maximumFractionDigits:0})}},[e.currencyCode,r,i]),h=c=>c.type==="currency",E=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):g().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,g,d,f]);return l.useMemo(()=>new Proxy(E,{get:(c,T)=>{var C;return(C=Reflect.get(c,T))==null?void 0:C.call(null)}}),[E])}const vt=new Map;function ie(e,t){const n=JSON.stringify([e,t]);return function(){let r=vt.get(n);if(!r){try{r=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,r=new Intl.NumberFormat(e,i)}else throw a}vt.set(n,r)}return r}}function Ie({data:e,as:t,withoutCurrency:n,withoutTrailingZeros:r,measurement:a,measurementSeparator:i="/",...o}){if(!ir(e))throw new Error("<Money/> needs a valid 'data' prop that has 'amount' and 'currencyCode'");const s=It(e),u=t??"div";let d=s.localizedString;return(n||r)&&(n&&!r?d=s.amount:!n&&r?d=s.withoutTrailingZeros:d=s.withoutTrailingZerosAndCurrency),React.createElement(u,{...o},d,a&&a.referenceUnit&&React.createElement(React.Fragment,null,i,a.referenceUnit))}function ir(e){return typeof e.amount=="string"&&!!e.amount&&typeof e.currencyCode=="string"&&!!e.currencyCode}function or(e){const{cost:t}=ae(),{amountType:n="total",children:r,...a}=e;let i;return n=="total"?i=t==null?void 0:t.totalAmount:n=="subtotal"?i=t==null?void 0:t.subtotalAmount:n=="tax"?i=t==null?void 0:t.totalTaxAmount:n=="duty"&&(i=t==null?void 0:t.totalDutyAmount),i==null?null:React.createElement(Ie,{...a,data:i},r)}const Pt=l.createContext(null);function Fe(){const e=l.useContext(Pt);if(e==null)throw new Error("Expected a cart line context but none was found");return e}function sr({children:e,line:t}){return React.createElement(Pt.Provider,{value:t},e)}function cr(e){const t=Fe(),{as:n,...r}=e,a=n||"span";return React.createElement(a,{...r},t.quantity)}function ur(e){const{status:t,linesRemove:n,linesUpdate:r}=ae(),a=Fe(),{children:i,adjust:o,onClick:s,...u}=e,d=l.useCallback(()=>{if(o==="remove"){n([(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){n([(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)??[]};r([h])},[o,a==null?void 0:a.attributes,a==null?void 0:a.id,a==null?void 0:a.quantity,n,r]),g=u.disabled;return React.createElement(be,{...u,onClick:s,defaultOnClick:d,disabled:typeof g<"u"?g:t!=="idle"},i)}const lr={DateTime:"string",Decimal:"string",HTML:"string",URL:"string",Color:"string",UnsignedInt64:"string"},dr={DateTime:"string",Decimal:"string",HTML:"string",ISO8601DateTime:"string",URL:"string",UnsignedInt64:"string"},Ot=l.forwardRef((e,t)=>{const{data:n,options:r,id:a=n.id,frameBorder:i="0",allow:o="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:s=!0,loading:u="lazy",...d}=e;if(!n.embedUrl)throw new Error("<ExternalVideo/> requires the 'embedUrl' property");let g=n.embedUrl;if(r){const f=new URL(n.embedUrl);for(const[h,E]of Object.entries(r))typeof E>"u"||f.searchParams.set(h,E.toString());g=f.toString()}return React.createElement("iframe",{...d,id:a??n.embedUrl,title:n.alt??n.id??"external video",frameBorder:i,allow:o,allowFullScreen:s,src:g,loading:u,ref:t})}),Le=",",oe={OPTION:":",END_OF_PREFIX:",",SEQUENCE_GAP:" ",RANGE:"-"},$e=(()=>{const e=new Map;return function(t,n){var r;if(t.length===0)return!1;if(!e.has(n)){const a=new Set;for(const i of Rt(n)){a.add(i.join(Le));for(let o=0;o<i.length;o++)a.add(i.slice(0,o+1).join(Le))}e.set(n,a)}return!!((r=e.get(n))!=null&&r.has(t.join(Le)))}})();function Rt(e){if(!e)return[];if(e.startsWith("v1_"))return gr(fr(e));throw new Error("Unsupported option value encoding")}const fr=e=>e.replace(/^v1_/,"");function gr(e){const t=/[ :,-]/g;let n=0,r;const a=[],i=[];let o=0,s=null;for(;r=t.exec(e);){const d=r[0],g=Number.parseInt(e.slice(n,r.index))||0;if(s!==null){for(;s<g;s++)i[o]=s,a.push([...i]);s=null}i[o]=g,d===oe.RANGE?s=g:d===oe.OPTION?o++:((d===oe.SEQUENCE_GAP||d===oe.END_OF_PREFIX&&e[r.index-1]!==oe.END_OF_PREFIX)&&a.push([...i]),d===oe.END_OF_PREFIX&&(i.pop(),o--)),n=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 hr(e){return Object.assign({},...e.map(t=>({[t.name]:Object.assign({},...t!=null&&t.optionValues?t.optionValues.map((n,r)=>({[n.name]:r})):[])})))}function de(e){return Object.assign({},...e.map(t=>({[t.name]:t.value})))}function je(e){return JSON.stringify(de(e))}function Vt(e){return Array.isArray(e)?JSON.stringify(Object.assign({},...e.map(t=>({[t.name]:t.value})))):JSON.stringify(e)}function yr(e,t){return Object.keys(e).map(r=>t[r]?t[r][e[r]]:null).filter(r=>r!==null)}function mr(e){return Object.assign({},...e.map(t=>({[Vt(t.selectedOptions||[])]:t})))}const kt=["options","selectedOrFirstAvailableVariant","adjacentVariants"],pr=["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 Dt(e,t=!1){var a;let n=!0;const r=Object.keys(e);if((t?[...kt,...pr]:kt).forEach(i=>{r.includes(i)||(n=J(i))}),e.options){const i=e==null?void 0:e.options[0];if(t&&!(i!=null&&i.name)&&(n=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)&&(n=J("options.optionValues.name")),o=e.options[0].optionValues.filter(s=>!!(s!=null&&s.firstSelectableVariant))[0],o!=null&&o.firstSelectableVariant&&(n=xe(o.firstSelectableVariant,"options.optionValues.firstSelectableVariant",n,t))}else n=J("options.optionValues")}return e.selectedOrFirstAvailableVariant&&(n=xe(e.selectedOrFirstAvailableVariant,"selectedOrFirstAvailableVariant",n,t)),e.adjacentVariants&&e.adjacentVariants[0]&&(n=xe(e.adjacentVariants[0],"adjacentVariants",n,t)),n?e:{}}function xe(e,t,n,r){var i;let a=n;if(r&&!((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 Er(e){const t=Dt(e);if(!t.options)return[];const n={};t.options.map(a=>{var i;(i=a.optionValues)==null||i.map(o=>{if(o.firstSelectableVariant){const s=je(o.firstSelectableVariant.selectedOptions);n[s]=o.firstSelectableVariant}})}),t.adjacentVariants.map(a=>{const i=je(a.selectedOptions);n[i]=a});const r=t.selectedOrFirstAvailableVariant;if(r){const a=je(r.selectedOptions);n[a]=r}return Object.values(n)}function _r(e){const t=Dt(e,!0);if(!t.options)return[];const{options:n,selectedOrFirstAvailableVariant:r,adjacentVariants:a,encodedVariantExistence:i,encodedVariantAvailability:o,handle:s}=t,u=r==null?void 0:r.selectedOptions.map(c=>c.name),d=n.filter(c=>u&&u.indexOf(c.name)>=0),g=hr(n),f=mr(r?[r,...a]:a),h=de(r?r.selectedOptions:[]);return d.map((c,T)=>({...c,optionValues:c.optionValues.map(C=>{var I;const A={...h};A[c.name]=C.name;const v=Vt(A||[]),R=yr(A||[],g).slice(0,T+1),y=$e(R,i||""),m=$e(R,o||""),_=f[v]||C.firstSelectableVariant;let P={};_&&(P=de(_.selectedOptions||[]));const O=new URLSearchParams(P),b=((I=_==null?void 0:_.product)==null?void 0:I.handle)||s;return{...C,variant:_,handle:b,variantUriQuery:O.toString(),selected:h[c.name]===C.name,exists:y,available:m,isDifferentProduct:b!==s}})}))}const Cr=`#graphql
329
313
  fragment Image on Image {
330
314
  altText
331
315
  url
332
316
  width
333
317
  height
334
318
  }
335
- `,qt=U.forwardRef(({alt:e,aspectRatio:t,crop:r="center",data:n,decoding:a="async",height:i="auto",loader:o=fe,loading:s="lazy",sizes:u,src:d,srcSetOptions:y={intervals:15,startingWidth:200,incrementSize:200,placeholderWidth:100},width:f="100%",...h},g)=>{const c=U.useMemo(()=>{const m=n!=null&&n.width&&(n!=null&&n.height)?n==null?void 0:n.width:void 0,E=n!=null&&n.width&&(n!=null&&n.height)?n==null?void 0:n.height:void 0;return{width:m,height:E,unitsMatch:!!Bt(m,E)}},[n]),_=U.useMemo(()=>{const E=he((f||"100%").toString()),P=`${E.number}${E.unit}`,R=i==null,b=R?null:he(i.toString()),O=b?`${b.number}${b.unit}`:"",q=R?"auto":O,V=d||(n==null?void 0:n.url),H=n!=null&&n.altText&&!e?n==null?void 0:n.altText:e||"",X=t||(c.unitsMatch?[ye(c.width),ye(c.height)].join("/"):void 0);return{width:P,height:q,src:V,alt:H,aspectRatio:X}},[f,i,d,n,e,t,c,h==null?void 0:h.key]),{intervals:C,startingWidth:v,incrementSize:A,placeholderWidth:w}=y,I=U.useMemo(()=>xn(f,C,v,A),[f,C,v,A]);return Yt(_.width)?U.createElement(Ln,{aspectRatio:t,crop:r,decoding:a,height:i,imageWidths:I,loader:o,loading:s,normalizedProps:_,passthroughProps:h,ref:g,width:f,data:n}):U.createElement($n,{aspectRatio:t,crop:r,decoding:a,imageWidths:I,loader:o,loading:s,normalizedProps:_,passthroughProps:h,placeholderWidth:w,ref:g,sizes:u,data:n})}),Ln=U.forwardRef(({aspectRatio:e,crop:t,decoding:r,height:n,imageWidths:a,loader:i=fe,loading:o,normalizedProps:s,passthroughProps:u,width:d,data:y},f)=>{const h=U.useMemo(()=>{const g=ye(d),c=ye(n),_=e||(Bt(s.width,s.height)?[g,c].join("/"):s.aspectRatio?s.aspectRatio:void 0),C=a===void 0?void 0:Gt(a,_,t,{width:(y==null?void 0:y.width)??void 0,height:(y==null?void 0:y.height)??void 0}),v=c||(_&&g?g*(We(_)??1):void 0),A=Wt(s.src,C,i),w=i({src:s.src,width:g,height:v,crop:s.height==="auto"?void 0:t});return{width:g,aspectRatio:_,height:v,srcSet:A,src:w}},[e,t,y,n,a,i,s,d]);return U.createElement("img",{ref:f,alt:s.alt,decoding:r,height:h.height,loading:o,src:h.src,srcSet:h.srcSet,width:h.width,style:{aspectRatio:h.aspectRatio,...u.style},...u})}),$n=U.forwardRef(({crop:e,decoding:t,imageWidths:r,loader:n=fe,loading:a,normalizedProps:i,passthroughProps:o,placeholderWidth:s,sizes:u,data:d},y)=>{const f=U.useMemo(()=>{const h=r===void 0?void 0:Gt(r,i.aspectRatio,e,{width:(d==null?void 0:d.width)??void 0,height:(d==null?void 0:d.height)??void 0}),g=i.aspectRatio&&s?s*(We(i.aspectRatio)??1):void 0,c=Wt(i.src,h,n),_=n({src:i.src,width:s,height:g,crop:e});return{placeholderHeight:g,srcSet:c,src:_}},[e,d,r,n,i,s]);return U.createElement("img",{ref:y,alt:i.alt,decoding:t,height:f.placeholderHeight,loading:a,sizes:u,src:f.src,srcSet:f.srcSet,width:s,...o,style:{width:i.width,aspectRatio:i.aspectRatio,...o.style}})}),Ht="https://placeholder.shopify.com";function fe({src:e,width:t,height:r,crop:n}){if(!e)return"";const a=new URL(e,Ht);return t&&a.searchParams.append("width",Math.round(t).toString()),r&&a.searchParams.append("height",Math.round(r).toString()),n&&a.searchParams.append("crop",n),a.href.replace(Ht,"")}function Bt(e="100%",t="auto"){return he(e.toString()).unit===he(t.toString()).unit}function he(e){const t=e.replace(/[0-9.]/g,""),r=parseFloat(e.replace(t,""));return{unit:t===""?r===void 0?"auto":"px":t,number:r}}function ye(e){if(e===void 0)return;const{unit:t,number:r}=he(e.toString());switch(t){case"em":return r*16;case"rem":return r*16;case"px":return r;case"":return r;default:return}}function Yt(e){return typeof e=="number"||/\d(px|em|rem)$/.test(e)}function Wt(e,t,r=fe){return e?(t==null?void 0:t.length)===0||!t?e:t.map((n,a)=>`${r({src:e,width:n.width,height:n.height,crop:n.crop})} ${t.length===3?`${a+1}x`:`${n.width??0}w`}`).join(", "):""}function xn(e="100%",t,r,n){const a=Array.from({length:t},(o,s)=>s*n+r),i=Array.from({length:3},(o,s)=>(s+1)*(ye(e)??0));return Yt(e)?i:a}function We(e){if(!e)return;const[t,r]=e.split("/");return 1/(Number(t)/Number(r))}function Gt(e,t,r="center",n){if(e)return e.map(a=>({width:a,height:t?a*(We(t)??1):void 0,crop:r})).filter(({width:a,height:i})=>!(n!=null&&n.width&&a>n.width||n!=null&&n.height&&i&&i>n.height))}const Zt={};function jn(e,t){const r=Zt[e];if(r)return r;const n=new Promise((a,i)=>{const o=document.createElement("script");t!=null&&t.module?o.type="module":o.type="text/javascript",o.src=e,o.onload=()=>{a(!0)},o.onerror=()=>{i(!1)},(t==null?void 0:t.in)==="head"?document.head.appendChild(o):document.body.appendChild(o);const s=t==null?void 0:t.attributes;s&&Object.keys(s).forEach(u=>{o.setAttribute(u,s[u])})});return Zt[e]=n,n}function Ge(e,t){const[r,n]=l.useState("loading");return l.useEffect(()=>{jn(e,t).then(()=>n("done")).catch(()=>n("error"))},[e]),r}const Kt=l.forwardRef((e,t)=>{var y;const{data:r,previewImageOptions:n,id:a=r.id,playsInline:i=!0,controls:o=!0,sourceProps:s={},...u}=e,d=fe({src:((y=r.previewImage)==null?void 0:y.url)??"",...n});if(!r.sources)throw new Error("<Video/> requires a 'data.sources' array");return React.createElement("video",{...u,id:a,playsInline:i,controls:o,poster:d,ref:t},r.sources.map(f=>{if(!(f!=null&&f.url&&(f!=null&&f.mimeType)))throw new Error("<Video/> needs 'source.url' and 'source.mimeType'");return React.createElement("source",{...s,key:f.url,src:f.url,type:f.mimeType})}))});function Qt(e){var d,y,f;const[t,r]=l.useState(void 0),n=l.useCallback(h=>{r(h)},[]),{data:a,children:i,className:o,...s}=e,u=Ge("https://unpkg.com/@google/model-viewer@v1.12.1/dist/model-viewer.min.js",{module:!0});return l.useEffect(()=>{const h={error:s.onError,load:s.onLoad,preload:s.onPreload,"model-visibility":s.onModelVisibility,progress:s.onProgress,"ar-status":s.onArStatus,"ar-tracking":s.onArTracking,"quick-look-button-tapped":s.onQuickLookButtonTapped,"camera-change":s.onCameraChange,"environment-change":s.onEnvironmentChange,play:s.onPlay,pause:s.onPause,"scene-graph-ready":s.onSceneGraphReady};if(t)return Object.entries(h).forEach(([g,c])=>{c&&t.addEventListener(g,c)}),()=>{t!=null&&Object.entries(h).forEach(([g,c])=>{c&&t.removeEventListener(g,c)})}},[t,s.onArStatus,s.onArTracking,s.onCameraChange,s.onEnvironmentChange,s.onError,s.onLoad,s.onModelVisibility,s.onPause,s.onPlay,s.onPreload,s.onProgress,s.onQuickLookButtonTapped,s.onSceneGraphReady]),u!=="done"?null:(y=(d=a.sources)==null?void 0:d[0])!=null&&y.url?React.createElement("model-viewer",{ref:n,...s,class:o,id:s.id??a.id,src:a.sources[0].url,alt:a.alt??null,"camera-controls":s.cameraControls??!0,poster:(s.poster||((f=a.previewImage)==null?void 0:f.url))??null,autoplay:s.autoplay??!0,loading:s.loading,reveal:s.reveal,ar:s.ar,"ar-modes":s.arModes,"ar-scale":s.arScale,"ar-placement":s.arPlacement,"ios-src":s.iosSrc,"touch-action":s.touchAction,"disable-zoom":s.disableZoom,"orbit-sensitivity":s.orbitSensitivity,"auto-rotate":s.autoRotate,"auto-rotate-delay":s.autoRotateDelay,"rotation-per-second":s.rotationPerSecond,"interaction-policy":s.interactionPolicy,"interaction-prompt":s.interactionPrompt,"interaction-prompt-style":s.interactionPromptStyle,"interaction-prompt-threshold":s.interactionPromptThreshold,"camera-orbit":s.cameraOrbit,"camera-target":s.cameraTarget,"field-of-view":s.fieldOfView,"max-camera-orbit":s.maxCameraOrbit,"min-camera-orbit":s.minCameraOrbit,"max-field-of-view":s.maxFieldOfView,"min-field-of-view":s.minFieldOfView,bounds:s.bounds,"interpolation-decay":s.interpolationDecay??100,"skybox-image":s.skyboxImage,"environment-image":s.environmentImage,exposure:s.exposure,"shadow-intensity":s.shadowIntensity??0,"shadow-softness":s.shadowSoftness??0,"animation-name":s.animationName,"animation-crossfade-duration":s.animationCrossfadeDuration,"variant-name":s.variantName,orientation:s.orientation,scale:s.scale},i):(console.error("<ModelViewer/> requires 'data.sources' prop to be an array, with an object that has a property 'url' on it. Rendering 'null'"),null)}function qn({data:e,mediaOptions:t,...r}){switch(e.__typename){case"MediaImage":return e.image?React.createElement(qt,{...r,...t==null?void 0:t.image,data:e.image}):(console.warn("<MediaFile/>: 'data.image' does not exist for __typename of 'MediaImage'; rendering 'null' by default."),null);case"Video":return React.createElement(Kt,{...r,...t==null?void 0:t.video,data:e});case"ExternalVideo":return React.createElement(Ft,{...r,...t==null?void 0:t.externalVideo,data:e});case"Model3d":return React.createElement(Qt,{...r,...t==null?void 0:t.modelViewer,data:e});default:return console.error("<MediaFile /> requires the '__typename' property to exist on the 'data' prop in order to render the matching sub-component for this type of media. Rendering 'null' by default"),null}}function Hn(e){if(!e.type)return console.error("parseMetafield(): The 'type' field is required in order to parse the Metafield. Returning 'parsedValue' of 'null'"),{...e,parsedValue:null};switch(e.type){case"boolean":return{...e,parsedValue:e.value==="true"};case"article_reference":case"collection_reference":case"file_reference":case"page_reference":case"product_reference":case"variant_reference":return{...e,parsedValue:e.reference};case"color":case"multi_line_text_field":case"single_line_text_field":case"url":return{...e,parsedValue:e.value};case"money":{let t=null;try{const r=Ze(e.value??"");if(r&&typeof r=="object"&&"currency_code"in r){const n=r;t={amount:n.amount,currencyCode:n.currency_code}}else r&&typeof r=="object"&&"currencyCode"in r,t=r}catch{console.error("parseMetafield(): attempted to JSON.parse the 'metafield.value' property, but failed. Returning 'null' for 'parsedValue'"),t=null}return{...e,parsedValue:t}}case"dimension":case"json":case"rating":case"volume":case"weight":case"rich_text_field":case"list.color":case"list.dimension":case"list.number_integer":case"list.number_decimal":case"list.rating":case"list.single_line_text_field":case"list.url":case"list.volume":case"list.weight":{let t=null;try{t=Ze(e.value??"")}catch{console.error("parseMetafield(): attempted to JSON.parse the 'metafield.value' property, but failed. Returning 'null' for 'parsedValue'"),t=null}return{...e,parsedValue:t}}case"date":case"date_time":return{...e,parsedValue:new Date(e.value??"")};case"list.date":case"list.date_time":{const t=Ze((e==null?void 0:e.value)??"");return{...e,parsedValue:t.map(r=>new Date(r))}}case"number_decimal":case"number_integer":return{...e,parsedValue:Number(e.value)};case"list.article_reference":case"list.collection_reference":case"list.file_reference":case"list.page_reference":case"list.product_reference":case"list.variant_reference":return{...e,parsedValue:Q(e.references??void 0)};default:{const t=`parseMetafield(): the 'metafield.type' you passed in is not supported. Your type: "${e.type}". If you believe this is an error, please open an issue on GitHub.`;return console.error(`${t} Returning 'parsedValue' of 'null'`),{...e,parsedValue:null}}}}function Ze(e){return String(e).includes("__proto__")?JSON.parse(e,(t,r)=>{if(t!=="__proto__")return r}):JSON.parse(e)}function Bn(e){var y,f,h,g,c,_;const{priceType:t="regular",variantId:r,valueType:n="min",data:a,...i}=e;if(a==null)throw new Error("<ProductPrice/> requires a product as the 'data' prop");let o,s;const u=r?Q((a==null?void 0:a.variants)??{}).find(C=>(C==null?void 0:C.id)===r)??null:null,d=n==="max"?"maxVariantPrice":"minVariantPrice";if(t==="compareAt"){r&&u?o=u.compareAtPrice:o=(y=a==null?void 0:a.compareAtPriceRange)==null?void 0:y[d];let C;r&&u?C=parseFloat(((f=u.price)==null?void 0:f.amount)??"0"):C=parseFloat(((g=(h=a==null?void 0:a.priceRange)==null?void 0:h[d])==null?void 0:g.amount)??"0");const v=parseFloat((o==null?void 0:o.amount)??"0");if(C>=v)return null}else r&&u?(o=u.price,n==="unit"&&(o=u.unitPrice,s=u.unitPriceMeasurement)):n==="max"?o=(c=a.priceRange)==null?void 0:c.maxVariantPrice:o=(_=a.priceRange)==null?void 0:_.minVariantPrice;return o?s?React.createElement(Ae,{...i,data:o,measurement:s}):React.createElement(Ae,{...i,data:o}):null}const Yn={root:Wn,heading:Gn,paragraph:Zn,text:Kn,link:Qn,list:Jn,"list-item":Xn};function Wn({node:e}){return React.createElement("div",null,e.children)}function Gn({node:e}){return l.createElement(`h${e.level??"1"}`,null,e.children)}function Zn({node:e}){return React.createElement("p",null,e.children)}function Kn({node:e}){return e.bold&&e.italic?React.createElement("em",null,React.createElement("strong",null,e.value)):e.bold?React.createElement("strong",null,e.value):e.italic?React.createElement("em",null,e.value):e.value}function Qn({node:e}){return React.createElement("a",{href:e.url,title:e.title,target:e.target},e.children)}function Jn({node:e}){const t=e.listType==="unordered"?"ul":"ol";return React.createElement(t,null,e.children)}function Xn({node:e}){return React.createElement("li",null,e.children)}function zn({as:e,data:t,plain:r,components:n,...a}){try{const i=e??"div",o=l.useMemo(()=>JSON.parse(t),[t]);return React.createElement(i,{...a},r?ge(o):Jt(n,o))}catch(i){throw new Error("[h2:error:RichText] Parsing error. Make sure to pass a JSON string of rich text metafield",{cause:i})}}function Jt(e={},t,r=0){let n;"children"in t&&(n=t.children.map((i,o)=>Jt(e,i,o)));const a=e[t.type==="list-item"?"listItem":t.type]??Yn[t.type];switch(t.type){case"root":return l.createElement(a,{key:r,node:{type:"root",children:n}});case"heading":return l.createElement(a,{key:r,node:{type:"heading",level:t.level,children:n}});case"paragraph":return l.createElement(a,{key:r,node:{type:"paragraph",children:n}});case"text":{const i=(t.value??"").split(`
336
- `).flatMap((o,s)=>{const u=`${r}-${o}-${s}`,d=l.createElement(a,{key:u,node:{type:"text",italic:t.italic,bold:t.bold,value:o}});return s===0?d:[l.createElement("br",{key:`${u}-br`}),d]});return i.length>1?l.createElement(l.Fragment,{key:r},i):i[0]}case"link":return l.createElement(a,{key:r,node:{type:"link",url:t.url,title:t.title,target:t.target,children:n}});case"list":return l.createElement(a,{key:r,node:{type:"list",listType:t.listType,children:n}});case"list-item":return l.createElement(a,{key:r,node:{type:"list-item",children:n}})}}function ge(e,t=[]){switch(e.type){case"root":e.children.forEach(r=>ge(r,t));break;case"heading":case"paragraph":e.children.forEach(r=>ge(r,t)),t.push(" ");break;case"text":t.push(e.value||"");break;case"link":e.children.forEach(r=>ge(r,t));break;case"list":e.children.forEach(r=>{r.children&&r.children.forEach(n=>ge(n,t)),t.push(" ")});break;default:throw new Error(`Unknown node encountered ${e.type}`)}return t.join("").trim()}const ea="https://cdn.shopify.com/shopifycloud/shop-js/v1.0/client.js";function ta(e){return e==="headless"||e==="hydrogen"}function ra({channel:e,variantIds:t,className:r,variantIdsAndQuantities:n,width:a,storeDomain:i}){const o=ce(),s=i||(o==null?void 0:o.storeDomain),u=Ge(ea);let d=[],y;if(!s||s===ft.storeDomain)throw new Error(na);if(t&&n)throw new Error(ia);if(!t&&!n)throw new Error(Xt);if(e)if(ta(e))y=e;else throw new Error(oa);if(t)d=t.reduce((h,g)=>{const c=$(g).id;return c&&h.push(c),h},[]);else if(n)d=n.reduce((h,g)=>{const c=$(g==null?void 0:g.id).id;return c&&h.push(`${c}:${(g==null?void 0:g.quantity)??1}`),h},[]);else throw new Error(Xt);if(d.length===0)throw new Error(aa);const f=a?{"--shop-pay-button-width":a}:void 0;return React.createElement("div",{className:r,style:f},u==="done"&&React.createElement("shop-pay-button",{...y?{channel:y}:{},"store-url":s,variants:d.join(",")}))}const na='You must pass a "storeDomain" prop to the "ShopPayButton" component, or wrap it in a "ShopifyProvider" component.',aa='You must pass in "variantIds" in the form of ["gid://shopify/ProductVariant/1"]',Xt='You must pass in either "variantIds" or "variantIdsAndQuantities" to ShopPayButton',ia="You must provide either a variantIds or variantIdsAndQuantities prop, but not both in the ShopPayButton component",oa='Invalid channel attribution value. Must be either "headless" or "hydrogen"';function sa(e){return l.useEffect(()=>{const t=new URLSearchParams(de(e||[])),r=new URLSearchParams(window.location.search),n=new URLSearchParams({...Object.fromEntries(r),...Object.fromEntries(t)});n.size>0&&window.history.replaceState({},"",`${window.location.pathname}?${n.toString()}`)},[JSON.stringify(e)]),null}function ca(e,t,r={}){let n=e+"="+encodeURIComponent(t);return r.expires&&(n+="; Expires="+new Date(r.expires).toUTCString()),r.maxage!=null&&r.maxage>=0&&(n+="; Max-Age="+(r.maxage|0)),r.domain&&(n+="; Domain="+r.domain),r.path&&(n+="; Path="+r.path),r.samesite&&(n+="; SameSite="+r.samesite),(r.secure||r.samesite==="None")&&(n+="; Secure"),r.httponly&&(n+="; HttpOnly"),n}const ua=3600*24*360*1,la=1800;function da(e){const{hasUserConsent:t,domain:r="",checkoutDomain:n="",storefrontAccessToken:a,fetchTrackingValues:i,ignoreDeprecatedCookies:o=!1}=e||{},s=fa({storefrontAccessToken:a,fetchTrackingValues:i,checkoutDomain:n});return l.useEffect(()=>{if(o||!s)return;let u=r||window.location.host;if(n){const y=n.split(".").reverse(),f=u.split(".").reverse(),h=[];y.forEach((g,c)=>{g===f[c]&&h.push(g)}),u=h.reverse().join(".")}/^localhost/.test(u)&&(u="");const d=u?/^\./.test(u)?u:`.${u}`:"";if(t){const y=ee();if((y.uniqueToken||y.visitToken||"").startsWith("00000000-"))return;Ie(Ce,y.uniqueToken||we(),ua,d),Ie(Te,y.visitToken||we(),la,d)}else Ie(Ce,"",0,d),Ie(Te,"",0,d)},[s,t,r,n,o]),s}function Ie(e,t,r,n){document.cookie=ca(e,t,{maxage:r,domain:n,samesite:"Lax",path:"/"})}async function zt(e,t=""){const{uniqueToken:r,visitToken:n}=ee(),a=await fetch(`${t.replace(/\/+$/,"")}/api/unstable/graphql.json`,{method:"POST",headers:{"Content-Type":"application/json",...e&&{"X-Shopify-Storefront-Access-Token":e},...n||r?{[Ne]:n,[Me]:r}:void 0},body:JSON.stringify({query:"query ensureCookies { consentManagement { cookies(visitorConsent:{}) { cookieDomain } } }"})});if(!a.ok)throw new Error(`Failed to fetch consent from browser: ${a.status} ${a.statusText}`);await a.json(),ee()}function fa({checkoutDomain:e,storefrontAccessToken:t,fetchTrackingValues:r=!1}){const[n,a]=l.useState(!r),i=l.useRef(!1);return l.useEffect(()=>{if(!r){a(!0);return}i.current||(i.current=!0,zt(t).catch(o=>e?zt(t,e):Promise.reject(o)).catch(o=>{console.warn("[h2:warn:useShopifyCookies] Failed to fetch tracking values from browser: "+(o instanceof Error?o.message:String(o)))}).finally(()=>{a(!0)}))},[e,r,t]),n}S.AddToCartButton=Qr,S.AnalyticsEventName=te,S.AnalyticsPageType=ve,S.BuyNowButton=Sn,S.CartCheckoutButton=Cn,S.CartCost=bn,S.CartLineProvider=vn,S.CartLineQuantity=wn,S.CartLineQuantityAdjustButton=An,S.CartProvider=Hr,S.ExternalVideo=Ft,S.IMAGE_FRAGMENT=Fn,S.Image=qt,S.MediaFile=qn,S.ModelViewer=Qt,S.Money=Ae,S.ProductPrice=Bn,S.ProductProvider=Gr,S.RichText=zn,S.SHOPIFY_S=Te,S.SHOPIFY_STOREFRONT_ID_HEADER=yt,S.SHOPIFY_STOREFRONT_S_HEADER=mt,S.SHOPIFY_STOREFRONT_Y_HEADER=gt,S.SHOPIFY_UNIQUE_TOKEN_HEADER=Me,S.SHOPIFY_VISIT_TOKEN_HEADER=Ne,S.SHOPIFY_Y=Ce,S.ShopPayButton=ra,S.ShopifyProvider=Mr,S.ShopifySalesChannel=wt,S.Video=Kt,S.createStorefrontClient=kr,S.customerAccountApiCustomScalars=Pn,S.decodeEncodedVariant=Lt,S.flattenConnection=Q,S.getAdjacentAndFirstAvailableVariants=Nn,S.getClientBrowserParameters=mn,S.getProductOptions=Mn,S.getShopifyCookies=zr,S.getTrackingValues=ee,S.isOptionValueCombinationInEncodedVariant=He,S.mapSelectedProductOptionToObject=de,S.parseGid=$,S.parseMetafield=Hn,S.sendShopifyAnalytics=hn,S.storefrontApiCustomScalars=In,S.useCart=ae,S.useCartLine=je,S.useLoadScript=Ge,S.useMoney=Ut,S.useProduct=Ct,S.useSelectedOptionInUrlParam=sa,S.useShop=ce,S.useShopifyCookies=da,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})}));
319
+ `,Ut=M.forwardRef(({alt:e,aspectRatio:t,crop:n="center",data:r,decoding:a="async",height:i="auto",loader:o=fe,loading:s="lazy",sizes:u,src:d,srcSetOptions:g={intervals:15,startingWidth:200,incrementSize:200,placeholderWidth:100},width:f="100%",...h},E)=>{const c=M.useMemo(()=>{const m=r!=null&&r.width&&(r!=null&&r.height)?r==null?void 0:r.width:void 0,_=r!=null&&r.width&&(r!=null&&r.height)?r==null?void 0:r.height:void 0;return{width:m,height:_,unitsMatch:!!Mt(m,_)}},[r]),T=M.useMemo(()=>{const _=ge((f||"100%").toString()),P=`${_.number}${_.unit}`,O=i==null,b=O?null:ge(i.toString()),I=b?`${b.number}${b.unit}`:"",q=O?"auto":I,V=d||(r==null?void 0:r.url),H=r!=null&&r.altText&&!e?r==null?void 0:r.altText:e||"",X=t||(c.unitsMatch?[he(c.width),he(c.height)].join("/"):void 0);return{width:P,height:q,src:V,alt:H,aspectRatio:X}},[f,i,d,r,e,t,c,h==null?void 0:h.key]),{intervals:C,startingWidth:A,incrementSize:v,placeholderWidth:w}=g,R=M.useMemo(()=>br(f,C,A,v),[f,C,A,v]);return Ft(T.width)?M.createElement(Tr,{aspectRatio:t,crop:n,decoding:a,height:i,imageWidths:R,loader:o,loading:s,normalizedProps:T,passthroughProps:h,ref:E,width:f,data:r}):M.createElement(Sr,{aspectRatio:t,crop:n,decoding:a,imageWidths:R,loader:o,loading:s,normalizedProps:T,passthroughProps:h,placeholderWidth:w,ref:E,sizes:u,data:r})}),Tr=M.forwardRef(({aspectRatio:e,crop:t,decoding:n,height:r,imageWidths:a,loader:i=fe,loading:o,normalizedProps:s,passthroughProps:u,width:d,data:g},f)=>{const h=M.useMemo(()=>{const E=he(d),c=he(r),T=e||(Mt(s.width,s.height)?[E,c].join("/"):s.aspectRatio?s.aspectRatio:void 0),C=a===void 0?void 0:$t(a,T,t,{width:(g==null?void 0:g.width)??void 0,height:(g==null?void 0:g.height)??void 0}),A=c||(T&&E?E*(qe(T)??1):void 0),v=Lt(s.src,C,i),w=i({src:s.src,width:E,height:A,crop:s.height==="auto"?void 0:t});return{width:E,aspectRatio:T,height:A,srcSet:v,src:w}},[e,t,g,r,a,i,s,d]);return M.createElement("img",{ref:f,alt:s.alt,decoding:n,height:h.height,loading:o,src:h.src,srcSet:h.srcSet,width:h.width,style:{aspectRatio:h.aspectRatio,...u.style},...u})}),Sr=M.forwardRef(({crop:e,decoding:t,imageWidths:n,loader:r=fe,loading:a,normalizedProps:i,passthroughProps:o,placeholderWidth:s,sizes:u,data:d},g)=>{const f=M.useMemo(()=>{const h=n===void 0?void 0:$t(n,i.aspectRatio,e,{width:(d==null?void 0:d.width)??void 0,height:(d==null?void 0:d.height)??void 0}),E=i.aspectRatio&&s?s*(qe(i.aspectRatio)??1):void 0,c=Lt(i.src,h,r),T=r({src:i.src,width:s,height:E,crop:e});return{placeholderHeight:E,srcSet:c,src:T}},[e,d,n,r,i,s]);return M.createElement("img",{ref:g,alt:i.alt,decoding:t,height:f.placeholderHeight,loading:a,sizes:u,src:f.src,srcSet:f.srcSet,width:s,...o,style:{width:i.width,aspectRatio:i.aspectRatio,...o.style}})}),Nt="https://placeholder.shopify.com";function fe({src:e,width:t,height:n,crop:r}){if(!e)return"";const a=new URL(e,Nt);return t&&a.searchParams.append("width",Math.round(t).toString()),n&&a.searchParams.append("height",Math.round(n).toString()),r&&a.searchParams.append("crop",r),a.href.replace(Nt,"")}function Mt(e="100%",t="auto"){return ge(e.toString()).unit===ge(t.toString()).unit}function ge(e){const t=e.replace(/[0-9.]/g,""),n=parseFloat(e.replace(t,""));return{unit:t===""?n===void 0?"auto":"px":t,number:n}}function he(e){if(e===void 0)return;const{unit:t,number:n}=ge(e.toString());switch(t){case"em":return n*16;case"rem":return n*16;case"px":return n;case"":return n;default:return}}function Ft(e){return typeof e=="number"||/\d(px|em|rem)$/.test(e)}function Lt(e,t,n=fe){return e?(t==null?void 0:t.length)===0||!t?e:t.map((r,a)=>`${n({src:e,width:r.width,height:r.height,crop:r.crop})} ${t.length===3?`${a+1}x`:`${r.width??0}w`}`).join(", "):""}function br(e="100%",t,n,r){const a=Array.from({length:t},(o,s)=>s*r+n),i=Array.from({length:3},(o,s)=>(s+1)*(he(e)??0));return Ft(e)?i:a}function qe(e){if(!e)return;const[t,n]=e.split("/");return 1/(Number(t)/Number(n))}function $t(e,t,n="center",r){if(e)return e.map(a=>({width:a,height:t?a*(qe(t)??1):void 0,crop:n})).filter(({width:a,height:i})=>!(r!=null&&r.width&&a>r.width||r!=null&&r.height&&i&&i>r.height))}const jt={};function Ar(e,t){const n=jt[e];if(n)return n;const r=new Promise((a,i)=>{const o=document.createElement("script");t!=null&&t.module?o.type="module":o.type="text/javascript",o.src=e,o.onload=()=>{a(!0)},o.onerror=()=>{i(!1)},(t==null?void 0:t.in)==="head"?document.head.appendChild(o):document.body.appendChild(o);const s=t==null?void 0:t.attributes;s&&Object.keys(s).forEach(u=>{o.setAttribute(u,s[u])})});return jt[e]=r,r}function He(e,t){const[n,r]=l.useState("loading");return l.useEffect(()=>{Ar(e,t).then(()=>r("done")).catch(()=>r("error"))},[e]),n}const xt=l.forwardRef((e,t)=>{var g;const{data:n,previewImageOptions:r,id:a=n.id,playsInline:i=!0,controls:o=!0,sourceProps:s={},...u}=e,d=fe({src:((g=n.previewImage)==null?void 0:g.url)??"",...r});if(!n.sources)throw new Error("<Video/> requires a 'data.sources' array");return React.createElement("video",{...u,id:a,playsInline:i,controls:o,poster:d,ref:t},n.sources.map(f=>{if(!(f!=null&&f.url&&(f!=null&&f.mimeType)))throw new Error("<Video/> needs 'source.url' and 'source.mimeType'");return React.createElement("source",{...s,key:f.url,src:f.url,type:f.mimeType})}))});function qt(e){var d,g,f;const[t,n]=l.useState(void 0),r=l.useCallback(h=>{n(h)},[]),{data:a,children:i,className:o,...s}=e,u=He("https://unpkg.com/@google/model-viewer@v1.12.1/dist/model-viewer.min.js",{module:!0});return l.useEffect(()=>{const h={error:s.onError,load:s.onLoad,preload:s.onPreload,"model-visibility":s.onModelVisibility,progress:s.onProgress,"ar-status":s.onArStatus,"ar-tracking":s.onArTracking,"quick-look-button-tapped":s.onQuickLookButtonTapped,"camera-change":s.onCameraChange,"environment-change":s.onEnvironmentChange,play:s.onPlay,pause:s.onPause,"scene-graph-ready":s.onSceneGraphReady};if(t)return Object.entries(h).forEach(([E,c])=>{c&&t.addEventListener(E,c)}),()=>{t!=null&&Object.entries(h).forEach(([E,c])=>{c&&t.removeEventListener(E,c)})}},[t,s.onArStatus,s.onArTracking,s.onCameraChange,s.onEnvironmentChange,s.onError,s.onLoad,s.onModelVisibility,s.onPause,s.onPlay,s.onPreload,s.onProgress,s.onQuickLookButtonTapped,s.onSceneGraphReady]),u!=="done"?null:(g=(d=a.sources)==null?void 0:d[0])!=null&&g.url?React.createElement("model-viewer",{ref:r,...s,class:o,id:s.id??a.id,src:a.sources[0].url,alt:a.alt??null,"camera-controls":s.cameraControls??!0,poster:(s.poster||((f=a.previewImage)==null?void 0:f.url))??null,autoplay:s.autoplay??!0,loading:s.loading,reveal:s.reveal,ar:s.ar,"ar-modes":s.arModes,"ar-scale":s.arScale,"ar-placement":s.arPlacement,"ios-src":s.iosSrc,"touch-action":s.touchAction,"disable-zoom":s.disableZoom,"orbit-sensitivity":s.orbitSensitivity,"auto-rotate":s.autoRotate,"auto-rotate-delay":s.autoRotateDelay,"rotation-per-second":s.rotationPerSecond,"interaction-policy":s.interactionPolicy,"interaction-prompt":s.interactionPrompt,"interaction-prompt-style":s.interactionPromptStyle,"interaction-prompt-threshold":s.interactionPromptThreshold,"camera-orbit":s.cameraOrbit,"camera-target":s.cameraTarget,"field-of-view":s.fieldOfView,"max-camera-orbit":s.maxCameraOrbit,"min-camera-orbit":s.minCameraOrbit,"max-field-of-view":s.maxFieldOfView,"min-field-of-view":s.minFieldOfView,bounds:s.bounds,"interpolation-decay":s.interpolationDecay??100,"skybox-image":s.skyboxImage,"environment-image":s.environmentImage,exposure:s.exposure,"shadow-intensity":s.shadowIntensity??0,"shadow-softness":s.shadowSoftness??0,"animation-name":s.animationName,"animation-crossfade-duration":s.animationCrossfadeDuration,"variant-name":s.variantName,orientation:s.orientation,scale:s.scale},i):(console.error("<ModelViewer/> requires 'data.sources' prop to be an array, with an object that has a property 'url' on it. Rendering 'null'"),null)}function wr({data:e,mediaOptions:t,...n}){switch(e.__typename){case"MediaImage":return e.image?React.createElement(Ut,{...n,...t==null?void 0:t.image,data:e.image}):(console.warn("<MediaFile/>: 'data.image' does not exist for __typename of 'MediaImage'; rendering 'null' by default."),null);case"Video":return React.createElement(xt,{...n,...t==null?void 0:t.video,data:e});case"ExternalVideo":return React.createElement(Ot,{...n,...t==null?void 0:t.externalVideo,data:e});case"Model3d":return React.createElement(qt,{...n,...t==null?void 0:t.modelViewer,data:e});default:return console.error("<MediaFile /> requires the '__typename' property to exist on the 'data' prop in order to render the matching sub-component for this type of media. Rendering 'null' by default"),null}}function Ir(e){if(!e.type)return console.error("parseMetafield(): The 'type' field is required in order to parse the Metafield. Returning 'parsedValue' of 'null'"),{...e,parsedValue:null};switch(e.type){case"boolean":return{...e,parsedValue:e.value==="true"};case"article_reference":case"collection_reference":case"file_reference":case"page_reference":case"product_reference":case"variant_reference":return{...e,parsedValue:e.reference};case"color":case"multi_line_text_field":case"single_line_text_field":case"url":return{...e,parsedValue:e.value};case"money":{let t=null;try{const n=Be(e.value??"");if(n&&typeof n=="object"&&"currency_code"in n){const r=n;t={amount:r.amount,currencyCode:r.currency_code}}else n&&typeof n=="object"&&"currencyCode"in n,t=n}catch{console.error("parseMetafield(): attempted to JSON.parse the 'metafield.value' property, but failed. Returning 'null' for 'parsedValue'"),t=null}return{...e,parsedValue:t}}case"dimension":case"json":case"rating":case"volume":case"weight":case"rich_text_field":case"list.color":case"list.dimension":case"list.number_integer":case"list.number_decimal":case"list.rating":case"list.single_line_text_field":case"list.url":case"list.volume":case"list.weight":{let t=null;try{t=Be(e.value??"")}catch{console.error("parseMetafield(): attempted to JSON.parse the 'metafield.value' property, but failed. Returning 'null' for 'parsedValue'"),t=null}return{...e,parsedValue:t}}case"date":case"date_time":return{...e,parsedValue:new Date(e.value??"")};case"list.date":case"list.date_time":{const t=Be((e==null?void 0:e.value)??"");return{...e,parsedValue:t.map(n=>new Date(n))}}case"number_decimal":case"number_integer":return{...e,parsedValue:Number(e.value)};case"list.article_reference":case"list.collection_reference":case"list.file_reference":case"list.page_reference":case"list.product_reference":case"list.variant_reference":return{...e,parsedValue:Q(e.references??void 0)};default:{const t=`parseMetafield(): the 'metafield.type' you passed in is not supported. Your type: "${e.type}". If you believe this is an error, please open an issue on GitHub.`;return console.error(`${t} Returning 'parsedValue' of 'null'`),{...e,parsedValue:null}}}}function Be(e){return String(e).includes("__proto__")?JSON.parse(e,(t,n)=>{if(t!=="__proto__")return n}):JSON.parse(e)}function vr(e){var g,f,h,E,c,T;const{priceType:t="regular",variantId:n,valueType:r="min",data:a,...i}=e;if(a==null)throw new Error("<ProductPrice/> requires a product as the 'data' prop");let o,s;const u=n?Q((a==null?void 0:a.variants)??{}).find(C=>(C==null?void 0:C.id)===n)??null:null,d=r==="max"?"maxVariantPrice":"minVariantPrice";if(t==="compareAt"){n&&u?o=u.compareAtPrice:o=(g=a==null?void 0:a.compareAtPriceRange)==null?void 0:g[d];let C;n&&u?C=parseFloat(((f=u.price)==null?void 0:f.amount)??"0"):C=parseFloat(((E=(h=a==null?void 0:a.priceRange)==null?void 0:h[d])==null?void 0:E.amount)??"0");const A=parseFloat((o==null?void 0:o.amount)??"0");if(C>=A)return null}else n&&u?(o=u.price,r==="unit"&&(o=u.unitPrice,s=u.unitPriceMeasurement)):r==="max"?o=(c=a.priceRange)==null?void 0:c.maxVariantPrice:o=(T=a.priceRange)==null?void 0:T.minVariantPrice;return o?s?React.createElement(Ie,{...i,data:o,measurement:s}):React.createElement(Ie,{...i,data:o}):null}const Pr={root:Or,heading:Rr,paragraph:Vr,text:kr,link:Dr,list:Ur,"list-item":Nr};function Or({node:e}){return React.createElement("div",null,e.children)}function Rr({node:e}){return l.createElement(`h${e.level??"1"}`,null,e.children)}function Vr({node:e}){return React.createElement("p",null,e.children)}function kr({node:e}){return e.bold&&e.italic?React.createElement("em",null,React.createElement("strong",null,e.value)):e.bold?React.createElement("strong",null,e.value):e.italic?React.createElement("em",null,e.value):e.value}function Dr({node:e}){return React.createElement("a",{href:e.url,title:e.title,target:e.target},e.children)}function Ur({node:e}){const t=e.listType==="unordered"?"ul":"ol";return React.createElement(t,null,e.children)}function Nr({node:e}){return React.createElement("li",null,e.children)}function Mr({as:e,data:t,plain:n,components:r,...a}){try{const i=e??"div",o=l.useMemo(()=>JSON.parse(t),[t]);return React.createElement(i,{...a},n?ye(o):Ht(r,o))}catch(i){throw new Error("[h2:error:RichText] Parsing error. Make sure to pass a JSON string of rich text metafield",{cause:i})}}function Ht(e={},t,n=0){let r;"children"in t&&(r=t.children.map((i,o)=>Ht(e,i,o)));const a=e[t.type==="list-item"?"listItem":t.type]??Pr[t.type];switch(t.type){case"root":return l.createElement(a,{key:n,node:{type:"root",children:r}});case"heading":return l.createElement(a,{key:n,node:{type:"heading",level:t.level,children:r}});case"paragraph":return l.createElement(a,{key:n,node:{type:"paragraph",children:r}});case"text":{const i=(t.value??"").split(`
320
+ `).flatMap((o,s)=>{const u=`${n}-${o}-${s}`,d=l.createElement(a,{key:u,node:{type:"text",italic:t.italic,bold:t.bold,value:o}});return s===0?d:[l.createElement("br",{key:`${u}-br`}),d]});return i.length>1?l.createElement(l.Fragment,{key:n},i):i[0]}case"link":return l.createElement(a,{key:n,node:{type:"link",url:t.url,title:t.title,target:t.target,children:r}});case"list":return l.createElement(a,{key:n,node:{type:"list",listType:t.listType,children:r}});case"list-item":return l.createElement(a,{key:n,node:{type:"list-item",children:r}})}}function ye(e,t=[]){switch(e.type){case"root":e.children.forEach(n=>ye(n,t));break;case"heading":case"paragraph":e.children.forEach(n=>ye(n,t)),t.push(" ");break;case"text":t.push(e.value||"");break;case"link":e.children.forEach(n=>ye(n,t));break;case"list":e.children.forEach(n=>{n.children&&n.children.forEach(r=>ye(r,t)),t.push(" ")});break;default:throw new Error(`Unknown node encountered ${e.type}`)}return t.join("").trim()}const Fr="https://cdn.shopify.com/shopifycloud/shop-js/v1.0/client.js";function Lr(e){return e==="headless"||e==="hydrogen"}function $r({channel:e,variantIds:t,className:n,variantIdsAndQuantities:r,width:a,storeDomain:i}){const o=ce(),s=i||(o==null?void 0:o.storeDomain),u=He(Fr);let d=[],g;if(!s||s===at.storeDomain)throw new Error(jr);if(t&&r)throw new Error(qr);if(!t&&!r)throw new Error(Bt);if(e)if(Lr(e))g=e;else throw new Error(Hr);if(t)d=t.reduce((h,E)=>{const c=$(E).id;return c&&h.push(c),h},[]);else if(r)d=r.reduce((h,E)=>{const c=$(E==null?void 0:E.id).id;return c&&h.push(`${c}:${(E==null?void 0:E.quantity)??1}`),h},[]);else throw new Error(Bt);if(d.length===0)throw new Error(xr);const f=a?{"--shop-pay-button-width":a}:void 0;return React.createElement("div",{className:n,style:f},u==="done"&&React.createElement("shop-pay-button",{...g?{channel:g}:{},"store-url":s,variants:d.join(",")}))}const jr='You must pass a "storeDomain" prop to the "ShopPayButton" component, or wrap it in a "ShopifyProvider" component.',xr='You must pass in "variantIds" in the form of ["gid://shopify/ProductVariant/1"]',Bt='You must pass in either "variantIds" or "variantIdsAndQuantities" to ShopPayButton',qr="You must provide either a variantIds or variantIdsAndQuantities prop, but not both in the ShopPayButton component",Hr='Invalid channel attribution value. Must be either "headless" or "hydrogen"';function Br(e){return l.useEffect(()=>{const t=new URLSearchParams(de(e||[])),n=new URLSearchParams(window.location.search),r=new URLSearchParams({...Object.fromEntries(n),...Object.fromEntries(t)});r.size>0&&window.history.replaceState({},"",`${window.location.pathname}?${r.toString()}`)},[JSON.stringify(e)]),null}function Yr(e,t,n={}){let r=e+"="+encodeURIComponent(t);return n.expires&&(r+="; Expires="+new Date(n.expires).toUTCString()),n.maxage!=null&&n.maxage>=0&&(r+="; Max-Age="+(n.maxage|0)),n.domain&&(r+="; Domain="+n.domain),n.path&&(r+="; Path="+n.path),n.samesite&&(r+="; SameSite="+n.samesite),(n.secure||n.samesite==="None")&&(r+="; Secure"),n.httponly&&(r+="; HttpOnly"),r}const Wr=3600*24*360*1,Gr=1800;function Zr(e){const{hasUserConsent:t,domain:n="",checkoutDomain:r="",storefrontAccessToken:a,fetchTrackingValues:i,ignoreDeprecatedCookies:o=!1}=e||{},s=Kr({storefrontAccessToken:a,fetchTrackingValues:i,checkoutDomain:r});return l.useEffect(()=>{if(o||!s)return;let u=n||window.location.host;if(r){const g=r.split(".").reverse(),f=u.split(".").reverse(),h=[];g.forEach((E,c)=>{E===f[c]&&h.push(E)}),u=h.reverse().join(".")}/^localhost/.test(u)&&(u="");const d=u?/^\./.test(u)?u:`.${u}`:"";if(t){const g=ee();if((g.uniqueToken||g.visitToken||"").startsWith("00000000-"))return;ve(Te,g.uniqueToken||we(),Wr,d),ve(Se,g.visitToken||we(),Gr,d)}else ve(Te,"",0,d),ve(Se,"",0,d)},[s,t,n,r,o]),s}function ve(e,t,n,r){document.cookie=Yr(e,t,{maxage:n,domain:r,samesite:"Lax",path:"/"})}async function Yt(e,t=""){const{uniqueToken:n,visitToken:r}=ee(),a=await fetch(`${t.replace(/\/+$/,"")}/api/unstable/graphql.json`,{method:"POST",headers:{"Content-Type":"application/json",...e&&{"X-Shopify-Storefront-Access-Token":e},...r||n?{[Ve]:r,[ke]:n}:void 0},body:JSON.stringify({query:"query ensureCookies { consentManagement { cookies(visitorConsent:{}) { cookieDomain } } }"})});if(!a.ok)throw new Error(`Failed to fetch consent from browser: ${a.status} ${a.statusText}`);await a.json(),ee()}function Kr({checkoutDomain:e,storefrontAccessToken:t,fetchTrackingValues:n=!1}){const[r,a]=l.useState(!n),i=l.useRef(!1);return l.useEffect(()=>{if(!n){a(!0);return}i.current||(i.current=!0,Yt(t).catch(o=>e?Yt(t,e):Promise.reject(o)).catch(o=>{console.warn("[h2:warn:useShopifyCookies] Failed to fetch tracking values from browser: "+(o instanceof Error?o.message:String(o)))}).finally(()=>{a(!0)}))},[e,n,t]),r}p.AddToCartButton=Un,p.AnalyticsEventName=te,p.AnalyticsPageType=Ae,p.BuyNowButton=rr,p.CartCheckoutButton=ar,p.CartCost=or,p.CartLineProvider=sr,p.CartLineQuantity=cr,p.CartLineQuantityAdjustButton=ur,p.CartProvider=vn,p.ExternalVideo=Ot,p.IMAGE_FRAGMENT=Cr,p.Image=Ut,p.MediaFile=wr,p.ModelViewer=qt,p.Money=Ie,p.ProductPrice=vr,p.ProductProvider=Vn,p.RichText=Mr,p.SHOPIFY_S=Se,p.SHOPIFY_STOREFRONT_ID_HEADER=ot,p.SHOPIFY_STOREFRONT_S_HEADER=ct,p.SHOPIFY_STOREFRONT_Y_HEADER=st,p.SHOPIFY_UNIQUE_TOKEN_HEADER=ke,p.SHOPIFY_VISIT_TOKEN_HEADER=Ve,p.SHOPIFY_Y=Te,p.ShopPayButton=$r,p.ShopifyProvider=Cn,p.ShopifySalesChannel=pt,p.Video=xt,p.createStorefrontClient=pn,p.customerAccountApiCustomScalars=dr,p.decodeEncodedVariant=Rt,p.flattenConnection=Q,p.getAdjacentAndFirstAvailableVariants=Er,p.getClientBrowserParameters=zn,p.getProductOptions=_r,p.getShopifyCookies=Fn,p.getTrackingValues=ee,p.isOptionValueCombinationInEncodedVariant=$e,p.mapSelectedProductOptionToObject=de,p.parseGid=$,p.parseMetafield=Ir,p.sendShopifyAnalytics=Qn,p.storefrontApiCustomScalars=lr,p.useCart=ae,p.useCartLine=Fe,p.useLoadScript=He,p.useMoney=It,p.useProduct=gt,p.useSelectedOptionInUrlParam=Br,p.useShop=ce,p.useShopifyCookies=Zr,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}));
337
321
  //# sourceMappingURL=hydrogen-react.prod.js.map