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,aAAO,MAM1B,EALFlC,UAAAA,OAAAA,IAAY,OACZK,EAIE,EAJFA,aAAAA,EAIE,EAHFD,mBAAAA,OAAAA,IAAqB,OACrB+B,EAEE,EAFFA,uBACAC,EACE,EADFA,WAGI,EAAkBvC,KAAK1C,MAArBkE,YAER,OACE,SAACV,MAAAA,CACCX,UAAW,wBAAkC,OAAVA,GACnCqC,UAAW,EACXC,KAAK,SACLC,IAAK1C,KAAKkB,Q,SAETM,IACC,SAACV,MAAAA,CAAIX,UAAU,eAAesC,KAAK,W,UACjC,UAAC3B,MAAAA,CAAIX,UAAU,gB,UACZD,IACC,UAACY,MAAAA,CAAIX,UAAU,qC,WACb,SAACM,SAAAA,CACC3B,KAAK,SACLqB,UAAU,QACVwC,eAAa,QACbC,aAAW,Q,UAEX,SAACC,OAAAA,CAAKC,cAAY,O,SAAO,SAE3B,SAACC,KAAAA,CAAG5C,UAAU,c,SAAeD,QAGjC,SAACY,MAAAA,CAAIX,UAAW,cAAiC,OAAnBI,G,SAC3B4B,IAEF3B,GACC,SAACM,MAAAA,CAAIX,UAAU,e,SAAgBK,KAE9B+B,IACC,UAACzB,MAAAA,CAAIX,UAAU,e,UACZiC,IACC,SAAC3B,SAAAA,CACC3B,KAAK,SACLqB,UAAW,OAEV,OADCmC,GAA0B,eAE5BzB,QAASwB,E,SAERD,KAGL,SAAC3B,SAAAA,CACC3B,KAAK,SACLqB,UAAU,gBACVwC,eAAa,Q,SACd,mBAWnB,EAxImB1C,C,CAAN,CAAoBc,EAAAA,U","sources":["webpack://webstaurantstore/./common/GdprBanner/index.tsx","webpack://webstaurantstore/./common/Modal/index.tsx"],"sourcesContent":["import React, { Component } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { getErrorTracking } from \"@wss/error-tracking\";\nimport { getDynamicData } from \"~/common/Store/actions/updateUserAndChatFromOrigin\";\nimport Modal from \"../Modal\";\n\nexport class GdprBannerModal extends Component {\n constructor(props: { [key: string]: unknown }) {\n super(props);\n import(\"storage-factory\").then(({ storageFactory }) => {\n const storage = storageFactory(() => window.localStorage);\n\n if (!storage.getItem(\"data-policy-seen\")) {\n this.isInEuropeanUnion();\n }\n });\n }\n\n // eslint-disable-next-line react/state-in-constructor\n state = { modalOpen: false };\n\n handleModalClose = () => {\n import(\"storage-factory\").then(({ storageFactory }) => {\n const storage = storageFactory(() => window.localStorage);\n\n storage.setItem(\"data-policy-seen\", \"true\");\n });\n this.setState({\n modalOpen: false,\n });\n };\n\n captureIPCheckError = async (\n error: unknown,\n response: Response | undefined | null,\n responseClone: Response | undefined | null\n ) => {\n getErrorTracking().then(async ({ captureException }) => {\n if (!response) {\n captureException(error);\n return;\n }\n\n const headerEntries = response?.headers\n ? Object.fromEntries(response.headers.entries())\n : {};\n\n captureException(error, {\n extra: {\n response: {\n headers: headerEntries,\n ok: response.ok,\n redirected: response.redirected,\n status: response.status,\n statusText: response.statusText,\n type: response.type,\n url: response.url,\n text: responseClone ? await responseClone.text() : \"\",\n },\n },\n });\n });\n };\n\n async isInEuropeanUnion() {\n const result = await getDynamicData;\n if (result.isError) return;\n let results;\n let response: Response | undefined;\n let responseClone: Response | undefined;\n try {\n response = await fetch(\"/object/ip.cfc?method=isEuropeanUnion\");\n responseClone = response.clone();\n results = await response.json<{ returnFlag: boolean }>();\n } catch (error) {\n this.captureIPCheckError(error, response, responseClone);\n if (!results) return;\n }\n\n const backdrop = document.getElementById(\n \"productAccessoriesAndOptionsFormBackdrop\"\n );\n if (backdrop) {\n backdrop.remove();\n }\n\n if (results.returnFlag) {\n import(\"./style.css\");\n import(\n /* webpackChunkName: \"modals-standalone\" */ \"~/bootstrap/less/modals-standalone.less\"\n );\n this.render();\n this.setState({ modalOpen: true });\n } else {\n const { storageFactory } = await import(\"storage-factory\");\n\n const storage = storageFactory(() => window.localStorage);\n storage.setItem(\"outsideOfEuropeanUnion\", \"true\");\n }\n }\n\n render() {\n const { modalOpen } = this.state;\n\n return (\n {\n this.setState({ modalOpen: false });\n }}\n modalBodyClassName=\"gdprBody\"\n customFooter={\n \n Accept\n \n }\n >\n
\n We would like to use cookies and identify general user data to give\n you a better experience on our website.Using cookies and identifying\n data such as IP address and the type and version of your browser help\n us improve our website's navigation and provide more personalized\n services to you. To find out more, see our Privacy Policy\n
\n \n );\n }\n}\n\nexport default function GdprBanner(): JSX.Element {\n const gdprBannerMount = document.getElementById(\"gdprBannerMount\");\n return <>{ReactDOM.render(, gdprBannerMount)};\n}\n","/**\n * This modal is kept for legacy purposes, any new modals should use the ModalReact component.\n */\n\nimport React, { Component, ReactNode } from \"react\";\nimport { Modal as BootstrapModal } from \"bootstrap.native\";\n\nexport interface Props {\n onClose?: EventListenerOrEventListenerObject;\n title?: string;\n titleIcon?: string;\n children?: ReactNode;\n primaryButtonText?: string;\n primaryButtonClick?: (\n event: React.MouseEvent\n ) => void;\n className?: string;\n isOpen: boolean;\n customFooter?: JSX.Element;\n modalBodyClassName?: string;\n primaryButtonClassName?: string;\n hideFooter?: boolean;\n}\n\ninterface State {\n renderModal: boolean;\n}\n\nexport default class Modal extends Component {\n private modal?: BootstrapModal;\n\n private element: React.RefObject;\n\n public constructor(props: Props) {\n super(props);\n\n this.element = React.createRef();\n this.openModal = this.openModal.bind(this);\n this.closeModal = this.closeModal.bind(this);\n\n const { isOpen } = this.props;\n\n this.state = {\n renderModal: isOpen,\n };\n }\n\n public componentDidMount() {\n const { onClose, isOpen } = this.props;\n\n if (!this.element.current) return;\n\n this.modal = new BootstrapModal(this.element.current);\n\n if (isOpen) {\n this.modal.show();\n }\n\n if (onClose)\n this.element.current.addEventListener(\"hidden.bs.modal\", onClose);\n\n this.element.current.addEventListener(\"show.bs.modal\", this.openModal);\n this.element.current.addEventListener(\"hidden.bs.modal\", this.closeModal);\n }\n\n public componentDidUpdate(prevProps: Props) {\n const { isOpen } = this.props;\n\n if (isOpen !== prevProps.isOpen && this.modal) {\n this.modal[isOpen ? \"show\" : \"hide\"]();\n }\n }\n\n public componentWillUnmount() {\n if (!this.element.current) return;\n\n this.element.current.removeEventListener(\"show.bs.modal\", this.openModal);\n this.element.current.removeEventListener(\n \"hidden.bs.modal\",\n this.closeModal\n );\n }\n\n openModal() {\n this.setState({ renderModal: true });\n }\n\n closeModal() {\n this.setState({ renderModal: false });\n }\n\n public render() {\n const {\n title,\n children,\n primaryButtonText,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n primaryButtonClick = () => {},\n className = \"\",\n customFooter,\n modalBodyClassName = \"\",\n primaryButtonClassName,\n hideFooter,\n } = this.props;\n\n const { renderModal } = this.state;\n\n return (\n \n {renderModal && (\n
\n
\n {title && (\n
\n \n ×\n \n

{title}

\n
\n )}\n
\n {children}\n
\n {customFooter ? (\n
{customFooter}
\n ) : (\n !hideFooter && (\n
\n {primaryButtonText && (\n \n {primaryButtonText}\n \n )}\n \n Close\n \n
\n )\n )}\n
\n
\n )}\n \n );\n }\n}\n"],"names":["GdprBannerModal","GdprBanner","props","state","modalOpen","handleModalClose","then","storageFactory","window","localStorage","setItem","setState","captureIPCheckError","error","response","responseClone","getErrorTracking","captureException","headerEntries","headers","Object","fromEntries","entries","ok","redirected","status","statusText","type","url","text","extra","getItem","isInEuropeanUnion","results","backdrop","getDynamicData","isError","fetch","clone","json","document","getElementById","remove","returnFlag","render","this","Modal","title","className","isOpen","Boolean","onClose","modalBodyClassName","customFooter","button","location","pathname","indexOf","onClick","div","Component","gdprBannerMount","ReactDOM","element","React","createRef","openModal","bind","closeModal","renderModal","componentDidMount","current","modal","BootstrapModal","show","addEventListener","componentDidUpdate","prevProps","componentWillUnmount","removeEventListener","children","primaryButtonText","primaryButtonClick","primaryButtonClassName","hideFooter","tabIndex","role","ref","data-dismiss","aria-label","span","aria-hidden","h3"],"sourceRoot":""}