tanya-chatbot 0.0.14 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),i=require("react/jsx-runtime"),Yt=require("@apollo/client"),gt=require("react-redux"),ye=require("@reduxjs/toolkit"),Vr=require("@radix-ui/react-popover");require("clsx");require("tailwind-merge");const M=require("axios");require("crypto-js");const Oe=require("@iconify/react"),Q=require("react-toastify");function Yr(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const dr=Yr(Vr),Jr='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.top-full{top:100%}.z-40{z-index:40}.z-50{z-index:50}.m-1{margin:.25rem}.m-3{margin:.75rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.mb-1{margin-bottom:.25rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-24{margin-bottom:6rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.h-12{height:3rem}.h-28{height:7rem}.h-3{height:.75rem}.h-6{height:1.5rem}.h-\\[120px\\]{height:120px}.h-\\[200px\\]{height:200px}.h-\\[60px\\]{height:60px}.h-\\[90vh\\]{height:90vh}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.w-28{width:7rem}.w-3{width:.75rem}.w-5\\/6{width:83.333333%}.w-6{width:1.5rem}.w-72{width:18rem}.w-\\[100vw\\]{width:100vw}.w-\\[120px\\]{width:120px}.w-\\[150px\\]{width:150px}.w-\\[60px\\]{width:60px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[75\\%\\]{max-width:75%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[5px\\]{border-radius:5px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:.75rem}.rounded-l-\\[20px\\]{border-top-left-radius:20px;border-bottom-left-radius:20px}.rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-r-xl{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-bl-2xl{border-bottom-left-radius:1rem}.rounded-br-xl{border-bottom-right-radius:.75rem}.rounded-tr-\\[20px\\]{border-top-right-radius:20px}.rounded-tr-\\[5px\\]{border-top-right-radius:5px}.border{border-width:1px}.border-0{border-width:0px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-t-2{border-top-width:2px}.border-none{border-style:none}.border-\\[\\#C9C2DE\\]{--tw-border-opacity: 1;border-color:rgb(201 194 222 / var(--tw-border-opacity, 1))}.border-\\[\\#E5E5E5\\]{--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.bg-\\[\\#553D94\\]{--tw-bg-opacity: 1;background-color:rgb(85 61 148 / var(--tw-bg-opacity, 1))}.bg-\\[\\#6851C6\\]{--tw-bg-opacity: 1;background-color:rgb(104 81 198 / var(--tw-bg-opacity, 1))}.bg-\\[\\#804C9E0D\\]{background-color:#804c9e0d}.bg-\\[\\#A21CAF\\]{--tw-bg-opacity: 1;background-color:rgb(162 28 175 / var(--tw-bg-opacity, 1))}.bg-\\[\\#AB192D\\]{--tw-bg-opacity: 1;background-color:rgb(171 25 45 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E2DBFF\\]{--tw-bg-opacity: 1;background-color:rgb(226 219 255 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E3DEEF\\]{--tw-bg-opacity: 1;background-color:rgb(227 222 239 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F3F3F3\\]{--tw-bg-opacity: 1;background-color:rgb(243 243 243 / var(--tw-bg-opacity, 1))}.bg-\\[\\#FFFFFF\\],.bg-\\[\\#ffffff\\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-black\\/30{background-color:#0000004d}.bg-indigo-300{--tw-bg-opacity: 1;background-color:rgb(165 180 252 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\\[1px\\]{padding:1px}.p-\\[5px\\]{padding:5px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pl-2{padding-left:.5rem}.pr-5{padding-right:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-nunitoSans{font-family:Nunito Sans}.text-\\[12px\\]{font-size:12px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-snug{line-height:1.375}.text-\\[\\#000000\\]{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-\\[\\#14121F\\]{--tw-text-opacity: 1;color:rgb(20 18 31 / var(--tw-text-opacity, 1))}.text-\\[\\#18181B\\]{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.text-\\[\\#232323\\]{--tw-text-opacity: 1;color:rgb(35 35 35 / var(--tw-text-opacity, 1))}.text-\\[\\#323135\\]{--tw-text-opacity: 1;color:rgb(50 49 53 / var(--tw-text-opacity, 1))}.text-\\[\\#494949\\]{--tw-text-opacity: 1;color:rgb(73 73 73 / var(--tw-text-opacity, 1))}.text-\\[\\#555555\\]{--tw-text-opacity: 1;color:rgb(85 85 85 / var(--tw-text-opacity, 1))}.text-\\[\\#5B5B5B\\]{--tw-text-opacity: 1;color:rgb(91 91 91 / var(--tw-text-opacity, 1))}.text-\\[\\#68656E\\]{--tw-text-opacity: 1;color:rgb(104 101 110 / var(--tw-text-opacity, 1))}.text-\\[\\#959595\\]{--tw-text-opacity: 1;color:rgb(149 149 149 / var(--tw-text-opacity, 1))}.text-\\[\\#EC5050\\]{--tw-text-opacity: 1;color:rgb(236 80 80 / var(--tw-text-opacity, 1))}.text-\\[\\#FBFBFC\\]{--tw-text-opacity: 1;color:rgb(251 251 252 / var(--tw-text-opacity, 1))}.text-\\[\\#FFFFFF\\]{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-80{opacity:.8}.shadow-\\[0px_2px_2px_0px_\\#9292BC40\\]{--tw-shadow: 0px 2px 2px 0px #9292BC40;--tw-shadow-colored: 0px 2px 2px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0px_4px_10px_0px_\\#5F499840\\]{--tw-shadow: 0px 4px 10px 0px #5F499840;--tw-shadow-colored: 0px 4px 10px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.running{animation-play-state:running}html,body,#root{margin:0;padding:0}:root{line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;padding:0}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.hover\\:scale-125:hover{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:text-\\[\\#6952C7\\]:hover{--tw-text-opacity: 1;color:rgb(105 82 199 / var(--tw-text-opacity, 1))}.hover\\:opacity-90:hover{opacity:.9}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}@media(min-width:640px){.sm\\:w-\\[80vw\\]{width:80vw}}@media(min-width:768px){.md\\:h-\\[100vh\\]{height:100vh}.md\\:w-1\\/2{width:50%}.md\\:w-\\[770px\\]{width:770px}.md\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:flex-row{flex-direction:row}}@media(min-width:1024px){.lg\\:h-\\[100vh\\]{height:100vh}.lg\\:w-1\\/2{width:50%}.lg\\:w-2\\/3{width:66.666667%}.lg\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:flex-row{flex-direction:row}.lg\\:rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.lg\\:rounded-bl-xl{border-bottom-left-radius:.75rem}}';function Kr(){return k.useEffect(()=>{if(typeof document<"u"){const t=document.createElement("style");return t.textContent=Jr,document.head.appendChild(t),()=>{document.head.removeChild(t)}}},[]),null}const Gr={store:{storeCode:"",storeName:"",storeDescription:"",activeCatalogId:0,isDefault:!1,logoDarkBg:"",logoLightBg:"",logoTransparent:"",catalogs:[],themeColor:"",themeContrastColor:"",tanyaThemeColor:"",tanyaThemeColorLight:"",favicon:"",websiteTitle:"",flowId:"",aliasId:"",searchConfigs:{endpoint:"",accessKey:"",secretKey:""},homePageCategories:[],carouselImages:{web:[],mobile:[]},otherImages:{web:[],mobile:[]}}},fr=ye.createSlice({name:"store",initialState:Gr,reducers:{setStore:(t,e)=>{t.store=e.payload}}}),{setStore:Ko}=fr.actions,Wr=fr.reducer,Qr={product:null},pr=ye.createSlice({name:"product",initialState:Qr,reducers:{setProduct:(t,e)=>{t.product=e.payload}}}),{setProduct:ue}=pr.actions,Xr=pr.reducer,Zr=ye.configureStore({reducer:{store:Wr,product:Xr}}),tn=({children:t})=>i.jsx(gt.Provider,{store:Zr,children:t}),It=t=>{const e=new CustomEvent("reactCartUpdated",{detail:{cartUpdated:!0,basketId:t}});window.dispatchEvent(e)};function en({...t}){return i.jsx(dr.Root,{"data-slot":"popover",...t})}function rn({...t}){return i.jsx(dr.Trigger,{"data-slot":"popover-trigger",...t})}const mt=()=>({aiConversationUrl:"https://mdv3qwfi2j.execute-api.us-east-1.amazonaws.com/dev/api/bedrock/invoke/stream",xAPIKey:"BJBtjpPkqGatuoa3qJqdR8aHXSsHkgvGaootbubi",serverUrl:"https://tanya-sfcc-server.vercel.app/",basePath:"sc-api"}),hr=async()=>{const t="https://tanya-sfcc-server.vercel.app/";try{const e=await M.post(`${t}api/auth/token-bm-grant?baseUrl=${it()}&siteId=${et()}`);return e.status===200&&e.data.access_token?e.data.access_token:(console.error("Failed to fetch token:",e.data),null)}catch(e){return M.isAxiosError(e)?console.error("Error fetching token:",e.response||e.message):console.error("Unexpected error:",e),null}},gr=async t=>{const e="https://tanya-sfcc-server.vercel.app/";try{const r=JSON.parse(sessionStorage.getItem("customerData")||"{}").dwsid,n=await M.post(`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${it()}&siteId=${et()}&pubCfg=${ct()}&envRef=${lt()}&orgRef=${ut()}`,{},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});return n.status===200&&n.data?n.data:null}catch(r){return M.isAxiosError(r)?console.error("Error creating basket:",r.response||r.message):console.error("Unexpected error:",r),null}};async function Qt(){const t=localStorage.getItem("expires_in"),e=localStorage.getItem("access_token"),r=JSON.parse(sessionStorage.getItem("customerData")||"{}").isGuest;if(t&&e&&new Date().getTime()<parseInt(t)&&r===JSON.parse(localStorage.getItem("isGuest")||"false"))return console.log("access token found in local storage"),{access_token:e,expires_in:t};const{serverUrl:n}=mt(),o=JSON.parse(sessionStorage.getItem("customerData")||"{}").dwsid,s=JSON.parse(sessionStorage.getItem("customerData")||"{}").usrRef;try{const a=r?"unregister-auth":"register-auth",l=await M.get(`${n}sc-api/${a}?dwsid=${o}&email=${s}&pubCfg=${ct()}&envRef=${lt()}&orgRef=${ut()}&siteId=${et()}`);return localStorage.setItem("access_token",l.data.access_token),localStorage.setItem("expires_in",String(new Date().getTime()+l.data.expires_in*1e3)),localStorage.setItem("isGuest",r.toString()),console.log(l.data),l.data}catch(a){console.log(a)}}const it=()=>sessionStorage.getItem("Host"),et=()=>sessionStorage.getItem("SiteId"),ct=()=>sessionStorage.getItem("pubCfg"),lt=()=>sessionStorage.getItem("envRef"),ut=()=>sessionStorage.getItem("orgRef"),$e=async(t,e)=>{const{serverUrl:r,basePath:n}=mt();try{const o=it();return(await M.get(`${r}${n}/search-sfcc?baseUrl=${o}&query=${t}&siteId=${et()}&pubCfg=${ct()}&envRef=${lt()}&orgRef=${ut()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}})).data.hits}catch(o){throw console.error("Error fetching search results:",o),o}},mr=async t=>{if(!t)throw new Error("Product ID is required");const{serverUrl:e,basePath:r}=mt(),n=it();console.log("calling access");const{access_token:o}=await Qt();return console.log(o),(await M.get(`${e}${r}/product-sfcc/${t}?baseUrl=${n}&siteId=${et()}&pubCfg=${ct()}&envRef=${lt()}&orgRef=${ut()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}})).data},nn=async t=>{if(!t)throw new Error("customerId is required");const e=await hr(),{customer_token:r}=await gr(e),{serverUrl:n,basePath:o}=mt(),a=(await Qt()).access_token;return(await M.get(`${n}${o}/get-interest?baseUrl=${it()}&customerId=${t}&siteId=${et()}&pubCfg=${ct()}&envRef=${lt()}&orgRef=${ut()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`}})).data},Ae=t=>String(typeof t=="string"?t:t["en-US"]||t),Le=t=>t!=null&&t.image?[t.image]:"variants"in t?t.variants[0].images:t.masterVariant.images.map(e=>e.url),on=(t,e)=>t.toLocaleString("en-US",{style:"currency",currency:e||"USD"}),ze=t=>{var e,r,n;return"variants"in t?{centAmount:(e=t.variants[0])==null?void 0:e.prices.EUR.max,currencyCode:"DOL"}:{centAmount:(r=t.masterVariant)==null?void 0:r.prices[0].value.centAmount,currencyCode:(n=t.masterVariant)==null?void 0:n.prices[0].value.currencyCode}},sn=t=>t.charAt(0).toUpperCase()+t.slice(1),De=(t,e)=>t.length<e?t:t.slice(0,e)+"...",ne=t=>t.split("\\n").map((e,r)=>{const n=e.match(/^(\d+)\.\s(.+)/);return n?`<p key=${r} class="mb-2"><strong>${n[1]}.</strong> ${n[2]}</p>`:e.trim()?`<p key=${r} class="mb-2">${e}</p>`:"<br/>"}).join("");function an(t,e){const r=t.icons,n=t.aliases||Object.create(null),o=Object.create(null);function s(a){if(r[a])return o[a]=[];if(!(a in o)){o[a]=null;const l=n[a]&&n[a].parent,c=l&&s(l);c&&(o[a]=[l].concat(c))}return o[a]}return Object.keys(r).concat(Object.keys(n)).forEach(s),o}const wr=Object.freeze({left:0,top:0,width:16,height:16}),Jt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),be=Object.freeze({...wr,...Jt}),de=Object.freeze({...be,body:"",hidden:!1});function cn(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function Me(t,e){const r=cn(t,e);for(const n in de)n in Jt?n in t&&!(n in r)&&(r[n]=Jt[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function ln(t,e,r){const n=t.icons,o=t.aliases||Object.create(null);let s={};function a(l){s=Me(n[l]||o[l],s)}return a(e),r.forEach(a),Me(t,s)}function xr(t,e){const r=[];if(typeof t!="object"||typeof t.icons!="object")return r;t.not_found instanceof Array&&t.not_found.forEach(o=>{e(o,null),r.push(o)});const n=an(t);for(const o in n){const s=n[o];s&&(e(o,ln(t,o,s)),r.push(o))}return r}const un={provider:"",aliases:{},not_found:{},...wr};function oe(t,e){for(const r in e)if(r in t&&typeof t[r]!=typeof e[r])return!1;return!0}function yr(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!oe(t,un))return null;const r=e.icons;for(const o in r){const s=r[o];if(!o||typeof s.body!="string"||!oe(s,de))return null}const n=e.aliases||Object.create(null);for(const o in n){const s=n[o],a=s.parent;if(!o||typeof a!="string"||!r[a]&&!n[a]||!oe(s,de))return null}return e}const qe=Object.create(null);function dn(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function Ft(t,e){const r=qe[t]||(qe[t]=Object.create(null));return r[e]||(r[e]=dn(t,e))}function br(t,e){return yr(e)?xr(e,(r,n)=>{n?t.icons[r]=n:t.missing.add(r)}):[]}function fn(t,e,r){try{if(typeof r.body=="string")return t.icons[e]={...r},!0}catch{}return!1}const vr=/^[a-z0-9]+(-[a-z0-9]+)*$/,Xt=(t,e,r,n="")=>{const o=t.split(":");if(t.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;n=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const l=o.pop(),c=o.pop(),u={provider:o.length>0?o[0]:n,prefix:c,name:l};return e&&!Rt(u)?null:u}const s=o[0],a=s.split("-");if(a.length>1){const l={provider:n,prefix:a.shift(),name:a.join("-")};return e&&!Rt(l)?null:l}if(r&&n===""){const l={provider:n,prefix:"",name:s};return e&&!Rt(l,r)?null:l}return null},Rt=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;let zt=!1;function kr(t){return typeof t=="boolean"&&(zt=t),zt}function Ue(t){const e=typeof t=="string"?Xt(t,!0,zt):t;if(e){const r=Ft(e.provider,e.prefix),n=e.name;return r.icons[n]||(r.missing.has(n)?null:void 0)}}function pn(t,e){const r=Xt(t,!0,zt);if(!r)return!1;const n=Ft(r.provider,r.prefix);return e?fn(n,r.name,e):(n.missing.add(r.name),!0)}function hn(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),zt&&!e&&!t.prefix){let o=!1;return yr(t)&&(t.prefix="",xr(t,(s,a)=>{pn(s,a)&&(o=!0)})),o}const r=t.prefix;if(!Rt({prefix:r,name:"a"}))return!1;const n=Ft(e,r);return!!br(n,t)}const Sr=Object.freeze({width:null,height:null}),jr=Object.freeze({...Sr,...Jt}),gn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,mn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Be(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(gn);if(n===null||!n.length)return t;const o=[];let s=n.shift(),a=mn.test(s);for(;;){if(a){const l=parseFloat(s);isNaN(l)?o.push(s):o.push(Math.ceil(l*e*r)/r)}else o.push(s);if(s=n.shift(),s===void 0)return o.join("");a=!a}}function wn(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const o=t.indexOf(">",n),s=t.indexOf("</"+e);if(o===-1||s===-1)break;const a=t.indexOf(">",s);if(a===-1)break;r+=t.slice(o+1,s).trim(),t=t.slice(0,n).trim()+t.slice(a+1)}return{defs:r,content:t}}function xn(t,e){return t?"<defs>"+t+"</defs>"+e:e}function yn(t,e,r){const n=wn(t);return xn(n.defs,e+n.content+r)}const bn=t=>t==="unset"||t==="undefined"||t==="none";function vn(t,e){const r={...be,...t},n={...jr,...e},o={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,n].forEach(I=>{const m=[],b=I.hFlip,q=I.vFlip;let T=I.rotate;b?q?T+=2:(m.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),m.push("scale(-1 1)"),o.top=o.left=0):q&&(m.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),m.push("scale(1 -1)"),o.top=o.left=0);let $;switch(T<0&&(T-=Math.floor(T/4)*4),T=T%4,T){case 1:$=o.height/2+o.top,m.unshift("rotate(90 "+$.toString()+" "+$.toString()+")");break;case 2:m.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:$=o.width/2+o.left,m.unshift("rotate(-90 "+$.toString()+" "+$.toString()+")");break}T%2===1&&(o.left!==o.top&&($=o.left,o.left=o.top,o.top=$),o.width!==o.height&&($=o.width,o.width=o.height,o.height=$)),m.length&&(s=yn(s,'<g transform="'+m.join(" ")+'">',"</g>"))});const a=n.width,l=n.height,c=o.width,u=o.height;let f,p;a===null?(p=l===null?"1em":l==="auto"?u:l,f=Be(p,c/u)):(f=a==="auto"?c:a,p=l===null?Be(f,u/c):l==="auto"?u:l);const h={},g=(I,m)=>{bn(m)||(h[I]=m.toString())};g("width",f),g("height",p);const v=[o.left,o.top,c,u];return h.viewBox=v.join(" "),{attributes:h,viewBox:v,body:s}}const kn=/\sid="(\S+)"/g,Sn="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let jn=0;function Cn(t,e=Sn){const r=[];let n;for(;n=kn.exec(t);)r.push(n[1]);if(!r.length)return t;const o="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(s=>{const a=typeof e=="function"?e(s):e+(jn++).toString(),l=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+a+o+"$3")}),t=t.replace(new RegExp(o,"g"),""),t}const fe=Object.create(null);function In(t,e){fe[t]=e}function pe(t){return fe[t]||fe[""]}function ve(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const ke=Object.create(null),Tt=["https://api.simplesvg.com","https://api.unisvg.com"],Ht=[];for(;Tt.length>0;)Tt.length===1||Math.random()>.5?Ht.push(Tt.shift()):Ht.push(Tt.pop());ke[""]=ve({resources:["https://api.iconify.design"].concat(Ht)});function _n(t,e){const r=ve(e);return r===null?!1:(ke[t]=r,!0)}function Se(t){return ke[t]}const Fn=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}};let Re=Fn();function Nn(t,e){const r=Se(t);if(!r)return 0;let n;if(!r.maxURL)n=0;else{let o=0;r.resources.forEach(a=>{o=Math.max(o,a.length)});const s=e+".json?icons=";n=r.maxURL-o-r.path.length-s.length}return n}function En(t){return t===404}const Tn=(t,e,r)=>{const n=[],o=Nn(t,e),s="icons";let a={type:s,provider:t,prefix:e,icons:[]},l=0;return r.forEach((c,u)=>{l+=c.length+1,l>=o&&u>0&&(n.push(a),a={type:s,provider:t,prefix:e,icons:[]},l=c.length),a.icons.push(c)}),n.push(a),n};function Pn(t){if(typeof t=="string"){const e=Se(t);if(e)return e.path}return"/"}const On=(t,e,r)=>{if(!Re){r("abort",424);return}let n=Pn(e.provider);switch(e.type){case"icons":{const s=e.prefix,l=e.icons.join(","),c=new URLSearchParams({icons:l});n+=s+".json?"+c.toString();break}case"custom":{const s=e.uri;n+=s.slice(0,1)==="/"?s.slice(1):s;break}default:r("abort",400);return}let o=503;Re(t+n).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{r(En(a)?"abort":"next",a)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?r("abort",s):r("next",o)});return}setTimeout(()=>{r("success",s)})}).catch(()=>{r("next",o)})},$n={prepare:Tn,send:On};function Cr(t,e){t.forEach(r=>{const n=r.loaderCallbacks;n&&(r.loaderCallbacks=n.filter(o=>o.id!==e))})}function An(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let r=!1;const n=t.provider,o=t.prefix;e.forEach(s=>{const a=s.icons,l=a.pending.length;a.pending=a.pending.filter(c=>{if(c.prefix!==o)return!0;const u=c.name;if(t.icons[u])a.loaded.push({provider:n,prefix:o,name:u});else if(t.missing.has(u))a.missing.push({provider:n,prefix:o,name:u});else return r=!0,!0;return!1}),a.pending.length!==l&&(r||Cr([t],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let Ln=0;function zn(t,e,r){const n=Ln++,o=Cr.bind(null,r,n);if(!e.pending.length)return o;const s={id:n,icons:e,callback:t,abort:o};return r.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),o}function Dn(t){const e={loaded:[],missing:[],pending:[]},r=Object.create(null);t.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let n={provider:"",prefix:"",name:""};return t.forEach(o=>{if(n.name===o.name&&n.prefix===o.prefix&&n.provider===o.provider)return;n=o;const s=o.provider,a=o.prefix,l=o.name,c=r[s]||(r[s]=Object.create(null)),u=c[a]||(c[a]=Ft(s,a));let f;l in u.icons?f=e.loaded:a===""||u.missing.has(l)?f=e.missing:f=e.pending;const p={provider:s,prefix:a,name:l};f.push(p)}),e}function Mn(t,e=!0,r=!1){const n=[];return t.forEach(o=>{const s=typeof o=="string"?Xt(o,e,r):o;s&&n.push(s)}),n}const qn={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Un(t,e,r,n){const o=t.resources.length,s=t.random?Math.floor(Math.random()*o):t.index;let a;if(t.random){let S=t.resources.slice(0);for(a=[];S.length>1;){const L=Math.floor(Math.random()*S.length);a.push(S[L]),S=S.slice(0,L).concat(S.slice(L+1))}a=a.concat(S)}else a=t.resources.slice(s).concat(t.resources.slice(0,s));const l=Date.now();let c="pending",u=0,f,p=null,h=[],g=[];typeof n=="function"&&g.push(n);function v(){p&&(clearTimeout(p),p=null)}function I(){c==="pending"&&(c="aborted"),v(),h.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),h=[]}function m(S,L){L&&(g=[]),typeof S=="function"&&g.push(S)}function b(){return{startTime:l,payload:e,status:c,queriesSent:u,queriesPending:h.length,subscribe:m,abort:I}}function q(){c="failed",g.forEach(S=>{S(void 0,f)})}function T(){h.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),h=[]}function $(S,L,R){const H=L!=="success";switch(h=h.filter(P=>P!==S),c){case"pending":break;case"failed":if(H||!t.dataAfterTimeout)return;break;default:return}if(L==="abort"){f=R,q();return}if(H){f=R,h.length||(a.length?X():q());return}if(v(),T(),!t.random){const P=t.resources.indexOf(S.resource);P!==-1&&P!==t.index&&(t.index=P)}c="completed",g.forEach(P=>{P(R)})}function X(){if(c!=="pending")return;v();const S=a.shift();if(S===void 0){if(h.length){p=setTimeout(()=>{v(),c==="pending"&&(T(),q())},t.timeout);return}q();return}const L={status:"pending",resource:S,callback:(R,H)=>{$(L,R,H)}};h.push(L),u++,p=setTimeout(X,t.rotate),r(S,e,L.callback)}return setTimeout(X),b}function Ir(t){const e={...qn,...t};let r=[];function n(){r=r.filter(l=>l().status==="pending")}function o(l,c,u){const f=Un(e,l,c,(p,h)=>{n(),u&&u(p,h)});return r.push(f),f}function s(l){return r.find(c=>l(c))||null}return{query:o,find:s,setIndex:l=>{e.index=l},getIndex:()=>e.index,cleanup:n}}function He(){}const se=Object.create(null);function Bn(t){if(!se[t]){const e=Se(t);if(!e)return;const r=Ir(e),n={config:e,redundancy:r};se[t]=n}return se[t]}function Rn(t,e,r){let n,o;if(typeof t=="string"){const s=pe(t);if(!s)return r(void 0,424),He;o=s.send;const a=Bn(t);a&&(n=a.redundancy)}else{const s=ve(t);if(s){n=Ir(s);const a=t.resources?t.resources[0]:"",l=pe(a);l&&(o=l.send)}}return!n||!o?(r(void 0,424),He):n.query(e,o,r)().abort}function Ve(){}function Hn(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,An(t)}))}function Vn(t){const e=[],r=[];return t.forEach(n=>{(n.match(vr)?e:r).push(n)}),{valid:e,invalid:r}}function Pt(t,e,r){function n(){const o=t.pendingIcons;e.forEach(s=>{o&&o.delete(s),t.icons[s]||t.missing.add(s)})}if(r&&typeof r=="object")try{if(!br(t,r).length){n();return}}catch(o){console.error(o)}n(),Hn(t)}function Ye(t,e){t instanceof Promise?t.then(r=>{e(r)}).catch(()=>{e(null)}):e(t)}function Yn(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:r,prefix:n}=t,o=t.iconsToLoad;if(delete t.iconsToLoad,!o||!o.length)return;const s=t.loadIcon;if(t.loadIcons&&(o.length>1||!s)){Ye(t.loadIcons(o,n,r),f=>{Pt(t,o,f)});return}if(s){o.forEach(f=>{const p=s(f,n,r);Ye(p,h=>{const g=h?{prefix:n,icons:{[f]:h}}:null;Pt(t,[f],g)})});return}const{valid:a,invalid:l}=Vn(o);if(l.length&&Pt(t,l,null),!a.length)return;const c=n.match(vr)?pe(r):null;if(!c){Pt(t,a,null);return}c.prepare(r,n,a).forEach(f=>{Rn(r,f,p=>{Pt(t,f.icons,p)})})}))}const Jn=(t,e)=>{const r=Mn(t,!0,kr()),n=Dn(r);if(!n.pending.length){let c=!0;return e&&setTimeout(()=>{c&&e(n.loaded,n.missing,n.pending,Ve)}),()=>{c=!1}}const o=Object.create(null),s=[];let a,l;return n.pending.forEach(c=>{const{provider:u,prefix:f}=c;if(f===l&&u===a)return;a=u,l=f,s.push(Ft(u,f));const p=o[u]||(o[u]=Object.create(null));p[f]||(p[f]=[])}),n.pending.forEach(c=>{const{provider:u,prefix:f,name:p}=c,h=Ft(u,f),g=h.pendingIcons||(h.pendingIcons=new Set);g.has(p)||(g.add(p),o[u][f].push(p))}),s.forEach(c=>{const u=o[c.provider][c.prefix];u.length&&Yn(c,u)}),e?zn(e,n,s):Ve};function Kn(t,e){const r={...t};for(const n in e){const o=e[n],s=typeof o;n in Sr?(o===null||o&&(s==="string"||s==="number"))&&(r[n]=o):s===typeof r[n]&&(r[n]=n==="rotate"?o%4:o)}return r}const Gn=/[\s,]+/;function Wn(t,e){e.split(Gn).forEach(r=>{switch(r.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}function Qn(t,e=0){const r=t.replace(/^-?[0-9.]*/,"");function n(o){for(;o<0;)o+=4;return o%4}if(r===""){const o=parseInt(t);return isNaN(o)?0:n(o)}else if(r!==t){let o=0;switch(r){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(t.slice(0,t.length-r.length));return isNaN(s)?0:(s=s/o,s%1===0?n(s):0)}}return e}function Xn(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+t+"</svg>"}function Zn(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function to(t){return"data:image/svg+xml,"+Zn(t)}function eo(t){return'url("'+to(t)+'")'}let Lt;function ro(){try{Lt=window.trustedTypes.createPolicy("iconify",{createHTML:t=>t})}catch{Lt=null}}function no(t){return Lt===void 0&&ro(),Lt?Lt.createHTML(t):t}const _r={...jr,inline:!1},oo={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},so={display:"inline-block"},he={backgroundColor:"currentColor"},Fr={backgroundColor:"transparent"},Je={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Ke={WebkitMask:he,mask:he,background:Fr};for(const t in Ke){const e=Ke[t];for(const r in Je)e[t+r]=Je[r]}const ao={..._r,inline:!0};function Ge(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}const io=(t,e,r)=>{const n=e.inline?ao:_r,o=Kn(n,e),s=e.mode||"svg",a={},l=e.style||{},c={...s==="svg"?oo:{}};if(r){const m=Xt(r,!1,!0);if(m){const b=["iconify"],q=["provider","prefix"];for(const T of q)m[T]&&b.push("iconify--"+m[T]);c.className=b.join(" ")}}for(let m in e){const b=e[m];if(b!==void 0)switch(m){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":case"fallback":break;case"_ref":c.ref=b;break;case"className":c[m]=(c[m]?c[m]+" ":"")+b;break;case"inline":case"hFlip":case"vFlip":o[m]=b===!0||b==="true"||b===1;break;case"flip":typeof b=="string"&&Wn(o,b);break;case"color":a.color=b;break;case"rotate":typeof b=="string"?o[m]=Qn(b):typeof b=="number"&&(o[m]=b);break;case"ariaHidden":case"aria-hidden":b!==!0&&b!=="true"&&delete c["aria-hidden"];break;default:n[m]===void 0&&(c[m]=b)}}const u=vn(t,o),f=u.attributes;if(o.inline&&(a.verticalAlign="-0.125em"),s==="svg"){c.style={...a,...l},Object.assign(c,f);let m=0,b=e.id;return typeof b=="string"&&(b=b.replace(/-/g,"_")),c.dangerouslySetInnerHTML={__html:no(Cn(u.body,b?()=>b+"ID"+m++:"iconifyReact"))},k.createElement("svg",c)}const{body:p,width:h,height:g}=t,v=s==="mask"||(s==="bg"?!1:p.indexOf("currentColor")!==-1),I=Xn(p,{...f,width:h+"",height:g+""});return c.style={...a,"--svg":eo(I),width:Ge(f.width),height:Ge(f.height),...so,...v?he:Fr,...l},k.createElement("span",c)};kr(!0);In("",$n);if(typeof document<"u"&&typeof window<"u"){const t=window;if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(n=>{try{(typeof n!="object"||n===null||n instanceof Array||typeof n.icons!="object"||typeof n.prefix!="string"||!hn(n))&&console.error(r)}catch{console.error(r)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(let r in e){const n="IconifyProviders["+r+"] is invalid.";try{const o=e[r];if(typeof o!="object"||!o||o.resources===void 0)continue;_n(r,o)||console.error(n)}catch{console.error(n)}}}}function Nr(t){const[e,r]=k.useState(!!t.ssr),[n,o]=k.useState({});function s(g){if(g){const v=t.icon;if(typeof v=="object")return{name:"",data:v};const I=Ue(v);if(I)return{name:v,data:I}}return{name:""}}const[a,l]=k.useState(s(!!t.ssr));function c(){const g=n.callback;g&&(g(),o({}))}function u(g){if(JSON.stringify(a)!==JSON.stringify(g))return c(),l(g),!0}function f(){var g;const v=t.icon;if(typeof v=="object"){u({name:"",data:v});return}const I=Ue(v);if(u({name:v,data:I}))if(I===void 0){const m=Jn([v],f);o({callback:m})}else I&&((g=t.onLoad)===null||g===void 0||g.call(t,v))}k.useEffect(()=>(r(!0),c),[]),k.useEffect(()=>{e&&f()},[t.icon,e]);const{name:p,data:h}=a;return h?io({...be,...h},t,p):t.children?t.children:t.fallback?t.fallback:k.createElement("span",{})}const We=k.forwardRef((t,e)=>Nr({...t,_ref:e}));k.forwardRef((t,e)=>Nr({inline:!0,...t,_ref:e}));function co(){const t=()=>window.innerWidth<425?1:window.innerWidth<768?2:4,[e,r]=k.useState(t);return k.useEffect(()=>{const n=()=>r(t());return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}const lo=({product:t})=>{const e=gt.useDispatch(),r=co(),[n,o]=k.useState(0),s=()=>{o(c=>c+r>=t.length?0:c+r)},a=()=>{o(c=>c-r<0?t.length-(t.length%r||r):c-r)},l=async c=>{const u=await mr(c);e(ue(u))};return i.jsx("div",{className:"mt-2 overflow-x-hidden",children:i.jsxs("div",{className:"flex items-center justify-center gap-4 relative",children:[(t==null?void 0:t.length)>r&&i.jsx("button",{onClick:a,className:"absolute z-50 left-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",children:i.jsx(We,{icon:"mdi:chevron-left",width:"25"})}),i.jsx("div",{className:"flex gap-5 justify-center flex-1 overflow-hidden",children:t.slice(n,n+r).map(c=>{var u,f,p,h;return i.jsxs("div",{className:"flex-shrink-0 flex flex-col w-[150px] h-[200px] p-2 items-center justify-between cursor-pointer bg-[#FFFFFF] rounded-[10px] shadow-[0px_2px_2px_0px_#9292BC40]",onClick:()=>{l(c.product_id??c.productId)},children:[i.jsx("div",{className:"w-full p-2 flex items-center justify-center bg-white",children:i.jsx("img",{src:((u=Le(c)[0])==null?void 0:u.link)||Le(c)[0]||"https://via.placeholder.com/120",alt:c!=null&&c.productName?c.productName:"Product",className:"w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"})}),i.jsxs("div",{className:"text-white w-full p-2 text-[12px] text-center h-[60px]",children:[i.jsxs("div",{className:"relative inline-block group",children:[i.jsx("div",{className:"w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans",children:c!=null&&c.productName?c.productName:c!=null&&c.product_name?c.product_name:De(Ae((f=c==null?void 0:c.name)==null?void 0:f["en-US"]),60)||"Product"}),i.jsx("div",{className:"absolute left-0 top-full mt-1 w-max max-w-[200px] p-2 bg-white shadow-lg text-black text-xs rounded opacity-0 transition-opacity duration-300 group-hover:opacity-100 z-50 pointer-events-auto",style:{position:"absolute",top:"-100%",left:"0",marginBottom:"5px",zIndex:50},children:c!=null&&c.productName?c.productName:c!=null&&c.product_name?c.product_name:De(Ae((p=c==null?void 0:c.name)==null?void 0:p["en-US"]),60)||"Product"})]}),i.jsxs("div",{className:" flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1",children:[i.jsx("p",{children:on(c!=null&&c.price?Number(c==null?void 0:c.price):ze(c).centAmount||0,(h=ze(c))==null?void 0:h.currencyCode)}),i.jsxs("p",{className:"text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate",children:["$",Number(c==null?void 0:c.price).toFixed(2)??5]})]})]})]},c.productId)})}),(t==null?void 0:t.length)>r&&i.jsx("button",{onClick:s,className:"absolute z-50 right-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",children:i.jsx(We,{icon:"mdi:chevron-right",width:"25"})})]})})},uo=({chat:t,storeDetails:e})=>i.jsx("div",{className:"bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full",children:t.map((r,n)=>i.jsxs("div",{className:"mb-4 p-3 rounded-xl",style:{background:"linear-gradient(109.52deg, #F0EEF5 36.91%, #F4F3EE 100.34%"},children:[i.jsx("div",{className:"font-nunitoSans font-bold text-sm text-[#494949] p-2 w-fit rounded-[20px]",children:sn(r.keyword)||"No keyword"}),i.jsx(lo,{product:r.items,storeDetails:e})]},n))}),Er=async(t,e)=>{const{serverUrl:r,basePath:n}=mt(),o=`${r}`;console.log(`customer_token
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),i=require("react/jsx-runtime"),Yt=require("@apollo/client"),gt=require("react-redux"),ye=require("@reduxjs/toolkit"),Vr=require("@radix-ui/react-popover");require("clsx");require("tailwind-merge");const M=require("axios");require("crypto-js");const Oe=require("@iconify/react"),Q=require("react-toastify");function Yr(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const dr=Yr(Vr),Jr='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.top-full{top:100%}.z-40{z-index:40}.z-50{z-index:50}.m-1{margin:.25rem}.m-3{margin:.75rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.mb-1{margin-bottom:.25rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-24{margin-bottom:6rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.h-12{height:3rem}.h-28{height:7rem}.h-3{height:.75rem}.h-6{height:1.5rem}.h-\\[120px\\]{height:120px}.h-\\[200px\\]{height:200px}.h-\\[60px\\]{height:60px}.h-\\[90vh\\]{height:90vh}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.w-28{width:7rem}.w-3{width:.75rem}.w-5\\/6{width:83.333333%}.w-6{width:1.5rem}.w-72{width:18rem}.w-\\[100vw\\]{width:100vw}.w-\\[120px\\]{width:120px}.w-\\[150px\\]{width:150px}.w-\\[60px\\]{width:60px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[75\\%\\]{max-width:75%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[5px\\]{border-radius:5px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:.75rem}.rounded-l-\\[20px\\]{border-top-left-radius:20px;border-bottom-left-radius:20px}.rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-r-xl{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-bl-2xl{border-bottom-left-radius:1rem}.rounded-br-xl{border-bottom-right-radius:.75rem}.rounded-tr-\\[20px\\]{border-top-right-radius:20px}.rounded-tr-\\[5px\\]{border-top-right-radius:5px}.border{border-width:1px}.border-0{border-width:0px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-t-2{border-top-width:2px}.border-none{border-style:none}.border-\\[\\#C9C2DE\\]{--tw-border-opacity: 1;border-color:rgb(201 194 222 / var(--tw-border-opacity, 1))}.border-\\[\\#E5E5E5\\]{--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.bg-\\[\\#553D94\\]{--tw-bg-opacity: 1;background-color:rgb(85 61 148 / var(--tw-bg-opacity, 1))}.bg-\\[\\#6851C6\\]{--tw-bg-opacity: 1;background-color:rgb(104 81 198 / var(--tw-bg-opacity, 1))}.bg-\\[\\#804C9E0D\\]{background-color:#804c9e0d}.bg-\\[\\#A21CAF\\]{--tw-bg-opacity: 1;background-color:rgb(162 28 175 / var(--tw-bg-opacity, 1))}.bg-\\[\\#AB192D\\]{--tw-bg-opacity: 1;background-color:rgb(171 25 45 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E2DBFF\\]{--tw-bg-opacity: 1;background-color:rgb(226 219 255 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E3DEEF\\]{--tw-bg-opacity: 1;background-color:rgb(227 222 239 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F3F3F3\\]{--tw-bg-opacity: 1;background-color:rgb(243 243 243 / var(--tw-bg-opacity, 1))}.bg-\\[\\#FFFFFF\\],.bg-\\[\\#ffffff\\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-black\\/30{background-color:#0000004d}.bg-indigo-300{--tw-bg-opacity: 1;background-color:rgb(165 180 252 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\\[1px\\]{padding:1px}.p-\\[5px\\]{padding:5px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pl-2{padding-left:.5rem}.pr-5{padding-right:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-nunitoSans{font-family:Nunito Sans}.text-\\[12px\\]{font-size:12px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-snug{line-height:1.375}.text-\\[\\#000000\\]{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-\\[\\#14121F\\]{--tw-text-opacity: 1;color:rgb(20 18 31 / var(--tw-text-opacity, 1))}.text-\\[\\#18181B\\]{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.text-\\[\\#232323\\]{--tw-text-opacity: 1;color:rgb(35 35 35 / var(--tw-text-opacity, 1))}.text-\\[\\#323135\\]{--tw-text-opacity: 1;color:rgb(50 49 53 / var(--tw-text-opacity, 1))}.text-\\[\\#494949\\]{--tw-text-opacity: 1;color:rgb(73 73 73 / var(--tw-text-opacity, 1))}.text-\\[\\#555555\\]{--tw-text-opacity: 1;color:rgb(85 85 85 / var(--tw-text-opacity, 1))}.text-\\[\\#5B5B5B\\]{--tw-text-opacity: 1;color:rgb(91 91 91 / var(--tw-text-opacity, 1))}.text-\\[\\#68656E\\]{--tw-text-opacity: 1;color:rgb(104 101 110 / var(--tw-text-opacity, 1))}.text-\\[\\#959595\\]{--tw-text-opacity: 1;color:rgb(149 149 149 / var(--tw-text-opacity, 1))}.text-\\[\\#EC5050\\]{--tw-text-opacity: 1;color:rgb(236 80 80 / var(--tw-text-opacity, 1))}.text-\\[\\#FBFBFC\\]{--tw-text-opacity: 1;color:rgb(251 251 252 / var(--tw-text-opacity, 1))}.text-\\[\\#FFFFFF\\]{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-80{opacity:.8}.shadow-\\[0px_2px_2px_0px_\\#9292BC40\\]{--tw-shadow: 0px 2px 2px 0px #9292BC40;--tw-shadow-colored: 0px 2px 2px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0px_4px_10px_0px_\\#5F499840\\]{--tw-shadow: 0px 4px 10px 0px #5F499840;--tw-shadow-colored: 0px 4px 10px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.running{animation-play-state:running}html,body,#root{margin:0;padding:0}:root{line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;padding:0}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.hover\\:scale-125:hover{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:text-\\[\\#6952C7\\]:hover{--tw-text-opacity: 1;color:rgb(105 82 199 / var(--tw-text-opacity, 1))}.hover\\:opacity-90:hover{opacity:.9}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}@media(min-width:640px){.sm\\:w-\\[80vw\\]{width:80vw}}@media(min-width:768px){.md\\:h-\\[100vh\\]{height:100vh}.md\\:w-1\\/2{width:50%}.md\\:w-\\[770px\\]{width:770px}.md\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:flex-row{flex-direction:row}}@media(min-width:1024px){.lg\\:h-\\[100vh\\]{height:100vh}.lg\\:w-1\\/2{width:50%}.lg\\:w-2\\/3{width:66.666667%}.lg\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:flex-row{flex-direction:row}.lg\\:rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.lg\\:rounded-bl-xl{border-bottom-left-radius:.75rem}}';function Kr(){return k.useEffect(()=>{if(typeof document<"u"){const t=document.createElement("style");return t.textContent=Jr,document.head.appendChild(t),()=>{document.head.removeChild(t)}}},[]),null}const Gr={store:{storeCode:"",storeName:"",storeDescription:"",activeCatalogId:0,isDefault:!1,logoDarkBg:"",logoLightBg:"",logoTransparent:"",catalogs:[],themeColor:"",themeContrastColor:"",tanyaThemeColor:"",tanyaThemeColorLight:"",favicon:"",websiteTitle:"",flowId:"",aliasId:"",searchConfigs:{endpoint:"",accessKey:"",secretKey:""},homePageCategories:[],carouselImages:{web:[],mobile:[]},otherImages:{web:[],mobile:[]}}},fr=ye.createSlice({name:"store",initialState:Gr,reducers:{setStore:(t,e)=>{t.store=e.payload}}}),{setStore:Ko}=fr.actions,Wr=fr.reducer,Qr={product:null},pr=ye.createSlice({name:"product",initialState:Qr,reducers:{setProduct:(t,e)=>{t.product=e.payload}}}),{setProduct:ue}=pr.actions,Xr=pr.reducer,Zr=ye.configureStore({reducer:{store:Wr,product:Xr}}),tn=({children:t})=>i.jsx(gt.Provider,{store:Zr,children:t}),It=t=>{const e=new CustomEvent("reactCartUpdated",{detail:{cartUpdated:!0,basketId:t}});window.dispatchEvent(e)};function en({...t}){return i.jsx(dr.Root,{"data-slot":"popover",...t})}function rn({...t}){return i.jsx(dr.Trigger,{"data-slot":"popover-trigger",...t})}const mt=()=>({aiConversationUrl:"https://mdv3qwfi2j.execute-api.us-east-1.amazonaws.com/dev/api/bedrock/invoke/stream",xAPIKey:"BJBtjpPkqGatuoa3qJqdR8aHXSsHkgvGaootbubi",serverUrl:"https://tanya-sfcc-server.vercel.app/",basePath:"sc-api"}),hr=async()=>{const t="https://tanya-sfcc-server.vercel.app/";try{const e=await M.post(`${t}api/auth/token-bm-grant?baseUrl=${it()}&siteId=${et()}`);return e.status===200&&e.data.access_token?e.data.access_token:(console.error("Failed to fetch token:",e.data),null)}catch(e){return M.isAxiosError(e)?console.error("Error fetching token:",e.response||e.message):console.error("Unexpected error:",e),null}},gr=async t=>{const e="https://tanya-sfcc-server.vercel.app/";try{const r=JSON.parse(sessionStorage.getItem("customerData")||"{}").dwsid,n=await M.post(`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${it()}&siteId=${et()}&pubCfg=${ct()}&envRef=${lt()}&orgRef=${ut()}`,{},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});return n.status===200&&n.data?n.data:null}catch(r){return M.isAxiosError(r)?console.error("Error creating basket:",r.response||r.message):console.error("Unexpected error:",r),null}};async function Qt(){const t=localStorage.getItem("expires_in"),e=localStorage.getItem("access_token"),r=JSON.parse(sessionStorage.getItem("customerData")||"{}").isGuest;if(t&&e&&new Date().getTime()<parseInt(t)&&r===JSON.parse(localStorage.getItem("isGuest")||"false"))return console.log("access token found in local storage"),{access_token:e,expires_in:t};const{serverUrl:n}=mt(),o=JSON.parse(sessionStorage.getItem("customerData")||"{}").dwsid,s=JSON.parse(sessionStorage.getItem("customerData")||"{}").usrRef;try{const a=r?"unregister-auth":"register-auth",l=await M.get(`${n}sc-api/${a}?dwsid=${o}&email=${s}&pubCfg=${ct()}&envRef=${lt()}&orgRef=${ut()}&siteId=${et()}`);return localStorage.setItem("access_token",l.data.access_token),localStorage.setItem("expires_in",String(new Date().getTime()+l.data.expires_in*1e3)),localStorage.setItem("isGuest",r.toString()),console.log(l.data),l.data}catch(a){console.log(a)}}const it=()=>sessionStorage.getItem("Host"),et=()=>sessionStorage.getItem("SiteId"),ct=()=>sessionStorage.getItem("pubCfg"),lt=()=>sessionStorage.getItem("envRef"),ut=()=>sessionStorage.getItem("orgRef"),$e=async(t,e)=>{const{serverUrl:r,basePath:n}=mt();try{const o=it();return(await M.get(`${r}${n}/search-sfcc?baseUrl=${o}&query=${t}&siteId=${et()}&pubCfg=${ct()}&envRef=${lt()}&orgRef=${ut()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}})).data.hits}catch(o){throw console.error("Error fetching search results:",o),o}},mr=async t=>{if(!t)throw new Error("Product ID is required");const{serverUrl:e,basePath:r}=mt(),n=it();console.log("calling access");const{access_token:o}=await Qt();return console.log(o),(await M.get(`${e}${r}/product-sfcc/${t}?baseUrl=${n}&siteId=${et()}&pubCfg=${ct()}&envRef=${lt()}&orgRef=${ut()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}})).data},nn=async t=>{if(!t)throw new Error("customerId is required");const e=await hr(),{customer_token:r}=await gr(e),{serverUrl:n,basePath:o}=mt(),a=(await Qt()).access_token;return(await M.get(`${n}${o}/get-interest?baseUrl=${it()}&customerId=${t}&siteId=${et()}&pubCfg=${ct()}&envRef=${lt()}&orgRef=${ut()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`}})).data},Ae=t=>String(typeof t=="string"?t:t["en-US"]||t),Le=t=>t!=null&&t.image?[t.image]:"variants"in t?t.variants[0].images:t.masterVariant.images.map(e=>e.url),on=(t,e)=>t.toLocaleString("en-US",{style:"currency",currency:e||"USD"}),ze=t=>{var e,r,n;return"variants"in t?{centAmount:(e=t.variants[0])==null?void 0:e.prices.EUR.max,currencyCode:"DOL"}:{centAmount:(r=t.masterVariant)==null?void 0:r.prices[0].value.centAmount,currencyCode:(n=t.masterVariant)==null?void 0:n.prices[0].value.currencyCode}},sn=t=>t.charAt(0).toUpperCase()+t.slice(1),De=(t,e)=>t.length<e?t:t.slice(0,e)+"...",ne=t=>t.split("\\n").map((e,r)=>{const n=e.match(/^(\d+)\.\s(.+)/);return n?`<p key=${r} class="mb-2"><strong>${n[1]}.</strong> ${n[2]}</p>`:e.trim()?`<p key=${r} class="mb-2">${e}</p>`:"<br/>"}).join("");function an(t,e){const r=t.icons,n=t.aliases||Object.create(null),o=Object.create(null);function s(a){if(r[a])return o[a]=[];if(!(a in o)){o[a]=null;const l=n[a]&&n[a].parent,c=l&&s(l);c&&(o[a]=[l].concat(c))}return o[a]}return Object.keys(r).concat(Object.keys(n)).forEach(s),o}const wr=Object.freeze({left:0,top:0,width:16,height:16}),Jt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),be=Object.freeze({...wr,...Jt}),de=Object.freeze({...be,body:"",hidden:!1});function cn(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function Me(t,e){const r=cn(t,e);for(const n in de)n in Jt?n in t&&!(n in r)&&(r[n]=Jt[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function ln(t,e,r){const n=t.icons,o=t.aliases||Object.create(null);let s={};function a(l){s=Me(n[l]||o[l],s)}return a(e),r.forEach(a),Me(t,s)}function xr(t,e){const r=[];if(typeof t!="object"||typeof t.icons!="object")return r;t.not_found instanceof Array&&t.not_found.forEach(o=>{e(o,null),r.push(o)});const n=an(t);for(const o in n){const s=n[o];s&&(e(o,ln(t,o,s)),r.push(o))}return r}const un={provider:"",aliases:{},not_found:{},...wr};function oe(t,e){for(const r in e)if(r in t&&typeof t[r]!=typeof e[r])return!1;return!0}function yr(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!oe(t,un))return null;const r=e.icons;for(const o in r){const s=r[o];if(!o||typeof s.body!="string"||!oe(s,de))return null}const n=e.aliases||Object.create(null);for(const o in n){const s=n[o],a=s.parent;if(!o||typeof a!="string"||!r[a]&&!n[a]||!oe(s,de))return null}return e}const qe=Object.create(null);function dn(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function Ft(t,e){const r=qe[t]||(qe[t]=Object.create(null));return r[e]||(r[e]=dn(t,e))}function br(t,e){return yr(e)?xr(e,(r,n)=>{n?t.icons[r]=n:t.missing.add(r)}):[]}function fn(t,e,r){try{if(typeof r.body=="string")return t.icons[e]={...r},!0}catch{}return!1}const vr=/^[a-z0-9]+(-[a-z0-9]+)*$/,Xt=(t,e,r,n="")=>{const o=t.split(":");if(t.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;n=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const l=o.pop(),c=o.pop(),u={provider:o.length>0?o[0]:n,prefix:c,name:l};return e&&!Rt(u)?null:u}const s=o[0],a=s.split("-");if(a.length>1){const l={provider:n,prefix:a.shift(),name:a.join("-")};return e&&!Rt(l)?null:l}if(r&&n===""){const l={provider:n,prefix:"",name:s};return e&&!Rt(l,r)?null:l}return null},Rt=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;let zt=!1;function kr(t){return typeof t=="boolean"&&(zt=t),zt}function Ue(t){const e=typeof t=="string"?Xt(t,!0,zt):t;if(e){const r=Ft(e.provider,e.prefix),n=e.name;return r.icons[n]||(r.missing.has(n)?null:void 0)}}function pn(t,e){const r=Xt(t,!0,zt);if(!r)return!1;const n=Ft(r.provider,r.prefix);return e?fn(n,r.name,e):(n.missing.add(r.name),!0)}function hn(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),zt&&!e&&!t.prefix){let o=!1;return yr(t)&&(t.prefix="",xr(t,(s,a)=>{pn(s,a)&&(o=!0)})),o}const r=t.prefix;if(!Rt({prefix:r,name:"a"}))return!1;const n=Ft(e,r);return!!br(n,t)}const Sr=Object.freeze({width:null,height:null}),jr=Object.freeze({...Sr,...Jt}),gn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,mn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Be(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(gn);if(n===null||!n.length)return t;const o=[];let s=n.shift(),a=mn.test(s);for(;;){if(a){const l=parseFloat(s);isNaN(l)?o.push(s):o.push(Math.ceil(l*e*r)/r)}else o.push(s);if(s=n.shift(),s===void 0)return o.join("");a=!a}}function wn(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const o=t.indexOf(">",n),s=t.indexOf("</"+e);if(o===-1||s===-1)break;const a=t.indexOf(">",s);if(a===-1)break;r+=t.slice(o+1,s).trim(),t=t.slice(0,n).trim()+t.slice(a+1)}return{defs:r,content:t}}function xn(t,e){return t?"<defs>"+t+"</defs>"+e:e}function yn(t,e,r){const n=wn(t);return xn(n.defs,e+n.content+r)}const bn=t=>t==="unset"||t==="undefined"||t==="none";function vn(t,e){const r={...be,...t},n={...jr,...e},o={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,n].forEach(I=>{const m=[],b=I.hFlip,q=I.vFlip;let T=I.rotate;b?q?T+=2:(m.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),m.push("scale(-1 1)"),o.top=o.left=0):q&&(m.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),m.push("scale(1 -1)"),o.top=o.left=0);let $;switch(T<0&&(T-=Math.floor(T/4)*4),T=T%4,T){case 1:$=o.height/2+o.top,m.unshift("rotate(90 "+$.toString()+" "+$.toString()+")");break;case 2:m.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:$=o.width/2+o.left,m.unshift("rotate(-90 "+$.toString()+" "+$.toString()+")");break}T%2===1&&(o.left!==o.top&&($=o.left,o.left=o.top,o.top=$),o.width!==o.height&&($=o.width,o.width=o.height,o.height=$)),m.length&&(s=yn(s,'<g transform="'+m.join(" ")+'">',"</g>"))});const a=n.width,l=n.height,c=o.width,u=o.height;let f,p;a===null?(p=l===null?"1em":l==="auto"?u:l,f=Be(p,c/u)):(f=a==="auto"?c:a,p=l===null?Be(f,u/c):l==="auto"?u:l);const h={},g=(I,m)=>{bn(m)||(h[I]=m.toString())};g("width",f),g("height",p);const v=[o.left,o.top,c,u];return h.viewBox=v.join(" "),{attributes:h,viewBox:v,body:s}}const kn=/\sid="(\S+)"/g,Sn="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let jn=0;function Cn(t,e=Sn){const r=[];let n;for(;n=kn.exec(t);)r.push(n[1]);if(!r.length)return t;const o="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(s=>{const a=typeof e=="function"?e(s):e+(jn++).toString(),l=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+a+o+"$3")}),t=t.replace(new RegExp(o,"g"),""),t}const fe=Object.create(null);function In(t,e){fe[t]=e}function pe(t){return fe[t]||fe[""]}function ve(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const ke=Object.create(null),Tt=["https://api.simplesvg.com","https://api.unisvg.com"],Ht=[];for(;Tt.length>0;)Tt.length===1||Math.random()>.5?Ht.push(Tt.shift()):Ht.push(Tt.pop());ke[""]=ve({resources:["https://api.iconify.design"].concat(Ht)});function _n(t,e){const r=ve(e);return r===null?!1:(ke[t]=r,!0)}function Se(t){return ke[t]}const Fn=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}};let Re=Fn();function Nn(t,e){const r=Se(t);if(!r)return 0;let n;if(!r.maxURL)n=0;else{let o=0;r.resources.forEach(a=>{o=Math.max(o,a.length)});const s=e+".json?icons=";n=r.maxURL-o-r.path.length-s.length}return n}function En(t){return t===404}const Tn=(t,e,r)=>{const n=[],o=Nn(t,e),s="icons";let a={type:s,provider:t,prefix:e,icons:[]},l=0;return r.forEach((c,u)=>{l+=c.length+1,l>=o&&u>0&&(n.push(a),a={type:s,provider:t,prefix:e,icons:[]},l=c.length),a.icons.push(c)}),n.push(a),n};function Pn(t){if(typeof t=="string"){const e=Se(t);if(e)return e.path}return"/"}const On=(t,e,r)=>{if(!Re){r("abort",424);return}let n=Pn(e.provider);switch(e.type){case"icons":{const s=e.prefix,l=e.icons.join(","),c=new URLSearchParams({icons:l});n+=s+".json?"+c.toString();break}case"custom":{const s=e.uri;n+=s.slice(0,1)==="/"?s.slice(1):s;break}default:r("abort",400);return}let o=503;Re(t+n).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{r(En(a)?"abort":"next",a)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?r("abort",s):r("next",o)});return}setTimeout(()=>{r("success",s)})}).catch(()=>{r("next",o)})},$n={prepare:Tn,send:On};function Cr(t,e){t.forEach(r=>{const n=r.loaderCallbacks;n&&(r.loaderCallbacks=n.filter(o=>o.id!==e))})}function An(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let r=!1;const n=t.provider,o=t.prefix;e.forEach(s=>{const a=s.icons,l=a.pending.length;a.pending=a.pending.filter(c=>{if(c.prefix!==o)return!0;const u=c.name;if(t.icons[u])a.loaded.push({provider:n,prefix:o,name:u});else if(t.missing.has(u))a.missing.push({provider:n,prefix:o,name:u});else return r=!0,!0;return!1}),a.pending.length!==l&&(r||Cr([t],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let Ln=0;function zn(t,e,r){const n=Ln++,o=Cr.bind(null,r,n);if(!e.pending.length)return o;const s={id:n,icons:e,callback:t,abort:o};return r.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),o}function Dn(t){const e={loaded:[],missing:[],pending:[]},r=Object.create(null);t.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let n={provider:"",prefix:"",name:""};return t.forEach(o=>{if(n.name===o.name&&n.prefix===o.prefix&&n.provider===o.provider)return;n=o;const s=o.provider,a=o.prefix,l=o.name,c=r[s]||(r[s]=Object.create(null)),u=c[a]||(c[a]=Ft(s,a));let f;l in u.icons?f=e.loaded:a===""||u.missing.has(l)?f=e.missing:f=e.pending;const p={provider:s,prefix:a,name:l};f.push(p)}),e}function Mn(t,e=!0,r=!1){const n=[];return t.forEach(o=>{const s=typeof o=="string"?Xt(o,e,r):o;s&&n.push(s)}),n}const qn={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Un(t,e,r,n){const o=t.resources.length,s=t.random?Math.floor(Math.random()*o):t.index;let a;if(t.random){let S=t.resources.slice(0);for(a=[];S.length>1;){const L=Math.floor(Math.random()*S.length);a.push(S[L]),S=S.slice(0,L).concat(S.slice(L+1))}a=a.concat(S)}else a=t.resources.slice(s).concat(t.resources.slice(0,s));const l=Date.now();let c="pending",u=0,f,p=null,h=[],g=[];typeof n=="function"&&g.push(n);function v(){p&&(clearTimeout(p),p=null)}function I(){c==="pending"&&(c="aborted"),v(),h.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),h=[]}function m(S,L){L&&(g=[]),typeof S=="function"&&g.push(S)}function b(){return{startTime:l,payload:e,status:c,queriesSent:u,queriesPending:h.length,subscribe:m,abort:I}}function q(){c="failed",g.forEach(S=>{S(void 0,f)})}function T(){h.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),h=[]}function $(S,L,R){const H=L!=="success";switch(h=h.filter(P=>P!==S),c){case"pending":break;case"failed":if(H||!t.dataAfterTimeout)return;break;default:return}if(L==="abort"){f=R,q();return}if(H){f=R,h.length||(a.length?X():q());return}if(v(),T(),!t.random){const P=t.resources.indexOf(S.resource);P!==-1&&P!==t.index&&(t.index=P)}c="completed",g.forEach(P=>{P(R)})}function X(){if(c!=="pending")return;v();const S=a.shift();if(S===void 0){if(h.length){p=setTimeout(()=>{v(),c==="pending"&&(T(),q())},t.timeout);return}q();return}const L={status:"pending",resource:S,callback:(R,H)=>{$(L,R,H)}};h.push(L),u++,p=setTimeout(X,t.rotate),r(S,e,L.callback)}return setTimeout(X),b}function Ir(t){const e={...qn,...t};let r=[];function n(){r=r.filter(l=>l().status==="pending")}function o(l,c,u){const f=Un(e,l,c,(p,h)=>{n(),u&&u(p,h)});return r.push(f),f}function s(l){return r.find(c=>l(c))||null}return{query:o,find:s,setIndex:l=>{e.index=l},getIndex:()=>e.index,cleanup:n}}function He(){}const se=Object.create(null);function Bn(t){if(!se[t]){const e=Se(t);if(!e)return;const r=Ir(e),n={config:e,redundancy:r};se[t]=n}return se[t]}function Rn(t,e,r){let n,o;if(typeof t=="string"){const s=pe(t);if(!s)return r(void 0,424),He;o=s.send;const a=Bn(t);a&&(n=a.redundancy)}else{const s=ve(t);if(s){n=Ir(s);const a=t.resources?t.resources[0]:"",l=pe(a);l&&(o=l.send)}}return!n||!o?(r(void 0,424),He):n.query(e,o,r)().abort}function Ve(){}function Hn(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,An(t)}))}function Vn(t){const e=[],r=[];return t.forEach(n=>{(n.match(vr)?e:r).push(n)}),{valid:e,invalid:r}}function Pt(t,e,r){function n(){const o=t.pendingIcons;e.forEach(s=>{o&&o.delete(s),t.icons[s]||t.missing.add(s)})}if(r&&typeof r=="object")try{if(!br(t,r).length){n();return}}catch(o){console.error(o)}n(),Hn(t)}function Ye(t,e){t instanceof Promise?t.then(r=>{e(r)}).catch(()=>{e(null)}):e(t)}function Yn(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:r,prefix:n}=t,o=t.iconsToLoad;if(delete t.iconsToLoad,!o||!o.length)return;const s=t.loadIcon;if(t.loadIcons&&(o.length>1||!s)){Ye(t.loadIcons(o,n,r),f=>{Pt(t,o,f)});return}if(s){o.forEach(f=>{const p=s(f,n,r);Ye(p,h=>{const g=h?{prefix:n,icons:{[f]:h}}:null;Pt(t,[f],g)})});return}const{valid:a,invalid:l}=Vn(o);if(l.length&&Pt(t,l,null),!a.length)return;const c=n.match(vr)?pe(r):null;if(!c){Pt(t,a,null);return}c.prepare(r,n,a).forEach(f=>{Rn(r,f,p=>{Pt(t,f.icons,p)})})}))}const Jn=(t,e)=>{const r=Mn(t,!0,kr()),n=Dn(r);if(!n.pending.length){let c=!0;return e&&setTimeout(()=>{c&&e(n.loaded,n.missing,n.pending,Ve)}),()=>{c=!1}}const o=Object.create(null),s=[];let a,l;return n.pending.forEach(c=>{const{provider:u,prefix:f}=c;if(f===l&&u===a)return;a=u,l=f,s.push(Ft(u,f));const p=o[u]||(o[u]=Object.create(null));p[f]||(p[f]=[])}),n.pending.forEach(c=>{const{provider:u,prefix:f,name:p}=c,h=Ft(u,f),g=h.pendingIcons||(h.pendingIcons=new Set);g.has(p)||(g.add(p),o[u][f].push(p))}),s.forEach(c=>{const u=o[c.provider][c.prefix];u.length&&Yn(c,u)}),e?zn(e,n,s):Ve};function Kn(t,e){const r={...t};for(const n in e){const o=e[n],s=typeof o;n in Sr?(o===null||o&&(s==="string"||s==="number"))&&(r[n]=o):s===typeof r[n]&&(r[n]=n==="rotate"?o%4:o)}return r}const Gn=/[\s,]+/;function Wn(t,e){e.split(Gn).forEach(r=>{switch(r.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}function Qn(t,e=0){const r=t.replace(/^-?[0-9.]*/,"");function n(o){for(;o<0;)o+=4;return o%4}if(r===""){const o=parseInt(t);return isNaN(o)?0:n(o)}else if(r!==t){let o=0;switch(r){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(t.slice(0,t.length-r.length));return isNaN(s)?0:(s=s/o,s%1===0?n(s):0)}}return e}function Xn(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+t+"</svg>"}function Zn(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function to(t){return"data:image/svg+xml,"+Zn(t)}function eo(t){return'url("'+to(t)+'")'}let Lt;function ro(){try{Lt=window.trustedTypes.createPolicy("iconify",{createHTML:t=>t})}catch{Lt=null}}function no(t){return Lt===void 0&&ro(),Lt?Lt.createHTML(t):t}const _r={...jr,inline:!1},oo={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},so={display:"inline-block"},he={backgroundColor:"currentColor"},Fr={backgroundColor:"transparent"},Je={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Ke={WebkitMask:he,mask:he,background:Fr};for(const t in Ke){const e=Ke[t];for(const r in Je)e[t+r]=Je[r]}const ao={..._r,inline:!0};function Ge(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}const io=(t,e,r)=>{const n=e.inline?ao:_r,o=Kn(n,e),s=e.mode||"svg",a={},l=e.style||{},c={...s==="svg"?oo:{}};if(r){const m=Xt(r,!1,!0);if(m){const b=["iconify"],q=["provider","prefix"];for(const T of q)m[T]&&b.push("iconify--"+m[T]);c.className=b.join(" ")}}for(let m in e){const b=e[m];if(b!==void 0)switch(m){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":case"fallback":break;case"_ref":c.ref=b;break;case"className":c[m]=(c[m]?c[m]+" ":"")+b;break;case"inline":case"hFlip":case"vFlip":o[m]=b===!0||b==="true"||b===1;break;case"flip":typeof b=="string"&&Wn(o,b);break;case"color":a.color=b;break;case"rotate":typeof b=="string"?o[m]=Qn(b):typeof b=="number"&&(o[m]=b);break;case"ariaHidden":case"aria-hidden":b!==!0&&b!=="true"&&delete c["aria-hidden"];break;default:n[m]===void 0&&(c[m]=b)}}const u=vn(t,o),f=u.attributes;if(o.inline&&(a.verticalAlign="-0.125em"),s==="svg"){c.style={...a,...l},Object.assign(c,f);let m=0,b=e.id;return typeof b=="string"&&(b=b.replace(/-/g,"_")),c.dangerouslySetInnerHTML={__html:no(Cn(u.body,b?()=>b+"ID"+m++:"iconifyReact"))},k.createElement("svg",c)}const{body:p,width:h,height:g}=t,v=s==="mask"||(s==="bg"?!1:p.indexOf("currentColor")!==-1),I=Xn(p,{...f,width:h+"",height:g+""});return c.style={...a,"--svg":eo(I),width:Ge(f.width),height:Ge(f.height),...so,...v?he:Fr,...l},k.createElement("span",c)};kr(!0);In("",$n);if(typeof document<"u"&&typeof window<"u"){const t=window;if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(n=>{try{(typeof n!="object"||n===null||n instanceof Array||typeof n.icons!="object"||typeof n.prefix!="string"||!hn(n))&&console.error(r)}catch{console.error(r)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(let r in e){const n="IconifyProviders["+r+"] is invalid.";try{const o=e[r];if(typeof o!="object"||!o||o.resources===void 0)continue;_n(r,o)||console.error(n)}catch{console.error(n)}}}}function Nr(t){const[e,r]=k.useState(!!t.ssr),[n,o]=k.useState({});function s(g){if(g){const v=t.icon;if(typeof v=="object")return{name:"",data:v};const I=Ue(v);if(I)return{name:v,data:I}}return{name:""}}const[a,l]=k.useState(s(!!t.ssr));function c(){const g=n.callback;g&&(g(),o({}))}function u(g){if(JSON.stringify(a)!==JSON.stringify(g))return c(),l(g),!0}function f(){var g;const v=t.icon;if(typeof v=="object"){u({name:"",data:v});return}const I=Ue(v);if(u({name:v,data:I}))if(I===void 0){const m=Jn([v],f);o({callback:m})}else I&&((g=t.onLoad)===null||g===void 0||g.call(t,v))}k.useEffect(()=>(r(!0),c),[]),k.useEffect(()=>{e&&f()},[t.icon,e]);const{name:p,data:h}=a;return h?io({...be,...h},t,p):t.children?t.children:t.fallback?t.fallback:k.createElement("span",{})}const We=k.forwardRef((t,e)=>Nr({...t,_ref:e}));k.forwardRef((t,e)=>Nr({inline:!0,...t,_ref:e}));function co(){const t=()=>window.innerWidth<425?1:window.innerWidth<768?2:4,[e,r]=k.useState(t);return k.useEffect(()=>{const n=()=>r(t());return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}const lo=({product:t})=>{const e=gt.useDispatch(),r=co(),[n,o]=k.useState(0),s=()=>{o(c=>c+r>=t.length?0:c+r)},a=()=>{o(c=>c-r<0?t.length-(t.length%r||r):c-r)},l=async c=>{const u=await mr(c);e(ue(u))};return i.jsx("div",{className:"mt-2 overflow-x-hidden",children:i.jsxs("div",{className:"flex items-center justify-center gap-4 relative",children:[(t==null?void 0:t.length)>r&&i.jsx("button",{onClick:a,className:"absolute z-50 left-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",children:i.jsx(We,{icon:"mdi:chevron-left",width:"25"})}),i.jsx("div",{className:"flex gap-5 justify-center flex-1 overflow-hidden",children:t.slice(n,n+r).map(c=>{var u,f,p,h;return i.jsxs("div",{className:"flex-shrink-0 flex flex-col w-[150px] h-[200px] p-2 items-center justify-between cursor-pointer bg-[#FFFFFF] rounded-[10px] shadow-[0px_2px_2px_0px_#9292BC40]",onClick:()=>{l(c.product_id??c.productId)},children:[i.jsx("div",{className:"w-full p-2 flex items-center justify-center bg-white",children:i.jsx("img",{src:((u=Le(c)[0])==null?void 0:u.link)||Le(c)[0]||"https://via.placeholder.com/120",alt:c!=null&&c.productName?c.productName:"Product",className:"w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"})}),i.jsxs("div",{className:"text-white w-full p-2 text-[12px] text-center h-[60px]",children:[i.jsxs("div",{className:"relative inline-block group",children:[i.jsx("div",{className:"w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans",children:c!=null&&c.productName?c.productName:c!=null&&c.product_name?c.product_name:De(Ae((f=c==null?void 0:c.name)==null?void 0:f["en-US"]),60)||"Product"}),i.jsx("div",{className:"absolute left-0 top-full mt-1 w-max max-w-[200px] p-2 bg-white shadow-lg text-black text-xs rounded opacity-0 transition-opacity duration-300 group-hover:opacity-100 z-50 pointer-events-auto",style:{position:"absolute",top:"-100%",left:"0",marginBottom:"5px",zIndex:50},children:c!=null&&c.productName?c.productName:c!=null&&c.product_name?c.product_name:De(Ae((p=c==null?void 0:c.name)==null?void 0:p["en-US"]),60)||"Product"})]}),i.jsxs("div",{className:" flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1",children:[i.jsx("p",{children:on(c!=null&&c.price?Number(c==null?void 0:c.price):ze(c).centAmount||0,(h=ze(c))==null?void 0:h.currencyCode)}),i.jsxs("p",{className:"text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate",children:["$",Number(c==null?void 0:c.price).toFixed(2)??5]})]})]})]},c.productId)})}),(t==null?void 0:t.length)>r&&i.jsx("button",{onClick:s,className:"absolute z-50 right-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",children:i.jsx(We,{icon:"mdi:chevron-right",width:"25"})})]})})},uo=({chat:t,storeDetails:e})=>i.jsx("div",{className:"bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full",children:t.map((r,n)=>i.jsxs("div",{className:"mb-4 p-3 rounded-xl",style:{background:"linear-gradient(109.52deg, #F0EEF5 36.91%, #F4F3EE 100.34%"},children:[i.jsx("div",{className:"font-nunitoSans font-bold text-sm text-[#494949] p-2 w-fit rounded-[20px]",children:sn(r.keyword)||"No keyword"}),i.jsx(lo,{product:r.items,storeDetails:e})]},n))}),Er=async(t,e)=>{const{serverUrl:r,basePath:n}=mt(),o=`${r}`;console.log(`customer_token
2
2
  `,t);try{return(await M.post(`${o}${n}/basket/create?baseUrl=${it()}&siteId=${et()}&pubCfg=${ct()}&envRef=${lt()}&orgRef=${ut()}`,e,{headers:{"Content-Type":"application/json",Authorization:t}})).data}catch(s){return M.isAxiosError(s)?console.error("Error creating basket:",s.response||s.message):console.error("Unexpected error:",s),null}},Kt=async(t,e,r)=>{const{serverUrl:n,basePath:o}=mt(),s=`${n}`;try{const a=await M.post(`${s}${o}/basket/add-product/${t}?baseUrl=${it()}&siteId=${et()}&pubCfg=${ct()}&envRef=${lt()}&orgRef=${ut()}`,e,{headers:{"Content-Type":"application/json",Authorization:r}});return a.status===200&&a.data?a.data:null}catch(a){return M.isAxiosError(a)?console.error("Error adding products to basket:",a.response||a.message):console.error("Unexpected error:",a),null}},Tr=async({basketId:t,customer_token:e})=>{var s;const{serverUrl:r,basePath:n}=mt(),o=`${r}`;try{const a=await M.get(`${o}${n}/basket/${t}?baseUrl=${it()}&siteId=${et()}&pubCfg=${ct()}&envRef=${lt()}&orgRef=${ut()}`,{headers:{"Content-Type":"application/json",Authorization:e}});return{status:a.status,data:a.data}}catch(a){return M.isAxiosError(a)?{status:(s=a.response)==null?void 0:s.status,data:null}:{status:null,data:null}}},Qe="sfcc_basket_id",Xe="sfcc_customer_token",Dt="sfcc_token_expiry",fo=300*1e3,Ot="1.0.0";const _t=t=>{try{t?localStorage.setItem(Qe,t):localStorage.removeItem(Qe)}catch(e){console.error("Error saving basket ID to storage:",e)}},Gt=t=>{try{if(t){localStorage.setItem(Xe,t);const e=Date.now()+fo;localStorage.setItem(Dt,e.toString())}else localStorage.removeItem(Xe)}catch(e){console.error("Error storing token:",e)}},Ze=300,po=()=>{var l,c,u,f,p,h;const t=gt.useDispatch(),e=gt.useSelector(g=>g.product.product),r=gt.useSelector(g=>g.store.store),[n,o]=k.useState(!!e);if(k.useEffect(()=>{o(!!e)},[e]),!e)return null;const s=async()=>{var g,v,I,m,b,q,T,$,X,S,L,R,H,P,wt,E;console.log(e,"the prod");try{if(!((v=(g=e==null?void 0:e.variants)==null?void 0:g[0])!=null&&v.product_id)&&!(e.type.item||e.type.bundle)&&!((m=(I=e==null?void 0:e.variants)==null?void 0:I[0])!=null&&m.productId)){Q.toast.error("Variants not available",{position:"bottom-right",autoClose:1e3}),console.error("No product variant found");return}const O=[{product_id:((b=e.variants)==null?void 0:b[0].product_id)||((q=e.variants)==null?void 0:q[0].productId)||(e==null?void 0:e.id),quantity:1}];console.log(O,"the product data");const Et=JSON.parse(sessionStorage.getItem("customerData")||"{}"),dt=Et==null?void 0:Et.basketId,Zt=!1,rt=localStorage.getItem(Dt),ft=Date.now();if(!Zt||!rt||ft>=parseInt(rt)){let V="";{const xt=await Qt();console.log("token from auth data"),V="Bearer "+xt.access_token}if(!V){console.error("Failed to get customer_token");return}const te=ft+300*1e3;if(Gt(V),localStorage.setItem(Dt,te.toString()),dt){const xt=await Tr({basketId:dt,customer_token:V});if(console.log(dt,"basket id from customer"),xt.status===200&&xt){const nt=await Kt(dt,O,V);(((T=nt==null?void 0:nt.product_items)==null?void 0:T.length)>0||(($=nt==null?void 0:nt.productItems)==null?void 0:$.length)>0)&&(Q.toast.success("Added to cart",{position:"bottom-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0}),It(dt));return}}const ee={productItems:[{productId:((X=e.variants)==null?void 0:X[0].product_id)||((S=e.variants)==null?void 0:S[0].productId)||(e==null?void 0:e.id),quantity:1}]};console.log("before create basket");const x=await Er(V,ee);if(console.log(x,x==null?void 0:x.basket_id,x==null?void 0:x.basketId,"the basket response"),!(x!=null&&x.basket_id)&&!(x!=null&&x.basketId)){console.error("Failed to create basket");return}console.log("setting stored id",(x==null?void 0:x.basket_id)||(x==null?void 0:x.basketId)),_t((x==null?void 0:x.basket_id)||(x==null?void 0:x.basketId)),console.log("adding product to basket");const Y=await Kt((x==null?void 0:x.basket_id)||(x==null?void 0:x.basketId),O,V);console.log("object added to basket"),(((L=Y==null?void 0:Y.product_items)==null?void 0:L.length)>0||((R=Y==null?void 0:Y.productItems)==null?void 0:R.length)>0)&&Q.toast.success("Added to cart",{position:"bottom-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0}),It(x.basket_id||(x==null?void 0:x.basketId))}}catch(O){console.error("Error adding to cart:",O),Q.toast.error("Failed to add product to cart",{position:"bottom-right",autoClose:3e3}),((H=O==null?void 0:O.response)==null?void 0:H.status)===404||((P=O==null?void 0:O.response)==null?void 0:P.status)===401?(((wt=O==null?void 0:O.response)==null?void 0:wt.status)===404&&_t(null),((E=O==null?void 0:O.response)==null?void 0:E.status)===401&&(_t(null),Gt(null))):(console.error("Failed to add product to basket:",O.message),Q.toast.error("Failed to add product to cart",{position:"bottom-right",autoClose:3e3}))}finally{It()}},a=()=>{e&&(window.location.href=e.c_pdpUrl)};return console.log(e,"the prod"),i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 z-40 bg-black/30",onClick:()=>{o(!1),setTimeout(()=>t(ue(null)),Ze)}}),i.jsxs("div",{className:`
3
3
  flex flex-col gap-2 items-center h-[90vh] absolute right-0 bottom-0 z-50 w-full md:w-1/2 md:h-[100vh] lg:w-1/2 lg:h-[100vh] shadow-xl p-2 border-l-2 bg-white border-gray-200 overflow-y-scroll
4
4
  transition-all duration-300
@@ -17,5 +17,5 @@
17
17
  ${f?"translate-y-0":"translate-y-full"}
18
18
  lg:translate-y-0
19
19
  `,style:{background:"linear-gradient(170.1deg, #FFFFFF 60.03%, #E3DEEF 99.59%)"},children:[i.jsxs("div",{className:"flex justify-between p-3 bg-[#FFFFFF] border border-b-1 border-[#E5E5E5] ",children:[i.jsx("div",{style:{display:"flex",color:E.tanyaThemeContrastColor,alignItems:"center",gap:"0.5rem"},children:i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsxs("div",{className:"flex gap-2 w-28 h-12 text-center items-center p-2 border rounded-l-[20px] rounded-tr-[20px]",style:{background:"linear-gradient(265.62deg, #6851C6 5.24%, #8668FF 98.49%)"},children:[i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 15 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M15 4.48438V0.5C15 0.5 8.94395 1.4375 6.78127 4.25C4.61859 7.0625 5.33095 15.5 5.33095 15.5H9.19857C9.19857 15.5 8.72793 7.76562 10.1654 6.125C11.6029 4.48438 15 4.48438 15 4.48438Z",fill:"white"}),i.jsx("path",{d:"M0 0.5H6.28488V4.25H0V0.5Z",fill:"white"})]}),i.jsx("p",{className:"text-[#FFFFFF] font-nunitoSans font-semibold",children:"TANYA"})]}),i.jsxs("p",{className:"text-[#5B5B5B] font-nunitoSans font-semibold",style:{fontStyle:"italic"},children:[" ","Your AI shopping assistant !"," "]})]})}),i.jsx("div",{style:{display:"flex",alignItems:"center",gap:"1.25rem",margin:"0.75rem"},children:i.jsx("button",{onClick:()=>u(!1),children:i.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsxs("g",{clipPath:"url(#clip0_501_6036)",children:[i.jsx("path",{d:"M18 6.5L6 18.5",stroke:"#555555",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M6 6.5L18 18.5",stroke:"#555555",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_501_6036",children:i.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 0.5)"})})})]})})})]}),i.jsxs("div",{className:"flex h-full md:flex-row lg:flex-row",children:[i.jsxs("div",{className:`flex flex-col h-full ${O?"lg:w-2/3 w-full":"w-full"}`,children:[i.jsxs("div",{ref:wt,className:"overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",children:[(E==null?void 0:E.whomRequired)&&i.jsxs("div",{className:"mx-3 p-3 rounded-2xl bg-[#FFFFFF]",children:[i.jsx("div",{className:"flex gap-2 bg-[#FFFFFF]",children:i.jsx("p",{className:"font-bold font-nunitoSans text-[#494949]",children:"Is this for you or someone else?"})}),i.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:t.map(d=>i.jsx("button",{onClick:()=>Zt(d),className:"px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",style:{backgroundColor:S===e[d]?"#FFFFFF":"#F3F3F3",borderColor:S===e[d]?"#BBB3DD":""},children:d},d))})]}),H.map((d,N)=>{var C,F;return i.jsxs("div",{children:[i.jsx("div",{className:"flex justify-end",children:i.jsx("p",{className:"text-sm font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]",children:d.query})}),d.response&&d.response.includes("Thinking")?i.jsx("div",{children:i.jsx("div",{className:"font-nunitoSans animate-pulse font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",dangerouslySetInnerHTML:{__html:ne(d.response)}})}):i.jsx("div",{children:i.jsx("div",{className:"font-nunitoSans font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",dangerouslySetInnerHTML:{__html:ne(d.response)}})}),q&&!d.response.includes("Thinking")&&((C=d.products)==null?void 0:C.length)==0&&i.jsx("div",{children:i.jsx("p",{className:"text-sm animate-pulse font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]",children:"Finding best products for you"})}),(d==null?void 0:d.products)&&((F=d==null?void 0:d.products)==null?void 0:F.length)>0&&i.jsx(uo,{chat:d.products,storeDetails:E}),d.potentialQuestions.length>0&&i.jsxs("div",{className:"my-2 px-4 text-sm text-gray-700",children:[i.jsx("p",{className:"font-nunitoSans font-bold text-sm text-[#494949]",style:{color:E.themeDarkColor},children:"Why not explore these inquiries..."}),d.potentialQuestions.split(",").map((y,j)=>i.jsx("button",{className:`cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${E.themeDarkColor} m-1 rounded-xl px-2 py-1`,onClick:()=>Y(y),style:{backgroundColor:E.tanyaThemeColorLight},children:y},j))]}),d.secondaryLoading&&i.jsx("div",{className:"mt-3 mb-4 px-4",children:i.jsxs("div",{className:"tanya-surprise-wrapper bg-indigo-300 text-sm px-7 py-4 rounded-r-xl rounded-bl-2xl w-full relative overflow-hidden",style:{margin:"0.75rem"},children:[i.jsxs("div",{className:"flex gap-1",children:[i.jsx("div",{className:"tanya-sparkle tanya-sparkle-1",children:"✨"}),i.jsx("div",{className:"tanya-sparkle tanya-sparkle-2",children:"✨"}),i.jsx("div",{className:"tanya-sparkle tanya-sparkle-3",children:"✨"})]}),i.jsx("div",{className:"tanya-shimmer"}),i.jsx("p",{className:"font-semibold tanya-pulse",style:{color:E.themeDarkColor},children:"I’ve found a special surprise crafted just for you… hang on a sec!"}),i.jsx("p",{className:"tanya-dots mt-1",style:{color:E.themeDarkColor},children:"• • •"})]})}),d.secondaryResponse&&i.jsx(i.Fragment,{children:i.jsxs("div",{className:"mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]",children:[i.jsx("div",{className:"text-sm text-[#232323] bg-[#FFFFFF] px-7 py-4 rounded-br-xl rounded-bl-2xl w-full",style:{backgroundColor:E.tanyaThemeColorLight},dangerouslySetInnerHTML:{__html:ne(d.secondaryResponse)}}),d.productSnapshot&&i.jsx("div",{className:"mt-4 w-full",children:i.jsxs("div",{className:"flex gap-4 items-stretch rounded-2xl p-4",style:{backgroundColor:E.tanyaThemeColorLight},children:[i.jsx("div",{className:"flex-shrink-0 rounded-xl overflow-hidden border",style:{width:112,height:112,borderColor:"#eee"},children:d.productSnapshot.image?i.jsx("img",{src:d.productSnapshot.image,alt:d.productSnapshot.name,className:"w-full h-full object-cover"}):i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-gray-500",children:"No Image"})}),i.jsxs("div",{className:"flex flex-col flex-1 justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold text-[15px] leading-snug",children:d.productSnapshot.name}),i.jsx("p",{className:"mt-1 text-[14px] font-medium",children:d.productSnapshot.price!=null?new Intl.NumberFormat(void 0,{style:"currency",currency:(E==null?void 0:E.currency)||"USD"}).format(d.productSnapshot.price):""}),d.productSnapshot.points>0&&i.jsxs("p",{className:"mt-1 text-xs opacity-80",children:["You will earn"," ",i.jsxs("strong",{children:[d.productSnapshot.points," ","points"]})]})]}),i.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[i.jsxs("div",{className:"flex items-center border rounded-full overflow-hidden",children:[i.jsx("button",{className:"px-3 py-1 text-sm",onClick:()=>P(y=>y.map((j,B)=>B===N&&j.productSnapshot?{...j,productSnapshot:{...j.productSnapshot,quantity:Math.max(1,j.productSnapshot.quantity-1)}}:j)),style:{background:"transparent",color:E.themeDarkColor},children:"−"}),i.jsx("div",{className:"px-3 py-1 text-sm select-none",children:d.productSnapshot.quantity}),i.jsx("button",{className:"px-3 py-1 text-sm",onClick:()=>P(y=>y.map((j,B)=>B===N&&j.productSnapshot?{...j,productSnapshot:{...j.productSnapshot,quantity:j.productSnapshot.quantity+1}}:j)),style:{background:"transparent",color:E.themeDarkColor},children:"+"})]}),i.jsx("button",{onClick:()=>{Ur(R(d.productSnapshot),d.productSnapshot.quantity)},disabled:v,className:"px-4 py-2 rounded-full font-medium",style:{background:E.tanyaThemeColor,color:(E==null?void 0:E.tanyaThemeContrastColor)||"#fff",opacity:v?.8:1},children:v?"Adding...":"Add to cart"})]})]})]})})]})}),i.jsx("div",{className:"mb-20"})]},N)})]}),i.jsx("div",{className:"flex flex-col gap-2 sticky bottom-0 left-0 right-0 bg-[#E3DEEF] z-50 px-4 py-2",children:i.jsx("div",{className:"p-[1px] rounded-xl",style:{background:"linear-gradient(180deg, #B09FFF 0%, #8D79F6 100%)"},children:i.jsxs("div",{className:"flex items-center bg-[#FFFFFF] flex-1 rounded-xl px-2 py-1",children:[i.jsx("input",{className:"flex-1 bg-[#FFFFFF] text-[#232323] outline-none border-none px-2 py-2 text-sm",placeholder:"How can I help you...",value:$,autoFocus:!0,onChange:d=>X(d.target.value),onKeyDown:d=>{d.key==="Enter"&&!m&&Y()}}),i.jsx("button",{type:"submit",disabled:m,className:"p-3",onClick:()=>Y(),children:m?i.jsx("div",{className:"p-3 animate-spin rounded-full h-3 w-3 border-b-2",style:{borderBottom:"2px solid",color:E.tanyaThemeColor}}):i.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M16.6357 13.6701L18.3521 8.5208C19.8516 4.02242 20.6013 1.77322 19.414 0.585948C18.2268 -0.601312 15.9776 0.148418 11.4792 1.64788L6.32987 3.36432C2.69923 4.57453 0.883923 5.17964 0.368062 6.06698C-0.122688 6.91112 -0.122688 7.95369 0.368062 8.7978C0.883923 9.6852 2.69923 10.2903 6.32987 11.5005C6.77981 11.6505 7.28601 11.5434 7.62294 11.2096L13.1286 5.75495C13.4383 5.44808 13.9382 5.45041 14.245 5.76015C14.5519 6.06989 14.5496 6.56975 14.2398 6.87662L8.8231 12.2432C8.4518 12.6111 8.3342 13.1742 8.4995 13.6701C9.7097 17.3007 10.3148 19.1161 11.2022 19.6319C12.0463 20.1227 13.0889 20.1227 13.933 19.6319C14.8204 19.1161 15.4255 17.3008 16.6357 13.6701Z",fill:"#6952C7"})})})]})})})]}),i.jsx(po,{})]})]})]})]})})};var ge=function(t,e){return ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},ge(t,e)};function go(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ge(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var at=function(){return at=Object.assign||function(e){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},at.apply(this,arguments)};function mo(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]]);return r}var ae="Invariant Violation",tr=Object.setPrototypeOf,wo=tr===void 0?function(t,e){return t.__proto__=e,t}:tr,Pr=(function(t){go(e,t);function e(r){r===void 0&&(r=ae);var n=t.call(this,typeof r=="number"?ae+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=ae,wo(n,e.prototype),n}return e})(Error);function ht(t,e){if(!t)throw new Pr(e)}var Or=["debug","log","warn","error","silent"],xo=Or.indexOf("log");function qt(t){return function(){if(Or.indexOf(t)>=xo){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=qt("debug"),t.log=qt("log"),t.warn=qt("warn"),t.error=qt("error")})(ht||(ht={}));var $r="3.14.0";function jt(t){try{return t()}catch{}}const me=jt(function(){return globalThis})||jt(function(){return window})||jt(function(){return self})||jt(function(){return global})||jt(function(){return jt.constructor("return this")()});var er=new Map;function yo(t){var e=er.get(t)||1;return er.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function bo(t,e){var r=yo("stringifyForDisplay");return JSON.stringify(t,function(n,o){return o===void 0?r:o},e).split(JSON.stringify(r)).join("<undefined>")}function Ut(t){return function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(typeof e=="number"){var o=e;e=je(o),e||(e=Ce(o,r),r=[])}t.apply(void 0,[e].concat(r))}}var ie=Object.assign(function(e,r){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];e||ht(e,je(r,n)||Ce(r,n))},{debug:Ut(ht.debug),log:Ut(ht.log),warn:Ut(ht.warn),error:Ut(ht.error)});function Ar(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return new Pr(je(t,e)||Ce(t,e))}var rr=Symbol.for("ApolloErrorMessageHandler_"+$r);function Lr(t){if(typeof t=="string")return t;try{return bo(t,2).slice(0,1e3)}catch{return"<non-serializable>"}}function je(t,e){if(e===void 0&&(e=[]),!!t)return me[rr]&&me[rr](t,e.map(Lr))}function Ce(t,e){if(e===void 0&&(e=[]),!!t)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:$r,message:t,args:e.map(Lr)})))}function vo(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}let z=null;const nr={};let ko=1;const So=()=>class{constructor(){this.id=["slot",ko++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=z;e;e=e.parent)if(this.id in e.slots){const r=e.slots[this.id];if(r===nr)break;return e!==z&&(z.slots[this.id]=r),!0}return z&&(z.slots[this.id]=nr),!1}getValue(){if(this.hasValue())return z.slots[this.id]}withValue(e,r,n,o){const s={__proto__:null,[this.id]:e},a=z;z={parent:a,slots:s};try{return r.apply(o,n)}finally{z=a}}static bind(e){const r=z;return function(){const n=z;try{return z=r,e.apply(this,arguments)}finally{z=n}}}static noContext(e,r,n){if(z){const o=z;try{return z=null,e.apply(n,r)}finally{z=o}}else return e.apply(n,r)}};function or(t){try{return t()}catch{}}const ce="@wry/context:Slot",jo=or(()=>globalThis)||or(()=>global)||Object.create(null),sr=jo,Ie=sr[ce]||Array[ce]||(function(t){try{Object.defineProperty(sr,ce,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}})(So()),{bind:Wo,noContext:Qo}=Ie;new Ie;function Co(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=Io(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
20
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Io(t,e){if(t){if(typeof t=="string")return ar(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ar(t,e)}}function ar(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ir(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _e(t,e,r){return e&&ir(t.prototype,e),r&&ir(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Fe=function(){return typeof Symbol=="function"},Ne=function(t){return Fe()&&!!Symbol[t]},Ee=function(t){return Ne(t)?Symbol[t]:"@@"+t};Fe()&&!Ne("observable")&&(Symbol.observable=Symbol("observable"));var _o=Ee("iterator"),we=Ee("observable"),zr=Ee("species");function Wt(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function $t(t){var e=t.constructor;return e!==void 0&&(e=e[zr],e===null&&(e=void 0)),e!==void 0?e:D}function Fo(t){return t instanceof D}function Nt(t){Nt.log?Nt.log(t):setTimeout(function(){throw t})}function Vt(t){Promise.resolve().then(function(){try{t()}catch(e){Nt(e)}})}function Dr(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=Wt(e,"unsubscribe");r&&r.call(e)}}catch(n){Nt(n)}}function xe(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function No(t){var e=t._queue;if(e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(Mr(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function Mr(t,e,r){t._state="running";var n=t._observer;try{var o=Wt(n,e);switch(e){case"next":o&&o.call(n,r);break;case"error":if(xe(t),o)o.call(n,r);else throw r;break;case"complete":xe(t),o&&o.call(n);break}}catch(s){Nt(s)}t._state==="closed"?Dr(t):t._state==="running"&&(t._state="ready")}function le(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],Vt(function(){return No(t)});return}Mr(t,e,r)}}var Eo=(function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var o=new To(this);try{this._cleanup=n.call(void 0,o)}catch(s){o.error(s)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(xe(this),Dr(this))},_e(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t})(),To=(function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){le(this._subscription,"next",n)},e.error=function(n){le(this._subscription,"error",n)},e.complete=function(){le(this._subscription,"complete")},_e(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t})(),D=(function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new Eo(n,this._subscriber)},e.forEach=function(n){var o=this;return new Promise(function(s,a){if(typeof n!="function"){a(new TypeError(n+" is not a function"));return}function l(){c.unsubscribe(),s()}var c=o.subscribe({next:function(u){try{n(u,l)}catch(f){a(f),c.unsubscribe()}},error:a,complete:s})})},e.map=function(n){var o=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var s=$t(this);return new s(function(a){return o.subscribe({next:function(l){try{l=n(l)}catch(c){return a.error(c)}a.next(l)},error:function(l){a.error(l)},complete:function(){a.complete()}})})},e.filter=function(n){var o=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var s=$t(this);return new s(function(a){return o.subscribe({next:function(l){try{if(!n(l))return}catch(c){return a.error(c)}a.next(l)},error:function(l){a.error(l)},complete:function(){a.complete()}})})},e.reduce=function(n){var o=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var s=$t(this),a=arguments.length>1,l=!1,c=arguments[1],u=c;return new s(function(f){return o.subscribe({next:function(p){var h=!l;if(l=!0,!h||a)try{u=n(u,p)}catch(g){return f.error(g)}else u=p},error:function(p){f.error(p)},complete:function(){if(!l&&!a)return f.error(new TypeError("Cannot reduce an empty sequence"));f.next(u),f.complete()}})})},e.concat=function(){for(var n=this,o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var l=$t(this);return new l(function(c){var u,f=0;function p(h){u=h.subscribe({next:function(g){c.next(g)},error:function(g){c.error(g)},complete:function(){f===s.length?(u=void 0,c.complete()):p(l.from(s[f++]))}})}return p(n),function(){u&&(u.unsubscribe(),u=void 0)}})},e.flatMap=function(n){var o=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var s=$t(this);return new s(function(a){var l=[],c=o.subscribe({next:function(f){if(n)try{f=n(f)}catch(h){return a.error(h)}var p=s.from(f).subscribe({next:function(h){a.next(h)},error:function(h){a.error(h)},complete:function(){var h=l.indexOf(p);h>=0&&l.splice(h,1),u()}});l.push(p)},error:function(f){a.error(f)},complete:function(){u()}});function u(){c.closed&&l.length===0&&a.complete()}return function(){l.forEach(function(f){return f.unsubscribe()}),c.unsubscribe()}})},e[we]=function(){return this},t.from=function(n){var o=typeof this=="function"?this:t;if(n==null)throw new TypeError(n+" is not an object");var s=Wt(n,we);if(s){var a=s.call(n);if(Object(a)!==a)throw new TypeError(a+" is not an object");return Fo(a)&&a.constructor===o?a:new o(function(l){return a.subscribe(l)})}if(Ne("iterator")&&(s=Wt(n,_o),s))return new o(function(l){Vt(function(){if(!l.closed){for(var c=Co(s.call(n)),u;!(u=c()).done;){var f=u.value;if(l.next(f),l.closed)return}l.complete()}})});if(Array.isArray(n))return new o(function(l){Vt(function(){if(!l.closed){for(var c=0;c<n.length;++c)if(l.next(n[c]),l.closed)return;l.complete()}})});throw new TypeError(n+" is not observable")},t.of=function(){for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];var a=typeof this=="function"?this:t;return new a(function(l){Vt(function(){if(!l.closed){for(var c=0;c<o.length;++c)if(l.next(o[c]),l.closed)return;l.complete()}})})},_e(t,null,[{key:zr,get:function(){return this}}]),t})();Fe()&&Object.defineProperty(D,Symbol("extensions"),{value:{symbol:we,hostReportError:Nt},configurable:!0});function Po(t){var e,r=t.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{typeof r.for=="function"?e=r.for("https://github.com/benlesh/symbol-observable"):e=r("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}var Ct;typeof self<"u"?Ct=self:typeof window<"u"?Ct=window:typeof global<"u"?Ct=global:typeof module<"u"?Ct=module:Ct=Function("return this")();Po(Ct);var cr=D.prototype,lr="@@observable";cr[lr]||(cr[lr]=function(){return this});function Oo(t){for(var e=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];if(e.indexOf(o)<0)throw Ar(58,o)}return t}function $o(t,e){var r=at({},t),n=function(s){typeof s=="function"?r=at(at({},r),s(r)):r=at(at({},r),s)},o=function(){return at({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:o}),e}function Ao(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?vo(e.query)||void 0:""),e}var Lo=Symbol.for("apollo.deprecations"),zo=me,Do=new Ie;function Mo(t){return zo[Lo]||(Do.getValue()||[]).includes(t)}function qo(t,e){Mo(t)||e()}function ur(t,e){return e?e(t):D.of()}function At(t){return typeof t=="function"?new qr(t):t}function Bt(t){return t.request.length<=1}var qr=(function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return D.of()})},t.from=function(e){return e.length===0?t.empty():e.map(At).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var o=At(r),s=At(n||new t(ur)),a;return Bt(o)&&Bt(s)?a=new t(function(l){return e(l)?o.request(l)||D.of():s.request(l)||D.of()}):a=new t(function(l,c){return e(l)?o.request(l,c)||D.of():s.request(l,c)||D.of()}),Object.assign(a,{left:o,right:s})},t.execute=function(e,r){return e.request($o(r.context,Ao(Oo(r))))||D.of()},t.concat=function(e,r){var n=At(e);if(Bt(n))return globalThis.__DEV__!==!1&&ie.warn(47,n),n;var o=At(r),s;return Bt(o)?s=new t(function(a){return n.request(a,function(l){return o.request(l)||D.of()})||D.of()}):s=new t(function(a,l){return n.request(a,function(c){return o.request(c,l)||D.of()})||D.of()}),Object.assign(s,{left:n,right:o})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(ur)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw Ar(48)},t.prototype.onError=function(e,r){if(globalThis.__DEV__!==!1&&qo("onError",function(){globalThis.__DEV__!==!1&&ie.warn(49)}),r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return globalThis.__DEV__!==!1&&globalThis.__DEV__!==!1&&ie.warn(50),this.onError=e,this},t})();function Uo(t){return new qr(function(e,r){var n=mo(e,[]);return new D(function(o){var s,a=!1;return Promise.resolve(n).then(function(l){return t(l,e.getContext())}).then(e.setContext).then(function(){a||(s=r(e).subscribe({next:o.next.bind(o),error:o.error.bind(o),complete:o.complete.bind(o)}))}).catch(o.error.bind(o)),function(){a=!0,s&&s.unsubscribe()}})})}const Bo=async()=>{const t="https://auth.australia-southeast1.gcp.commercetools.com/oauth/token",n="Basic "+btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN")+":"+encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));try{const o=await M.post(t,new URLSearchParams({grant_type:"client_credentials"}),{headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:n}});return o.status===200&&o.data.access_token?o.data.access_token:(console.error("Failed to fetch token:",o.data),null)}catch(o){return M.isAxiosError(o)?console.error("Error fetching token:",o.response||o.message):console.error("Unexpected error:",o),null}},Ro="https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql",Ho=Yt.createHttpLink({uri:`${Ro}`}),Vo=Uo(async(t,{headers:e})=>{const r=await Bo();return{headers:{...e,authorization:`Bearer ${r}`}}}),Yo=new Yt.ApolloClient({link:Vo.concat(Ho),cache:new Yt.InMemoryCache,defaultOptions:{watchQuery:{fetchPolicy:"cache-and-network"}}}),Jo=()=>i.jsx(Yt.ApolloProvider,{client:Yo,children:i.jsx(tn,{children:i.jsx(ho,{})})});exports.TanyaChatbot=Jo;exports.TanyaChatbotProvider=Kr;
20
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Io(t,e){if(t){if(typeof t=="string")return ar(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ar(t,e)}}function ar(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ir(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _e(t,e,r){return e&&ir(t.prototype,e),r&&ir(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Fe=function(){return typeof Symbol=="function"},Ne=function(t){return Fe()&&!!Symbol[t]},Ee=function(t){return Ne(t)?Symbol[t]:"@@"+t};Fe()&&!Ne("observable")&&(Symbol.observable=Symbol("observable"));var _o=Ee("iterator"),we=Ee("observable"),zr=Ee("species");function Wt(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function $t(t){var e=t.constructor;return e!==void 0&&(e=e[zr],e===null&&(e=void 0)),e!==void 0?e:D}function Fo(t){return t instanceof D}function Nt(t){Nt.log?Nt.log(t):setTimeout(function(){throw t})}function Vt(t){Promise.resolve().then(function(){try{t()}catch(e){Nt(e)}})}function Dr(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=Wt(e,"unsubscribe");r&&r.call(e)}}catch(n){Nt(n)}}function xe(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function No(t){var e=t._queue;if(e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(Mr(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function Mr(t,e,r){t._state="running";var n=t._observer;try{var o=Wt(n,e);switch(e){case"next":o&&o.call(n,r);break;case"error":if(xe(t),o)o.call(n,r);else throw r;break;case"complete":xe(t),o&&o.call(n);break}}catch(s){Nt(s)}t._state==="closed"?Dr(t):t._state==="running"&&(t._state="ready")}function le(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],Vt(function(){return No(t)});return}Mr(t,e,r)}}var Eo=(function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var o=new To(this);try{this._cleanup=n.call(void 0,o)}catch(s){o.error(s)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(xe(this),Dr(this))},_e(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t})(),To=(function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){le(this._subscription,"next",n)},e.error=function(n){le(this._subscription,"error",n)},e.complete=function(){le(this._subscription,"complete")},_e(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t})(),D=(function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new Eo(n,this._subscriber)},e.forEach=function(n){var o=this;return new Promise(function(s,a){if(typeof n!="function"){a(new TypeError(n+" is not a function"));return}function l(){c.unsubscribe(),s()}var c=o.subscribe({next:function(u){try{n(u,l)}catch(f){a(f),c.unsubscribe()}},error:a,complete:s})})},e.map=function(n){var o=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var s=$t(this);return new s(function(a){return o.subscribe({next:function(l){try{l=n(l)}catch(c){return a.error(c)}a.next(l)},error:function(l){a.error(l)},complete:function(){a.complete()}})})},e.filter=function(n){var o=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var s=$t(this);return new s(function(a){return o.subscribe({next:function(l){try{if(!n(l))return}catch(c){return a.error(c)}a.next(l)},error:function(l){a.error(l)},complete:function(){a.complete()}})})},e.reduce=function(n){var o=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var s=$t(this),a=arguments.length>1,l=!1,c=arguments[1],u=c;return new s(function(f){return o.subscribe({next:function(p){var h=!l;if(l=!0,!h||a)try{u=n(u,p)}catch(g){return f.error(g)}else u=p},error:function(p){f.error(p)},complete:function(){if(!l&&!a)return f.error(new TypeError("Cannot reduce an empty sequence"));f.next(u),f.complete()}})})},e.concat=function(){for(var n=this,o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var l=$t(this);return new l(function(c){var u,f=0;function p(h){u=h.subscribe({next:function(g){c.next(g)},error:function(g){c.error(g)},complete:function(){f===s.length?(u=void 0,c.complete()):p(l.from(s[f++]))}})}return p(n),function(){u&&(u.unsubscribe(),u=void 0)}})},e.flatMap=function(n){var o=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var s=$t(this);return new s(function(a){var l=[],c=o.subscribe({next:function(f){if(n)try{f=n(f)}catch(h){return a.error(h)}var p=s.from(f).subscribe({next:function(h){a.next(h)},error:function(h){a.error(h)},complete:function(){var h=l.indexOf(p);h>=0&&l.splice(h,1),u()}});l.push(p)},error:function(f){a.error(f)},complete:function(){u()}});function u(){c.closed&&l.length===0&&a.complete()}return function(){l.forEach(function(f){return f.unsubscribe()}),c.unsubscribe()}})},e[we]=function(){return this},t.from=function(n){var o=typeof this=="function"?this:t;if(n==null)throw new TypeError(n+" is not an object");var s=Wt(n,we);if(s){var a=s.call(n);if(Object(a)!==a)throw new TypeError(a+" is not an object");return Fo(a)&&a.constructor===o?a:new o(function(l){return a.subscribe(l)})}if(Ne("iterator")&&(s=Wt(n,_o),s))return new o(function(l){Vt(function(){if(!l.closed){for(var c=Co(s.call(n)),u;!(u=c()).done;){var f=u.value;if(l.next(f),l.closed)return}l.complete()}})});if(Array.isArray(n))return new o(function(l){Vt(function(){if(!l.closed){for(var c=0;c<n.length;++c)if(l.next(n[c]),l.closed)return;l.complete()}})});throw new TypeError(n+" is not observable")},t.of=function(){for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];var a=typeof this=="function"?this:t;return new a(function(l){Vt(function(){if(!l.closed){for(var c=0;c<o.length;++c)if(l.next(o[c]),l.closed)return;l.complete()}})})},_e(t,null,[{key:zr,get:function(){return this}}]),t})();Fe()&&Object.defineProperty(D,Symbol("extensions"),{value:{symbol:we,hostReportError:Nt},configurable:!0});function Po(t){var e,r=t.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{typeof r.for=="function"?e=r.for("https://github.com/benlesh/symbol-observable"):e=r("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}var Ct;typeof self<"u"?Ct=self:typeof window<"u"?Ct=window:typeof global<"u"?Ct=global:typeof module<"u"?Ct=module:Ct=Function("return this")();Po(Ct);var cr=D.prototype,lr="@@observable";cr[lr]||(cr[lr]=function(){return this});function Oo(t){for(var e=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];if(e.indexOf(o)<0)throw Ar(58,o)}return t}function $o(t,e){var r=at({},t),n=function(s){typeof s=="function"?r=at(at({},r),s(r)):r=at(at({},r),s)},o=function(){return at({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:o}),e}function Ao(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?vo(e.query)||void 0:""),e}var Lo=Symbol.for("apollo.deprecations"),zo=me,Do=new Ie;function Mo(t){return zo[Lo]||(Do.getValue()||[]).includes(t)}function qo(t,e){Mo(t)||e()}function ur(t,e){return e?e(t):D.of()}function At(t){return typeof t=="function"?new qr(t):t}function Bt(t){return t.request.length<=1}var qr=(function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return D.of()})},t.from=function(e){return e.length===0?t.empty():e.map(At).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var o=At(r),s=At(n||new t(ur)),a;return Bt(o)&&Bt(s)?a=new t(function(l){return e(l)?o.request(l)||D.of():s.request(l)||D.of()}):a=new t(function(l,c){return e(l)?o.request(l,c)||D.of():s.request(l,c)||D.of()}),Object.assign(a,{left:o,right:s})},t.execute=function(e,r){return e.request($o(r.context,Ao(Oo(r))))||D.of()},t.concat=function(e,r){var n=At(e);if(Bt(n))return globalThis.__DEV__!==!1&&ie.warn(47,n),n;var o=At(r),s;return Bt(o)?s=new t(function(a){return n.request(a,function(l){return o.request(l)||D.of()})||D.of()}):s=new t(function(a,l){return n.request(a,function(c){return o.request(c,l)||D.of()})||D.of()}),Object.assign(s,{left:n,right:o})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(ur)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw Ar(48)},t.prototype.onError=function(e,r){if(globalThis.__DEV__!==!1&&qo("onError",function(){globalThis.__DEV__!==!1&&ie.warn(49)}),r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return globalThis.__DEV__!==!1&&globalThis.__DEV__!==!1&&ie.warn(50),this.onError=e,this},t})();function Uo(t){return new qr(function(e,r){var n=mo(e,[]);return new D(function(o){var s,a=!1;return Promise.resolve(n).then(function(l){return t(l,e.getContext())}).then(e.setContext).then(function(){a||(s=r(e).subscribe({next:o.next.bind(o),error:o.error.bind(o),complete:o.complete.bind(o)}))}).catch(o.error.bind(o)),function(){a=!0,s&&s.unsubscribe()}})})}const Bo=async()=>{const t="https://auth.australia-southeast1.gcp.commercetools.com/oauth/token",n="Basic "+btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN")+":"+encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));try{const o=await M.post(t,new URLSearchParams({grant_type:"client_credentials"}),{headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:n}});return o.status===200&&o.data.access_token?o.data.access_token:(console.error("Failed to fetch token:",o.data),null)}catch(o){return M.isAxiosError(o)?console.error("Error fetching token:",o.response||o.message):console.error("Unexpected error:",o),null}},Ro="https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql",Ho=Yt.createHttpLink({uri:`${Ro}`}),Vo=Uo(async(t,{headers:e})=>{const r=await Bo();return{headers:{...e,authorization:`Bearer ${r}`}}}),Yo=new Yt.ApolloClient({link:Vo.concat(Ho),cache:new Yt.InMemoryCache,defaultOptions:{watchQuery:{fetchPolicy:"cache-and-network"}}}),Jo=t=>{const{tanyaConfig:e}=t,{clientID:r,host:n,organizationID:o,shortCode:s,siteId:a}=e;return console.log(e,"tanyaConfig"),sessionStorage.setItem("Host",n),sessionStorage.setItem("SiteId",a),sessionStorage.setItem("pubCfg",r),sessionStorage.setItem("envRef",s),sessionStorage.setItem("orgRef",o),i.jsx(Yt.ApolloProvider,{client:Yo,children:i.jsx(tn,{children:i.jsx(ho,{})})})};exports.TanyaChatbot=Jo;exports.TanyaChatbotProvider=Kr;
21
21
  //# sourceMappingURL=tanya-chatbot.cjs.js.map