{"version":3,"file":"index-BVPnjTP8.js","sources":["../../src/scripts/modules/react-modules/Cart/CartContext.tsx","../../src/scripts/modules/react-modules/Cart/CartProvider.tsx","../../node_modules/.pnpm/html-dom-parser@5.0.10/node_modules/html-dom-parser/lib/client/domparser.js","../../node_modules/.pnpm/domelementtype@2.3.0/node_modules/domelementtype/lib/index.js","../../node_modules/.pnpm/domhandler@5.0.3/node_modules/domhandler/lib/node.js","../../node_modules/.pnpm/domhandler@5.0.3/node_modules/domhandler/lib/index.js","../../node_modules/.pnpm/html-dom-parser@5.0.10/node_modules/html-dom-parser/lib/client/constants.js","../../node_modules/.pnpm/html-dom-parser@5.0.10/node_modules/html-dom-parser/lib/client/utilities.js","../../node_modules/.pnpm/html-dom-parser@5.0.10/node_modules/html-dom-parser/lib/client/html-to-dom.js","../../node_modules/.pnpm/react-property@2.0.2/node_modules/react-property/lib/possibleStandardNamesOptimized.js","../../node_modules/.pnpm/react-property@2.0.2/node_modules/react-property/lib/index.js","../../node_modules/.pnpm/inline-style-parser@0.2.4/node_modules/inline-style-parser/index.js","../../node_modules/.pnpm/style-to-object@1.0.8/node_modules/style-to-object/cjs/index.js","../../node_modules/.pnpm/style-to-js@1.1.16/node_modules/style-to-js/cjs/utilities.js","../../node_modules/.pnpm/style-to-js@1.1.16/node_modules/style-to-js/cjs/index.js","../../node_modules/.pnpm/html-react-parser@5.1.18_@types+react@18.2.67_react@18.3.1/node_modules/html-react-parser/lib/utilities.js","../../node_modules/.pnpm/html-react-parser@5.1.18_@types+react@18.2.67_react@18.3.1/node_modules/html-react-parser/lib/attributes-to-props.js","../../node_modules/.pnpm/html-react-parser@5.1.18_@types+react@18.2.67_react@18.3.1/node_modules/html-react-parser/lib/dom-to-react.js","../../node_modules/.pnpm/html-react-parser@5.1.18_@types+react@18.2.67_react@18.3.1/node_modules/html-react-parser/lib/index.js","../../node_modules/.pnpm/html-react-parser@5.1.18_@types+react@18.2.67_react@18.3.1/node_modules/html-react-parser/esm/index.mjs","../../src/scripts/modules/react-modules/Cart/CartItem.tsx","../../src/scripts/modules/react-modules/Cart/Cart.tsx","../../src/scripts/modules/react-modules/Cart/index.tsx"],"sourcesContent":["import { createContext } from 'react';\nimport { CartProps } from '../../../../stories/modules/cart.stories';\n\nexport const CartContext = createContext(\n {} as { getCartState: () => void; cartState: CartProps | null }\n);\n","import { CartProps } from '../../../../stories/modules/cart.stories';\nimport React, { ReactNode, useEffect, useState } from 'react';\nimport { CartContext } from './CartContext';\nimport { GetCartState } from '../../../helpers/cart';\n\nexport const CartProvider = (props: CartProps & { children: ReactNode }) => {\n const [cartState, setCartState] = useState(null);\n\n useEffect(() => {\n const cartTrigger = document.querySelector('.cart-trigger');\n\n if (cartTrigger) {\n cartTrigger.addEventListener('click', getCartState);\n } else if (props.isCheckout === 'true') {\n getCartState();\n }\n\n return () => {\n if (cartTrigger) {\n cartTrigger.removeEventListener('click', getCartState);\n }\n };\n }, []);\n\n const getCartState = async () => {\n if (props.cartEndpoint && props.cartEndpoint !== '') {\n const cartData = await GetCartState(props.cartEndpoint);\n if (cartData) {\n const cart: CartProps = Object.assign({}, props, cartData);\n setCartState(cart);\n }\n }\n };\n\n return (\n \n {props.children}\n \n );\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = domparser;\n// constants\nvar HTML = 'html';\nvar HEAD = 'head';\nvar BODY = 'body';\nvar FIRST_TAG_REGEX = /<([a-zA-Z]+[0-9]?)/; // e.g.,

\n// match-all-characters in case of newlines (DOTALL)\nvar HEAD_TAG_REGEX = //i;\nvar BODY_TAG_REGEX = //i;\n// falls back to `parseFromString` if `createHTMLDocument` cannot be used\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nvar parseFromDocument = function (html, tagName) {\n /* istanbul ignore next */\n throw new Error('This browser does not support `document.implementation.createHTMLDocument`');\n};\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nvar parseFromString = function (html, tagName) {\n /* istanbul ignore next */\n throw new Error('This browser does not support `DOMParser.prototype.parseFromString`');\n};\nvar DOMParser = typeof window === 'object' && window.DOMParser;\n/**\n * DOMParser (performance: slow).\n *\n * @see https://developer.mozilla.org/docs/Web/API/DOMParser#Parsing_an_SVG_or_HTML_document\n */\nif (typeof DOMParser === 'function') {\n var domParser_1 = new DOMParser();\n var mimeType_1 = 'text/html';\n /**\n * Creates an HTML document using `DOMParser.parseFromString`.\n *\n * @param html - The HTML string.\n * @param tagName - The element to render the HTML (with 'body' as fallback).\n * @returns - Document.\n */\n parseFromString = function (html, tagName) {\n if (tagName) {\n /* istanbul ignore next */\n html = \"<\".concat(tagName, \">\").concat(html, \"\");\n }\n return domParser_1.parseFromString(html, mimeType_1);\n };\n parseFromDocument = parseFromString;\n}\n/**\n * DOMImplementation (performance: fair).\n *\n * @see https://developer.mozilla.org/docs/Web/API/DOMImplementation/createHTMLDocument\n */\nif (typeof document === 'object' && document.implementation) {\n var htmlDocument_1 = document.implementation.createHTMLDocument();\n /**\n * Use HTML document created by `document.implementation.createHTMLDocument`.\n *\n * @param html - The HTML string.\n * @param tagName - The element to render the HTML (with 'body' as fallback).\n * @returns - Document\n */\n parseFromDocument = function (html, tagName) {\n if (tagName) {\n var element = htmlDocument_1.documentElement.querySelector(tagName);\n if (element) {\n element.innerHTML = html;\n }\n return htmlDocument_1;\n }\n htmlDocument_1.documentElement.innerHTML = html;\n return htmlDocument_1;\n };\n}\n/**\n * Template (performance: fast).\n *\n * @see https://developer.mozilla.org/docs/Web/HTML/Element/template\n */\nvar template = typeof document === 'object' && document.createElement('template');\nvar parseFromTemplate;\nif (template && template.content) {\n /**\n * Uses a template element (content fragment) to parse HTML.\n *\n * @param html - HTML string.\n * @returns - Nodes.\n */\n parseFromTemplate = function (html) {\n template.innerHTML = html;\n return template.content.childNodes;\n };\n}\n/**\n * Parses HTML string to DOM nodes.\n *\n * @param html - HTML markup.\n * @returns - DOM nodes.\n */\nfunction domparser(html) {\n var _a, _b;\n var match = html.match(FIRST_TAG_REGEX);\n var firstTagName = match && match[1] ? match[1].toLowerCase() : '';\n switch (firstTagName) {\n case HTML: {\n var doc = parseFromString(html);\n // the created document may come with filler head/body elements,\n // so make sure to remove them if they don't actually exist\n if (!HEAD_TAG_REGEX.test(html)) {\n var element = doc.querySelector(HEAD);\n (_a = element === null || element === void 0 ? void 0 : element.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(element);\n }\n if (!BODY_TAG_REGEX.test(html)) {\n var element = doc.querySelector(BODY);\n (_b = element === null || element === void 0 ? void 0 : element.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(element);\n }\n return doc.querySelectorAll(HTML);\n }\n case HEAD:\n case BODY: {\n var elements = parseFromDocument(html).querySelectorAll(firstTagName);\n // if there's a sibling element, then return both elements\n if (BODY_TAG_REGEX.test(html) && HEAD_TAG_REGEX.test(html)) {\n return elements[0].parentNode.childNodes;\n }\n return elements;\n }\n // low-level tag or text\n default: {\n if (parseFromTemplate) {\n return parseFromTemplate(html);\n }\n var element = parseFromDocument(html, BODY).querySelector(BODY);\n return element.childNodes;\n }\n }\n}\n//# sourceMappingURL=domparser.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0;\n/** Types of elements found in htmlparser2's DOM */\nvar ElementType;\n(function (ElementType) {\n /** Type for the root element of a document */\n ElementType[\"Root\"] = \"root\";\n /** Type for Text */\n ElementType[\"Text\"] = \"text\";\n /** Type for */\n ElementType[\"Directive\"] = \"directive\";\n /** Type for */\n ElementType[\"Comment\"] = \"comment\";\n /** Type for