tanya-chatbot 0.7.5 → 0.7.6

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,22 +1,21 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),s=require("react/jsx-runtime"),mr=require("@apollo/client"),ht=require("react-redux"),tn=require("@reduxjs/toolkit"),zs=require("@radix-ui/react-popover");require("clsx");require("tailwind-merge");const _e=require("axios");require("crypto-js");const qs=require("@iconify/react"),Ke=require("react-toastify"),Us=require("react-dom");function bo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Ce=bo(h),vo=bo(zs),Bs='*,: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}.visible{visibility:visible}.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}.m-\\[15px\\]{margin:15px}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.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-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.mr-2{margin-right:.5rem}.mr-6{margin-right:1.5rem}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-12{height:3rem}.h-20{height:5rem}.h-28{height:7rem}.h-3{height:.75rem}.h-6{height:1.5rem}.h-\\[120px\\]{height:120px}.h-\\[150px\\]{height:150px}.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-3\\/4{width:75%}.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-\\[64\\.7vw\\]{width:64.7vw}.w-\\[96\\%\\]{width:96%}.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%}.max-w-\\[90\\%\\]{max-width:90%}.max-w-md{max-width:28rem}.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-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.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}.gap-y-2{row-gap:.5rem}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.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-bl-xl{border-bottom-left-radius:.75rem}.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-2{border-width:2px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-t{border-top-width:1px}.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))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / 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-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.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))}.bg-white\\/70{background-color:#ffffffb3}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\\[1px\\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.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-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.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-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.pl-2{padding-left:.5rem}.pr-5{padding-right:1.25rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-nunitoSans{font-family:Nunito Sans}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[16px\\]{font-size:16px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm,.text-sm\\/5{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.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-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / 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-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-green-900{--tw-text-opacity: 1;color:rgb(20 83 45 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.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))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-95{opacity:.95}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px 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_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-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 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-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}.drop-shadow-xl{--tw-drop-shadow: drop-shadow(0 20px 13px rgb(0 0 0 / .03)) drop-shadow(0 8px 5px rgb(0 0 0 / .08));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)}.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{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.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-150{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-150{animation-duration:.15s}.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}}.placeholder\\:text-red-400::-moz-placeholder{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.placeholder\\:text-red-400::placeholder{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\\:-translate-y-0\\.5:hover{--tw-translate-y: -.125rem;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\\: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\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\\:text-\\[\\#6952C7\\]:hover{--tw-text-opacity: 1;color:rgb(105 82 199 / var(--tw-text-opacity, 1))}.hover\\:opacity-90:hover{opacity:.9}.hover\\:shadow-lg:hover{--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)}.hover\\:shadow-sm:hover{--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)}.focus\\:border-transparent:focus{border-color:transparent}.focus\\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-gray-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity, 1))}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-gray-100:disabled{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.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\\:col-span-10{grid-column:span 10 / span 10}.sm\\:col-span-2{grid-column:span 2 / span 2}.sm\\:mx-0{margin-left:0;margin-right:0}.sm\\:w-\\[80vw\\]{width:80vw}.sm\\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\\:flex-row{flex-direction:row}.sm\\:items-center{align-items:center}.sm\\:justify-start{justify-content:flex-start}}@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\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.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 Hs(){return h.useEffect(()=>{if(typeof document<"u"){const e=document.createElement("style");return e.textContent=Bs,document.head.appendChild(e),()=>{document.head.removeChild(e)}}},[]),null}const Vs={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:[]}}},ko=tn.createSlice({name:"store",initialState:Vs,reducers:{setStore:(e,t)=>{e.store=t.payload}}}),{setStore:Pl}=ko.actions,Ys=ko.reducer,Ws={product:null},jo=tn.createSlice({name:"product",initialState:Ws,reducers:{setProduct:(e,t)=>{e.product=t.payload}}}),{setProduct:qr}=jo.actions,Ks=jo.reducer,Gs=tn.configureStore({reducer:{store:Ys,product:Ks}}),Js=({children:e})=>s.jsx(ht.Provider,{store:Gs,children:e}),pr=e=>{const t=new CustomEvent("reactCartUpdated",{detail:{cartUpdated:!0,basketId:e}});window.dispatchEvent(t)};function Xs({...e}){return s.jsx(vo.Root,{"data-slot":"popover",...e})}function Qs({...e}){return s.jsx(vo.Trigger,{"data-slot":"popover-trigger",...e})}const xt=()=>({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"}),So=async()=>{const e="https://tanya-sfcc-server.vercel.app/";try{const t=await _e.post(`${e}api/auth/token-bm-grant?baseUrl=${st()}&siteId=${et()}`);return t.status===200&&t.data.access_token?t.data.access_token:(console.error("Failed to fetch token:",t.data),null)}catch(t){return _e.isAxiosError(t)?console.error("Error fetching token:",t.response||t.message):console.error("Unexpected error:",t),null}},No=async e=>{const t="https://tanya-sfcc-server.vercel.app/";try{const r=JSON.parse(sessionStorage.getItem("customerData")||"{}").dwsid,n=await _e.post(`${t}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${st()}&siteId=${et()}&pubCfg=${yt()}&envRef=${wt()}&orgRef=${bt()}`,{},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});return n.status===200&&n.data?n.data:null}catch(r){return _e.isAxiosError(r)?console.error("Error creating basket:",r.response||r.message):console.error("Unexpected error:",r),null}};async function Tt(){var a;const e=et(),t="access_token_"+e,r="expires_in_"+e,n=localStorage.getItem(r),o=localStorage.getItem(t);return console.log(o),(a=JSON.parse(sessionStorage.getItem("customerData")||"{}"))!=null&&a.isGuest,console.log("access token found in local storage"),{access_token:o,expires_in:n}}const Ur=async(e,t)=>{if(e&&t&&Date.now()<t)return e;try{const r="https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token",n=new URLSearchParams({grant_type:"client_credentials",client_id:"4i8rd70sgt961tc4dhskgf08c",client_secret:"bnsfq1220loh2cn2cm2ttn8fdhdpt0u8m1fgj8vfk2rn61aurjg",scope:"default-m2m-resource-server-8xzfzo/read"}),o=await fetch(r,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n});if(!o.ok)throw new Error(`Token request failed! status: ${o.status}`);const a=await o.json();e=a.access_token;const i=a.expires_in||3600;return t=Date.now()+(i-60)*1e3,e}catch(r){return console.error("Error obtaining JWT token:",r),e=null,t=null,null}},st=()=>sessionStorage.getItem("Host"),et=()=>sessionStorage.getItem("SiteId"),yt=()=>sessionStorage.getItem("pubCfg"),wt=()=>sessionStorage.getItem("envRef"),bt=()=>sessionStorage.getItem("orgRef"),Zs=async e=>{console.log("fetching results");const{serverUrl:t,basePath:r}=xt();let n="";{const o=await Tt();console.log("the token from getSearchResults",o),n=o.access_token}try{const o=st();return(await _e.get(`${t}${r}/search-sfcc?baseUrl=${o}&query=${e}&siteId=${et()}&pubCfg=${yt()}&envRef=${wt()}&orgRef=${bt()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`}})).data.hits}catch(o){throw console.error("Error fetching search results:",o),o}},Co=async e=>{if(!e)throw new Error("Product ID is required");const{serverUrl:t,basePath:r}=xt(),n=st();console.log("calling access");const{access_token:o}=await Tt();return(await _e.get(`${t}${r}/product-sfcc/${e}?baseUrl=${n}&siteId=${et()}&pubCfg=${yt()}&envRef=${wt()}&orgRef=${bt()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}})).data},ea=async e=>{if(!e)throw new Error("customerId is required");const t=await So(),{customer_token:r}=await No(t),{serverUrl:n,basePath:o}=xt(),i=(await Tt()).access_token;return(await _e.get(`${n}${o}/get-interest?baseUrl=${st()}&customerId=${e}&siteId=${et()}&pubCfg=${yt()}&envRef=${wt()}&orgRef=${bt()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`}})).data},Pn=e=>String(typeof e=="string"?e:e["en-US"]||e),In=e=>e!=null&&e.image?[e.image]:"variants"in e?e.variants[0].images:e.masterVariant.images.map(t=>t.url),ta=(e,t)=>e.toLocaleString("en-US",{style:"currency",currency:t||"USD"}),En=e=>{var t,r,n;return"variants"in e?{centAmount:(t=e.variants[0])==null?void 0:t.prices.EUR.max,currencyCode:"DOL"}:{centAmount:(r=e.masterVariant)==null?void 0:r.prices[0].value.centAmount,currencyCode:(n=e.masterVariant)==null?void 0:n.prices[0].value.currencyCode}},ra=e=>e.charAt(0).toUpperCase()+e.slice(1),Fn=(e,t)=>e.length<t?e:e.slice(0,t)+"...",Ir=e=>e.split("\\n").map((t,r)=>{const n=t.match(/^(\d+)\.\s(.+)/);return n?`<p key=${r} class="mb-2"><strong>${n[1]}.</strong> ${n[2]}</p>`:t.trim()?`<p key=${r} class="mb-2">${t}</p>`:"<br/>"}).join("");function na(){const e=()=>window.innerWidth<425?1:window.innerWidth<768?2:4,[t,r]=h.useState(e);return h.useEffect(()=>{const n=()=>r(e());return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),t}const oa=({product:e})=>{const t=ht.useDispatch(),r=na(),[n,o]=h.useState(0),a=()=>{o(c=>c+r>=e.length?0:c+r)},i=()=>{o(c=>c-r<0?e.length-(e.length%r||r):c-r)},l=async c=>{const f=await Co(c);t(qr(f))};return s.jsx("div",{className:"mt-2 overflow-x-hidden",children:s.jsxs("div",{className:"flex items-center justify-center gap-4 relative",children:[(e==null?void 0:e.length)>r&&s.jsx("button",{onClick:i,className:"absolute z-50 left-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",style:{height:"30px",width:"30px",boxShadow:"0 4px 10px rgba(0, 0, 0, 0.25)"},children:"<"}),s.jsx("div",{className:"flex gap-5 justify-center flex-1 overflow-hidden",children:e.slice(n,n+r).map(c=>{var f,u,p,w;return s.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:[s.jsx("div",{className:"w-full p-2 flex items-center justify-center bg-white",children:s.jsx("img",{src:((f=In(c)[0])==null?void 0:f.link)||In(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"})}),s.jsxs("div",{className:"text-white w-full p-2 text-[12px] text-center h-[60px]",children:[s.jsxs("div",{className:"relative inline-block group",children:[s.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:Fn(Pn((u=c==null?void 0:c.name)==null?void 0:u["en-US"]),60)||"Product"}),s.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:Fn(Pn((p=c==null?void 0:c.name)==null?void 0:p["en-US"]),60)||"Product"})]}),s.jsxs("div",{className:" flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1",children:[s.jsx("p",{children:ta(c!=null&&c.price?Number(c==null?void 0:c.price):En(c).centAmount||0,(w=En(c))==null?void 0:w.currencyCode)}),s.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)})}),(e==null?void 0:e.length)>r&&s.jsx("button",{onClick:a,className:"absolute z-50 right-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",style:{height:"30px",width:"30px",boxShadow:"0 4px 10px rgba(0, 0, 0, 0.25)"},children:">"})]})})},sa=({chat:e,storeDetails:t})=>s.jsx("div",{className:"bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full",children:e.map((r,n)=>s.jsxs("div",{className:"mb-4 p-3 rounded-xl",style:{background:"linear-gradient(109.52deg, #F0EEF5 36.91%, #F4F3EE 100.34%"},children:[s.jsx("div",{className:"font-nunitoSans font-bold text-sm text-[#494949] p-2 w-fit rounded-[20px]",children:ra(r.keyword)||"No keyword"}),s.jsx(oa,{product:r.items,storeDetails:t})]},n))}),_o=async(e,t)=>{var a,i;const{serverUrl:r,basePath:n}=xt(),o=`${r}`;try{const l=await _e.post(`${o}${n}/basket/create?baseUrl=${st()}&siteId=${et()}&pubCfg=${yt()}&envRef=${wt()}&orgRef=${bt()}`,t,{headers:{"Content-Type":"application/json",Authorization:e}});return window.postMessage({type:"WIDGET_CREATED_BASKET",basketId:((a=l.data)==null?void 0:a.basket_id)||((i=l.data)==null?void 0:i.basketId)},"*"),l.data}catch(l){return _e.isAxiosError(l)?console.error("Error creating basket:",l.response||l.message):console.error("Unexpected error:",l),null}},Br=async(e,t,r)=>{const{serverUrl:n,basePath:o}=xt(),a=`${n}`;try{const i=await _e.post(`${a}${o}/basket/add-product/${e}?baseUrl=${st()}&siteId=${et()}&pubCfg=${yt()}&envRef=${wt()}&orgRef=${bt()}`,t,{headers:{"Content-Type":"application/json",Authorization:r}});return i.status===200&&i.data?i.data:null}catch(i){return _e.isAxiosError(i)?console.error("Error adding products to basket:",i.response||i.message):console.error("Unexpected error:",i),null}},Po=async({basketId:e,customer_token:t})=>{var a;const{serverUrl:r,basePath:n}=xt(),o=`${r}`;try{const i=await _e.get(`${o}${n}/basket/${e}?baseUrl=${st()}&siteId=${et()}&pubCfg=${yt()}&envRef=${wt()}&orgRef=${bt()}`,{headers:{"Content-Type":"application/json",Authorization:t}});return{status:i.status,data:i.data}}catch(i){return _e.isAxiosError(i)?{status:(a=i.response)==null?void 0:a.status,data:null}:{status:null,data:null}}},hr="sfcc_basket_id",Tn="sfcc_customer_token",Ht="sfcc_token_expiry",aa=300*1e3,er="1.0.0";const pt=e=>{try{e?localStorage.setItem(hr,e):localStorage.removeItem(hr)}catch(t){console.error("Error saving basket ID to storage:",t)}},gr=e=>{try{if(e){localStorage.setItem(Tn,e);const t=Date.now()+aa;localStorage.setItem(Ht,t.toString())}else localStorage.removeItem(Tn)}catch(t){console.error("Error storing token:",t)}},On=300,ia=({addToCartPwa:e})=>{var c,f,u,p,w,j;const t=ht.useDispatch(),r=ht.useSelector(v=>v.product.product),n=ht.useSelector(v=>v.store.store),[o,a]=h.useState(!!r);if(h.useEffect(()=>{a(!!r)},[r]),!r)return null;const i=async()=>{var v,b,k,S,I,x,T,te,N,_,ie,G,K,fe,H,ce;try{if(!((b=(v=r==null?void 0:r.variants)==null?void 0:v[0])!=null&&b.product_id)&&!(r.type.item||r.type.bundle)&&!((S=(k=r==null?void 0:r.variants)==null?void 0:k[0])!=null&&S.productId)){Ke.toast.error("Variants not available",{position:"bottom-right",autoClose:1e3}),console.error("No product variant found");return}const D=[{product_id:((I=r.variants)==null?void 0:I[0].product_id)||((x=r.variants)==null?void 0:x[0].productId)||(r==null?void 0:r.id),quantity:1}],A=JSON.parse(sessionStorage.getItem("customerData")||"{}"),E=(A==null?void 0:A.basketId)||localStorage.getItem(hr),me=!1,Pe=localStorage.getItem(Ht),Se=Date.now();if(!me||!Pe||Se>=parseInt(Pe)){let Me="";if(Me="Bearer "+(await Tt()).access_token,!Me){console.error("Failed to get customer_token");return}const vt=Se+300*1e3;if(gr(Me),localStorage.setItem(Ht,vt.toString()),E){const Re=await Po({basketId:E,customer_token:Me});if(Re.status===200&&Re){const Le=await Br(E,D,Me);(((T=Le==null?void 0:Le.product_items)==null?void 0:T.length)>0||((te=Le==null?void 0:Le.productItems)==null?void 0:te.length)>0)&&(Ke.toast.success("Added to cart",{position:"bottom-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0}),pr(E));return}}const at={productItems:[{productId:((N=r.variants)==null?void 0:N[0].product_id)||((_=r.variants)==null?void 0:_[0].productId)||(r==null?void 0:r.id),quantity:1}]},V=await _o(Me,at);if(!(V!=null&&V.basket_id)&&!(V!=null&&V.basketId)){console.error("Failed to create basket");return}pt((V==null?void 0:V.basket_id)||(V==null?void 0:V.basketId)),console.log("adding product to basket");const xe=await Br((V==null?void 0:V.basket_id)||(V==null?void 0:V.basketId),D,Me);console.log("object added to basket"),(((ie=xe==null?void 0:xe.product_items)==null?void 0:ie.length)>0||((G=xe==null?void 0:xe.productItems)==null?void 0:G.length)>0)&&Ke.toast.success("Added to cart",{position:"bottom-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0}),pr(V.basket_id||(V==null?void 0:V.basketId))}}catch(D){console.error("Error adding to cart:",D),Ke.toast.error("Failed to add product to cart",{position:"bottom-right",autoClose:3e3}),((K=D==null?void 0:D.response)==null?void 0:K.status)===404||((fe=D==null?void 0:D.response)==null?void 0:fe.status)===401?(((H=D==null?void 0:D.response)==null?void 0:H.status)===404&&pt(null),((ce=D==null?void 0:D.response)==null?void 0:ce.status)===401&&(pt(null),gr(null))):(console.error("Failed to add product to basket:",D.message),Ke.toast.error("Failed to add product to cart",{position:"bottom-right",autoClose:3e3}))}},l=()=>{if(!r)return;const v=window.location.origin+"/product/"+r.id;console.log("path",v),window.location.href=v};return console.log(r,"the prod"),s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-40 bg-black/30",onClick:()=>{a(!1),setTimeout(()=>t(qr(null)),On)}}),s.jsxs("div",{className:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),n=require("react/jsx-runtime"),Ut=require("@apollo/client"),ot=require("react-redux"),yr=require("@reduxjs/toolkit"),So=require("@radix-ui/react-popover");require("clsx");require("tailwind-merge");const pe=require("axios");require("crypto-js");const No=require("@iconify/react"),Le=require("react-toastify"),Co=require("react-dom");function _o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const jn=_o(So),Io='*,: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}.visible{visibility:visible}.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}.m-\\[15px\\]{margin:15px}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.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-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.mr-2{margin-right:.5rem}.mr-6{margin-right:1.5rem}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-12{height:3rem}.h-20{height:5rem}.h-28{height:7rem}.h-3{height:.75rem}.h-6{height:1.5rem}.h-\\[120px\\]{height:120px}.h-\\[150px\\]{height:150px}.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-3\\/4{width:75%}.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-\\[64\\.7vw\\]{width:64.7vw}.w-\\[96\\%\\]{width:96%}.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%}.max-w-\\[90\\%\\]{max-width:90%}.max-w-md{max-width:28rem}.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-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.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}.gap-y-2{row-gap:.5rem}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.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-bl-xl{border-bottom-left-radius:.75rem}.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-2{border-width:2px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-t{border-top-width:1px}.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))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / 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-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.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))}.bg-white\\/70{background-color:#ffffffb3}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\\[1px\\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.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-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.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-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.pl-2{padding-left:.5rem}.pr-5{padding-right:1.25rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-nunitoSans{font-family:Nunito Sans}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[16px\\]{font-size:16px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm,.text-sm\\/5{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.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-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / 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-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-green-900{--tw-text-opacity: 1;color:rgb(20 83 45 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.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))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-95{opacity:.95}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px 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_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-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 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-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}.drop-shadow-xl{--tw-drop-shadow: drop-shadow(0 20px 13px rgb(0 0 0 / .03)) drop-shadow(0 8px 5px rgb(0 0 0 / .08));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)}.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{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.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-150{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-150{animation-duration:.15s}.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}}.placeholder\\:text-red-400::-moz-placeholder{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.placeholder\\:text-red-400::placeholder{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\\:-translate-y-0\\.5:hover{--tw-translate-y: -.125rem;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\\: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\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\\:text-\\[\\#6952C7\\]:hover{--tw-text-opacity: 1;color:rgb(105 82 199 / var(--tw-text-opacity, 1))}.hover\\:opacity-90:hover{opacity:.9}.hover\\:shadow-lg:hover{--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)}.hover\\:shadow-sm:hover{--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)}.focus\\:border-transparent:focus{border-color:transparent}.focus\\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-gray-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity, 1))}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-gray-100:disabled{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.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\\:col-span-10{grid-column:span 10 / span 10}.sm\\:col-span-2{grid-column:span 2 / span 2}.sm\\:mx-0{margin-left:0;margin-right:0}.sm\\:w-\\[80vw\\]{width:80vw}.sm\\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\\:flex-row{flex-direction:row}.sm\\:items-center{align-items:center}.sm\\:justify-start{justify-content:flex-start}}@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\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.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 Fo(){return g.useEffect(()=>{if(typeof document<"u"){const e=document.createElement("style");return e.textContent=Io,document.head.appendChild(e),()=>{document.head.removeChild(e)}}},[]),null}const Po={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:[]}}},kn=yr.createSlice({name:"store",initialState:Po,reducers:{setStore:(e,t)=>{e.store=t.payload}}}),{setStore:La}=kn.actions,Eo=kn.reducer,To={product:null},Sn=yr.createSlice({name:"product",initialState:To,reducers:{setProduct:(e,t)=>{e.product=t.payload}}}),{setProduct:ar}=Sn.actions,Oo=Sn.reducer,Ao=yr.configureStore({reducer:{store:Eo,product:Oo}}),$o=({children:e})=>n.jsx(ot.Provider,{store:Ao,children:e}),Ht=e=>{const t=new CustomEvent("reactCartUpdated",{detail:{cartUpdated:!0,basketId:e}});window.dispatchEvent(t)};function Lo({...e}){return n.jsx(jn.Root,{"data-slot":"popover",...e})}function Do({...e}){return n.jsx(jn.Trigger,{"data-slot":"popover-trigger",...e})}const st=()=>({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"}),Nn=async()=>{const e="https://tanya-sfcc-server.vercel.app/";try{const t=await pe.post(`${e}api/auth/token-bm-grant?baseUrl=${Je()}&siteId=${Re()}`);return t.status===200&&t.data.access_token?t.data.access_token:(console.error("Failed to fetch token:",t.data),null)}catch(t){return pe.isAxiosError(t)?console.error("Error fetching token:",t.response||t.message):console.error("Unexpected error:",t),null}},Cn=async e=>{const t="https://tanya-sfcc-server.vercel.app/";try{const r=JSON.parse(sessionStorage.getItem("customerData")||"{}").dwsid,o=await pe.post(`${t}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${Je()}&siteId=${Re()}&pubCfg=${at()}&envRef=${it()}&orgRef=${lt()}`,{},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});return o.status===200&&o.data?o.data:null}catch(r){return pe.isAxiosError(r)?console.error("Error creating basket:",r.response||r.message):console.error("Unexpected error:",r),null}};async function yt(){var a;const e=Re(),t="access_token_"+e,r="expires_in_"+e,o=localStorage.getItem(r),s=localStorage.getItem(t);return console.log(s),(a=JSON.parse(sessionStorage.getItem("customerData")||"{}"))!=null&&a.isGuest,console.log("access token found in local storage"),{access_token:s,expires_in:o}}const ir=async(e,t)=>{if(e&&t&&Date.now()<t)return e;try{const r="https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token",o=new URLSearchParams({grant_type:"client_credentials",client_id:"4i8rd70sgt961tc4dhskgf08c",client_secret:"bnsfq1220loh2cn2cm2ttn8fdhdpt0u8m1fgj8vfk2rn61aurjg",scope:"default-m2m-resource-server-8xzfzo/read"}),s=await fetch(r,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:o});if(!s.ok)throw new Error(`Token request failed! status: ${s.status}`);const a=await s.json();e=a.access_token;const i=a.expires_in||3600;return t=Date.now()+(i-60)*1e3,e}catch(r){return console.error("Error obtaining JWT token:",r),e=null,t=null,null}},Je=()=>sessionStorage.getItem("Host"),Re=()=>sessionStorage.getItem("SiteId"),at=()=>sessionStorage.getItem("pubCfg"),it=()=>sessionStorage.getItem("envRef"),lt=()=>sessionStorage.getItem("orgRef"),zo=async e=>{console.log("fetching results");const{serverUrl:t,basePath:r}=st();let o="";{const s=await yt();console.log("the token from getSearchResults",s),o=s.access_token}try{const s=Je();return(await pe.get(`${t}${r}/search-sfcc?baseUrl=${s}&query=${e}&siteId=${Re()}&pubCfg=${at()}&envRef=${it()}&orgRef=${lt()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}})).data.hits}catch(s){throw console.error("Error fetching search results:",s),s}},_n=async e=>{if(!e)throw new Error("Product ID is required");const{serverUrl:t,basePath:r}=st(),o=Je();console.log("calling access");const{access_token:s}=await yt();return(await pe.get(`${t}${r}/product-sfcc/${e}?baseUrl=${o}&siteId=${Re()}&pubCfg=${at()}&envRef=${it()}&orgRef=${lt()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`}})).data},Mo=async e=>{if(!e)throw new Error("customerId is required");const t=await Nn(),{customer_token:r}=await Cn(t),{serverUrl:o,basePath:s}=st(),i=(await yt()).access_token;return(await pe.get(`${o}${s}/get-interest?baseUrl=${Je()}&customerId=${e}&siteId=${Re()}&pubCfg=${at()}&envRef=${it()}&orgRef=${lt()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`}})).data},qr=e=>String(typeof e=="string"?e:e["en-US"]||e),Rr=e=>e!=null&&e.image?[e.image]:"variants"in e?e.variants[0].images:e.masterVariant.images.map(t=>t.url),qo=(e,t)=>e.toLocaleString("en-US",{style:"currency",currency:t||"USD"}),Br=e=>{var t,r,o;return"variants"in e?{centAmount:(t=e.variants[0])==null?void 0:t.prices.EUR.max,currencyCode:"DOL"}:{centAmount:(r=e.masterVariant)==null?void 0:r.prices[0].value.centAmount,currencyCode:(o=e.masterVariant)==null?void 0:o.prices[0].value.currencyCode}},Ro=e=>e.charAt(0).toUpperCase()+e.slice(1),Ur=(e,t)=>e.length<t?e:e.slice(0,t)+"...",Zt=e=>e.split("\\n").map((t,r)=>{const o=t.match(/^(\d+)\.\s(.+)/);return o?`<p key=${r} class="mb-2"><strong>${o[1]}.</strong> ${o[2]}</p>`:t.trim()?`<p key=${r} class="mb-2">${t}</p>`:"<br/>"}).join("");function Bo(){const e=()=>window.innerWidth<425?1:window.innerWidth<768?2:4,[t,r]=g.useState(e);return g.useEffect(()=>{const o=()=>r(e());return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]),t}const Uo=({product:e})=>{const t=ot.useDispatch(),r=Bo(),[o,s]=g.useState(0),a=()=>{s(l=>l+r>=e.length?0:l+r)},i=()=>{s(l=>l-r<0?e.length-(e.length%r||r):l-r)},c=async l=>{const h=await _n(l);t(ar(h))};return n.jsx("div",{className:"mt-2 overflow-x-hidden",children:n.jsxs("div",{className:"flex items-center justify-center gap-4 relative",children:[(e==null?void 0:e.length)>r&&n.jsx("button",{onClick:i,className:"absolute z-50 left-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",style:{height:"30px",width:"30px",boxShadow:"0 4px 10px rgba(0, 0, 0, 0.25)"},children:"<"}),n.jsx("div",{className:"flex gap-5 justify-center flex-1 overflow-hidden",children:e.slice(o,o+r).map(l=>{var h,p,y,w;return n.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:()=>{c(l.product_id??l.productId)},children:[n.jsx("div",{className:"w-full p-2 flex items-center justify-center bg-white",children:n.jsx("img",{src:((h=Rr(l)[0])==null?void 0:h.link)||Rr(l)[0]||"https://via.placeholder.com/120",alt:l!=null&&l.productName?l.productName:"Product",className:"w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"})}),n.jsxs("div",{className:"text-white w-full p-2 text-[12px] text-center h-[60px]",children:[n.jsxs("div",{className:"relative inline-block group",children:[n.jsx("div",{className:"w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans",children:l!=null&&l.productName?l.productName:l!=null&&l.product_name?l.product_name:Ur(qr((p=l==null?void 0:l.name)==null?void 0:p["en-US"]),60)||"Product"}),n.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:l!=null&&l.productName?l.productName:l!=null&&l.product_name?l.product_name:Ur(qr((y=l==null?void 0:l.name)==null?void 0:y["en-US"]),60)||"Product"})]}),n.jsxs("div",{className:" flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1",children:[n.jsx("p",{children:qo(l!=null&&l.price?Number(l==null?void 0:l.price):Br(l).centAmount||0,(w=Br(l))==null?void 0:w.currencyCode)}),n.jsxs("p",{className:"text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate",children:["$",Number(l==null?void 0:l.price).toFixed(2)??5]})]})]})]},l.productId)})}),(e==null?void 0:e.length)>r&&n.jsx("button",{onClick:a,className:"absolute z-50 right-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",style:{height:"30px",width:"30px",boxShadow:"0 4px 10px rgba(0, 0, 0, 0.25)"},children:">"})]})})},Ho=({chat:e,storeDetails:t})=>n.jsx("div",{className:"bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full",children:e.map((r,o)=>n.jsxs("div",{className:"mb-4 p-3 rounded-xl",style:{background:"linear-gradient(109.52deg, #F0EEF5 36.91%, #F4F3EE 100.34%"},children:[n.jsx("div",{className:"font-nunitoSans font-bold text-sm text-[#494949] p-2 w-fit rounded-[20px]",children:Ro(r.keyword)||"No keyword"}),n.jsx(Uo,{product:r.items,storeDetails:t})]},o))}),In=async(e,t)=>{var a,i;const{serverUrl:r,basePath:o}=st(),s=`${r}`;try{const c=await pe.post(`${s}${o}/basket/create?baseUrl=${Je()}&siteId=${Re()}&pubCfg=${at()}&envRef=${it()}&orgRef=${lt()}`,t,{headers:{"Content-Type":"application/json",Authorization:e}});return window.postMessage({type:"WIDGET_CREATED_BASKET",basketId:((a=c.data)==null?void 0:a.basket_id)||((i=c.data)==null?void 0:i.basketId)},"*"),c.data}catch(c){return pe.isAxiosError(c)?console.error("Error creating basket:",c.response||c.message):console.error("Unexpected error:",c),null}},lr=async(e,t,r)=>{const{serverUrl:o,basePath:s}=st(),a=`${o}`;try{const i=await pe.post(`${a}${s}/basket/add-product/${e}?baseUrl=${Je()}&siteId=${Re()}&pubCfg=${at()}&envRef=${it()}&orgRef=${lt()}`,t,{headers:{"Content-Type":"application/json",Authorization:r}});return i.status===200&&i.data?i.data:null}catch(i){return pe.isAxiosError(i)?console.error("Error adding products to basket:",i.response||i.message):console.error("Unexpected error:",i),null}},Fn=async({basketId:e,customer_token:t})=>{var a;const{serverUrl:r,basePath:o}=st(),s=`${r}`;try{const i=await pe.get(`${s}${o}/basket/${e}?baseUrl=${Je()}&siteId=${Re()}&pubCfg=${at()}&envRef=${it()}&orgRef=${lt()}`,{headers:{"Content-Type":"application/json",Authorization:t}});return{status:i.status,data:i.data}}catch(i){return pe.isAxiosError(i)?{status:(a=i.response)==null?void 0:a.status,data:null}:{status:null,data:null}}},Vt="sfcc_basket_id",Hr="sfcc_customer_token",It="sfcc_token_expiry",Vo=300*1e3,At="1.0.0";const nt=e=>{try{e?localStorage.setItem(Vt,e):localStorage.removeItem(Vt)}catch(t){console.error("Error saving basket ID to storage:",t)}},Yt=e=>{try{if(e){localStorage.setItem(Hr,e);const t=Date.now()+Vo;localStorage.setItem(It,t.toString())}else localStorage.removeItem(Hr)}catch(t){console.error("Error storing token:",t)}},Vr=300,Yo=({addToCartPwa:e})=>{var l,h,p,y,w,k;const t=ot.useDispatch(),r=ot.useSelector(N=>N.product.product),o=ot.useSelector(N=>N.store.store),[s,a]=g.useState(!!r);if(g.useEffect(()=>{a(!!r)},[r]),!r)return null;const i=async()=>{var N,_,S,I,B,x,H,Ee,P,U,ge,oe,G,Ce,Te,me;try{if(!((_=(N=r==null?void 0:r.variants)==null?void 0:N[0])!=null&&_.product_id)&&!(r.type.item||r.type.bundle)&&!((I=(S=r==null?void 0:r.variants)==null?void 0:S[0])!=null&&I.productId)){Le.toast.error("Variants not available",{position:"bottom-right",autoClose:1e3}),console.error("No product variant found");return}const L=[{product_id:((B=r.variants)==null?void 0:B[0].product_id)||((x=r.variants)==null?void 0:x[0].productId)||(r==null?void 0:r.id),quantity:1}],E=JSON.parse(sessionStorage.getItem("customerData")||"{}"),R=(E==null?void 0:E.basketId)||localStorage.getItem(Vt),Ke=!1,Be=localStorage.getItem(It),ye=Date.now();if(!Ke||!Be||ye>=parseInt(Be)){let ke="";if(ke="Bearer "+(await yt()).access_token,!ke){console.error("Failed to get customer_token");return}const ct=ye+300*1e3;if(Yt(ke),localStorage.setItem(It,ct.toString()),R){const _e=await Fn({basketId:R,customer_token:ke});if(_e.status===200&&_e){const Se=await lr(R,L,ke);(((H=Se==null?void 0:Se.product_items)==null?void 0:H.length)>0||((Ee=Se==null?void 0:Se.productItems)==null?void 0:Ee.length)>0)&&(Le.toast.success("Added to cart",{position:"bottom-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0}),Ht(R));return}}const We={productItems:[{productId:((P=r.variants)==null?void 0:P[0].product_id)||((U=r.variants)==null?void 0:U[0].productId)||(r==null?void 0:r.id),quantity:1}]},z=await In(ke,We);if(!(z!=null&&z.basket_id)&&!(z!=null&&z.basketId)){console.error("Failed to create basket");return}nt((z==null?void 0:z.basket_id)||(z==null?void 0:z.basketId)),console.log("adding product to basket");const ie=await lr((z==null?void 0:z.basket_id)||(z==null?void 0:z.basketId),L,ke);console.log("object added to basket"),(((ge=ie==null?void 0:ie.product_items)==null?void 0:ge.length)>0||((oe=ie==null?void 0:ie.productItems)==null?void 0:oe.length)>0)&&Le.toast.success("Added to cart",{position:"bottom-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0}),Ht(z.basket_id||(z==null?void 0:z.basketId))}}catch(L){console.error("Error adding to cart:",L),Le.toast.error("Failed to add product to cart",{position:"bottom-right",autoClose:3e3}),((G=L==null?void 0:L.response)==null?void 0:G.status)===404||((Ce=L==null?void 0:L.response)==null?void 0:Ce.status)===401?(((Te=L==null?void 0:L.response)==null?void 0:Te.status)===404&&nt(null),((me=L==null?void 0:L.response)==null?void 0:me.status)===401&&(nt(null),Yt(null))):(console.error("Failed to add product to basket:",L.message),Le.toast.error("Failed to add product to cart",{position:"bottom-right",autoClose:3e3}))}},c=()=>{if(!r)return;const N=window.location.origin+"/product/"+r.id;console.log("path",N),window.location.href=N};return console.log(r,"the prod"),n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-40 bg-black/30",onClick:()=>{a(!1),setTimeout(()=>t(ar(null)),Vr)}}),n.jsxs("div",{className:`
2
2
  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
3
3
  transition-all duration-300
4
- ${o?"translate-y-0 md:translate-y-0 md:translate-x-0 opacity-100":"translate-y-full md:translate-y-0 md:translate-x-full opacity-0 pointer-events-none"}
5
- `,style:{willChange:"transform, opacity"},onClick:v=>v.stopPropagation(),children:[s.jsxs("div",{className:"mt-3 flex flex-row justify-between w-full ",children:[s.jsx("div",{children:s.jsx("p",{className:"text-[#000000] font-bold font-nunitoSans",children:r.name})}),s.jsx("div",{children:s.jsx("div",{className:"text-[#555555] w-6 h-6 cursor-pointer",onClick:()=>{a(!1),setTimeout(()=>t(qr(null)),On)},children:"✕"})})]}),s.jsxs("div",{className:"flex flex-row gap-2 items-center flex-wrap",children:[s.jsx("div",{className:"flex flex-row items-center justify-center w-[120px] h-[120px] my-5",children:s.jsx("img",{src:(p=(u=(f=(c=r.imageGroups)==null?void 0:c[0])==null?void 0:f.images)==null?void 0:u[0])==null?void 0:p.link,alt:r.name,className:"rounded-[10px]"})}),s.jsx("div",{className:"flex flex-col items-center gap-2",children:r.imageGroups.slice(1,2).map(v=>v.images.slice(1,2).map(b=>s.jsx("img",{src:b.link,alt:r.name,className:"rounded-[10px] w-[60px] h-[60px]"},b.link)))})]}),s.jsxs("div",{className:"flex flex-row items-center justify-between w-full",children:[s.jsxs("div",{className:"flex flex-row items-center gap-2",children:[s.jsxs("p",{className:"text-[#14121F] font-bold font-nunitoSans",children:[" ","$",r.price.toFixed(2)]})," ",s.jsxs("p",{className:"text-[#14121F] font-normal line-through text-sm font-nunitoSans",children:[" ","$",(r.price+5).toFixed(2)]})]}),s.jsx("div",{children:s.jsx("p",{className:"text-[#EC5050] font-bold font-nunitoSans",children:r.discount})})]}),s.jsx("div",{className:"mt-2 w-full border-t-2 border-gray-200"}),s.jsxs("div",{className:"w-full text-left",children:[s.jsx("div",{className:"text-[#323135] font-bold font-nunitoSans mt-3 text-[14px]",children:"Product Details"}),s.jsx("div",{className:"text-[#68656E] font-normal font-nunitoSans text-xs pl-2 mt-3",dangerouslySetInnerHTML:{__html:r.short_description||r.longDescription}})]}),s.jsxs("div",{className:"mt-4 flex flex-col gap-2 w-full p-2",children:[s.jsx("div",{className:"flex flex-row items-center gap-2",children:s.jsxs("div",{className:"flex items-center gap-2 text-left font-nunitoSans",children:[s.jsxs("div",{className:"text-[#323135] font-bold",children:[((w=r==null?void 0:r.rating)==null?void 0:w.rate)||0," /"," ",s.jsx("span",{className:"text-[#68656E]",children:"5"})]}),s.jsx("div",{className:"text-[#323135] font-semibold text-sm",children:"Overall Rating"}),s.jsxs("div",{className:"text-[#68656E] font-semibold text-sm",children:[((j=r==null?void 0:r.rating)==null?void 0:j.count)||0," ratings"]})]})}),s.jsx("div",{className:"mt-2 flex flex-row items-center gap-2",children:Array.from({length:5}).map((v,b)=>{var k;return s.jsx(qs.Icon,{icon:"mdi:star",width:"20",height:"20",className:`text-yellow-500
6
- ${((k=r==null?void 0:r.rating)==null?void 0:k.rate)>b?"text-yellow-500":"text-gray-300"}
7
- `},b)})})]}),s.jsxs("div",{className:"flex flex-col items-center justify-between font-nunitoSans font-semibold w-5/6 text-black gap-2",style:{marginTop:"40px"},children:[s.jsx("button",{className:"rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer",style:{backgroundColor:n.tanyaThemeColor},onClick:i,children:"Add to Cart"}),s.jsx("button",{className:"rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer mb-16",style:{backgroundColor:n.tanyaThemeColor},onClick:l,children:"View more"})]})]})]})},ca=({tanyaConfig:e,basketId:t,addToCart:r})=>{const n=["Myself","My Child","My Grandchild","Niece/Nephew","My Friends","Others"],o={Myself:"himself/herself","My Child":"his/her child","My Grandchild":"his/her grandchild","Niece/Nephew":"his/her niece/nephew","My Friends":"his/her friends",Others:"others"},a=h.useRef(null),i=h.useRef(null),l=h.useRef(null),c=h.useRef(null),[f,u]=h.useState(null);h.useRef(null);const[p,w]=h.useState(!1),[j,v]=h.useState(!1),[b,k]=h.useState(!1),[S,I]=h.useState(!1),[x,T]=h.useState(!1),[te,N]=h.useState(!1),[_,ie]=h.useState(""),[G,K]=h.useState(""),fe=g=>({id:g.id,title:g.name,image:g.image??"",price:g.price??0}),[H,ce]=h.useState([]),D=h.useRef(null),A=ht.useSelector(g=>g.store.store),E=ht.useSelector(g=>g.product.product);h.useEffect(()=>{const g=localStorage.getItem(`access_token_${e.siteId}`),L=localStorage.getItem(`chat-token-${e.siteId}`);if(g&&L===g){const q=localStorage.getItem("chatHistory");q&&ce(JSON.parse(q))}else localStorage.setItem("chatHistory",JSON.stringify([])),localStorage.setItem(`chat-token-${e.siteId}`,g||"")},[]),h.useEffect(()=>{localStorage.setItem("chatHistory",JSON.stringify(H));const g=localStorage.getItem(`access_token_${e.siteId}`);g&&localStorage.setItem(`chat-token-${e.siteId}`,g)},[H]);const me=()=>{k(!0),setTimeout(()=>v(!0),10)},Pe=()=>{v(!1),setTimeout(()=>k(!1),300)};h.useEffect(()=>{p?me():Pe()},[p]);const Se=g=>{K(o[g])};h.useEffect(()=>{b&&D.current&&D.current.scrollTo({top:D.current.scrollHeight,behavior:"smooth"})},[H,b]);const Me=null,vt=null,at=async()=>{const g=await Tt();g!=null&&u(g)};h.useEffect(()=>{if(e!=null&&e.siteId){const{clientID:g,host:L,organizationID:q,shortCode:J,siteId:B}=e;sessionStorage.setItem("Host",L),sessionStorage.setItem("SiteId",B),sessionStorage.setItem("pubCfg",btoa(g)),sessionStorage.setItem("envRef",J),sessionStorage.setItem("orgRef",q)}at(),console.log("scapi environment v1")},[]),h.useEffect(()=>{t&&(console.log("setting the basket id",t),pt(t))},[t]);const V=async()=>{const g=JSON.parse(sessionStorage.getItem("customerData")||"{}").customerId;return(await ea(g||"")).c_interests},xe=async(g,L)=>{console.log("in secondary flow",er);const q=await V();if(console.log(q,"interests of customer",er),!!q)try{ce(ne=>ne.map((Z,Oe)=>Oe===ne.length-1?{...Z,secondaryLoading:!0}:Z));const J=await Ur(Me,vt);if(!J)throw new Error("Failed to fetch token");const B=localStorage.getItem("customerNumber"),M=localStorage.getItem("isLoggedIn"),W=`https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({registered:String(M||!1),userId:String(B||new Date().getTime())}).toString()}`,U=JSON.stringify({flowId:"Q166PR519W",flowAliasId:"HKFUVLWVH2",input:{loyaltyPoints:"",productName:g,productPoints:String(L||0),interests:q}}),re=await fetch(W,{signal:AbortSignal.timeout(3e4),method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${J}`},body:U});if(!re.body)throw new Error("Readable stream not supported");const le=re.body.getReader(),Fe=new TextDecoder;let Te="";for(;;){const{done:ne,value:Z}=await le.read();if(ne)break;Te+=Fe.decode(Z,{stream:!0});const Oe=Te.split(`
8
- `);Te=Oe.pop()||"";for(const oe of Oe)if(oe.startsWith("data:")){const F=oe.slice(5).trim();try{const X=JSON.parse(F);X.index===0&&ce(ee=>ee.map((we,Ae)=>Ae===ee.length-1?{...we,secondaryResponse:X.data,secondaryLoading:!1}:we))}catch(X){ce(ee=>ee.map((we,Ae)=>Ae===ee.length-1?{...we,secondaryLoading:!1}:we)),console.error("Secondary flow JSON parse error:",X)}}}}catch(J){console.error("Secondary flow error:",J)}},Re=async g=>{const L=g||_.trim();if(L){T(!0),ie(""),a.current=null,i.current=null,l.current=null,c.current=null,ce(q=>[...q,{query:L,response:"Thinking for what suits you best...",potentialQuestions:"",products:[],keywords:"Thinking for best products..."}]);try{const q=G,J=localStorage.getItem("customerNumber"),B=localStorage.getItem("isLoggedIn"),M=await Ur(Me,vt);if(!M)throw new Error("Failed to obtain access token");const W=`https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({registered:String(B||!1),userId:String(J||new Date().getTime())}).toString()}`,U=JSON.stringify({flowId:"MMHQKYI1NE",flowAliasId:"SZF9ZK1ATE",input:{userPrompt:L,whom:q}}),re=await fetch(W,{signal:AbortSignal.timeout(3e4),method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${M}`},body:U});if(!re.ok)throw new Error(`HTTP error! status: ${re.status}`);if(!re.body)throw new Error("Readable stream not supported");const le=re.body.getReader(),Fe=new TextDecoder;let Te="",ne="";for(;;){N(!0);const{done:Z,value:Oe}=await le.read();if(Z)break;Te+=Fe.decode(Oe,{stream:!0});const oe=Te.split(`
9
- `);Te=oe.pop()||"";for(const F of oe)if(F.startsWith("data:")){const X=F.slice(5).trim();try{const ee=JSON.parse(X);ee.index==1&&(ne=ee.data),ce(we=>we.map((Ae,it)=>it===we.length-1?{...Ae,[ee.index==0?"response":ee.index==1?"keywords":ee.index==2?"potentialQuestions":"end"]:ee.data}:Ae))}catch(ee){console.error("Error parsing JSON:",ee)}}}Cr(Le(ne))}catch(q){console.error("Error sending message to Tanya:",q)}finally{T(!1)}}},Le=g=>{const L=g.match(/top five relevant product or category names are: (.*)/i),B=(L?L[1]:g).split(", ").map(ye=>ye.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi,"").trim());return[...new Set(B)].filter(Boolean).join(",")},Cr=async g=>{var q,J,B;const L=typeof g=="string"?g.split(","):g;N(!0);try{const M=await Promise.all(L.map(U=>Zs(U).catch(()=>[]))),ye=L.map((U,re)=>({keyword:U,items:M[re]??[],loading:!1})).filter(U=>U.items.length>0),W=(J=(q=ye[0])==null?void 0:q.items)==null?void 0:J[0];if(W){i.current=W.product_id,a.current=W.product_name,l.current=(B=W.image)==null?void 0:B.link;const U=typeof W.price=="number"?W.price:null;c.current=U}if(ce(U=>U.map((re,le)=>le===U.length-1?{...re,products:ye,productSnapshot:W?{id:i.current,name:a.current,image:l.current,price:c.current,points:0,quantity:1}:re.productSnapshot}:re)),W){const U=JSON.parse(sessionStorage.getItem("customerData")||"{}");U!=null&&U.isGuest||(console.log("running secondary flow",er),xe(a.current,0))}}catch(M){console.error("error in keyword search",M)}finally{N(!1)}},_r=async(g,L)=>{var q,J,B,M,ye,W,U,re,le,Fe,Te,ne,Z,Oe,oe;I(!0);try{const F=await Co(g.id);if(!((J=(q=F==null?void 0:F.variants)==null?void 0:q[0])!=null&&J.product_id||(M=(B=F==null?void 0:F.variants)==null?void 0:B[0])!=null&&M.productId)&&!(F.type.item||F.type.bundle)){I(!1),Ke.toast.error("Variants not found",{position:"bottom-right",autoClose:1e3}),console.error("No product variant found");return}const X=[{product_id:((ye=F.variants)==null?void 0:ye[0].product_id)||((W=F.variants)==null?void 0:W[0].productId)||(F==null?void 0:F.id),quantity:L}];console.log(X,"product data","app version",er);const ee=JSON.parse(sessionStorage.getItem("customerData")||"{}"),we=(ee==null?void 0:ee.basketId)||localStorage.getItem(hr),Ae=!1,it=localStorage.getItem(Ht),kt=Date.now();if(!Ae||!it||kt>=parseInt(it)){const Jt=await So();let{customer_token:Je}=await No(Jt);if(Je="Bearer "+f.access_token,!Je){console.error("Failed to get customer_token");return}const Xt=kt+300*1e3;if(gr(Je),localStorage.setItem(Ht,Xt.toString()),console.log(we,"basketIdFromCustomer"),we){const ct=await Po({basketId:we,customer_token:Je});if(ct.status===200&&ct){const At=await Br(we,X,Je);((U=At==null?void 0:At.product_items)==null?void 0:U.length)>0&&(Ke.toast.success("Added to cart",{position:"bottom-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0}),pr(we),I(!1));return}}const jt={productItems:[{productId:((re=F.variants)==null?void 0:re[0].product_id)||((le=F.variants)==null?void 0:le[0].productId)||(F==null?void 0:F.id),quantity:1}]},O=await _o(Je,jt);if(console.log(O,O==null?void 0:O.basket_id,O==null?void 0:O.basketId,"the basket response"),!(O!=null&&O.basket_id||!(O!=null&&O.basketId))){I(!1),console.error("Failed to create basket");return}pt((O==null?void 0:O.basket_id)||(O==null?void 0:O.basketId));const Be=await r({productId:i,quantity:L},(O==null?void 0:O.basket_id)||(O==null?void 0:O.basketId));(((Fe=Be==null?void 0:Be.product_items)==null?void 0:Fe.length)>0||((Te=Be==null?void 0:Be.productItems)==null?void 0:Te.length)>0)&&Ke.toast.success("Added to cart",{position:"bottom-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0}),pr(O.basket_id||(O==null?void 0:O.basketId))}}catch(F){I(!1),console.error("Error adding to cart:",F),Ke.toast.error("Failed to add product to cart",{position:"bottom-right",autoClose:3e3}),((ne=F==null?void 0:F.response)==null?void 0:ne.status)===404||((Z=F==null?void 0:F.response)==null?void 0:Z.status)===401?(((Oe=F==null?void 0:F.response)==null?void 0:Oe.status)===404&&pt(null),((oe=F==null?void 0:F.response)==null?void 0:oe.status)===401&&(pt(null),gr(null))):(console.error("Failed to add product to basket:",F.message),Ke.toast.error("Failed to add product to cart",{position:"bottom-right",autoClose:3e3}))}I(!1)};return h.useEffect(()=>{b?setTimeout(()=>v(!0),10):v(!1)},[b]),s.jsx("div",{className:"relative flex justify-center",children:s.jsxs(Xs,{open:p,onOpenChange:w,children:[s.jsx(Qs,{onClick:()=>w(!0),style:{},className:"flex items-center rounded-lg cursor-pointer hover:opacity-90 transition-opacity p-0",children:s.jsx("div",{className:"flex flex-col",children:s.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsxs("g",{clipPath:"url(#clip0_958_585)",children:[s.jsx("path",{d:"M30.0002 5C31.7683 5 33.464 5.70238 34.7142 6.95262C35.9644 8.20286 36.6668 9.89856 36.6668 11.6667V25C36.6668 26.7681 35.9644 28.4638 34.7142 29.714C33.464 30.9643 31.7683 31.6667 30.0002 31.6667H25.6902L21.1785 36.1783C20.8915 36.4653 20.5097 36.6377 20.1046 36.6631C19.6996 36.6886 19.2992 36.5654 18.9785 36.3167L18.8218 36.1783L14.3085 31.6667H10.0002C8.28976 31.6667 6.64478 31.0093 5.40548 29.8305C4.16617 28.6516 3.42735 27.0416 3.34183 25.3333L3.3335 25V11.6667C3.3335 9.89856 4.03588 8.20286 5.28612 6.95262C6.53636 5.70238 8.23205 5 10.0002 5H30.0002Z",fill:"url(#paint0_linear_958_585)"}),s.jsx("path",{d:"M28.3335 15.6511V11.6667C28.3335 11.6667 22.2774 12.6042 20.1148 15.4167C17.9521 18.2292 18.6644 26.6667 18.6644 26.6667H22.5321C22.5321 26.6667 22.0614 18.9323 23.4989 17.2917C24.9364 15.6511 28.3335 15.6511 28.3335 15.6511Z",fill:"white"}),s.jsx("path",{d:"M13.3335 11.6667H19.6184V15.4167H13.3335V11.6667Z",fill:"white"})]}),s.jsxs("defs",{children:[s.jsxs("linearGradient",{id:"paint0_linear_958_585",x1:"20.0002",y1:"5",x2:"35.0002",y2:"30",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#452697"}),s.jsx("stop",{offset:"1",stopColor:"#7C5BFF"})]}),s.jsx("clipPath",{id:"clip0_958_585",children:s.jsx("rect",{width:"40",height:"40",fill:"white"})})]})]})})}),b&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-40 bg-black/30",onClick:()=>w(!1)}),s.jsxs("div",{className:`
4
+ ${s?"translate-y-0 md:translate-y-0 md:translate-x-0 opacity-100":"translate-y-full md:translate-y-0 md:translate-x-full opacity-0 pointer-events-none"}
5
+ `,style:{willChange:"transform, opacity"},onClick:N=>N.stopPropagation(),children:[n.jsxs("div",{className:"mt-3 flex flex-row justify-between w-full ",children:[n.jsx("div",{children:n.jsx("p",{className:"text-[#000000] font-bold font-nunitoSans",children:r.name})}),n.jsx("div",{children:n.jsx("div",{className:"text-[#555555] w-6 h-6 cursor-pointer",onClick:()=>{a(!1),setTimeout(()=>t(ar(null)),Vr)},children:"✕"})})]}),n.jsxs("div",{className:"flex flex-row gap-2 items-center flex-wrap",children:[n.jsx("div",{className:"flex flex-row items-center justify-center w-[120px] h-[120px] my-5",children:n.jsx("img",{src:(y=(p=(h=(l=r.imageGroups)==null?void 0:l[0])==null?void 0:h.images)==null?void 0:p[0])==null?void 0:y.link,alt:r.name,className:"rounded-[10px]"})}),n.jsx("div",{className:"flex flex-col items-center gap-2",children:r.imageGroups.slice(1,2).map(N=>N.images.slice(1,2).map(_=>n.jsx("img",{src:_.link,alt:r.name,className:"rounded-[10px] w-[60px] h-[60px]"},_.link)))})]}),n.jsxs("div",{className:"flex flex-row items-center justify-between w-full",children:[n.jsxs("div",{className:"flex flex-row items-center gap-2",children:[n.jsxs("p",{className:"text-[#14121F] font-bold font-nunitoSans",children:[" ","$",r.price.toFixed(2)]})," ",n.jsxs("p",{className:"text-[#14121F] font-normal line-through text-sm font-nunitoSans",children:[" ","$",(r.price+5).toFixed(2)]})]}),n.jsx("div",{children:n.jsx("p",{className:"text-[#EC5050] font-bold font-nunitoSans",children:r.discount})})]}),n.jsx("div",{className:"mt-2 w-full border-t-2 border-gray-200"}),n.jsxs("div",{className:"w-full text-left",children:[n.jsx("div",{className:"text-[#323135] font-bold font-nunitoSans mt-3 text-[14px]",children:"Product Details"}),n.jsx("div",{className:"text-[#68656E] font-normal font-nunitoSans text-xs pl-2 mt-3",dangerouslySetInnerHTML:{__html:r.short_description||r.longDescription}})]}),n.jsxs("div",{className:"mt-4 flex flex-col gap-2 w-full p-2",children:[n.jsx("div",{className:"flex flex-row items-center gap-2",children:n.jsxs("div",{className:"flex items-center gap-2 text-left font-nunitoSans",children:[n.jsxs("div",{className:"text-[#323135] font-bold",children:[((w=r==null?void 0:r.rating)==null?void 0:w.rate)||0," /"," ",n.jsx("span",{className:"text-[#68656E]",children:"5"})]}),n.jsx("div",{className:"text-[#323135] font-semibold text-sm",children:"Overall Rating"}),n.jsxs("div",{className:"text-[#68656E] font-semibold text-sm",children:[((k=r==null?void 0:r.rating)==null?void 0:k.count)||0," ratings"]})]})}),n.jsx("div",{className:"mt-2 flex flex-row items-center gap-2",children:Array.from({length:5}).map((N,_)=>{var S;return n.jsx(No.Icon,{icon:"mdi:star",width:"20",height:"20",className:`text-yellow-500
6
+ ${((S=r==null?void 0:r.rating)==null?void 0:S.rate)>_?"text-yellow-500":"text-gray-300"}
7
+ `},_)})})]}),n.jsxs("div",{className:"flex flex-col items-center justify-between font-nunitoSans font-semibold w-5/6 text-black gap-2",style:{marginTop:"40px"},children:[n.jsx("button",{className:"rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer",style:{backgroundColor:o.tanyaThemeColor},onClick:i,children:"Add to Cart"}),n.jsx("button",{className:"rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer mb-16",style:{backgroundColor:o.tanyaThemeColor},onClick:c,children:"View more"})]})]})]})},Jo=({tanyaConfig:e,basketId:t,addToCart:r})=>{const o=["Myself","My Child","My Grandchild","Niece/Nephew","My Friends","Others"],s={Myself:"himself/herself","My Child":"his/her child","My Grandchild":"his/her grandchild","Niece/Nephew":"his/her niece/nephew","My Friends":"his/her friends",Others:"others"},a=g.useRef(null),i=g.useRef(null),c=g.useRef(null),l=g.useRef(null),[h,p]=g.useState(null);g.useRef(null);const[y,w]=g.useState(!1),[k,N]=g.useState(!1),[_,S]=g.useState(!1),[I,B]=g.useState(!1),[x,H]=g.useState(!1),[Ee,P]=g.useState(!1),[U,ge]=g.useState(""),[oe,G]=g.useState(""),Ce=f=>({id:f.id,title:f.name,image:f.image??"",price:f.price??0}),[Te,me]=g.useState([]),L=g.useRef(null),E=ot.useSelector(f=>f.store.store),R=ot.useSelector(f=>f.product.product);g.useEffect(()=>{const f=localStorage.getItem(`access_token_${e.siteId}`),O=localStorage.getItem(`chat-token-${e.siteId}`);if(f&&O===f){const A=localStorage.getItem("chatHistory");A&&me(JSON.parse(A))}else localStorage.setItem("chatHistory",JSON.stringify([])),localStorage.setItem(`chat-token-${e.siteId}`,f||"")},[]),g.useEffect(()=>{localStorage.setItem("chatHistory",JSON.stringify(Te));const f=localStorage.getItem(`access_token_${e.siteId}`);f&&localStorage.setItem(`chat-token-${e.siteId}`,f)},[Te]);const Ke=()=>{S(!0),setTimeout(()=>N(!0),10)},Be=()=>{N(!1),setTimeout(()=>S(!1),300)};g.useEffect(()=>{y?Ke():Be()},[y]);const ye=f=>{G(s[f])};g.useEffect(()=>{_&&L.current&&L.current.scrollTo({top:L.current.scrollHeight,behavior:"smooth"})},[Te,_]);const ke=null,ct=null,We=async()=>{const f=await yt();f!=null&&p(f)};g.useEffect(()=>{if(e!=null&&e.siteId){const{clientID:f,host:O,organizationID:A,shortCode:V,siteId:D}=e;sessionStorage.setItem("Host",O),sessionStorage.setItem("SiteId",D),sessionStorage.setItem("pubCfg",btoa(f)),sessionStorage.setItem("envRef",V),sessionStorage.setItem("orgRef",A)}We(),console.log("scapi environment v1")},[]),g.useEffect(()=>{t&&(console.log("setting the basket id",t),nt(t))},[t]);const z=async()=>{const f=JSON.parse(sessionStorage.getItem("customerData")||"{}").customerId;return(await Mo(f||"")).c_interests},ie=async(f,O)=>{console.log("in secondary flow",At);const A=await z();if(console.log(A,"interests of customer",At),!!A)try{me(X=>X.map((K,ve)=>ve===X.length-1?{...K,secondaryLoading:!0}:K));const V=await ir(ke,ct);if(!V)throw new Error("Failed to fetch token");const D=localStorage.getItem("customerNumber"),T=localStorage.getItem("isLoggedIn"),q=`https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({registered:String(T||!1),userId:String(D||new Date().getTime())}).toString()}`,$=JSON.stringify({flowId:"Q166PR519W",flowAliasId:"HKFUVLWVH2",input:{loyaltyPoints:"",productName:f,productPoints:String(O||0),interests:A}}),Q=await fetch(q,{signal:AbortSignal.timeout(3e4),method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${V}`},body:$});if(!Q.body)throw new Error("Readable stream not supported");const te=Q.body.getReader(),we=new TextDecoder;let be="";for(;;){const{done:X,value:K}=await te.read();if(X)break;be+=we.decode(K,{stream:!0});const ve=be.split(`
8
+ `);be=ve.pop()||"";for(const Z of ve)if(Z.startsWith("data:")){const j=Z.slice(5).trim();try{const Y=JSON.parse(j);Y.index===0&&me(W=>W.map((ce,je)=>je===W.length-1?{...ce,secondaryResponse:Y.data,secondaryLoading:!1}:ce))}catch(Y){me(W=>W.map((ce,je)=>je===W.length-1?{...ce,secondaryLoading:!1}:ce)),console.error("Secondary flow JSON parse error:",Y)}}}}catch(V){console.error("Secondary flow error:",V)}},_e=async f=>{const O=f||U.trim();if(O){H(!0),ge(""),a.current=null,i.current=null,c.current=null,l.current=null,me(A=>[...A,{query:O,response:"Thinking for what suits you best...",potentialQuestions:"",products:[],keywords:"Thinking for best products..."}]);try{const A=oe,V=localStorage.getItem("customerNumber"),D=localStorage.getItem("isLoggedIn"),T=await ir(ke,ct);if(!T)throw new Error("Failed to obtain access token");const q=`https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({registered:String(D||!1),userId:String(V||new Date().getTime())}).toString()}`,$=JSON.stringify({flowId:"MMHQKYI1NE",flowAliasId:"SZF9ZK1ATE",input:{userPrompt:O,whom:A}}),Q=await fetch(q,{signal:AbortSignal.timeout(3e4),method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${T}`},body:$});if(!Q.ok)throw new Error(`HTTP error! status: ${Q.status}`);if(!Q.body)throw new Error("Readable stream not supported");const te=Q.body.getReader(),we=new TextDecoder;let be="",X="";for(;;){P(!0);const{done:K,value:ve}=await te.read();if(K)break;be+=we.decode(ve,{stream:!0});const Z=be.split(`
9
+ `);be=Z.pop()||"";for(const j of Z)if(j.startsWith("data:")){const Y=j.slice(5).trim();try{const W=JSON.parse(Y);W.index==1&&(X=W.data),me(ce=>ce.map((je,Ge)=>Ge===ce.length-1?{...je,[W.index==0?"response":W.index==1?"keywords":W.index==2?"potentialQuestions":"end"]:W.data}:je))}catch(W){console.error("Error parsing JSON:",W)}}}Gt(Se(X))}catch(A){console.error("Error sending message to Tanya:",A)}finally{H(!1)}}},Se=f=>{const O=f.match(/top five relevant product or category names are: (.*)/i),D=(O?O[1]:f).split(", ").map(le=>le.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi,"").trim());return[...new Set(D)].filter(Boolean).join(",")},Gt=async f=>{var A,V,D;const O=typeof f=="string"?f.split(","):f;P(!0);try{const T=await Promise.all(O.map($=>zo($).catch(()=>[]))),le=O.map(($,Q)=>({keyword:$,items:T[Q]??[],loading:!1})).filter($=>$.items.length>0),q=(V=(A=le[0])==null?void 0:A.items)==null?void 0:V[0];if(q){i.current=q.product_id,a.current=q.product_name,c.current=(D=q.image)==null?void 0:D.link;const $=typeof q.price=="number"?q.price:null;l.current=$}if(me($=>$.map((Q,te)=>te===$.length-1?{...Q,products:le,productSnapshot:q?{id:i.current,name:a.current,image:c.current,price:l.current,points:0,quantity:1}:Q.productSnapshot}:Q)),q){const $=JSON.parse(sessionStorage.getItem("customerData")||"{}");$!=null&&$.isGuest||(console.log("running secondary flow",At),ie(a.current,0))}}catch(T){console.error("error in keyword search",T)}finally{P(!1)}},Qt=async(f,O)=>{var A,V,D,T,le,q,$,Q,te,we,be,X,K,ve,Z;B(!0);try{const j=await _n(f.id);if(!((V=(A=j==null?void 0:j.variants)==null?void 0:A[0])!=null&&V.product_id||(T=(D=j==null?void 0:j.variants)==null?void 0:D[0])!=null&&T.productId)&&!(j.type.item||j.type.bundle)){B(!1),Le.toast.error("Variants not found",{position:"bottom-right",autoClose:1e3}),console.error("No product variant found");return}const Y=[{product_id:((le=j.variants)==null?void 0:le[0].product_id)||((q=j.variants)==null?void 0:q[0].productId)||(j==null?void 0:j.id),quantity:O}];console.log(Y,"product data","app version",At);const W=JSON.parse(sessionStorage.getItem("customerData")||"{}"),ce=(W==null?void 0:W.basketId)||localStorage.getItem(Vt),je=!1,Ge=localStorage.getItem(It),dt=Date.now();if(!je||!Ge||dt>=parseInt(Ge)){const Pt=await Nn();let{customer_token:De}=await Cn(Pt);if(De="Bearer "+h.access_token,!De){console.error("Failed to get customer_token");return}const Et=dt+300*1e3;if(Yt(De),localStorage.setItem(It,Et.toString()),console.log(ce,"basketIdFromCustomer"),ce){const Qe=await Fn({basketId:ce,customer_token:De});if(Qe.status===200&&Qe){const wt=await lr(ce,Y,De);(($=wt==null?void 0:wt.product_items)==null?void 0:$.length)>0&&(Le.toast.success("Added to cart",{position:"bottom-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0}),Ht(ce),B(!1));return}}const ut={productItems:[{productId:((Q=j.variants)==null?void 0:Q[0].product_id)||((te=j.variants)==null?void 0:te[0].productId)||(j==null?void 0:j.id),quantity:1}]},C=await In(De,ut);if(console.log(C,C==null?void 0:C.basket_id,C==null?void 0:C.basketId,"the basket response"),!(C!=null&&C.basket_id||!(C!=null&&C.basketId))){B(!1),console.error("Failed to create basket");return}nt((C==null?void 0:C.basket_id)||(C==null?void 0:C.basketId));const Oe=await r({productId:i,quantity:O},(C==null?void 0:C.basket_id)||(C==null?void 0:C.basketId));(((we=Oe==null?void 0:Oe.product_items)==null?void 0:we.length)>0||((be=Oe==null?void 0:Oe.productItems)==null?void 0:be.length)>0)&&Le.toast.success("Added to cart",{position:"bottom-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0}),Ht(C.basket_id||(C==null?void 0:C.basketId))}}catch(j){B(!1),console.error("Error adding to cart:",j),Le.toast.error("Failed to add product to cart",{position:"bottom-right",autoClose:3e3}),((X=j==null?void 0:j.response)==null?void 0:X.status)===404||((K=j==null?void 0:j.response)==null?void 0:K.status)===401?(((ve=j==null?void 0:j.response)==null?void 0:ve.status)===404&&nt(null),((Z=j==null?void 0:j.response)==null?void 0:Z.status)===401&&(nt(null),Yt(null))):(console.error("Failed to add product to basket:",j.message),Le.toast.error("Failed to add product to cart",{position:"bottom-right",autoClose:3e3}))}B(!1)};return g.useEffect(()=>{_?setTimeout(()=>N(!0),10):N(!1)},[_]),n.jsx("div",{className:"relative flex justify-center",children:n.jsxs(Lo,{open:y,onOpenChange:w,children:[n.jsx(Do,{onClick:()=>w(!0),style:{},className:"flex items-center rounded-lg cursor-pointer hover:opacity-90 transition-opacity p-0",children:n.jsx("div",{className:"flex flex-col",children:n.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsxs("g",{clipPath:"url(#clip0_958_585)",children:[n.jsx("path",{d:"M30.0002 5C31.7683 5 33.464 5.70238 34.7142 6.95262C35.9644 8.20286 36.6668 9.89856 36.6668 11.6667V25C36.6668 26.7681 35.9644 28.4638 34.7142 29.714C33.464 30.9643 31.7683 31.6667 30.0002 31.6667H25.6902L21.1785 36.1783C20.8915 36.4653 20.5097 36.6377 20.1046 36.6631C19.6996 36.6886 19.2992 36.5654 18.9785 36.3167L18.8218 36.1783L14.3085 31.6667H10.0002C8.28976 31.6667 6.64478 31.0093 5.40548 29.8305C4.16617 28.6516 3.42735 27.0416 3.34183 25.3333L3.3335 25V11.6667C3.3335 9.89856 4.03588 8.20286 5.28612 6.95262C6.53636 5.70238 8.23205 5 10.0002 5H30.0002Z",fill:"url(#paint0_linear_958_585)"}),n.jsx("path",{d:"M28.3335 15.6511V11.6667C28.3335 11.6667 22.2774 12.6042 20.1148 15.4167C17.9521 18.2292 18.6644 26.6667 18.6644 26.6667H22.5321C22.5321 26.6667 22.0614 18.9323 23.4989 17.2917C24.9364 15.6511 28.3335 15.6511 28.3335 15.6511Z",fill:"white"}),n.jsx("path",{d:"M13.3335 11.6667H19.6184V15.4167H13.3335V11.6667Z",fill:"white"})]}),n.jsxs("defs",{children:[n.jsxs("linearGradient",{id:"paint0_linear_958_585",x1:"20.0002",y1:"5",x2:"35.0002",y2:"30",gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:"#452697"}),n.jsx("stop",{offset:"1",stopColor:"#7C5BFF"})]}),n.jsx("clipPath",{id:"clip0_958_585",children:n.jsx("rect",{width:"40",height:"40",fill:"white"})})]})]})})}),_&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-40 bg-black/30",onClick:()=>w(!1)}),n.jsxs("div",{className:`
10
10
  fixed z-50 h-screen w-[100vw] sm:w-[80vw] md:w-[770px] border-0 bg-white lg:rounded-l-xl overflow-hidden flex flex-col shadow-[0px_4px_10px_0px_#5F499840]
11
11
  top-0 right-0
12
12
  transition-transform duration-300 ease-in-out
13
13
  lg:transform lg:translate-y-0
14
14
 
15
- `,style:{background:"linear-gradient(170.1deg, #FFFFFF 60.03%, #E3DEEF 99.59%)"},children:[s.jsxs("div",{className:"flex justify-between p-3 bg-[#FFFFFF] border border-b-1 border-[#E5E5E5] ",children:[s.jsx("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:s.jsxs("div",{className:"flex flex-col gap-1",children:[s.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:[s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 15 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.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"}),s.jsx("path",{d:"M0 0.5H6.28488V4.25H0V0.5Z",fill:"white"})]}),s.jsx("p",{className:"text-[#FFFFFF] font-nunitoSans font-semibold",children:"TANYA"})]}),s.jsxs("p",{className:"text-[#5B5B5B] font-nunitoSans font-semibold",style:{fontStyle:"italic"},children:[" ","Your AI shopping assistant !"," "]})]})}),s.jsx("div",{style:{display:"flex",alignItems:"center",gap:"1.25rem",margin:"0.75rem"},children:s.jsx("button",{onClick:()=>w(!1),children:s.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsxs("g",{clipPath:"url(#clip0_501_6036)",children:[s.jsx("path",{d:"M18 6.5L6 18.5",stroke:"#555555",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("path",{d:"M6 6.5L18 18.5",stroke:"#555555",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),s.jsx("defs",{children:s.jsx("clipPath",{id:"clip0_501_6036",children:s.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 0.5)"})})})]})})})]}),s.jsxs("div",{className:"flex h-full md:flex-row lg:flex-row",children:[s.jsxs("div",{className:`flex flex-col h-full ${E?"lg:w-2/3 w-full":"w-full"}`,children:[s.jsxs("div",{ref:D,className:"overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",children:[(A==null?void 0:A.whomRequired)&&s.jsxs("div",{className:"mx-3 p-3 rounded-2xl bg-[#FFFFFF]",children:[s.jsx("div",{className:"flex gap-2 bg-[#FFFFFF]",children:s.jsx("p",{className:"font-bold font-nunitoSans text-[#494949]",children:"Is this for you or someone else?"})}),s.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:n.map(g=>s.jsx("button",{onClick:()=>Se(g),className:"px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",style:{backgroundColor:G===o[g]?"#FFFFFF":"#F3F3F3",borderColor:G===o[g]?"#BBB3DD":""},children:g},g))})]}),H.map((g,L)=>{var q,J;return s.jsxs("div",{children:[s.jsx("div",{className:"flex justify-end",children:s.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:g.query})}),g.response&&g.response.includes("Thinking")?s.jsx("div",{children:s.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:Ir(g.response)}})}):s.jsx("div",{children:s.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:Ir(g.response)}})}),te&&!g.response.includes("Thinking")&&((q=g.products)==null?void 0:q.length)==0&&s.jsx("div",{children:s.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"})}),(g==null?void 0:g.products)&&((J=g==null?void 0:g.products)==null?void 0:J.length)>0&&s.jsx(sa,{chat:g.products,storeDetails:A}),(g==null?void 0:g.potentialQuestions.length)>0&&s.jsxs("div",{className:"my-2 px-4 text-sm text-gray-700",children:[s.jsx("p",{className:"font-nunitoSans font-bold text-sm text-[#494949]",style:{color:A.themeDarkColor},children:"Why not explore these inquiries..."}),g.potentialQuestions.split(",").map((B,M)=>s.jsx("button",{className:`cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${A.themeDarkColor} m-1 rounded-xl px-2 py-1`,onClick:()=>Re(B),style:{backgroundColor:A.tanyaThemeColorLight},children:B},M))]}),(g==null?void 0:g.secondaryLoading)&&s.jsx("div",{className:"mt-3 mb-4 px-4",children:s.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:[s.jsxs("div",{className:"flex gap-1",children:[s.jsx("div",{className:"tanya-sparkle tanya-sparkle-1",children:"✨"}),s.jsx("div",{className:"tanya-sparkle tanya-sparkle-2",children:"✨"}),s.jsx("div",{className:"tanya-sparkle tanya-sparkle-3",children:"✨"})]}),s.jsx("div",{className:"tanya-shimmer"}),s.jsx("p",{className:"font-semibold tanya-pulse",style:{color:A.themeDarkColor},children:"I’ve found a special surprise crafted just for you… hang on a sec!"}),s.jsx("p",{className:"tanya-dots mt-1",style:{color:A.themeDarkColor},children:"• • •"})]})}),(g==null?void 0:g.secondaryResponse)&&s.jsx(s.Fragment,{children:s.jsxs("div",{className:"mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]",children:[s.jsx("div",{className:"text-sm text-[#232323] bg-[#FFFFFF] px-7 py-4 rounded-br-xl rounded-bl-2xl w-full",style:{backgroundColor:A.tanyaThemeColorLight},dangerouslySetInnerHTML:{__html:Ir(g.secondaryResponse)}}),g.productSnapshot&&s.jsx("div",{className:"mt-4 w-full",children:s.jsxs("div",{className:"flex gap-4 items-stretch rounded-2xl p-4",style:{backgroundColor:A.tanyaThemeColorLight},children:[s.jsx("div",{className:"flex-shrink-0 rounded-xl overflow-hidden border",style:{width:112,height:112,borderColor:"#eee"},children:g.productSnapshot.image?s.jsx("img",{src:g.productSnapshot.image,alt:g.productSnapshot.name,className:"w-full h-full object-cover"}):s.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-gray-500",children:"No Image"})}),s.jsxs("div",{className:"flex flex-col flex-1 justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold text-[15px] leading-snug",children:g.productSnapshot.name}),s.jsx("p",{className:"mt-1 text-[14px] font-medium",children:g.productSnapshot.price!=null?new Intl.NumberFormat(void 0,{style:"currency",currency:(A==null?void 0:A.currency)||"USD"}).format(g.productSnapshot.price):""}),g.productSnapshot.points>0&&s.jsxs("p",{className:"mt-1 text-xs opacity-80",children:["You will earn"," ",s.jsxs("strong",{children:[g.productSnapshot.points," ","points"]})]})]}),s.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center border rounded-full overflow-hidden",children:[s.jsx("button",{className:"px-3 py-1 text-sm",onClick:()=>ce(B=>B.map((M,ye)=>ye===L&&M.productSnapshot?{...M,productSnapshot:{...M.productSnapshot,quantity:Math.max(1,M.productSnapshot.quantity-1)}}:M)),style:{background:"transparent",color:A.themeDarkColor},children:"−"}),s.jsx("div",{className:"px-3 py-1 text-sm select-none",children:g.productSnapshot.quantity}),s.jsx("button",{className:"px-3 py-1 text-sm",onClick:()=>ce(B=>B.map((M,ye)=>ye===L&&M.productSnapshot?{...M,productSnapshot:{...M.productSnapshot,quantity:M.productSnapshot.quantity+1}}:M)),style:{background:"transparent",color:A.themeDarkColor},children:"+"})]}),s.jsx("button",{onClick:()=>{_r(fe(g.productSnapshot),g.productSnapshot.quantity)},disabled:S,className:"px-4 py-2 rounded-full font-medium",style:{background:A.tanyaThemeColor,color:(A==null?void 0:A.tanyaThemeContrastColor)||"#fff",opacity:S?.8:1},children:S?"Adding...":"Add to cart"})]})]})]})})]})}),s.jsx("div",{className:"mb-20"})]},L)})]}),s.jsx("div",{className:"flex flex-col gap-2 sticky bottom-0 left-0 right-0 bg-[#E3DEEF] z-50 px-4 py-2",children:s.jsx("div",{className:"p-[1px] rounded-xl",style:{background:"linear-gradient(180deg, #B09FFF 0%, #8D79F6 100%)"},children:s.jsxs("div",{className:"flex items-center bg-[#FFFFFF] flex-1 rounded-xl px-2 py-1",children:[s.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:g=>ie(g.target.value),onKeyDown:g=>{g.key==="Enter"&&!x&&Re()}}),s.jsx("button",{type:"submit",disabled:x,className:"p-3",onClick:()=>Re(),children:x?s.jsx("div",{className:"p-3 animate-spin rounded-full h-3 w-3 border-b-2",style:{borderBottom:"2px solid",color:A.tanyaThemeColor}}):s.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.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"})})})]})})})]}),s.jsx(ia,{addToCartPwa:r})]})]})]})]})})};var Hr=function(e,t){return Hr=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])},Hr(e,t)};function la(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Hr(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var ot=function(){return ot=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},ot.apply(this,arguments)};function da(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}var Er="Invariant Violation",An=Object.setPrototypeOf,ua=An===void 0?function(e,t){return e.__proto__=t,e}:An,Io=(function(e){la(t,e);function t(r){r===void 0&&(r=Er);var n=e.call(this,typeof r=="number"?Er+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=Er,ua(n,t.prototype),n}return t})(Error);function mt(e,t){if(!e)throw new Io(t)}var Eo=["debug","log","warn","error","silent"],fa=Eo.indexOf("log");function tr(e){return function(){if(Eo.indexOf(e)>=fa){var t=console[e]||console.log;return t.apply(console,arguments)}}}(function(e){e.debug=tr("debug"),e.log=tr("log"),e.warn=tr("warn"),e.error=tr("error")})(mt||(mt={}));var Fo="3.14.0";function Ct(e){try{return e()}catch{}}const Vr=Ct(function(){return globalThis})||Ct(function(){return window})||Ct(function(){return self})||Ct(function(){return global})||Ct(function(){return Ct.constructor("return this")()});var $n=new Map;function ma(e){var t=$n.get(e)||1;return $n.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function pa(e,t){var r=ma("stringifyForDisplay");return JSON.stringify(e,function(n,o){return o===void 0?r:o},t).split(JSON.stringify(r)).join("<undefined>")}function rr(e){return function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(typeof t=="number"){var o=t;t=rn(o),t||(t=nn(o,r),r=[])}e.apply(void 0,[t].concat(r))}}var Fr=Object.assign(function(t,r){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];t||mt(t,rn(r,n)||nn(r,n))},{debug:rr(mt.debug),log:rr(mt.log),warn:rr(mt.warn),error:rr(mt.error)});function To(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return new Io(rn(e,t)||nn(e,t))}var Mn=Symbol.for("ApolloErrorMessageHandler_"+Fo);function Oo(e){if(typeof e=="string")return e;try{return pa(e,2).slice(0,1e3)}catch{return"<non-serializable>"}}function rn(e,t){if(t===void 0&&(t=[]),!!e)return Vr[Mn]&&Vr[Mn](e,t.map(Oo))}function nn(e,t){if(t===void 0&&(t=[]),!!e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:Fo,message:e,args:t.map(Oo)})))}function ha(e){return e.definitions.filter(function(t){return t.kind==="OperationDefinition"&&!!t.name}).map(function(t){return t.name.value})[0]||null}let he=null;const Ln={};let ga=1;const xa=()=>class{constructor(){this.id=["slot",ga++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let t=he;t;t=t.parent)if(this.id in t.slots){const r=t.slots[this.id];if(r===Ln)break;return t!==he&&(he.slots[this.id]=r),!0}return he&&(he.slots[this.id]=Ln),!1}getValue(){if(this.hasValue())return he.slots[this.id]}withValue(t,r,n,o){const a={__proto__:null,[this.id]:t},i=he;he={parent:i,slots:a};try{return r.apply(o,n)}finally{he=i}}static bind(t){const r=he;return function(){const n=he;try{return he=r,t.apply(this,arguments)}finally{he=n}}}static noContext(t,r,n){if(he){const o=he;try{return he=null,t.apply(n,r)}finally{he=o}}else return t.apply(n,r)}};function Dn(e){try{return e()}catch{}}const Tr="@wry/context:Slot",ya=Dn(()=>globalThis)||Dn(()=>global)||Object.create(null),Rn=ya,on=Rn[Tr]||Array[Tr]||(function(e){try{Object.defineProperty(Rn,Tr,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}})(xa()),{bind:El,noContext:Fl}=on;new on;function wa(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=ba(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
16
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ba(e,t){if(e){if(typeof e=="string")return zn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zn(e,t)}}function zn(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function qn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function sn(e,t,r){return t&&qn(e.prototype,t),r&&qn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var an=function(){return typeof Symbol=="function"},cn=function(e){return an()&&!!Symbol[e]},ln=function(e){return cn(e)?Symbol[e]:"@@"+e};an()&&!cn("observable")&&(Symbol.observable=Symbol("observable"));var va=ln("iterator"),Yr=ln("observable"),Ao=ln("species");function xr(e,t){var r=e[t];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function Dt(e){var t=e.constructor;return t!==void 0&&(t=t[Ao],t===null&&(t=void 0)),t!==void 0?t:je}function ka(e){return e instanceof je}function It(e){It.log?It.log(e):setTimeout(function(){throw e})}function sr(e){Promise.resolve().then(function(){try{e()}catch(t){It(t)}})}function $o(e){var t=e._cleanup;if(t!==void 0&&(e._cleanup=void 0,!!t))try{if(typeof t=="function")t();else{var r=xr(t,"unsubscribe");r&&r.call(t)}}catch(n){It(n)}}function Wr(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function ja(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(Mo(e,t[r].type,t[r].value),e._state!=="closed");++r);}}function Mo(e,t,r){e._state="running";var n=e._observer;try{var o=xr(n,t);switch(t){case"next":o&&o.call(n,r);break;case"error":if(Wr(e),o)o.call(n,r);else throw r;break;case"complete":Wr(e),o&&o.call(n);break}}catch(a){It(a)}e._state==="closed"?$o(e):e._state==="running"&&(e._state="ready")}function Or(e,t,r){if(e._state!=="closed"){if(e._state==="buffering"){e._queue.push({type:t,value:r});return}if(e._state!=="ready"){e._state="buffering",e._queue=[{type:t,value:r}],sr(function(){return ja(e)});return}Mo(e,t,r)}}var Sa=(function(){function e(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var o=new Na(this);try{this._cleanup=n.call(void 0,o)}catch(a){o.error(a)}this._state==="initializing"&&(this._state="ready")}var t=e.prototype;return t.unsubscribe=function(){this._state!=="closed"&&(Wr(this),$o(this))},sn(e,[{key:"closed",get:function(){return this._state==="closed"}}]),e})(),Na=(function(){function e(r){this._subscription=r}var t=e.prototype;return t.next=function(n){Or(this._subscription,"next",n)},t.error=function(n){Or(this._subscription,"error",n)},t.complete=function(){Or(this._subscription,"complete")},sn(e,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),e})(),je=(function(){function e(r){if(!(this instanceof e))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 t=e.prototype;return t.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new Sa(n,this._subscriber)},t.forEach=function(n){var o=this;return new Promise(function(a,i){if(typeof n!="function"){i(new TypeError(n+" is not a function"));return}function l(){c.unsubscribe(),a()}var c=o.subscribe({next:function(f){try{n(f,l)}catch(u){i(u),c.unsubscribe()}},error:i,complete:a})})},t.map=function(n){var o=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Dt(this);return new a(function(i){return o.subscribe({next:function(l){try{l=n(l)}catch(c){return i.error(c)}i.next(l)},error:function(l){i.error(l)},complete:function(){i.complete()}})})},t.filter=function(n){var o=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Dt(this);return new a(function(i){return o.subscribe({next:function(l){try{if(!n(l))return}catch(c){return i.error(c)}i.next(l)},error:function(l){i.error(l)},complete:function(){i.complete()}})})},t.reduce=function(n){var o=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Dt(this),i=arguments.length>1,l=!1,c=arguments[1],f=c;return new a(function(u){return o.subscribe({next:function(p){var w=!l;if(l=!0,!w||i)try{f=n(f,p)}catch(j){return u.error(j)}else f=p},error:function(p){u.error(p)},complete:function(){if(!l&&!i)return u.error(new TypeError("Cannot reduce an empty sequence"));u.next(f),u.complete()}})})},t.concat=function(){for(var n=this,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var l=Dt(this);return new l(function(c){var f,u=0;function p(w){f=w.subscribe({next:function(j){c.next(j)},error:function(j){c.error(j)},complete:function(){u===a.length?(f=void 0,c.complete()):p(l.from(a[u++]))}})}return p(n),function(){f&&(f.unsubscribe(),f=void 0)}})},t.flatMap=function(n){var o=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Dt(this);return new a(function(i){var l=[],c=o.subscribe({next:function(u){if(n)try{u=n(u)}catch(w){return i.error(w)}var p=a.from(u).subscribe({next:function(w){i.next(w)},error:function(w){i.error(w)},complete:function(){var w=l.indexOf(p);w>=0&&l.splice(w,1),f()}});l.push(p)},error:function(u){i.error(u)},complete:function(){f()}});function f(){c.closed&&l.length===0&&i.complete()}return function(){l.forEach(function(u){return u.unsubscribe()}),c.unsubscribe()}})},t[Yr]=function(){return this},e.from=function(n){var o=typeof this=="function"?this:e;if(n==null)throw new TypeError(n+" is not an object");var a=xr(n,Yr);if(a){var i=a.call(n);if(Object(i)!==i)throw new TypeError(i+" is not an object");return ka(i)&&i.constructor===o?i:new o(function(l){return i.subscribe(l)})}if(cn("iterator")&&(a=xr(n,va),a))return new o(function(l){sr(function(){if(!l.closed){for(var c=wa(a.call(n)),f;!(f=c()).done;){var u=f.value;if(l.next(u),l.closed)return}l.complete()}})});if(Array.isArray(n))return new o(function(l){sr(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")},e.of=function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];var i=typeof this=="function"?this:e;return new i(function(l){sr(function(){if(!l.closed){for(var c=0;c<o.length;++c)if(l.next(o[c]),l.closed)return;l.complete()}})})},sn(e,null,[{key:Ao,get:function(){return this}}]),e})();an()&&Object.defineProperty(je,Symbol("extensions"),{value:{symbol:Yr,hostReportError:It},configurable:!0});function Ca(e){var t,r=e.Symbol;if(typeof r=="function")if(r.observable)t=r.observable;else{typeof r.for=="function"?t=r.for("https://github.com/benlesh/symbol-observable"):t=r("https://github.com/benlesh/symbol-observable");try{r.observable=t}catch{}}else t="@@observable";return t}var _t;typeof self<"u"?_t=self:typeof window<"u"?_t=window:typeof global<"u"?_t=global:typeof module<"u"?_t=module:_t=Function("return this")();Ca(_t);var Un=je.prototype,Bn="@@observable";Un[Bn]||(Un[Bn]=function(){return this});function _a(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];if(t.indexOf(o)<0)throw To(58,o)}return e}function Pa(e,t){var r=ot({},e),n=function(a){typeof a=="function"?r=ot(ot({},r),a(r)):r=ot(ot({},r),a)},o=function(){return ot({},r)};return Object.defineProperty(t,"setContext",{enumerable:!1,value:n}),Object.defineProperty(t,"getContext",{enumerable:!1,value:o}),t}function Ia(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName=typeof t.query!="string"?ha(t.query)||void 0:""),t}var Ea=Symbol.for("apollo.deprecations"),Fa=Vr,Ta=new on;function Oa(e){return Fa[Ea]||(Ta.getValue()||[]).includes(e)}function Aa(e,t){Oa(e)||t()}function Hn(e,t){return t?t(e):je.of()}function Rt(e){return typeof e=="function"?new Lo(e):e}function nr(e){return e.request.length<=1}var Lo=(function(){function e(t){t&&(this.request=t)}return e.empty=function(){return new e(function(){return je.of()})},e.from=function(t){return t.length===0?e.empty():t.map(Rt).reduce(function(r,n){return r.concat(n)})},e.split=function(t,r,n){var o=Rt(r),a=Rt(n||new e(Hn)),i;return nr(o)&&nr(a)?i=new e(function(l){return t(l)?o.request(l)||je.of():a.request(l)||je.of()}):i=new e(function(l,c){return t(l)?o.request(l,c)||je.of():a.request(l,c)||je.of()}),Object.assign(i,{left:o,right:a})},e.execute=function(t,r){return t.request(Pa(r.context,Ia(_a(r))))||je.of()},e.concat=function(t,r){var n=Rt(t);if(nr(n))return globalThis.__DEV__!==!1&&Fr.warn(47,n),n;var o=Rt(r),a;return nr(o)?a=new e(function(i){return n.request(i,function(l){return o.request(l)||je.of()})||je.of()}):a=new e(function(i,l){return n.request(i,function(c){return o.request(c,l)||je.of()})||je.of()}),Object.assign(a,{left:n,right:o})},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(Hn)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(t,r){throw To(48)},e.prototype.onError=function(t,r){if(globalThis.__DEV__!==!1&&Aa("onError",function(){globalThis.__DEV__!==!1&&Fr.warn(49)}),r&&r.error)return r.error(t),!1;throw t},e.prototype.setOnError=function(t){return globalThis.__DEV__!==!1&&globalThis.__DEV__!==!1&&Fr.warn(50),this.onError=t,this},e})();function $a(e){return new Lo(function(t,r){var n=da(t,[]);return new je(function(o){var a,i=!1;return Promise.resolve(n).then(function(l){return e(l,t.getContext())}).then(t.setContext).then(function(){i||(a=r(t).subscribe({next:o.next.bind(o),error:o.error.bind(o),complete:o.complete.bind(o)}))}).catch(o.error.bind(o)),function(){i=!0,a&&a.unsubscribe()}})})}const Ma=async()=>{const e="https://auth.australia-southeast1.gcp.commercetools.com/oauth/token",n="Basic "+btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN")+":"+encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));try{const o=await _e.post(e,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 _e.isAxiosError(o)?console.error("Error fetching token:",o.response||o.message):console.error("Unexpected error:",o),null}},La="https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql",Da=mr.createHttpLink({uri:`${La}`}),Ra=$a(async(e,{headers:t})=>{const r=await Ma();return{headers:{...t,authorization:`Bearer ${r}`}}}),za=new mr.ApolloClient({link:Ra.concat(Da),cache:new mr.InMemoryCache,defaultOptions:{watchQuery:{fetchPolicy:"cache-and-network"}}}),qa=e=>{const{tanyaConfig:t}=e;return s.jsx(mr.ApolloProvider,{client:za,children:s.jsx(Js,{children:s.jsx(ca,{tanyaConfig:t})})})};function Ua(e,t){const r=e.icons,n=e.aliases||Object.create(null),o=Object.create(null);function a(i){if(r[i])return o[i]=[];if(!(i in o)){o[i]=null;const l=n[i]&&n[i].parent,c=l&&a(l);c&&(o[i]=[l].concat(c))}return o[i]}return Object.keys(r).concat(Object.keys(n)).forEach(a),o}const Do=Object.freeze({left:0,top:0,width:16,height:16}),yr=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),dn=Object.freeze({...Do,...yr}),Kr=Object.freeze({...dn,body:"",hidden:!1});function Ba(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const n=((e.rotate||0)+(t.rotate||0))%4;return n&&(r.rotate=n),r}function Vn(e,t){const r=Ba(e,t);for(const n in Kr)n in yr?n in e&&!(n in r)&&(r[n]=yr[n]):n in t?r[n]=t[n]:n in e&&(r[n]=e[n]);return r}function Ha(e,t,r){const n=e.icons,o=e.aliases||Object.create(null);let a={};function i(l){a=Vn(n[l]||o[l],a)}return i(t),r.forEach(i),Vn(e,a)}function Ro(e,t){const r=[];if(typeof e!="object"||typeof e.icons!="object")return r;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),r.push(o)});const n=Ua(e);for(const o in n){const a=n[o];a&&(t(o,Ha(e,o,a)),r.push(o))}return r}const Va={provider:"",aliases:{},not_found:{},...Do};function Ar(e,t){for(const r in t)if(r in e&&typeof e[r]!=typeof t[r])return!1;return!0}function zo(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Ar(e,Va))return null;const r=t.icons;for(const o in r){const a=r[o];if(!o||typeof a.body!="string"||!Ar(a,Kr))return null}const n=t.aliases||Object.create(null);for(const o in n){const a=n[o],i=a.parent;if(!o||typeof i!="string"||!r[i]&&!n[i]||!Ar(a,Kr))return null}return t}const Yn=Object.create(null);function Ya(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Et(e,t){const r=Yn[e]||(Yn[e]=Object.create(null));return r[t]||(r[t]=Ya(e,t))}function qo(e,t){return zo(t)?Ro(t,(r,n)=>{n?e.icons[r]=n:e.missing.add(r)}):[]}function Wa(e,t,r){try{if(typeof r.body=="string")return e.icons[t]={...r},!0}catch{}return!1}const Uo=/^[a-z0-9]+(-[a-z0-9]+)*$/,kr=(e,t,r,n="")=>{const o=e.split(":");if(e.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(),f={provider:o.length>0?o[0]:n,prefix:c,name:l};return t&&!ar(f)?null:f}const a=o[0],i=a.split("-");if(i.length>1){const l={provider:n,prefix:i.shift(),name:i.join("-")};return t&&!ar(l)?null:l}if(r&&n===""){const l={provider:n,prefix:"",name:a};return t&&!ar(l,r)?null:l}return null},ar=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;let Vt=!1;function Bo(e){return typeof e=="boolean"&&(Vt=e),Vt}function Wn(e){const t=typeof e=="string"?kr(e,!0,Vt):e;if(t){const r=Et(t.provider,t.prefix),n=t.name;return r.icons[n]||(r.missing.has(n)?null:void 0)}}function Ka(e,t){const r=kr(e,!0,Vt);if(!r)return!1;const n=Et(r.provider,r.prefix);return t?Wa(n,r.name,t):(n.missing.add(r.name),!0)}function Ga(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),Vt&&!t&&!e.prefix){let o=!1;return zo(e)&&(e.prefix="",Ro(e,(a,i)=>{Ka(a,i)&&(o=!0)})),o}const r=e.prefix;if(!ar({prefix:r,name:"a"}))return!1;const n=Et(t,r);return!!qo(n,e)}const Ho=Object.freeze({width:null,height:null}),Vo=Object.freeze({...Ho,...yr}),Ja=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Xa=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Kn(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const n=e.split(Ja);if(n===null||!n.length)return e;const o=[];let a=n.shift(),i=Xa.test(a);for(;;){if(i){const l=parseFloat(a);isNaN(l)?o.push(a):o.push(Math.ceil(l*t*r)/r)}else o.push(a);if(a=n.shift(),a===void 0)return o.join("");i=!i}}function Qa(e,t="defs"){let r="";const n=e.indexOf("<"+t);for(;n>=0;){const o=e.indexOf(">",n),a=e.indexOf("</"+t);if(o===-1||a===-1)break;const i=e.indexOf(">",a);if(i===-1)break;r+=e.slice(o+1,a).trim(),e=e.slice(0,n).trim()+e.slice(i+1)}return{defs:r,content:e}}function Za(e,t){return e?"<defs>"+e+"</defs>"+t:t}function ei(e,t,r){const n=Qa(e);return Za(n.defs,t+n.content+r)}const ti=e=>e==="unset"||e==="undefined"||e==="none";function ri(e,t){const r={...dn,...e},n={...Vo,...t},o={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach(b=>{const k=[],S=b.hFlip,I=b.vFlip;let x=b.rotate;S?I?x+=2:(k.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),k.push("scale(-1 1)"),o.top=o.left=0):I&&(k.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),k.push("scale(1 -1)"),o.top=o.left=0);let T;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:T=o.height/2+o.top,k.unshift("rotate(90 "+T.toString()+" "+T.toString()+")");break;case 2:k.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:T=o.width/2+o.left,k.unshift("rotate(-90 "+T.toString()+" "+T.toString()+")");break}x%2===1&&(o.left!==o.top&&(T=o.left,o.left=o.top,o.top=T),o.width!==o.height&&(T=o.width,o.width=o.height,o.height=T)),k.length&&(a=ei(a,'<g transform="'+k.join(" ")+'">',"</g>"))});const i=n.width,l=n.height,c=o.width,f=o.height;let u,p;i===null?(p=l===null?"1em":l==="auto"?f:l,u=Kn(p,c/f)):(u=i==="auto"?c:i,p=l===null?Kn(u,f/c):l==="auto"?f:l);const w={},j=(b,k)=>{ti(k)||(w[b]=k.toString())};j("width",u),j("height",p);const v=[o.left,o.top,c,f];return w.viewBox=v.join(" "),{attributes:w,viewBox:v,body:a}}const ni=/\sid="(\S+)"/g,oi="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let si=0;function ai(e,t=oi){const r=[];let n;for(;n=ni.exec(e);)r.push(n[1]);if(!r.length)return e;const o="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(a=>{const i=typeof t=="function"?t(a):t+(si++).toString(),l=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+i+o+"$3")}),e=e.replace(new RegExp(o,"g"),""),e}const Gr=Object.create(null);function ii(e,t){Gr[e]=t}function Jr(e){return Gr[e]||Gr[""]}function un(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const fn=Object.create(null),zt=["https://api.simplesvg.com","https://api.unisvg.com"],ir=[];for(;zt.length>0;)zt.length===1||Math.random()>.5?ir.push(zt.shift()):ir.push(zt.pop());fn[""]=un({resources:["https://api.iconify.design"].concat(ir)});function ci(e,t){const r=un(t);return r===null?!1:(fn[e]=r,!0)}function mn(e){return fn[e]}const li=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Gn=li();function di(e,t){const r=mn(e);if(!r)return 0;let n;if(!r.maxURL)n=0;else{let o=0;r.resources.forEach(i=>{o=Math.max(o,i.length)});const a=t+".json?icons=";n=r.maxURL-o-r.path.length-a.length}return n}function ui(e){return e===404}const fi=(e,t,r)=>{const n=[],o=di(e,t),a="icons";let i={type:a,provider:e,prefix:t,icons:[]},l=0;return r.forEach((c,f)=>{l+=c.length+1,l>=o&&f>0&&(n.push(i),i={type:a,provider:e,prefix:t,icons:[]},l=c.length),i.icons.push(c)}),n.push(i),n};function mi(e){if(typeof e=="string"){const t=mn(e);if(t)return t.path}return"/"}const pi=(e,t,r)=>{if(!Gn){r("abort",424);return}let n=mi(t.provider);switch(t.type){case"icons":{const a=t.prefix,l=t.icons.join(","),c=new URLSearchParams({icons:l});n+=a+".json?"+c.toString();break}case"custom":{const a=t.uri;n+=a.slice(0,1)==="/"?a.slice(1):a;break}default:r("abort",400);return}let o=503;Gn(e+n).then(a=>{const i=a.status;if(i!==200){setTimeout(()=>{r(ui(i)?"abort":"next",i)});return}return o=501,a.json()}).then(a=>{if(typeof a!="object"||a===null){setTimeout(()=>{a===404?r("abort",a):r("next",o)});return}setTimeout(()=>{r("success",a)})}).catch(()=>{r("next",o)})},hi={prepare:fi,send:pi};function Yo(e,t){e.forEach(r=>{const n=r.loaderCallbacks;n&&(r.loaderCallbacks=n.filter(o=>o.id!==t))})}function gi(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let r=!1;const n=e.provider,o=e.prefix;t.forEach(a=>{const i=a.icons,l=i.pending.length;i.pending=i.pending.filter(c=>{if(c.prefix!==o)return!0;const f=c.name;if(e.icons[f])i.loaded.push({provider:n,prefix:o,name:f});else if(e.missing.has(f))i.missing.push({provider:n,prefix:o,name:f});else return r=!0,!0;return!1}),i.pending.length!==l&&(r||Yo([e],a.id),a.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),a.abort))})}))}let xi=0;function yi(e,t,r){const n=xi++,o=Yo.bind(null,r,n);if(!t.pending.length)return o;const a={id:n,icons:t,callback:e,abort:o};return r.forEach(i=>{(i.loaderCallbacks||(i.loaderCallbacks=[])).push(a)}),o}function wi(e){const t={loaded:[],missing:[],pending:[]},r=Object.create(null);e.sort((o,a)=>o.provider!==a.provider?o.provider.localeCompare(a.provider):o.prefix!==a.prefix?o.prefix.localeCompare(a.prefix):o.name.localeCompare(a.name));let n={provider:"",prefix:"",name:""};return e.forEach(o=>{if(n.name===o.name&&n.prefix===o.prefix&&n.provider===o.provider)return;n=o;const a=o.provider,i=o.prefix,l=o.name,c=r[a]||(r[a]=Object.create(null)),f=c[i]||(c[i]=Et(a,i));let u;l in f.icons?u=t.loaded:i===""||f.missing.has(l)?u=t.missing:u=t.pending;const p={provider:a,prefix:i,name:l};u.push(p)}),t}function bi(e,t=!0,r=!1){const n=[];return e.forEach(o=>{const a=typeof o=="string"?kr(o,t,r):o;a&&n.push(a)}),n}const vi={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function ki(e,t,r,n){const o=e.resources.length,a=e.random?Math.floor(Math.random()*o):e.index;let i;if(e.random){let N=e.resources.slice(0);for(i=[];N.length>1;){const _=Math.floor(Math.random()*N.length);i.push(N[_]),N=N.slice(0,_).concat(N.slice(_+1))}i=i.concat(N)}else i=e.resources.slice(a).concat(e.resources.slice(0,a));const l=Date.now();let c="pending",f=0,u,p=null,w=[],j=[];typeof n=="function"&&j.push(n);function v(){p&&(clearTimeout(p),p=null)}function b(){c==="pending"&&(c="aborted"),v(),w.forEach(N=>{N.status==="pending"&&(N.status="aborted")}),w=[]}function k(N,_){_&&(j=[]),typeof N=="function"&&j.push(N)}function S(){return{startTime:l,payload:t,status:c,queriesSent:f,queriesPending:w.length,subscribe:k,abort:b}}function I(){c="failed",j.forEach(N=>{N(void 0,u)})}function x(){w.forEach(N=>{N.status==="pending"&&(N.status="aborted")}),w=[]}function T(N,_,ie){const G=_!=="success";switch(w=w.filter(K=>K!==N),c){case"pending":break;case"failed":if(G||!e.dataAfterTimeout)return;break;default:return}if(_==="abort"){u=ie,I();return}if(G){u=ie,w.length||(i.length?te():I());return}if(v(),x(),!e.random){const K=e.resources.indexOf(N.resource);K!==-1&&K!==e.index&&(e.index=K)}c="completed",j.forEach(K=>{K(ie)})}function te(){if(c!=="pending")return;v();const N=i.shift();if(N===void 0){if(w.length){p=setTimeout(()=>{v(),c==="pending"&&(x(),I())},e.timeout);return}I();return}const _={status:"pending",resource:N,callback:(ie,G)=>{T(_,ie,G)}};w.push(_),f++,p=setTimeout(te,e.rotate),r(N,t,_.callback)}return setTimeout(te),S}function Wo(e){const t={...vi,...e};let r=[];function n(){r=r.filter(l=>l().status==="pending")}function o(l,c,f){const u=ki(t,l,c,(p,w)=>{n(),f&&f(p,w)});return r.push(u),u}function a(l){return r.find(c=>l(c))||null}return{query:o,find:a,setIndex:l=>{t.index=l},getIndex:()=>t.index,cleanup:n}}function Jn(){}const $r=Object.create(null);function ji(e){if(!$r[e]){const t=mn(e);if(!t)return;const r=Wo(t),n={config:t,redundancy:r};$r[e]=n}return $r[e]}function Si(e,t,r){let n,o;if(typeof e=="string"){const a=Jr(e);if(!a)return r(void 0,424),Jn;o=a.send;const i=ji(e);i&&(n=i.redundancy)}else{const a=un(e);if(a){n=Wo(a);const i=e.resources?e.resources[0]:"",l=Jr(i);l&&(o=l.send)}}return!n||!o?(r(void 0,424),Jn):n.query(t,o,r)().abort}function Xn(){}function Ni(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,gi(e)}))}function Ci(e){const t=[],r=[];return e.forEach(n=>{(n.match(Uo)?t:r).push(n)}),{valid:t,invalid:r}}function qt(e,t,r){function n(){const o=e.pendingIcons;t.forEach(a=>{o&&o.delete(a),e.icons[a]||e.missing.add(a)})}if(r&&typeof r=="object")try{if(!qo(e,r).length){n();return}}catch(o){console.error(o)}n(),Ni(e)}function Qn(e,t){e instanceof Promise?e.then(r=>{t(r)}).catch(()=>{t(null)}):t(e)}function _i(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:r,prefix:n}=e,o=e.iconsToLoad;if(delete e.iconsToLoad,!o||!o.length)return;const a=e.loadIcon;if(e.loadIcons&&(o.length>1||!a)){Qn(e.loadIcons(o,n,r),u=>{qt(e,o,u)});return}if(a){o.forEach(u=>{const p=a(u,n,r);Qn(p,w=>{const j=w?{prefix:n,icons:{[u]:w}}:null;qt(e,[u],j)})});return}const{valid:i,invalid:l}=Ci(o);if(l.length&&qt(e,l,null),!i.length)return;const c=n.match(Uo)?Jr(r):null;if(!c){qt(e,i,null);return}c.prepare(r,n,i).forEach(u=>{Si(r,u,p=>{qt(e,u.icons,p)})})}))}const Pi=(e,t)=>{const r=bi(e,!0,Bo()),n=wi(r);if(!n.pending.length){let c=!0;return t&&setTimeout(()=>{c&&t(n.loaded,n.missing,n.pending,Xn)}),()=>{c=!1}}const o=Object.create(null),a=[];let i,l;return n.pending.forEach(c=>{const{provider:f,prefix:u}=c;if(u===l&&f===i)return;i=f,l=u,a.push(Et(f,u));const p=o[f]||(o[f]=Object.create(null));p[u]||(p[u]=[])}),n.pending.forEach(c=>{const{provider:f,prefix:u,name:p}=c,w=Et(f,u),j=w.pendingIcons||(w.pendingIcons=new Set);j.has(p)||(j.add(p),o[f][u].push(p))}),a.forEach(c=>{const f=o[c.provider][c.prefix];f.length&&_i(c,f)}),t?yi(t,n,a):Xn};function Ii(e,t){const r={...e};for(const n in t){const o=t[n],a=typeof o;n in Ho?(o===null||o&&(a==="string"||a==="number"))&&(r[n]=o):a===typeof r[n]&&(r[n]=n==="rotate"?o%4:o)}return r}const Ei=/[\s,]+/;function Fi(e,t){t.split(Ei).forEach(r=>{switch(r.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Ti(e,t=0){const r=e.replace(/^-?[0-9.]*/,"");function n(o){for(;o<0;)o+=4;return o%4}if(r===""){const o=parseInt(e);return isNaN(o)?0:n(o)}else if(r!==e){let o=0;switch(r){case"%":o=25;break;case"deg":o=90}if(o){let a=parseFloat(e.slice(0,e.length-r.length));return isNaN(a)?0:(a=a/o,a%1===0?n(a):0)}}return t}function Oi(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in t)r+=" "+n+'="'+t[n]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}function Ai(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function $i(e){return"data:image/svg+xml,"+Ai(e)}function Mi(e){return'url("'+$i(e)+'")'}let Bt;function Li(){try{Bt=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Bt=null}}function Di(e){return Bt===void 0&&Li(),Bt?Bt.createHTML(e):e}const Ko={...Vo,inline:!1},Ri={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},zi={display:"inline-block"},Xr={backgroundColor:"currentColor"},Go={backgroundColor:"transparent"},Zn={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},eo={WebkitMask:Xr,mask:Xr,background:Go};for(const e in eo){const t=eo[e];for(const r in Zn)t[e+r]=Zn[r]}const qi={...Ko,inline:!0};function to(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const Ui=(e,t,r)=>{const n=t.inline?qi:Ko,o=Ii(n,t),a=t.mode||"svg",i={},l=t.style||{},c={...a==="svg"?Ri:{}};if(r){const k=kr(r,!1,!0);if(k){const S=["iconify"],I=["provider","prefix"];for(const x of I)k[x]&&S.push("iconify--"+k[x]);c.className=S.join(" ")}}for(let k in t){const S=t[k];if(S!==void 0)switch(k){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":case"fallback":break;case"_ref":c.ref=S;break;case"className":c[k]=(c[k]?c[k]+" ":"")+S;break;case"inline":case"hFlip":case"vFlip":o[k]=S===!0||S==="true"||S===1;break;case"flip":typeof S=="string"&&Fi(o,S);break;case"color":i.color=S;break;case"rotate":typeof S=="string"?o[k]=Ti(S):typeof S=="number"&&(o[k]=S);break;case"ariaHidden":case"aria-hidden":S!==!0&&S!=="true"&&delete c["aria-hidden"];break;default:n[k]===void 0&&(c[k]=S)}}const f=ri(e,o),u=f.attributes;if(o.inline&&(i.verticalAlign="-0.125em"),a==="svg"){c.style={...i,...l},Object.assign(c,u);let k=0,S=t.id;return typeof S=="string"&&(S=S.replace(/-/g,"_")),c.dangerouslySetInnerHTML={__html:Di(ai(f.body,S?()=>S+"ID"+k++:"iconifyReact"))},h.createElement("svg",c)}const{body:p,width:w,height:j}=e,v=a==="mask"||(a==="bg"?!1:p.indexOf("currentColor")!==-1),b=Oi(p,{...u,width:w+"",height:j+""});return c.style={...i,"--svg":Mi(b),width:to(u.width),height:to(u.height),...zi,...v?Xr:Go,...l},h.createElement("span",c)};Bo(!0);ii("",hi);if(typeof document<"u"&&typeof window<"u"){const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(n=>{try{(typeof n!="object"||n===null||n instanceof Array||typeof n.icons!="object"||typeof n.prefix!="string"||!Ga(n))&&console.error(r)}catch{console.error(r)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let r in t){const n="IconifyProviders["+r+"] is invalid.";try{const o=t[r];if(typeof o!="object"||!o||o.resources===void 0)continue;ci(r,o)||console.error(n)}catch{console.error(n)}}}}function Jo(e){const[t,r]=h.useState(!!e.ssr),[n,o]=h.useState({});function a(j){if(j){const v=e.icon;if(typeof v=="object")return{name:"",data:v};const b=Wn(v);if(b)return{name:v,data:b}}return{name:""}}const[i,l]=h.useState(a(!!e.ssr));function c(){const j=n.callback;j&&(j(),o({}))}function f(j){if(JSON.stringify(i)!==JSON.stringify(j))return c(),l(j),!0}function u(){var j;const v=e.icon;if(typeof v=="object"){f({name:"",data:v});return}const b=Wn(v);if(f({name:v,data:b}))if(b===void 0){const k=Pi([v],u);o({callback:k})}else b&&((j=e.onLoad)===null||j===void 0||j.call(e,v))}h.useEffect(()=>(r(!0),c),[]),h.useEffect(()=>{t&&u()},[e.icon,t]);const{name:p,data:w}=i;return w?Ui({...dn,...w},e,p):e.children?e.children:e.fallback?e.fallback:h.createElement("span",{})}const ue=h.forwardRef((e,t)=>Jo({...e,_ref:t}));h.forwardRef((e,t)=>Jo({inline:!0,...e,_ref:t}));const Ze="USD",ro=e=>{var n,o,a;const t=e==null?void 0:e.availability;if(!t)return!1;const r=(a=(o=(n=t.channels)==null?void 0:n.results)==null?void 0:o[0])==null?void 0:a.availability;return r?r.isOnStock===!0&&(r.availableQuantity??0)>0:!1},Qr=(e,t=Ze)=>{const r=(e==null?void 0:e.prices)??[];if(!r.length)return null;const n=i=>{var f,u;const l=i.find(p=>{var w;return!!((w=p.discounted)!=null&&w.value)});if(l)return{cent:l.discounted.value.centAmount,cur:l.discounted.value.currencyCode,regularCent:(f=l.value)==null?void 0:f.centAmount};const c=(u=i[0])==null?void 0:u.value;return c?{cent:c.centAmount,cur:c.currencyCode}:null},o=r.filter(i=>{var l,c;return((c=((l=i.discounted)==null?void 0:l.value)||i.value)==null?void 0:c.currencyCode)===t}),a=n(o);return a||n(r)||null},Bi=(e,t)=>{if(!Array.isArray(e))return"";const r=e.find(n=>n.name===t)||e.find(n=>{var o;return((o=n.name)==null?void 0:o.toLowerCase())===t.toLowerCase()});return!r||!r.value?"":typeof r.value=="object"?r.value.label||"":r.value},Hi=e=>{let t="";if(Array.isArray(e)){const r=e.find(n=>n.name==="size")||e.find(n=>n.name==="Size");r&&r.value&&(t=typeof r.value=="object"?r.value.label||"":r.value)}return{sizeLabel:t}},Qe=e=>Bi((e==null?void 0:e.attributesRaw)??[],"color"),nt=e=>Hi((e==null?void 0:e.attributesRaw)??[]).sizeLabel,ut=(e,t,r)=>{for(const n of e){const o=Qe(n.variant),a=nt(n.variant);if((t?o===t:!0)&&(r?a===r:!0))return n}return null};function Xo(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Vi=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Yi=Xo(function(e){return Vi.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});function Wi(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Ki(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Gi=(function(){function e(r){var n=this;this._insertTag=function(o){var a;n.tags.length===0?n.insertionPoint?a=n.insertionPoint.nextSibling:n.prepend?a=n.container.firstChild:a=n.before:a=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(o,a),n.tags.push(o)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Ki(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var a=Wi(o);try{a.insertRule(n,a.cssRules.length)}catch{}}else o.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){var o;return(o=n.parentNode)==null?void 0:o.removeChild(n)}),this.tags=[],this.ctr=0},e})(),ke="-ms-",wr="-moz-",R="-webkit-",Qo="comm",pn="rule",hn="decl",Ji="@import",Zo="@keyframes",Xi="@layer",Qi=Math.abs,jr=String.fromCharCode,Zi=Object.assign;function ec(e,t){return ge(e,0)^45?(((t<<2^ge(e,0))<<2^ge(e,1))<<2^ge(e,2))<<2^ge(e,3):0}function es(e){return e.trim()}function tc(e,t){return(e=t.exec(e))?e[0]:e}function z(e,t,r){return e.replace(t,r)}function Zr(e,t){return e.indexOf(t)}function ge(e,t){return e.charCodeAt(t)|0}function Yt(e,t,r){return e.slice(t,r)}function Ye(e){return e.length}function gn(e){return e.length}function or(e,t){return t.push(e),e}function rc(e,t){return e.map(t).join("")}var Sr=1,Ft=1,ts=0,Ee=0,ae=0,Ot="";function Nr(e,t,r,n,o,a,i){return{value:e,root:t,parent:r,type:n,props:o,children:a,line:Sr,column:Ft,length:i,return:""}}function Ut(e,t){return Zi(Nr("",null,null,"",null,null,0),e,{length:-e.length},t)}function nc(){return ae}function oc(){return ae=Ee>0?ge(Ot,--Ee):0,Ft--,ae===10&&(Ft=1,Sr--),ae}function $e(){return ae=Ee<ts?ge(Ot,Ee++):0,Ft++,ae===10&&(Ft=1,Sr++),ae}function Ge(){return ge(Ot,Ee)}function cr(){return Ee}function Gt(e,t){return Yt(Ot,e,t)}function Wt(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function rs(e){return Sr=Ft=1,ts=Ye(Ot=e),Ee=0,[]}function ns(e){return Ot="",e}function lr(e){return es(Gt(Ee-1,en(e===91?e+2:e===40?e+1:e)))}function sc(e){for(;(ae=Ge())&&ae<33;)$e();return Wt(e)>2||Wt(ae)>3?"":" "}function ac(e,t){for(;--t&&$e()&&!(ae<48||ae>102||ae>57&&ae<65||ae>70&&ae<97););return Gt(e,cr()+(t<6&&Ge()==32&&$e()==32))}function en(e){for(;$e();)switch(ae){case e:return Ee;case 34:case 39:e!==34&&e!==39&&en(ae);break;case 40:e===41&&en(e);break;case 92:$e();break}return Ee}function ic(e,t){for(;$e()&&e+ae!==57;)if(e+ae===84&&Ge()===47)break;return"/*"+Gt(t,Ee-1)+"*"+jr(e===47?e:$e())}function cc(e){for(;!Wt(Ge());)$e();return Gt(e,Ee)}function lc(e){return ns(dr("",null,null,null,[""],e=rs(e),0,[0],e))}function dr(e,t,r,n,o,a,i,l,c){for(var f=0,u=0,p=i,w=0,j=0,v=0,b=1,k=1,S=1,I=0,x="",T=o,te=a,N=n,_=x;k;)switch(v=I,I=$e()){case 40:if(v!=108&&ge(_,p-1)==58){Zr(_+=z(lr(I),"&","&\f"),"&\f")!=-1&&(S=-1);break}case 34:case 39:case 91:_+=lr(I);break;case 9:case 10:case 13:case 32:_+=sc(v);break;case 92:_+=ac(cr()-1,7);continue;case 47:switch(Ge()){case 42:case 47:or(dc(ic($e(),cr()),t,r),c);break;default:_+="/"}break;case 123*b:l[f++]=Ye(_)*S;case 125*b:case 59:case 0:switch(I){case 0:case 125:k=0;case 59+u:S==-1&&(_=z(_,/\f/g,"")),j>0&&Ye(_)-p&&or(j>32?oo(_+";",n,r,p-1):oo(z(_," ","")+";",n,r,p-2),c);break;case 59:_+=";";default:if(or(N=no(_,t,r,f,u,o,l,x,T=[],te=[],p),a),I===123)if(u===0)dr(_,t,N,N,T,a,p,l,te);else switch(w===99&&ge(_,3)===110?100:w){case 100:case 108:case 109:case 115:dr(e,N,N,n&&or(no(e,N,N,0,0,o,l,x,o,T=[],p),te),o,te,p,l,n?T:te);break;default:dr(_,N,N,N,[""],te,0,l,te)}}f=u=j=0,b=S=1,x=_="",p=i;break;case 58:p=1+Ye(_),j=v;default:if(b<1){if(I==123)--b;else if(I==125&&b++==0&&oc()==125)continue}switch(_+=jr(I),I*b){case 38:S=u>0?1:(_+="\f",-1);break;case 44:l[f++]=(Ye(_)-1)*S,S=1;break;case 64:Ge()===45&&(_+=lr($e())),w=Ge(),u=p=Ye(x=_+=cc(cr())),I++;break;case 45:v===45&&Ye(_)==2&&(b=0)}}return a}function no(e,t,r,n,o,a,i,l,c,f,u){for(var p=o-1,w=o===0?a:[""],j=gn(w),v=0,b=0,k=0;v<n;++v)for(var S=0,I=Yt(e,p+1,p=Qi(b=i[v])),x=e;S<j;++S)(x=es(b>0?w[S]+" "+I:z(I,/&\f/g,w[S])))&&(c[k++]=x);return Nr(e,t,r,o===0?pn:l,c,f,u)}function dc(e,t,r){return Nr(e,t,r,Qo,jr(nc()),Yt(e,2,-2),0)}function oo(e,t,r,n){return Nr(e,t,r,hn,Yt(e,0,n),Yt(e,n+1,-1),n)}function Pt(e,t){for(var r="",n=gn(e),o=0;o<n;o++)r+=t(e[o],o,e,t)||"";return r}function uc(e,t,r,n){switch(e.type){case Xi:if(e.children.length)break;case Ji:case hn:return e.return=e.return||e.value;case Qo:return"";case Zo:return e.return=e.value+"{"+Pt(e.children,n)+"}";case pn:e.value=e.props.join(",")}return Ye(r=Pt(e.children,n))?e.return=e.value+"{"+r+"}":""}function fc(e){var t=gn(e);return function(r,n,o,a){for(var i="",l=0;l<t;l++)i+=e[l](r,n,o,a)||"";return i}}function mc(e){return function(t){t.root||(t=t.return)&&e(t)}}var pc=function(t,r,n){for(var o=0,a=0;o=a,a=Ge(),o===38&&a===12&&(r[n]=1),!Wt(a);)$e();return Gt(t,Ee)},hc=function(t,r){var n=-1,o=44;do switch(Wt(o)){case 0:o===38&&Ge()===12&&(r[n]=1),t[n]+=pc(Ee-1,r,n);break;case 2:t[n]+=lr(o);break;case 4:if(o===44){t[++n]=Ge()===58?"&\f":"",r[n]=t[n].length;break}default:t[n]+=jr(o)}while(o=$e());return t},gc=function(t,r){return ns(hc(rs(t),r))},so=new WeakMap,xc=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var r=t.value,n=t.parent,o=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&r.charCodeAt(0)!==58&&!so.get(n))&&!o){so.set(t,!0);for(var a=[],i=gc(r,a),l=n.props,c=0,f=0;c<i.length;c++)for(var u=0;u<l.length;u++,f++)t.props[f]=a[c]?i[c].replace(/&\f/g,l[u]):l[u]+" "+i[c]}}},yc=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}};function os(e,t){switch(ec(e,t)){case 5103:return R+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return R+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return R+e+wr+e+ke+e+e;case 6828:case 4268:return R+e+ke+e+e;case 6165:return R+e+ke+"flex-"+e+e;case 5187:return R+e+z(e,/(\w+).+(:[^]+)/,R+"box-$1$2"+ke+"flex-$1$2")+e;case 5443:return R+e+ke+"flex-item-"+z(e,/flex-|-self/,"")+e;case 4675:return R+e+ke+"flex-line-pack"+z(e,/align-content|flex-|-self/,"")+e;case 5548:return R+e+ke+z(e,"shrink","negative")+e;case 5292:return R+e+ke+z(e,"basis","preferred-size")+e;case 6060:return R+"box-"+z(e,"-grow","")+R+e+ke+z(e,"grow","positive")+e;case 4554:return R+z(e,/([^-])(transform)/g,"$1"+R+"$2")+e;case 6187:return z(z(z(e,/(zoom-|grab)/,R+"$1"),/(image-set)/,R+"$1"),e,"")+e;case 5495:case 3959:return z(e,/(image-set\([^]*)/,R+"$1$`$1");case 4968:return z(z(e,/(.+:)(flex-)?(.*)/,R+"box-pack:$3"+ke+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+R+e+e;case 4095:case 3583:case 4068:case 2532:return z(e,/(.+)-inline(.+)/,R+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ye(e)-1-t>6)switch(ge(e,t+1)){case 109:if(ge(e,t+4)!==45)break;case 102:return z(e,/(.+:)(.+)-([^]+)/,"$1"+R+"$2-$3$1"+wr+(ge(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Zr(e,"stretch")?os(z(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(ge(e,t+1)!==115)break;case 6444:switch(ge(e,Ye(e)-3-(~Zr(e,"!important")&&10))){case 107:return z(e,":",":"+R)+e;case 101:return z(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+R+(ge(e,14)===45?"inline-":"")+"box$3$1"+R+"$2$3$1"+ke+"$2box$3")+e}break;case 5936:switch(ge(e,t+11)){case 114:return R+e+ke+z(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return R+e+ke+z(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return R+e+ke+z(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return R+e+ke+e+e}return e}var wc=function(t,r,n,o){if(t.length>-1&&!t.return)switch(t.type){case hn:t.return=os(t.value,t.length);break;case Zo:return Pt([Ut(t,{value:z(t.value,"@","@"+R)})],o);case pn:if(t.length)return rc(t.props,function(a){switch(tc(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Pt([Ut(t,{props:[z(a,/:(read-\w+)/,":"+wr+"$1")]})],o);case"::placeholder":return Pt([Ut(t,{props:[z(a,/:(plac\w+)/,":"+R+"input-$1")]}),Ut(t,{props:[z(a,/:(plac\w+)/,":"+wr+"$1")]}),Ut(t,{props:[z(a,/:(plac\w+)/,ke+"input-$1")]})],o)}return""})}},bc=[wc],vc=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(b){var k=b.getAttribute("data-emotion");k.indexOf(" ")!==-1&&(document.head.appendChild(b),b.setAttribute("data-s",""))})}var o=t.stylisPlugins||bc,a={},i,l=[];i=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(b){for(var k=b.getAttribute("data-emotion").split(" "),S=1;S<k.length;S++)a[k[S]]=!0;l.push(b)});var c,f=[xc,yc];{var u,p=[uc,mc(function(b){u.insert(b)})],w=fc(f.concat(o,p)),j=function(k){return Pt(lc(k),w)};c=function(k,S,I,x){u=I,j(k?k+"{"+S.styles+"}":S.styles),x&&(v.inserted[S.name]=!0)}}var v={key:r,sheet:new Gi({key:r,container:i,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:c};return v.sheet.hydrate(l),v},kc=!0;function jc(e,t,r){var n="";return r.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):o&&(n+=o+" ")}),n}var ss=function(t,r,n){var o=t.key+"-"+r.name;(n===!1||kc===!1)&&t.registered[o]===void 0&&(t.registered[o]=r.styles)},Sc=function(t,r,n){ss(t,r,n);var o=t.key+"-"+r.name;if(t.inserted[r.name]===void 0){var a=r;do t.insert(r===a?"."+o:"",a,t.sheet,!0),a=a.next;while(a!==void 0)}};function Nc(e){for(var t=0,r,n=0,o=e.length;o>=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Cc={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},_c=/[A-Z]|^ms/g,Pc=/_EMO_([^_]+?)_([^]*?)_EMO_/g,as=function(t){return t.charCodeAt(1)===45},ao=function(t){return t!=null&&typeof t!="boolean"},Mr=Xo(function(e){return as(e)?e:e.replace(_c,"-$&").toLowerCase()}),io=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(Pc,function(n,o,a){return We={name:o,styles:a,next:We},o})}return Cc[t]!==1&&!as(t)&&typeof r=="number"&&r!==0?r+"px":r};function Kt(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var o=r;if(o.anim===1)return We={name:o.name,styles:o.styles,next:We},o.name;var a=r;if(a.styles!==void 0){var i=a.next;if(i!==void 0)for(;i!==void 0;)We={name:i.name,styles:i.styles,next:We},i=i.next;var l=a.styles+";";return l}return Ic(e,t,r)}case"function":{if(e!==void 0){var c=We,f=r(e);return We=c,Kt(e,t,f)}break}}var u=r;if(t==null)return u;var p=t[u];return p!==void 0?p:u}function Ic(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=Kt(e,t,r[o])+";";else for(var a in r){var i=r[a];if(typeof i!="object"){var l=i;t!=null&&t[l]!==void 0?n+=a+"{"+t[l]+"}":ao(l)&&(n+=Mr(a)+":"+io(a,l)+";")}else if(Array.isArray(i)&&typeof i[0]=="string"&&(t==null||t[i[0]]===void 0))for(var c=0;c<i.length;c++)ao(i[c])&&(n+=Mr(a)+":"+io(a,i[c])+";");else{var f=Kt(e,t,i);switch(a){case"animation":case"animationName":{n+=Mr(a)+":"+f+";";break}default:n+=a+"{"+f+"}"}}}return n}var co=/label:\s*([^\s;{]+)\s*(;|$)/g,We;function Ec(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,o="";We=void 0;var a=e[0];if(a==null||a.raw===void 0)n=!1,o+=Kt(r,t,a);else{var i=a;o+=i[0]}for(var l=1;l<e.length;l++)if(o+=Kt(r,t,e[l]),n){var c=a;o+=c[l]}co.lastIndex=0;for(var f="",u;(u=co.exec(o))!==null;)f+="-"+u[1];var p=Nc(o)+f;return{name:p,styles:o,next:We}}var Fc=function(t){return t()},Tc=Ce.useInsertionEffect?Ce.useInsertionEffect:!1,Oc=Tc||Fc,is=Ce.createContext(typeof HTMLElement<"u"?vc({key:"css"}):null);is.Provider;var Ac=function(t){return h.forwardRef(function(r,n){var o=h.useContext(is);return t(r,o,n)})},$c=Ce.createContext({});function Mc(...e){return function(...r){e.forEach(n=>n==null?void 0:n(...r))}}const Lc=(...e)=>e.map(t=>{var r;return(r=t==null?void 0:t.trim)==null?void 0:r.call(t)}).filter(Boolean).join(" "),Dc=/^on[A-Z]/;function cs(...e){let t={};for(let r of e){for(let n in t){if(Dc.test(n)&&typeof t[n]=="function"&&typeof r[n]=="function"){t[n]=Mc(t[n],r[n]);continue}if(n==="className"||n==="class"){t[n]=Lc(t[n],r[n]);continue}if(n==="style"){t[n]=Object.assign({},t[n]??{},r[n]??{});continue}t[n]=r[n]!==void 0?r[n]:t[n]}for(let n in r)t[n]===void 0&&(t[n]=r[n])}return t}const Rc=parseInt(Ce.version.split(".")[0],10),zc=Rc>=19;function Lr(e,t){if(e!=null){if(typeof e=="function")return e(t);try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function qc(...e){const t=e.filter(r=>r!=null);if(zc){const r=new Map;return n=>(t.forEach(o=>{const a=Lr(o,n);a&&r.set(o,a)}),()=>{t.forEach(o=>{const a=r.get(o);a&&typeof a=="function"?a():Lr(o,null)}),r.clear()})}else return r=>{t.forEach(n=>{Lr(n,r)})}}function Uc(e){const t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}const ls=e=>typeof e=="string",Bc=e=>typeof e=="function",gt=(...e)=>{const t=[];for(let r=0;r<e.length;r++){const n=e[r];if(!ls(n))continue;const o=n.trim();o&&t.push(o)}return t.join(" ")};function Hc(e){return e.default||e}function Vc(e){var r;const t=Ce.version;return!ls(t)||t.startsWith("18.")?e==null?void 0:e.ref:(r=e==null?void 0:e.props)==null?void 0:r.ref}const Yc=(...e)=>{const t=e.reduce((r,n)=>(n!=null&&n.forEach(o=>r.add(o)),r),new Set([]));return Array.from(t)};function Wc(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function ds(e={}){const{name:t,strict:r=!0,hookName:n="useContext",providerName:o="Provider",errorMessage:a,defaultValue:i}=e,l=h.createContext(i);l.displayName=t;function c(){var u;const f=h.useContext(l);if(!f&&r){const p=new Error(a??Wc(n,o));throw p.name="ContextError",(u=Error.captureStackTrace)==null||u.call(Error,p,c),p}return f}return[l.Provider,c,l]}const[Tl,xn]=ds({name:"ChakraContext",strict:!0,providerName:"<ChakraProvider />"}),Kc=(e,t)=>{const r={},n={},o=Object.keys(e);for(const a of o)t(a)?n[a]=e[a]:r[a]=e[a];return[n,r]},Dr=(e,t)=>{const r=Bc(t)?t:n=>t.includes(n);return Kc(e,r)},Gc=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function Jc(e){return typeof e=="string"&&Gc.has(e)}function Xc(e,t,r){const{css:n,isValidProperty:o}=xn(),{children:a,...i}=e,l=h.useMemo(()=>{const[w,j]=Dr(i,I=>r(I,t.variantKeys)),[v,b]=Dr(j,t.variantKeys),[k,S]=Dr(b,o);return{forwardedProps:w,variantProps:v,styleProps:k,elementProps:S}},[t.variantKeys,r,i,o]),{css:c,...f}=l.styleProps,u=h.useMemo(()=>{const w={...l.variantProps},j=t.variantKeys.includes("colorPalette"),v=t.variantKeys.includes("orientation");return j||(w.colorPalette=i.colorPalette),v||(w.orientation=i.orientation),t(w)},[t,l.variantProps,i.colorPalette,i.orientation]);return{styles:h.useMemo(()=>n(u,...Qc(c),f),[n,u,c,f]),props:{...l.forwardedProps,...l.elementProps,children:a}}}const Qc=e=>(Array.isArray(e)?e:[e]).filter(Boolean).flat(),Zc=Hc(Yi),el=Zc,tl=e=>e!=="theme",rl=(e,t,r)=>{let n;if(t){const o=t.shouldForwardProp;n=e.__emotion_forwardProp&&o?a=>e.__emotion_forwardProp(a)&&o(a):o}return typeof n!="function"&&r&&(n=e.__emotion_forwardProp),n};let nl=typeof document<"u";const lo=({cache:e,serialized:t,isStringTag:r})=>{ss(e,t,r);const n=Oc(()=>Sc(e,t,r));if(!nl&&n!==void 0){let o=t.name,a=t.next;for(;a!==void 0;)o=gt(o,a.name),a=a.next;return s.jsx("style",{"data-emotion":gt(e.key,o),dangerouslySetInnerHTML:{__html:n},nonce:e.sheet.nonce})}return null},uo={path:["d"],text:["x","y"],circle:["cx","cy","r"],rect:["width","height","x","y","rx","ry"],ellipse:["cx","cy","rx","ry"],g:["transform"],stop:["offset","stopOpacity"]},ol=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),sl=(e,t={},r={})=>{if(process.env.NODE_ENV!=="production"&&e===void 0)throw new Error(`You are trying to create a styled element with an undefined component.
17
- You may have forgotten to import it.`);if(ol(uo,e)){r.forwardProps||(r.forwardProps=[]);const f=uo[e];r.forwardProps=Yc([...r.forwardProps,...f])}const n=e.__emotion_real===e,o=n&&e.__emotion_base||e;let a,i;r!==void 0&&(a=r.label,i=r.target);let l=[];const c=Ac((f,u,p)=>{var A;const{cva:w,isValidProperty:j}=xn(),v=t.__cva__?t:w(t),b=il(e.__emotion_cva,v),k=E=>(me,Pe)=>E.includes(me)?!0:!(Pe!=null&&Pe.includes(me))&&!j(me);!r.shouldForwardProp&&r.forwardProps&&(r.shouldForwardProp=k(r.forwardProps));const S=(E,me)=>{const Pe=typeof e=="string"&&e.charCodeAt(0)>96?el:tl,Se=!(me!=null&&me.includes(E))&&!j(E);return Pe(E)&&Se},I=rl(e,r,n)||S,x=Ce.useMemo(()=>Object.assign({},r.defaultProps,Uc(f)),[f]),{props:T,styles:te}=Xc(x,b,I);let N="",_=[te],ie=T;if(T.theme==null){ie={};for(let E in T)ie[E]=T[E];ie.theme=Ce.useContext($c)}typeof T.className=="string"?N=jc(u.registered,_,T.className):T.className!=null&&(N=gt(N,T.className));const G=Ec(l.concat(_),u.registered,ie);G.styles&&(N=gt(N,`${u.key}-${G.name}`)),i!==void 0&&(N=gt(N,i));const K=!I("as");let fe=K&&T.as||o,H={};for(let E in T)if(!(K&&E==="as")){if(Jc(E)){const me=E.replace("html","").toLowerCase();H[me]=T[E];continue}I(E)&&(H[E]=T[E])}let ce=N.trim();ce?H.className=ce:Reflect.deleteProperty(H,"className"),H.ref=p;const D=r.forwardAsChild||((A=r.forwardProps)==null?void 0:A.includes("asChild"));if(T.asChild&&!D){const E=Ce.isValidElement(T.children)?Ce.Children.only(T.children):Ce.Children.toArray(T.children).find(Ce.isValidElement);if(!E)throw new Error("[chakra-ui > factory] No valid child found");fe=E.type,H.children=null,Reflect.deleteProperty(H,"asChild"),H=cs(H,E.props),H.ref=qc(p,Vc(E))}return H.as&&D?(H.as=void 0,s.jsxs(Ce.Fragment,{children:[s.jsx(lo,{cache:u,serialized:G,isStringTag:typeof fe=="string"}),s.jsx(fe,{asChild:!0,...H,children:s.jsx(T.as,{children:H.children})})]})):s.jsxs(Ce.Fragment,{children:[s.jsx(lo,{cache:u,serialized:G,isStringTag:typeof fe=="string"}),s.jsx(fe,{...H})]})});return c.displayName=a!==void 0?a:`chakra(${typeof o=="string"?o:o.displayName||o.name||"Component"})`,c.__emotion_real=c,c.__emotion_base=o,c.__emotion_forwardProp=r.shouldForwardProp,c.__emotion_cva=t,Object.defineProperty(c,"toString",{value(){return i===void 0&&process.env.NODE_ENV!=="production"?"NO_COMPONENT_SELECTOR":`.${i}`}}),c},Rr=sl.bind(),zr=new Map,al=new Proxy(Rr,{apply(e,t,r){return Rr(...r)},get(e,t){return zr.has(t)||zr.set(t,Rr(t)),zr.get(t)}}),us=al,il=(e,t)=>e&&!t?e:!e&&t?t:e.merge(t),cl=Object.freeze({});function ll(e){const{key:t,recipe:r}=e,n=xn();return h.useMemo(()=>{const o=r||(t!=null?n.getRecipe(t):{});return n.cva(structuredClone(o))},[t,r,n])}const dl=e=>e.charAt(0).toUpperCase()+e.slice(1);function ul(e){const{key:t,recipe:r}=e,n=dl(t||r.className||"Component"),[o,a]=ds({strict:!1,name:`${n}PropsContext`,providerName:`${n}PropsContext`});function i(f){const{unstyled:u,...p}=f,w=ll({key:t,recipe:p.recipe||r}),[j,v]=h.useMemo(()=>w.splitVariantProps(p),[w,p]);return{styles:u?cl:w(j),className:w.className,props:v}}const l=(f,u)=>{const p=us(f,{},u),w=h.forwardRef((j,v)=>{const b=a(),k=h.useMemo(()=>cs(b,j),[j,b]),{styles:S,className:I,props:x}=i(k);return s.jsx(p,{...x,ref:v,css:[S,k.css],className:gt(I,k.className)})});return w.displayName=f.displayName||f.name,w};function c(){return o}return{withContext:l,PropsProvider:o,withPropsProvider:c,usePropsContext:a,useRecipeResult:i}}const{useRecipeResult:fl}=ul({key:"icon"}),fs=Ce.forwardRef(function(t,r){const{styles:n,className:o,props:a}=fl({asChild:!t.as,...t});return s.jsx(us.svg,{ref:r,focusable:!1,"aria-hidden":"true",...a,css:[n,t.css],className:gt(o,t.className)})});fs.displayName="Icon";var ms={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},fo=h.createContext&&h.createContext(ms),ml=["attr","size","title"];function pl(e,t){if(e==null)return{};var r=hl(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hl(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function br(){return br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},br.apply(this,arguments)}function mo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function vr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mo(Object(r),!0).forEach(function(n){gl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gl(e,t,r){return t=xl(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xl(e){var t=yl(e,"string");return typeof t=="symbol"?t:t+""}function yl(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ps(e){return e&&e.map((t,r)=>h.createElement(t.tag,vr({key:r},t.attr),ps(t.child)))}function wl(e){return t=>h.createElement(bl,br({attr:vr({},e.attr)},t),ps(e.child))}function bl(e){var t=r=>{var{attr:n,size:o,title:a}=e,i=pl(e,ml),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),h.createElement("svg",br({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,i,{className:c,style:vr(vr({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),a&&h.createElement("title",null,a),e.children)};return fo!==void 0?h.createElement(fo.Consumer,null,r=>t(r)):t(ms)}function vl(e){return wl({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"},child:[]},{tag:"path",attr:{d:"M20 3v4"},child:[]},{tag:"path",attr:{d:"M22 5h-4"},child:[]},{tag:"path",attr:{d:"M4 17v2"},child:[]},{tag:"path",attr:{d:"M5 18H3"},child:[]}]})(e)}const rt=e=>e.charAt(0).toUpperCase()+e.slice(1),ft={standard:{label:"Standard Delivery",fee:0,subtitle:"Arrives in 4–6 days (Free)",icon:"mdi:clock-outline"},express:{label:"Express Delivery",fee:5,subtitle:"Arrives in 1–2 days (+$5)",icon:"mdi:flash"},sameday:{label:"Same-Day Delivery",fee:10,subtitle:"Available in select locations (+$10)",icon:"mdi:truck-fast-outline"}},kl={standard:"GROUND",express:"2-DAY SHIPPING",sameday:"OVERNIGHT"},Ue=(e,t)=>{try{return e.toLocaleString("en-US",{style:"currency",currency:t||"USD"})}catch{return`${t} ${e.toFixed(2)}`}},hs=e=>e==null?void 0:e.masterVariant,po=e=>Array.isArray(e==null?void 0:e.variants)?e.variants:[],ur=e=>{const t=hs(e);return t?[t,...po(e)]:po(e)},jl=(e,t=0)=>ur(e)[t],Sl=e=>{var t,r;return((r=(t=e==null?void 0:e.images)==null?void 0:t[0])==null?void 0:r.url)??""},ho=(e,t)=>{var r,n,o,a,i,l,c,f;return Sl(t)||((a=(o=(n=(r=e.imageGroups)==null?void 0:r[0])==null?void 0:n.images)==null?void 0:o[0])==null?void 0:a.link)||((f=(c=(l=(i=e.image_groups)==null?void 0:i[0])==null?void 0:l.images)==null?void 0:c[0])==null?void 0:f.link)||""},go=e=>(e==null?void 0:e.name)||(e==null?void 0:e.title)||(e==null?void 0:e.productName)||"any",fr=e=>{var a,i,l,c,f,u;const t=e?Qr(e,Ze):null;if(t!=null&&t.cent&&(t!=null&&t.cur))return{amount:+(t.cent/100),currency:t.cur,regularAmount:t.regularCent?t.regularCent/100:void 0};const r=(l=(i=(a=e==null?void 0:e.prices)==null?void 0:a[0])==null?void 0:i.value)==null?void 0:l.centAmount,n=((u=(f=(c=e==null?void 0:e.prices)==null?void 0:c[0])==null?void 0:f.value)==null?void 0:u.currencyCode)??Ze;return{amount:Number.isFinite(r)?+(Number(r)/100):0,currency:n}},xo=(e,t)=>{const{amount:r}=fr(t);if(r)return r;const n=(e==null?void 0:e.price)??(e==null?void 0:e.sellingPrice)??(e==null?void 0:e.unitPrice)??(e==null?void 0:e.mrp)??0,o=Number(n);return Number.isFinite(o)?o:0},yo=e=>{var t;return(e==null?void 0:e.sku)||((t=e==null?void 0:e.variant)==null?void 0:t.sku)||(e==null?void 0:e.selectedSku)||""},Nl=e=>{var t;return(e==null?void 0:e.color)||(e==null?void 0:e.selectedColor)||((t=e==null?void 0:e.variant)==null?void 0:t.color)||""},Cl=e=>{var t;return(e==null?void 0:e.size)||(e==null?void 0:e.selectedSize)||((t=e==null?void 0:e.variant)==null?void 0:t.size)||""},wo=20,_l=({open:e,onClose:t,product:r,index:n,addressListProp:o,addressLoading:a})=>{console.log(r,"the product for ai shopping");const i=null,l=null,c=ur(r),f=Math.min(Math.max(0,n||0),Math.max(0,c.length-1)),u=c.length,[p,w]=h.useState(f),[j,v]=h.useState(null),[b,k]=h.useState(null),S=h.useRef(null),I=h.useRef(null),x=jl(r,p),[T,te]=h.useState(""),[N,_]=h.useState(!1),[ie,G]=h.useState(!1),[K,fe]=h.useState(!1),[H,ce]=h.useState(""),[D,A]=h.useState(!1),[E,me]=h.useState(null),[Pe,Se]=h.useState([]),[Me,vt]=h.useState([]),[at,V]=h.useState([]),[xe,Re]=h.useState(!1),[Le,Cr]=h.useState(),[_r,g]=h.useState(!0),[L,q]=h.useState(!1),[J,B]=h.useState(!1),[M,ye]=h.useState("standard"),[W,U]=h.useState(!1),[re,le]=h.useState(!1),[Fe,Te]=h.useState("card"),[ne,Z]=h.useState(!1),[Oe,oe]=h.useState(!1),[F,X]=h.useState(!1),[ee,we]=h.useState(null),[Ae,it]=h.useState(null),[kt,Jt]=h.useState(""),[Je,Xt]=h.useState(!1),jt=h.useRef(null);h.useEffect(()=>{const d=ur(r),y=Math.min(Math.max(0,n||0),Math.max(0,d.length-1));w(y);const m=hs(r),P=Qe(m),$=nt(m);S.current=P||null,I.current=$||null,v(P||null),k($||null)},[n,r]),h.useEffect(()=>{jt.current&&(jt.current.scrollTop=jt.current.scrollHeight)},[Pe,xe,L,J,W,re,ne,Oe,F,N,ie]);const O="var(--tanya)",Be="var(--tanya-contrast)",ct=O,At="#804c9e",gs=()=>{console.log("AgenticShopping feedback:",{rating:Ae,comment:kt}),Xt(!0)},xs=()=>{it(null),Jt(""),Xt(!0)},yn=d=>{const m=((d==null?void 0:d.intentMandateId)||(d==null?void 0:d.intent_mandate_id)||(d==null?void 0:d.id)||null)??ee;return e?s.jsxs("div",{className:"mt-3 flex items-start gap-3 rounded-lg border border-green-200 bg-green-50 p-4 text-green-800",children:[s.jsx("div",{className:"success-tick-animation",children:s.jsx(ue,{icon:"mdi:check-circle",width:"28",color:"#16a34a"})}),s.jsxs("div",{className:"text-sm w-full",children:[s.jsx("div",{className:"font-semibold",children:"Success!"}),s.jsx("div",{children:"Your smart order has been saved. I’ll watch the price and auto-purchase when the conditions are met."}),m&&s.jsxs("div",{className:"mt-2 text-xs font-medium",children:["Your Smart Order ID: ",s.jsx("span",{className:"font-semibold text-blue-600 cursor-pointer underline",children:m})]}),!Je&&s.jsxs("div",{className:"mt-4 rounded-lg bg-white/70 p-3 text-gray-900",children:[s.jsx("h4",{className:"font-semibold mb-1",children:"Please post your feedback here"}),s.jsx("p",{className:"text-sm text-gray-700 mb-3",children:"Rate us on how much our response was helpful"}),s.jsx("div",{className:"flex items-center gap-1 mb-3",children:[1,2,3,4,5].map(P=>s.jsx("button",{type:"button",onClick:()=>it(P),className:"p-0.5",children:s.jsx(ue,{icon:Ae&&Ae>=P?"mdi:star":"mdi:star-outline",width:"20",className:"text-yellow-500"})},P))}),s.jsx("label",{className:"block text-sm text-gray-700 mb-1",children:"Tell us more about the response"}),s.jsx("textarea",{value:kt,onChange:P=>Jt(P.target.value),rows:3,className:"mt-1 w-full rounded-md border border-gray-300 p-2 text-sm outline-none focus:ring-1 focus:ring-gray-300",placeholder:"Your feedback helps us improve..."}),s.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[s.jsx("button",{type:"button",onClick:xs,className:"px-4 py-2 rounded-full border text-sm font-medium hover:bg-gray-50",children:"Cancel"}),s.jsx("button",{type:"button",onClick:gs,className:"px-4 py-2 rounded-full text-sm font-semibold text-white shadow",style:{background:O},disabled:!Ae&&!kt.trim(),children:"Submit"})]})]}),Je&&s.jsx("div",{className:"mt-3 text-xs text-green-900 font-medium",children:"Thanks for your feedback! 💚"})]})]}):null},ys=async()=>{try{V(o)}catch(d){console.error("Error fetching addresses:",d)}},$t=(d,y)=>{Se(m=>[...m,{query:"",response:"__SNAPSHOT__",snapshotStage:d,snapshotPayload:y}])},wn=(d,y)=>{Se(m=>m.map(P=>P.response==="__CARD__"?{...P,response:"__SNAPSHOT__",snapshotStage:d??P.snapshotStage,snapshotPayload:y??P.snapshotPayload}:P))},ws=()=>{Se(d=>d.filter(y=>!(y.query===""&&y.response!=="__SNAPSHOT__"&&y.response!=="__TEXT__")))},Qt=()=>{oe(!1),Re(!1),B(!1),le(!1),q(!1),U(!1),Z(!1),X(!1),A(!1),me(null),ws(),_(!1),G(!1)},bs=()=>{Re(!1),q(!1),B(!1),ye("standard"),U(!1),le(!1),Te("card"),Z(!1),oe(!1),X(!1),g(!0),me(null),localStorage.removeItem("agentic_order"),localStorage.removeItem("agentic_order_address"),localStorage.removeItem("agentic_order_delivery"),localStorage.removeItem("agentic_order_payment"),localStorage.removeItem("agentic_order_final")},De=h.useMemo(()=>ur(r).map((y,m)=>({index:m,variant:y,images:((y==null?void 0:y.images)||[]).map(P=>(P==null?void 0:P.url)||"").filter(Boolean)})),[r]),Mt=h.useMemo(()=>{if(!De.length)return!1;const d=j||void 0,y=b||void 0,m=(P,$)=>{var Y;const C=ut(De,P||void 0,$||void 0);return!!(C&&((Y=C.variant)!=null&&Y.sku))};return d&&y?m(d,y):d&&!y?m(d,null):!d&&y?m(void 0,y):!!(x&&x.sku)},[De,j,b,x]),vs=K||D||!Mt,Lt=d=>{const y=Number((d==null?void 0:d.quantity)??1);return Number.isFinite(y)&&y>0?y:1},bn=d=>{const y=Lt(d),m=Number((d==null?void 0:d.max_price_minor)??0);return Number.isFinite(m)&&m>0?+(m/100):+(xo(r,x)*y)},vn=d=>{var Q;const y=E,m=fr(x),P=d||(y==null?void 0:y.currency)||m.currency||Ze,$=bn(y),C=+($*.08).toFixed(2),Y=((Q=ft[M])==null?void 0:Q.fee)||0;return{product_total:$,tax:C,shipping_fee:Y,currency:P}},Pr=async(d,y,m)=>{wn(),bs(),fe(!0),A(!0),_(!1),G(!1);const P=Me.slice(-wo);try{const $=await Ur(i,l);if(!$)throw new Error("Failed to fetch token");const C=localStorage.getItem("customerNumber"),Y=localStorage.getItem("isLoggedIn"),be=`https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({registered:String(Y||!1),userId:String(C||new Date().getTime())}).toString()}`,se=await fetch(`${be}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${$}`},body:JSON.stringify({flowId:"MTMI0P4LC6",flowAliasId:"BCUA138F2Q",input:{instruction:`Use SKU ${y}. Currency is USD. ${d}`,metadata:{productId:(r==null?void 0:r.id)??null,skuId:y??null,variantIndex:m},context:P}})});if(!se.body)throw new Error("Readable stream not supported");const Ie=se.body.getReader(),de=new TextDecoder;let ze="",qe="",He="";for(;;){const{done:Ne,value:tt}=await Ie.read();if(Ne)break;ze+=de.decode(tt,{stream:!0});const St=ze.split(`
18
- `);ze=St.pop()||"";for(const Nt of St){if(!Nt.startsWith("data:"))continue;const lt=Nt.slice(5).trim();try{const Xe=JSON.parse(lt),Ve=Xe.index,ve=Xe.data;Ve===0?qe=String(ve??""):Ve===1&&(He=String(ve??""))}catch(Xe){console.error("Error parsing JSON chunk:",Xe)}}}let pe=null;if(qe){const Ne=String(qe).replace(/\\n/g,"").trim();if(Ne.startsWith("{")&&Ne.endsWith("}"))try{pe=JSON.parse(Ne),pe.product_id=y,pe.sku_id=y,localStorage.setItem("agentic_order",JSON.stringify(pe))}catch(tt){console.log(tt)}}me(pe),pe&&Se(Ne=>[...Ne,{query:"",response:"__CARD__",snapshotPayload:{extractedDetails:pe}}]),vt(Ne=>[...Ne,{userQuery:d,mainResponse:qe||"",keywords:He||""}].slice(-wo))}catch($){console.error("Error sending message to Tanya:",$),A(!1)}finally{fe(!1)}},kn=async d=>{if(D||K||!Mt)return;const y=H.trim();if(!y)return;Se(C=>[...C,{query:y,response:""}]),ce(""),te(y);const m=x==null?void 0:x.sku,P=yo(r),$=m||P||"";if(u<=1){if($){Pr(y,$,p);return}G(!0),A(!0);return}$?(_(!0),A(!0)):(G(!0),A(!0))},ks=()=>{const d=x==null?void 0:x.sku;d&&Pr(T,d,p)},js=()=>{_(!1),G(!0),A(!0)},Ss=()=>{if(!x||!x.sku)return;const d=x.sku;Pr(T,d,p)},Ns=async()=>{Re(!0),B(!1),le(!1),oe(!1),q(!1),U(!1),Z(!1),X(!1),await ys(),wn("initial",{extractedDetails:E??void 0})},Cs=()=>{if(!Le)return;const d=at.find(y=>String(y.addressId??y.id)===Le)||null;d&&(localStorage.setItem("agentic_order_address",JSON.stringify(d)),q(!0),B(!0),U(!1),le(!1),Z(!1),oe(!1),X(!1),$t("address",d))},_s=()=>{q(!1),B(!1),U(!1),le(!1),Z(!1),oe(!1),X(!1),localStorage.removeItem("agentic_order_address")},Ps=()=>{M&&(localStorage.setItem("agentic_order_delivery",M),U(!0),le(!0),Z(!1),oe(!1),X(!1),$t("delivery",{method:M,...ft[M]}))},jn=()=>{B(!1),U(!1),le(!1),Z(!1),oe(!1),X(!1),A(!1),Qt(),Se(d=>[...d,{query:"",response:"__TEXT__",snapshotPayload:{text:"No worries! I’ve cancelled this request. You can start again anytime — just tell me what you’d like to buy or track"}}])},Is=()=>{U(!1),le(!1),Z(!1),oe(!1),X(!1),localStorage.removeItem("agentic_order_delivery")},Es=()=>{Fe&&(localStorage.setItem("agentic_order_payment",Fe),Z(!0),oe(!0),X(!1),$t("payment",{method:Fe}))},Fs=()=>{le(!1),Z(!1),oe(!1),X(!1),A(!1),Qt(),Se(d=>[...d,{query:"",response:"__TEXT__",snapshotPayload:{text:"No worries! I’ve cancelled this request. You can start again anytime — just tell me what you’d like to buy or track"}}])},Ts=()=>{Z(!1),oe(!1),X(!1),localStorage.removeItem("agentic_order_payment")},Os=async()=>{try{fe(!0);const d=E||{},y=JSON.parse(localStorage.getItem("agentic_order_address")||"null"),m=localStorage.getItem("agentic_order_delivery"),P=localStorage.getItem("agentic_order_payment")||"card",{product_total:$,tax:C,shipping_fee:Y,currency:Q}=vn(),be=d.shopper_id||localStorage.getItem("customerId")||void 0,se=(y==null?void 0:y.addressId)||(y==null?void 0:y.id)||void 0,Ie=m?kl[m]:"GROUND",de="card-visa",ze=x==null?void 0:x.sku,qe=(r==null?void 0:r.id)||"",He=Lt(d),pe=typeof d.max_price_minor=="number"?d.max_price_minor:Math.round($*100),St={shopper_id:be,shipping_address_id:se,shipping_method_id:Ie,payment_method_id:de,sku:ze,platform:"SFCC",storeCode:"Sites-SiteGenesis-Site",product_id:qe,quantity:He,max_price_minor:pe,currency:Q,instruction_text:T};if(!be||!se){console.error("Missing shopper_id or shipping_address_id for intent-mandate",{shopperId:be,shippingAddressId:se}),alert("Missing customer or address information. Please re-select address and try again."),fe(!1);return}const lt=(await Tt()).access_token;if(!lt)throw new Error("Failed to fetch auth token for intent-mandate");const{serverUrl:Xe}=xt(),Ve=await fetch(`${Xe}/api/intent-mandate`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${lt}`},body:JSON.stringify(St)});if(!Ve.ok){const Rs=await Ve.text().catch(()=>"");console.error("intent-mandate failed",Ve.status,Rs),alert("Something went wrong while saving your smart order. Please try again."),fe(!1);return}const ve=await Ve.json().catch(()=>null);console.log("intent-mandate success:",ve);const dt=(ve==null?void 0:ve.intent_mandate_id)||(ve==null?void 0:ve.intent_mandateId)||(ve==null?void 0:ve.key)||null;dt&&we(dt);const Zt={...d,address:y,delivery:m,payment:P,summary:{product_total:$,tax:C,shipping_fee:Y,currency:Q},intent_mandate_id:dt};localStorage.setItem("agentic_order_final",JSON.stringify(Zt)),X(!0),g(!1),$t("final",Zt),$t("success",{intentMandateId:dt}),Qt()}catch(d){console.error("Error in handleConfirmWatch / intent-mandate:",d),alert("Unable to complete your smart order right now. Please try again in a moment.")}finally{fe(!1)}},Sn=()=>{Qt(),Se(d=>[...d,{query:"",response:"__TEXT__",snapshotPayload:{text:"No worries! I’ve cancelled this request. You can start again anytime — just tell me what you’d like to buy or track"}}])},As=()=>{const d=ho(r,x),y=go(r),m=(r==null?void 0:r.id)||"",P=Qe(x)||"",$=nt(x)||"",{amount:C}=fr(x),Y=!!(r!=null&&r.id),Q=x&&Y?ro(x):!1;return console.log(d,y,m,P,$,C,Y,Q,"base product"),s.jsx("div",{className:"mx-4 mt-2 rounded-xl border border-gray-200 bg-white p-4",children:s.jsxs("div",{className:"flex flex-col sm:flex-row items-center sm:items-center gap-4",children:[s.jsx("div",{className:"flex-shrink-0 flex justify-center sm:justify-start",children:s.jsx("div",{className:"w-[150px] h-[150px] rounded-lg bg-gray-50 border border-gray-200 flex items-center justify-center overflow-hidden",children:d?s.jsx("img",{src:d,alt:y,className:"object-contain w-full h-full"}):s.jsx(ue,{icon:"mdi:image-outline",width:"28",className:"opacity-60"})})}),s.jsxs("div",{className:"flex-grow flex flex-col justify-center text-center",children:[s.jsx("div",{className:"text-2xl font-bold text-gray-900 mb-1",children:y}),s.jsx("div",{className:"text-sm text-gray-700 mb-1",children:[m&&`SKU: ${m}`,P&&`Color: ${P}`,$&&`Size: ${$}`].filter(Boolean).join(" • ")||"—"}),s.jsx("div",{className:"mt-1 text-xl font-semibold text-gray-900",children:Y?Ue(Number(C)||0,Ze):"Currently unavailable"}),Y&&!Q&&s.jsx("div",{className:"mt-1 text-xs font-medium text-red-600",children:"Currently out of stock"})]})]})})},Nn=({showSubmit:d=!0})=>{const y={},m=De.map(C=>Qe(C.variant)).filter(C=>!!C&&!y[C]&&(y[C]=!0)),P={},$=De.map(C=>nt(C.variant)).filter(C=>!!C&&!P[C]&&(P[C]=!0));return s.jsxs("div",{className:"mx-4 mt-4 mb-2 rounded-xl border border-gray-200 bg-white p-4 animate-fade-in",children:[s.jsx("h3",{className:"font-semibold text-gray-800",children:"Choose a variant"}),m.length>0&&s.jsxs("div",{className:"mt-4",children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsx("div",{className:"text-sm font-bold",children:"Color :"}),j&&s.jsx("div",{className:"text-sm text-gray-600",children:j})]}),s.jsx("div",{className:"flex flex-wrap gap-4 mt-2",children:m.map(C=>{var He;const Y=j===C,Q=b||I.current||null,be=Q?ut(De,C,Q):ut(De,C,null),se=!!be,Ie=se&&ro(be.variant),de=se&&Ie?Qr(be.variant,Ze)||Qr(be.variant):null,ze=De.find(pe=>Qe(pe.variant)===C),qe=(He=ze==null?void 0:ze.images)==null?void 0:He[0];return s.jsxs("div",{className:`flex flex-col items-center w-28 border rounded-md p-2
19
- ${Y?"border-2 border-tanya-light":"border-gray-300"}
20
- ${!se||!Ie?"opacity-60":""}`,children:[s.jsx("button",{onClick:()=>{v(C);const pe=b||I.current||null,Ne=pe&&ut(De,C,pe)||ut(De,C,null);Ne&&w(Ne.index)},className:"w-full h-20 flex items-center justify-center overflow-hidden",title:C,children:qe?s.jsx("img",{src:qe,alt:C,className:"w/full h-full object-contain"}):s.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs px-1",children:C})}),s.jsx("div",{className:"w-full border-t my-2"}),se&&!Ie&&s.jsx("div",{className:"text-[11px] text-red-600 text-center",children:"Out of stock"}),!se&&s.jsx("div",{className:"text-[11px] text-red-600 text-center",children:"any not offered"}),se&&Ie&&de&&s.jsxs("div",{className:"text-xs text-gray-800 font-medium text-center",children:[Ue(de.cent/100,de.cur),de.regularCent&&de.regularCent>de.cent&&s.jsx("span",{className:"ml-1 line-through text-gray-500",children:Ue(de.regularCent/100,de.cur)})]})]},`color-${C}`)})})]}),$.length>0&&s.jsxs("div",{className:"mt-4",children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsx("div",{className:"text-sm font-bold",children:"Size :"}),b&&s.jsx("div",{className:"text-sm text-gray-600",children:b})]}),s.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:$.map(C=>{const Y=b===C;return s.jsx("button",{onClick:()=>{k(C);const Q=j&&ut(De,j,C)||ut(De,void 0,C);Q&&w(Q.index)},className:`px-4 py-2 rounded-md border text-sm ${Y?"border-2 border-tanya-light font-semibold":"border-gray-300"}`,title:C,children:C},`size-${C}`)})})]}),d&&s.jsx("div",{className:"mt-4 flex justify-end",children:s.jsx("button",{onClick:Ss,className:"px-6 py-2.5 rounded-full font-semibold text-white shadow-md",style:{background:O},disabled:!Mt,children:"Submit"})})]})},Cn=(d,y=!0)=>{!(d!=null&&d.extractedDetails)&&d&&(d={extractedDetails:d});const m=(d==null?void 0:d.extractedDetails)||E;if(!m)return null;const P=Lt(m),{currency:$}=fr(x),C=xo(r,x),Y=Number((m==null?void 0:m.max_price_minor)??0),be=Number.isFinite(Y)&&Y>0?+(Y/100):+(C*P),se=(m==null?void 0:m.currency)||$||Ze,Ie=x!=null&&x.sku?x.sku:m.product_id;return s.jsxs("div",{className:"px-6 pb-6 flex flex-col items-center space-y-4",style:{backgroundColor:"#14377D"},children:[s.jsx("p",{className:"text-base font-semibold text-center mt-2",style:{color:Be},children:"Here’s what I found from your instruction:"}),s.jsxs("div",{className:"w-full max-w-md bg-white rounded-xl shadow-inner p-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-y-2 text-sm",children:[s.jsx("p",{className:"font-semibold text-gray-600",children:"SKU:"}),s.jsx("p",{className:"text-gray-800",children:Ie}),s.jsx("p",{className:"font-semibold text-gray-600",children:"Quantity:"}),s.jsx("p",{className:"text-gray-800",children:Lt(m)}),s.jsx("p",{className:"font-semibold text-gray-600",children:"Currency:"}),s.jsx("p",{className:"text-gray-800",children:se}),s.jsx("p",{className:"font-semibold text-gray-600",children:"Maximum Total Price:"}),s.jsx("p",{className:"text-gray-800",children:Ue(be,se)})]}),s.jsxs("div",{className:"mt-3 flex flex-wrap gap-2 text-xs",children:[Qe(x)&&s.jsxs("span",{className:"rounded-full bg-gray-100 px-2 py-1",children:["Color: ",Qe(x)]}),nt(x)&&s.jsxs("span",{className:"rounded-full bg-gray-100 px-2 py-1",children:["Size: ",nt(x)]}),(x==null?void 0:x.sku)&&s.jsxs("span",{className:"rounded-full bg-gray-100 px-2 py-1",children:["SKU: ",x.sku]})]})]}),!y&&s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-sm font-medium text-gray-700 text-center max-w-[90%] leading-relaxed",style:{color:Be},children:["Would you like me to ",s.jsx("strong",{children:"lock this in"})," and monitor it for you?"]}),s.jsxs("div",{className:"flex flex-wrap justify-center gap-4",children:[s.jsxs("button",{onClick:Ns,disabled:xe,className:`relative inline-flex items-center justify-center px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${xe?"opacity-60 cursor-not-allowed":"hover:-translate-y-0.5 hover:shadow-lg"}`,style:{background:`${O}`},children:[s.jsx(ue,{icon:"fluent:checkmark-circle-24-filled",className:"mr-2",width:"18",height:"18"}),"Yes, lock it in"]}),s.jsxs("button",{onClick:Sn,disabled:xe,className:`relative inline-flex items-center justify-center px-6 py-2.5 rounded-full font-semibold border transition-all duration-300 ${xe?"opacity-60 cursor-not-allowed":"hover:-translate-y-0.5 hover:shadow-lg"}`,style:{borderColor:O,color:Be},children:[s.jsx(ue,{icon:"fluent:dismiss-circle-24-filled",className:"mr-2",width:"18",height:"18"}),"No"]})]})]})]})},_n=(d,y=!0)=>{var Nt,lt,Xe,Ve,ve,dt;const m=d||{},P=((Nt=m==null?void 0:m.summary)==null?void 0:Nt.currency)||(E==null?void 0:E.currency)||Ze,$=ho(r,x),C=go(r),Y=x!=null&&x.sku?x.sku:(r==null?void 0:r.id)??(E==null?void 0:E.product_id),Q=(x==null?void 0:x.sku)??yo(r),be=Qe(x)||Nl(r),se=nt(x)||Cl(r),Ie=Lt(m),de=((lt=m==null?void 0:m.summary)==null?void 0:lt.product_total)!=null?+m.summary.product_total:bn(m),ze=Ie>0?+(de/Ie).toFixed(2):0,qe=de,He=((Xe=m==null?void 0:m.summary)==null?void 0:Xe.tax)??+(de*.08).toFixed(2),pe=((Ve=m==null?void 0:m.summary)==null?void 0:Ve.shipping_fee)??(((ve=ft[M])==null?void 0:ve.fee)||0),Ne=m!=null&&m.address?[m.address.addressLine1,m.address.addressLine2,m.address.street,[m.address.city,m.address.state,m.address.postalCode].filter(Boolean).join(", "),m.address.country].filter(Boolean).map(Zt=>rt(String(Zt))).join(", "):"—",tt=(m==null?void 0:m.payment)||"card",St=tt==="card"?s.jsxs(s.Fragment,{children:["Credit Card — Mastercard",s.jsx("br",{}),"•••• 7820 Exp: 12/26"]}):s.jsx(s.Fragment,{children:rt(tt)});return s.jsxs("div",{className:"mx-auto mt-3 mb-3 rounded-2xl bg-white",children:[s.jsx("div",{className:"px-6 pt-5 pb-3",children:s.jsxs("h3",{className:"font-semibold text-lg mb-2 text-gray-800 flex items-center gap-2",children:[s.jsx(ue,{icon:"mdi:receipt-text-check-outline",width:"24",color:O}),"All set! Here’s what your smart order looks like 🧾"]})}),s.jsx("div",{className:"px-6 pb-4",children:s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-12 gap-4 rounded-xl border border-gray-200 bg-gray-50 p-3",children:[s.jsx("div",{className:"sm:col-span-2 flex",children:s.jsx("div",{className:"w-30 h-26 sm:w-30 sm:h-26 overflow-hidden rounded-lg bg-white border border-gray-200 flex items-center justify-center mx-auto sm:mx-0",children:$?s.jsx("img",{src:$,alt:C,className:"w-full h-full object-contain"}):s.jsx(ue,{icon:"mdi:image-outline",width:"24",className:"opacity-50"})})}),s.jsxs("div",{className:"sm:col-span-10",children:[s.jsxs("div",{className:"mb-3",children:[s.jsx("div",{className:"text-lg text-center font-bold text-gray-900",children:C}),s.jsxs("div",{className:"text-xs text-center font-bold text-gray-600",children:[s.jsx("span",{className:"font-medium",children:"SKU:"})," ",Y??"—"]}),(Q||be||se)&&s.jsxs("div",{className:"text-xs text-gray-600 mt-0.5 text-center",children:[Q&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"font-medium",children:"SKU:"})," ",Q,"  "]}),be&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"font-medium",children:"Color:"})," ",be,"  "]}),se&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"font-medium",children:"Size:"})," ",se]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md-grid-cols-3 md:grid-cols-3 gap-3",children:[s.jsxs("div",{className:"flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center",children:[s.jsx("div",{className:"text-[11px] uppercase tracking-wide text-gray-500",children:"Unit Price"}),s.jsx("div",{className:"mt-0.5 text-base font-bold text-gray-900",children:Ue(ze,P)})]}),s.jsxs("div",{className:"flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center",children:[s.jsx("div",{className:"text-[11px] uppercase tracking-wide text-gray-500",children:"Quantity"}),s.jsx("div",{className:"mt-0.5 text-base font-bold text-gray-900",children:Ie})]}),s.jsxs("div",{className:"flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center",children:[s.jsx("div",{className:"text-[11px] uppercase tracking-wide text-gray-500",children:"Subtotal"}),s.jsx("div",{className:"mt-0.5 text-base font-bold text-gray-900",children:Ue(qe,P)})]})]})]})]})}),s.jsxs("div",{className:"px-6 pb-2",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-3",children:[s.jsxs("div",{className:"flex flex-col items-center rounded-xl border border-gray-200 bg-gray-50 p-3",children:[s.jsx("div",{className:"text-xs uppercase tracking-wide text-gray-500",children:"🏠 Address"}),s.jsx("div",{className:"mt-1 text-sm font-semibold text-gray-900 text-center",children:Ne})]}),s.jsxs("div",{className:"flex flex-col items-center rounded-xl border border-gray-200 bg-gray-50 p-3",children:[s.jsx("div",{className:"text-xs uppercase tracking-wide text-gray-500",children:"💳 Payment"}),s.jsx("div",{className:"mt-1 text-sm font-semibold text-gray-900 text-center",children:St})]}),s.jsxs("div",{className:"flex flex-col items-center rounded-xl border border-gray-200 bg-gray-50 p-3",children:[s.jsx("div",{className:"text-xs uppercase tracking-wide text-gray-500",children:"🚚 Delivery"}),s.jsx("div",{className:"mt-1 text-sm font-semibold text-gray-900 text-center",children:m!=null&&m.delivery&&((dt=ft[m.delivery])==null?void 0:dt.label)||"—"})]})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[s.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-gray-200 bg-gray-50 p-4 text-center",children:[s.jsx("div",{className:"text-xs uppercase tracking-wide text-gray-500",children:"💰 any(s)"}),s.jsx("div",{className:"mt-1 text-2xl font-bold text-gray-900",children:Ue(de,P)})]}),s.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-gray-200 bg-gray-50 p-4 text-center",children:[s.jsx("div",{className:"text-xs uppercase tracking-wide text-gray-500",children:"🏛️ Taxes"}),s.jsx("div",{className:"mt-1 text-2xl font-bold text-gray-900",children:Ue(He,P)})]}),s.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-gray-200 bg-gray-50 p-4 text-center",children:[s.jsx("div",{className:"text-xs uppercase tracking-wide text-gray-500",children:"🚚 Shipping"}),s.jsx("div",{className:"mt-1 text-2xl font-bold text-gray-900",children:Ue(pe,P)})]})]}),s.jsxs("div",{className:"mt-4 rounded-xl p-4 text-center text-white shadow-sm",style:{background:ct},children:[s.jsx("div",{className:"text-sm/5 opacity-95",children:"🔹 Total Payable"}),s.jsx("div",{className:"mt-1 text-3xl font-extrabold tracking-tight",children:Ue(de+He+pe,P)})]})]}),!y&&s.jsxs("div",{className:"px-6 pb-5",children:[!F&&s.jsx("p",{className:"mt-3 text-center text-sm text-gray-700",children:"Everything looks good! Do you want me to watch this product and buy it automatically when it meets your condition?"}),F&&yn({intentMandateId:ee}),_r&&!F&&s.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-center gap-3",children:[s.jsx("button",{onClick:Os,className:"inline-flex items-center justify-center rounded-full px-6 py-2.5 font-semibold text-white shadow-md transition-transform duration-150 hover:-translate-y-0.5 hover:shadow-lg",style:{background:ct},children:"Confirm"}),s.jsx("button",{onClick:Sn,className:"inline-flex items-center justify-center rounded-full border px-6 py-2.5 font-semibold hover:bg-gray-50",style:{borderColor:ct,color:ct},children:"Cancel"})]})]})]})},$s=d=>{if(!d)return null;const y=[d.addressLine1,d.addressLine2,d.street,[d.city,d.state,d.postalCode].filter(Boolean).join(", "),d.country].filter(m=>!!m).map(m=>rt(m)).join(", ");return s.jsx("div",{className:"px-6 py-4",style:{backgroundColor:"var(--tanya-light)"},children:s.jsxs("div",{className:"rounded-xl border border-gray-200 bg-white p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(ue,{icon:"mdi:home-map-marker",width:"20",color:O}),s.jsx("div",{className:"font-semibold text-gray-800",children:"Delivery Address"})]}),s.jsx("div",{className:"text-sm text-gray-800",children:y})]})})},Ms=d=>{const y=d==null?void 0:d.method,m=y?ft[y]:void 0;return s.jsx("div",{className:"px-6 py-4",style:{backgroundColor:"var(--tanya-light)"},children:s.jsxs("div",{className:"rounded-xl border border-gray-200 bg-white p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(ue,{icon:"mdi:truck-delivery",width:"20",color:O}),s.jsx("div",{className:"font-semibold text-gray-800",children:"Delivery Method"})]}),s.jsx("div",{className:"text-sm text-gray-800",children:m?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ue,{icon:m.icon,width:"18"}),s.jsx("span",{className:"font-medium",children:m.label})]}),s.jsx("div",{className:"text-gray-600",children:m.subtitle})]}):"—"})]})})},Ls=d=>{const y=(d==null?void 0:d.method)||"card";return s.jsx("div",{className:"px-6 py-4",style:{backgroundColor:"var(--tanya-light)"},children:s.jsxs("div",{className:"rounded-xl border border-gray-200 bg-white p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(ue,{icon:"mdi:credit-card-outline",width:"20",color:O}),s.jsx("div",{className:"font-semibold text-gray-800",children:"Payment Method"})]}),s.jsx("div",{className:"text-sm text-gray-800",children:y==="card"?s.jsxs(s.Fragment,{children:["Credit Card — Mastercard",s.jsx("br",{}),"•••• 7820   Exp: 12/26"]}):rt(y)})]})})},Ds=(d,y)=>{const m=d.snapshotStage;if(!m||m==="address"&&xe||m==="delivery"&&J||m==="payment"&&re||m==="final"&&Oe)return null;switch(m){case"initial":return Cn(d.snapshotPayload,!y);case"address":return $s(d.snapshotPayload);case"delivery":return Ms(d.snapshotPayload);case"payment":return Ls(d.snapshotPayload);case"final":return _n(d.snapshotPayload,!y);case"success":return yn(d.snapshotPayload);default:return null}};return Us.createPortal(s.jsxs("div",{className:"fixed inset-0",style:{zIndex:2147483647},"aria-modal":"true",role:"dialog",children:[s.jsx("div",{className:"absolute inset-0",style:{background:"rgba(0,0,0,0.25)"},onClick:t}),s.jsx("div",{className:"absolute right-0 ",children:s.jsxs("div",{className:"w-[64.7vw] h-screen bg-white rounded-xl overflow-hidden flex flex-col shadow-xl",children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",borderTopLeftRadius:"0.75rem",borderBottomLeftRadius:"0.75rem",padding:"0.25rem",background:At},children:[s.jsxs("div",{style:{display:"flex",color:"#ffffff",alignItems:"center",gap:"0.5rem"},children:[s.jsx(fs,{color:"white",children:s.jsx(vl,{})}),s.jsx("div",{children:s.jsx("p",{className:"font-bold",children:"Agentic Shopping with TANYA"})})]}),s.jsx("div",{style:{display:"flex",alignItems:"center",gap:"1.25rem",margin:"0.75rem"},children:s.jsx(ue,{icon:"fluent:dismiss-24-filled",color:"#ffffff",width:"24",height:"24",className:"cursor-pointer",onClick:t})})]}),s.jsxs("div",{ref:jt,className:"overflow-y-auto pr-5 pb-4 space-y-4 hide-scrollbar flex-grow",children:[s.jsxs("div",{className:"text-sm text-[16px] rounded-r-xl p-3 m-3 rounded-bl-xl w-3/4 text-tanya-contrast",style:{backgroundColor:"#e5dbeb"},children:["Welcome to your smart shopping companion!",s.jsxs("p",{children:["Simply share your instruction — like “If this product goes below $",parseInt(r.price)-5," grab it for me.”"]}),s.jsx("p",{children:"I’ll monitor it, calculate total prices, and place the order when your conditions are met."})]}),s.jsx(As,{}),u>1&&s.jsx(Nn,{showSubmit:!1}),Pe.map((d,y)=>{var $;const m=y===Pe.length-1,P=!!d.snapshotStage;return s.jsxs("div",{children:[d.query&&s.jsx("div",{className:"flex justify-end",children:s.jsx("p",{className:"text-sm rounded-l-xl p-3 m-3 mb-4 rounded-br-xl max-w-[75%]",style:{color:"#ffffff",backgroundColor:"var(--tanya)"},children:d.query})}),d.response==="__TEXT__"&&(($=d.snapshotPayload)==null?void 0:$.text)&&s.jsx("div",{className:"mt-2",children:s.jsx("div",{className:"text-sm text-tanya-contrast px-7 py-4 rounded-r-xl rounded-bl-2xl w-full",style:{backgroundColor:"var(--tanya-light)",margin:"0.75rem"},children:s.jsx("div",{className:"flex items-center gap-2",children:s.jsx("p",{children:d.snapshotPayload.text})})})}),m&&N&&u>1&&s.jsxs("div",{className:"mx-4 mt-2 rounded-xl border border-gray-200 bg-white p-4 animate-fade-in",children:[s.jsxs("div",{className:"text-sm text-gray-800",children:["Proceed with color:"," ",s.jsx("span",{className:"font-semibold",children:Qe(x)||"—"}),", size:"," ",s.jsx("span",{className:"font-semibold",children:nt(x)||"—"}),"?"]}),s.jsxs("div",{className:"mt-3 flex gap-3",children:[s.jsx("button",{onClick:ks,className:"px-5 py-2 rounded-full text-white font-semibold",style:{background:O},children:"Yes"}),s.jsx("button",{onClick:js,className:"px-5 py-2 rounded-full font-semibold border",style:{borderColor:O,color:O},children:"No, change SKU"})]})]}),m&&ie&&s.jsx(Nn,{showSubmit:!0}),m&&K&&s.jsx("div",{className:"mt-4",children:s.jsx("div",{className:"text-sm text-tanya-contrast px-7 py-4 rounded-r-xl rounded-bl-2xl w-full",style:{backgroundColor:"var(--tanya-light)",margin:"0.75rem"},children:s.jsx("div",{className:"flex items-center gap-2 tanya-pulse-text",children:s.jsx("p",{children:"Reading your instruction and setting things up…"})})})}),(P||d.response==="__CARD__")&&(!K||!m)&&s.jsx("div",{className:"mt-6 mb-4 mx-4 animate-fade-in",style:{backgroundColor:"#fff",borderRadius:"1rem",boxShadow:"0 2px 8px rgba(0,0,0,0.08)",overflow:"hidden"},children:P?Ds(d,m):Cn(d.snapshotPayload,!1)})]},y)}),xe&&s.jsxs("div",{className:"mt-6 mb-6 mx-6 rounded-xl p-6 shadow-md border border-gray-200 bg-white animate-fade-in",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("h3",{className:"font-semibold text-lg text-gray-800 flex items-center gap-2",children:[s.jsx(ue,{icon:"mdi:home-map-marker",width:"24",color:"var(--tanya-light)"}),"Select a Delivery Address"]}),L&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"ml-2 text-xs px-2 py-1 rounded-full bg-green-100 text-green-700 font-semibold",children:"Selected"}),!F&&s.jsx("button",{onClick:_s,className:"ml-2 text-xs px-2 py-1 rounded-full border hover:bg-gray-50",style:{borderColor:"var(--tanya-light)",color:"var(--tanya-light)"},title:"Change address",children:"Change"})]})]}),s.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Choose where you’d like us to deliver this item."}),a?s.jsxs("div",{className:"flex items-center py-6",children:[s.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2",style:{borderBottomColor:"var(--tanya-light)"}}),s.jsx("p",{className:"ml-3 text-gray-600",children:"Fetching your addresses..."})]}):at.length>0?s.jsxs("div",{className:`space-y-3 ${L?"opacity-70":""}`,children:[at.map(d=>{const y=[d.addressLine1,d.addressLine2].filter(Boolean).map(Q=>rt(Q||"")).join(" "),m=rt(d.city||""),P=`${rt(d.state||"")}${d.state&&d.postalCode?", ":""}${d.postalCode||""}`,$=rt(d.country||""),C=String(d.addressId??d.id),Y=Le===C;return s.jsxs("label",{className:`flex items-start gap-3 p-4 border rounded-lg cursor-pointer transition hover:shadow-sm ${Y?"border-tanya-light":"border-gray-300"} ${L?"pointer-events-none":""}`,title:L?"Address already submitted":"",children:[s.jsx("input",{type:"radio",name:"address",className:"mt-1 accent-tanya-light",checked:Y,disabled:L,onChange:()=>Cr(C),value:C}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"font-semibold text-gray-800",children:y||"Address"}),s.jsxs("div",{className:"text-sm text-gray-700",children:[m,s.jsx("br",{}),P,s.jsx("br",{}),$]})]})]},C)}),s.jsxs("div",{className:"flex justify-between pt-2",children:[s.jsx("button",{onClick:jn,className:"px-6 py-2.5 rounded-full font-semibold border transition-all hover:-translate-y-0.5 hover:shadow-sm",style:{borderColor:"var(--tanya-light)",color:"var(--tanya-light)"},children:"Cancel"}),s.jsx("button",{onClick:Cs,disabled:L,className:`px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${L?"opacity-60 cursor-not-allowed":"hover:-translate-y-0.5 hover:shadow-lg"}`,style:{background:O},children:L?"Address Submitted":"Submit Address"})]})]}):s.jsx("div",{className:"text-center py-8 text-gray-600",children:"No addresses found. Please add a new one in your profile."})]}),J&&s.jsxs("div",{className:"mt-2 mb-6 mx-6 rounded-xl p-6 shadow-md border border-gray-200 bg-white animate-fade-in",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("h3",{className:"font-semibold text-lg text-gray-800 flex items-center gap-2",children:[s.jsx(ue,{icon:"mdi:truck-delivery",width:"24",color:"var(--tanya-light)"}),"Great! Now choose how fast you want it delivered 🚚"]}),W&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"ml-2 text-xs px-2 py-1 rounded-full bg-green-100 text-green-700 font-semibold",children:"Selected"}),!F&&s.jsx("button",{onClick:Is,className:"ml-2 text-xs px-2 py-1 rounded-full border hover:bg-gray-50",style:{borderColor:"var(--tanya-light)",color:"var(--tanya-light)"},title:"Change shipping method",children:"Change"})]})]}),s.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Which one would you like me to use for this order?"}),s.jsx("div",{className:`space-y-3 ${W?"opacity-70":""}`,children:Object.keys(ft).map(d=>{const y=ft[d],m=M===d;return s.jsxs("label",{className:`flex items-start gap-3 p-4 border rounded-lg cursor-pointer transition hover:shadow-sm ${m?"border-tanya-light":"border-gray-300"} ${W?"pointer-events-none":""}`,title:W?"Delivery already submitted":"",children:[s.jsx("input",{type:"radio",name:"delivery",className:"mt-1 accent-tanya-light",checked:m,disabled:W,onChange:()=>ye(d)}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"font-semibold text-gray-800 flex items-center gap-2",children:[s.jsx(ue,{icon:y.icon,width:"18"})," ",y.label]}),s.jsx("div",{className:"text-sm text-gray-700",children:y.subtitle})]}),s.jsx("div",{className:"text-sm font-semibold text-gray-800",children:y.fee===0?"Free":Ue(y.fee,(E==null?void 0:E.currency)||Ze)})]},d)})}),s.jsxs("div",{className:"flex justify-between pt-4",children:[s.jsx("button",{onClick:jn,className:"px-6 py-2.5 rounded-full font-semibold border transition-all hover:-translate-y-0.5 hover:shadow-sm",style:{borderColor:"var(--tanya-light)",color:"var(--tanya-light)"},children:"Cancel"}),s.jsx("button",{onClick:Ps,disabled:W,className:`px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${W?"opacity-60 cursor-not-allowed":"hover:-translate-y-0.5 hover:shadow-lg"}`,style:{background:"var(--tanya)"},children:W?"Delivery Submitted":"Submit Delivery Option"})]})]}),re&&s.jsxs("div",{className:"mt-2 mb-6 mx-6 rounded-xl p-6 shadow-md border border-gray-200 bg-white animate-fade-in",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("h3",{className:"font-semibold text-lg text-gray-800 flex items-center gap-2",children:[s.jsx(ue,{icon:"mdi:credit-card-outline",width:"24",color:"var(--tanya-light)"}),"Almost done! 💳"]}),ne&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"ml-2 text-xs px-2 py-1 rounded-full bg-green-100 text-green-700 font-semibold",children:"Selected"}),!F&&s.jsx("button",{onClick:Ts,className:"ml-2 text-xs px-2 py-1 rounded-full border hover:bg-gray-50",style:{borderColor:"var(--tanya-light)",color:"var(--tanya-light)"},title:"Change payment method",children:"Change"})]})]}),s.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Please choose a payment method for this order:"}),s.jsx("div",{className:`space-y-3 ${ne?"opacity-70":""}`,children:s.jsxs("label",{className:`flex items-start gap-3 p-4 border rounded-lg cursor-pointer transition hover:shadow-sm ${Fe==="card"?"border-tanya-light":"border-gray-300"} ${ne?"pointer-events-none":""}`,title:ne?"Payment already submitted":"",children:[s.jsx("input",{type:"radio",name:"payment",className:"mt-1 accent-tanya-light",checked:Fe==="card",disabled:ne,onChange:()=>Te("card")}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"font-semibold text-gray-800 flex items-center gap-2",children:[s.jsx(ue,{icon:"mdi:credit-card-chip-outline",width:"18"})," ","Credit Card"]}),Fe==="card"&&s.jsxs("div",{className:"text-sm text-gray-700 mt-1",children:["Mastercard    •••• 7820",s.jsx("br",{}),"Expiry: 12/26"]})]})]})}),s.jsxs("div",{className:"flex justify-between pt-4",children:[s.jsx("button",{onClick:Fs,className:"px-6 py-2.5 rounded-full font-semibold border transition-all hover:-translate-y-0.5 hover:shadow-sm",style:{borderColor:"var(--tanya-light)",color:"var(--tanya-light)"},children:"Cancel"}),s.jsx("button",{onClick:Es,disabled:ne,className:`px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${ne?"opacity-60 cursor-not-allowed":"hover:-translate-y-0.5 hover:shadow-lg"}`,style:{background:"var(--tanya)"},children:ne?"Payment Submitted":"Submit Payment Method"})]})]}),Oe&&_n({...E,address:JSON.parse(localStorage.getItem("agentic_order_address")||"null"),delivery:localStorage.getItem("agentic_order_delivery"),payment:localStorage.getItem("agentic_order_payment"),summary:vn(E==null?void 0:E.currency)},!1)]}),s.jsxs("div",{className:"sticky bottom-0 w-[96%] drop-shadow-xl flex items-center rounded-full bg-white border border-gray-300 m-[15px]",children:[s.jsx("input",{placeholder:D?"Complete the current step…":Mt?`What would you like me to do? (e.g., If this product goes below $${parseInt(r.price)-5}, grab it for me.)`:"Oops! This combination isn’t available for this product. Try a different option.",disabled:vs,className:`w-full rounded-full p-4 outline-none border-none focus:ring-0 focus:border-transparent disabled:bg-gray-100 disabled:cursor-not-allowed
21
- ${Mt?"":"placeholder:text-red-400 text-red-500"}`,value:H,onKeyDown:d=>{d.key==="Enter"&&!K&&!D&&kn()},onChange:d=>ce(d.target.value)}),s.jsx("button",{type:"submit",disabled:K||D,className:"mr-6 font-medium",style:{color:"var(--tanya-light)"},onClick:()=>kn(),children:K?s.jsx("div",{className:"m-3 animate-spin rounded-full h-6 w-6 border-b-2",style:{borderBottom:"2px solid"}}):s.jsx(ue,{icon:"fluent:send-48-filled",color:"var(--tanya-light)",width:"24",height:"24"})})]})]})})]}),document.body)};exports.AgenticShoppingButton=_l;exports.TanyaChatbot=qa;exports.TanyaChatbotProvider=Hs;
15
+ `,style:{background:"linear-gradient(170.1deg, #FFFFFF 60.03%, #E3DEEF 99.59%)"},children:[n.jsxs("div",{className:"flex justify-between p-3 bg-[#FFFFFF] border border-b-1 border-[#E5E5E5] ",children:[n.jsx("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:n.jsxs("div",{className:"flex flex-col gap-1",children:[n.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:[n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 15 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.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"}),n.jsx("path",{d:"M0 0.5H6.28488V4.25H0V0.5Z",fill:"white"})]}),n.jsx("p",{className:"text-[#FFFFFF] font-nunitoSans font-semibold",children:"TANYA"})]}),n.jsxs("p",{className:"text-[#5B5B5B] font-nunitoSans font-semibold",style:{fontStyle:"italic"},children:[" ","Your AI shopping assistant !"," "]})]})}),n.jsx("div",{style:{display:"flex",alignItems:"center",gap:"1.25rem",margin:"0.75rem"},children:n.jsx("button",{onClick:()=>w(!1),children:n.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsxs("g",{clipPath:"url(#clip0_501_6036)",children:[n.jsx("path",{d:"M18 6.5L6 18.5",stroke:"#555555",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M6 6.5L18 18.5",stroke:"#555555",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),n.jsx("defs",{children:n.jsx("clipPath",{id:"clip0_501_6036",children:n.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 0.5)"})})})]})})})]}),n.jsxs("div",{className:"flex h-full md:flex-row lg:flex-row",children:[n.jsxs("div",{className:`flex flex-col h-full ${R?"lg:w-2/3 w-full":"w-full"}`,children:[n.jsxs("div",{ref:L,className:"overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",children:[(E==null?void 0:E.whomRequired)&&n.jsxs("div",{className:"mx-3 p-3 rounded-2xl bg-[#FFFFFF]",children:[n.jsx("div",{className:"flex gap-2 bg-[#FFFFFF]",children:n.jsx("p",{className:"font-bold font-nunitoSans text-[#494949]",children:"Is this for you or someone else?"})}),n.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:o.map(f=>n.jsx("button",{onClick:()=>ye(f),className:"px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",style:{backgroundColor:oe===s[f]?"#FFFFFF":"#F3F3F3",borderColor:oe===s[f]?"#BBB3DD":""},children:f},f))})]}),Te.map((f,O)=>{var A,V;return n.jsxs("div",{children:[n.jsx("div",{className:"flex justify-end",children:n.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:f.query})}),f.response&&f.response.includes("Thinking")?n.jsx("div",{children:n.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:Zt(f.response)}})}):n.jsx("div",{children:n.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:Zt(f.response)}})}),Ee&&!f.response.includes("Thinking")&&((A=f.products)==null?void 0:A.length)==0&&n.jsx("div",{children:n.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"})}),(f==null?void 0:f.products)&&((V=f==null?void 0:f.products)==null?void 0:V.length)>0&&n.jsx(Ho,{chat:f.products,storeDetails:E}),(f==null?void 0:f.potentialQuestions.length)>0&&n.jsxs("div",{className:"my-2 px-4 text-sm text-gray-700",children:[n.jsx("p",{className:"font-nunitoSans font-bold text-sm text-[#494949]",style:{color:E.themeDarkColor},children:"Why not explore these inquiries..."}),f.potentialQuestions.split(",").map((D,T)=>n.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:()=>_e(D),style:{backgroundColor:E.tanyaThemeColorLight},children:D},T))]}),(f==null?void 0:f.secondaryLoading)&&n.jsx("div",{className:"mt-3 mb-4 px-4",children:n.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:[n.jsxs("div",{className:"flex gap-1",children:[n.jsx("div",{className:"tanya-sparkle tanya-sparkle-1",children:"✨"}),n.jsx("div",{className:"tanya-sparkle tanya-sparkle-2",children:"✨"}),n.jsx("div",{className:"tanya-sparkle tanya-sparkle-3",children:"✨"})]}),n.jsx("div",{className:"tanya-shimmer"}),n.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!"}),n.jsx("p",{className:"tanya-dots mt-1",style:{color:E.themeDarkColor},children:"• • •"})]})}),(f==null?void 0:f.secondaryResponse)&&n.jsx(n.Fragment,{children:n.jsxs("div",{className:"mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]",children:[n.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:Zt(f.secondaryResponse)}}),f.productSnapshot&&n.jsx("div",{className:"mt-4 w-full",children:n.jsxs("div",{className:"flex gap-4 items-stretch rounded-2xl p-4",style:{backgroundColor:E.tanyaThemeColorLight},children:[n.jsx("div",{className:"flex-shrink-0 rounded-xl overflow-hidden border",style:{width:112,height:112,borderColor:"#eee"},children:f.productSnapshot.image?n.jsx("img",{src:f.productSnapshot.image,alt:f.productSnapshot.name,className:"w-full h-full object-cover"}):n.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-gray-500",children:"No Image"})}),n.jsxs("div",{className:"flex flex-col flex-1 justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"font-semibold text-[15px] leading-snug",children:f.productSnapshot.name}),n.jsx("p",{className:"mt-1 text-[14px] font-medium",children:f.productSnapshot.price!=null?new Intl.NumberFormat(void 0,{style:"currency",currency:(E==null?void 0:E.currency)||"USD"}).format(f.productSnapshot.price):""}),f.productSnapshot.points>0&&n.jsxs("p",{className:"mt-1 text-xs opacity-80",children:["You will earn"," ",n.jsxs("strong",{children:[f.productSnapshot.points," ","points"]})]})]}),n.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[n.jsxs("div",{className:"flex items-center border rounded-full overflow-hidden",children:[n.jsx("button",{className:"px-3 py-1 text-sm",onClick:()=>me(D=>D.map((T,le)=>le===O&&T.productSnapshot?{...T,productSnapshot:{...T.productSnapshot,quantity:Math.max(1,T.productSnapshot.quantity-1)}}:T)),style:{background:"transparent",color:E.themeDarkColor},children:"−"}),n.jsx("div",{className:"px-3 py-1 text-sm select-none",children:f.productSnapshot.quantity}),n.jsx("button",{className:"px-3 py-1 text-sm",onClick:()=>me(D=>D.map((T,le)=>le===O&&T.productSnapshot?{...T,productSnapshot:{...T.productSnapshot,quantity:T.productSnapshot.quantity+1}}:T)),style:{background:"transparent",color:E.themeDarkColor},children:"+"})]}),n.jsx("button",{onClick:()=>{Qt(Ce(f.productSnapshot),f.productSnapshot.quantity)},disabled:I,className:"px-4 py-2 rounded-full font-medium",style:{background:E.tanyaThemeColor,color:(E==null?void 0:E.tanyaThemeContrastColor)||"#fff",opacity:I?.8:1},children:I?"Adding...":"Add to cart"})]})]})]})})]})}),n.jsx("div",{className:"mb-20"})]},O)})]}),n.jsx("div",{className:"flex flex-col gap-2 sticky bottom-0 left-0 right-0 bg-[#E3DEEF] z-50 px-4 py-2",children:n.jsx("div",{className:"p-[1px] rounded-xl",style:{background:"linear-gradient(180deg, #B09FFF 0%, #8D79F6 100%)"},children:n.jsxs("div",{className:"flex items-center bg-[#FFFFFF] flex-1 rounded-xl px-2 py-1",children:[n.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:U,autoFocus:!0,onChange:f=>ge(f.target.value),onKeyDown:f=>{f.key==="Enter"&&!x&&_e()}}),n.jsx("button",{type:"submit",disabled:x,className:"p-3",onClick:()=>_e(),children:x?n.jsx("div",{className:"p-3 animate-spin rounded-full h-3 w-3 border-b-2",style:{borderBottom:"2px solid",color:E.tanyaThemeColor}}):n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.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"})})})]})})})]}),n.jsx(Yo,{addToCartPwa:r})]})]})]})]})})};var cr=function(e,t){return cr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(r[s]=o[s])},cr(e,t)};function Ko(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");cr(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Ye=function(){return Ye=Object.assign||function(t){for(var r,o=1,s=arguments.length;o<s;o++){r=arguments[o];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Ye.apply(this,arguments)};function Wo(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(e);s<o.length;s++)t.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(e,o[s])&&(r[o[s]]=e[o[s]]);return r}var er="Invariant Violation",Yr=Object.setPrototypeOf,Go=Yr===void 0?function(e,t){return e.__proto__=t,e}:Yr,Pn=(function(e){Ko(t,e);function t(r){r===void 0&&(r=er);var o=e.call(this,typeof r=="number"?er+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return o.framesToPop=1,o.name=er,Go(o,t.prototype),o}return t})(Error);function rt(e,t){if(!e)throw new Pn(t)}var En=["debug","log","warn","error","silent"],Qo=En.indexOf("log");function $t(e){return function(){if(En.indexOf(e)>=Qo){var t=console[e]||console.log;return t.apply(console,arguments)}}}(function(e){e.debug=$t("debug"),e.log=$t("log"),e.warn=$t("warn"),e.error=$t("error")})(rt||(rt={}));var Tn="3.14.0";function ht(e){try{return e()}catch{}}const dr=ht(function(){return globalThis})||ht(function(){return window})||ht(function(){return self})||ht(function(){return global})||ht(function(){return ht.constructor("return this")()});var Jr=new Map;function Xo(e){var t=Jr.get(e)||1;return Jr.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function Zo(e,t){var r=Xo("stringifyForDisplay");return JSON.stringify(e,function(o,s){return s===void 0?r:s},t).split(JSON.stringify(r)).join("<undefined>")}function Lt(e){return function(t){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(typeof t=="number"){var s=t;t=wr(s),t||(t=br(s,r),r=[])}e.apply(void 0,[t].concat(r))}}var tr=Object.assign(function(t,r){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];t||rt(t,wr(r,o)||br(r,o))},{debug:Lt(rt.debug),log:Lt(rt.log),warn:Lt(rt.warn),error:Lt(rt.error)});function On(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return new Pn(wr(e,t)||br(e,t))}var Kr=Symbol.for("ApolloErrorMessageHandler_"+Tn);function An(e){if(typeof e=="string")return e;try{return Zo(e,2).slice(0,1e3)}catch{return"<non-serializable>"}}function wr(e,t){if(t===void 0&&(t=[]),!!e)return dr[Kr]&&dr[Kr](e,t.map(An))}function br(e,t){if(t===void 0&&(t=[]),!!e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:Tn,message:e,args:t.map(An)})))}function es(e){return e.definitions.filter(function(t){return t.kind==="OperationDefinition"&&!!t.name}).map(function(t){return t.name.value})[0]||null}let ae=null;const Wr={};let ts=1;const rs=()=>class{constructor(){this.id=["slot",ts++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let t=ae;t;t=t.parent)if(this.id in t.slots){const r=t.slots[this.id];if(r===Wr)break;return t!==ae&&(ae.slots[this.id]=r),!0}return ae&&(ae.slots[this.id]=Wr),!1}getValue(){if(this.hasValue())return ae.slots[this.id]}withValue(t,r,o,s){const a={__proto__:null,[this.id]:t},i=ae;ae={parent:i,slots:a};try{return r.apply(s,o)}finally{ae=i}}static bind(t){const r=ae;return function(){const o=ae;try{return ae=r,t.apply(this,arguments)}finally{ae=o}}}static noContext(t,r,o){if(ae){const s=ae;try{return ae=null,t.apply(o,r)}finally{ae=s}}else return t.apply(o,r)}};function Gr(e){try{return e()}catch{}}const rr="@wry/context:Slot",ns=Gr(()=>globalThis)||Gr(()=>global)||Object.create(null),Qr=ns,vr=Qr[rr]||Array[rr]||(function(e){try{Object.defineProperty(Qr,rr,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}})(rs()),{bind:za,noContext:Ma}=vr;new vr;function os(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=ss(e))||t){r&&(e=r);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
16
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ss(e,t){if(e){if(typeof e=="string")return Xr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xr(e,t)}}function Xr(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function Zr(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function jr(e,t,r){return t&&Zr(e.prototype,t),r&&Zr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var kr=function(){return typeof Symbol=="function"},Sr=function(e){return kr()&&!!Symbol[e]},Nr=function(e){return Sr(e)?Symbol[e]:"@@"+e};kr()&&!Sr("observable")&&(Symbol.observable=Symbol("observable"));var as=Nr("iterator"),ur=Nr("observable"),$n=Nr("species");function Jt(e,t){var r=e[t];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function kt(e){var t=e.constructor;return t!==void 0&&(t=t[$n],t===null&&(t=void 0)),t!==void 0?t:fe}function is(e){return e instanceof fe}function gt(e){gt.log?gt.log(e):setTimeout(function(){throw e})}function zt(e){Promise.resolve().then(function(){try{e()}catch(t){gt(t)}})}function Ln(e){var t=e._cleanup;if(t!==void 0&&(e._cleanup=void 0,!!t))try{if(typeof t=="function")t();else{var r=Jt(t,"unsubscribe");r&&r.call(t)}}catch(o){gt(o)}}function fr(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function ls(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(Dn(e,t[r].type,t[r].value),e._state!=="closed");++r);}}function Dn(e,t,r){e._state="running";var o=e._observer;try{var s=Jt(o,t);switch(t){case"next":s&&s.call(o,r);break;case"error":if(fr(e),s)s.call(o,r);else throw r;break;case"complete":fr(e),s&&s.call(o);break}}catch(a){gt(a)}e._state==="closed"?Ln(e):e._state==="running"&&(e._state="ready")}function nr(e,t,r){if(e._state!=="closed"){if(e._state==="buffering"){e._queue.push({type:t,value:r});return}if(e._state!=="ready"){e._state="buffering",e._queue=[{type:t,value:r}],zt(function(){return ls(e)});return}Dn(e,t,r)}}var cs=(function(){function e(r,o){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var s=new ds(this);try{this._cleanup=o.call(void 0,s)}catch(a){s.error(a)}this._state==="initializing"&&(this._state="ready")}var t=e.prototype;return t.unsubscribe=function(){this._state!=="closed"&&(fr(this),Ln(this))},jr(e,[{key:"closed",get:function(){return this._state==="closed"}}]),e})(),ds=(function(){function e(r){this._subscription=r}var t=e.prototype;return t.next=function(o){nr(this._subscription,"next",o)},t.error=function(o){nr(this._subscription,"error",o)},t.complete=function(){nr(this._subscription,"complete")},jr(e,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),e})(),fe=(function(){function e(r){if(!(this instanceof e))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 t=e.prototype;return t.subscribe=function(o){return(typeof o!="object"||o===null)&&(o={next:o,error:arguments[1],complete:arguments[2]}),new cs(o,this._subscriber)},t.forEach=function(o){var s=this;return new Promise(function(a,i){if(typeof o!="function"){i(new TypeError(o+" is not a function"));return}function c(){l.unsubscribe(),a()}var l=s.subscribe({next:function(h){try{o(h,c)}catch(p){i(p),l.unsubscribe()}},error:i,complete:a})})},t.map=function(o){var s=this;if(typeof o!="function")throw new TypeError(o+" is not a function");var a=kt(this);return new a(function(i){return s.subscribe({next:function(c){try{c=o(c)}catch(l){return i.error(l)}i.next(c)},error:function(c){i.error(c)},complete:function(){i.complete()}})})},t.filter=function(o){var s=this;if(typeof o!="function")throw new TypeError(o+" is not a function");var a=kt(this);return new a(function(i){return s.subscribe({next:function(c){try{if(!o(c))return}catch(l){return i.error(l)}i.next(c)},error:function(c){i.error(c)},complete:function(){i.complete()}})})},t.reduce=function(o){var s=this;if(typeof o!="function")throw new TypeError(o+" is not a function");var a=kt(this),i=arguments.length>1,c=!1,l=arguments[1],h=l;return new a(function(p){return s.subscribe({next:function(y){var w=!c;if(c=!0,!w||i)try{h=o(h,y)}catch(k){return p.error(k)}else h=y},error:function(y){p.error(y)},complete:function(){if(!c&&!i)return p.error(new TypeError("Cannot reduce an empty sequence"));p.next(h),p.complete()}})})},t.concat=function(){for(var o=this,s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];var c=kt(this);return new c(function(l){var h,p=0;function y(w){h=w.subscribe({next:function(k){l.next(k)},error:function(k){l.error(k)},complete:function(){p===a.length?(h=void 0,l.complete()):y(c.from(a[p++]))}})}return y(o),function(){h&&(h.unsubscribe(),h=void 0)}})},t.flatMap=function(o){var s=this;if(typeof o!="function")throw new TypeError(o+" is not a function");var a=kt(this);return new a(function(i){var c=[],l=s.subscribe({next:function(p){if(o)try{p=o(p)}catch(w){return i.error(w)}var y=a.from(p).subscribe({next:function(w){i.next(w)},error:function(w){i.error(w)},complete:function(){var w=c.indexOf(y);w>=0&&c.splice(w,1),h()}});c.push(y)},error:function(p){i.error(p)},complete:function(){h()}});function h(){l.closed&&c.length===0&&i.complete()}return function(){c.forEach(function(p){return p.unsubscribe()}),l.unsubscribe()}})},t[ur]=function(){return this},e.from=function(o){var s=typeof this=="function"?this:e;if(o==null)throw new TypeError(o+" is not an object");var a=Jt(o,ur);if(a){var i=a.call(o);if(Object(i)!==i)throw new TypeError(i+" is not an object");return is(i)&&i.constructor===s?i:new s(function(c){return i.subscribe(c)})}if(Sr("iterator")&&(a=Jt(o,as),a))return new s(function(c){zt(function(){if(!c.closed){for(var l=os(a.call(o)),h;!(h=l()).done;){var p=h.value;if(c.next(p),c.closed)return}c.complete()}})});if(Array.isArray(o))return new s(function(c){zt(function(){if(!c.closed){for(var l=0;l<o.length;++l)if(c.next(o[l]),c.closed)return;c.complete()}})});throw new TypeError(o+" is not observable")},e.of=function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var i=typeof this=="function"?this:e;return new i(function(c){zt(function(){if(!c.closed){for(var l=0;l<s.length;++l)if(c.next(s[l]),c.closed)return;c.complete()}})})},jr(e,null,[{key:$n,get:function(){return this}}]),e})();kr()&&Object.defineProperty(fe,Symbol("extensions"),{value:{symbol:ur,hostReportError:gt},configurable:!0});function us(e){var t,r=e.Symbol;if(typeof r=="function")if(r.observable)t=r.observable;else{typeof r.for=="function"?t=r.for("https://github.com/benlesh/symbol-observable"):t=r("https://github.com/benlesh/symbol-observable");try{r.observable=t}catch{}}else t="@@observable";return t}var pt;typeof self<"u"?pt=self:typeof window<"u"?pt=window:typeof global<"u"?pt=global:typeof module<"u"?pt=module:pt=Function("return this")();us(pt);var en=fe.prototype,tn="@@observable";en[tn]||(en[tn]=function(){return this});function fs(e){for(var t=["query","operationName","variables","extensions","context"],r=0,o=Object.keys(e);r<o.length;r++){var s=o[r];if(t.indexOf(s)<0)throw On(58,s)}return e}function ms(e,t){var r=Ye({},e),o=function(a){typeof a=="function"?r=Ye(Ye({},r),a(r)):r=Ye(Ye({},r),a)},s=function(){return Ye({},r)};return Object.defineProperty(t,"setContext",{enumerable:!1,value:o}),Object.defineProperty(t,"getContext",{enumerable:!1,value:s}),t}function hs(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName=typeof t.query!="string"?es(t.query)||void 0:""),t}var ps=Symbol.for("apollo.deprecations"),gs=dr,xs=new vr;function ys(e){return gs[ps]||(xs.getValue()||[]).includes(e)}function ws(e,t){ys(e)||t()}function rn(e,t){return t?t(e):fe.of()}function St(e){return typeof e=="function"?new zn(e):e}function Dt(e){return e.request.length<=1}var zn=(function(){function e(t){t&&(this.request=t)}return e.empty=function(){return new e(function(){return fe.of()})},e.from=function(t){return t.length===0?e.empty():t.map(St).reduce(function(r,o){return r.concat(o)})},e.split=function(t,r,o){var s=St(r),a=St(o||new e(rn)),i;return Dt(s)&&Dt(a)?i=new e(function(c){return t(c)?s.request(c)||fe.of():a.request(c)||fe.of()}):i=new e(function(c,l){return t(c)?s.request(c,l)||fe.of():a.request(c,l)||fe.of()}),Object.assign(i,{left:s,right:a})},e.execute=function(t,r){return t.request(ms(r.context,hs(fs(r))))||fe.of()},e.concat=function(t,r){var o=St(t);if(Dt(o))return globalThis.__DEV__!==!1&&tr.warn(47,o),o;var s=St(r),a;return Dt(s)?a=new e(function(i){return o.request(i,function(c){return s.request(c)||fe.of()})||fe.of()}):a=new e(function(i,c){return o.request(i,function(l){return s.request(l,c)||fe.of()})||fe.of()}),Object.assign(a,{left:o,right:s})},e.prototype.split=function(t,r,o){return this.concat(e.split(t,r,o||new e(rn)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(t,r){throw On(48)},e.prototype.onError=function(t,r){if(globalThis.__DEV__!==!1&&ws("onError",function(){globalThis.__DEV__!==!1&&tr.warn(49)}),r&&r.error)return r.error(t),!1;throw t},e.prototype.setOnError=function(t){return globalThis.__DEV__!==!1&&globalThis.__DEV__!==!1&&tr.warn(50),this.onError=t,this},e})();function bs(e){return new zn(function(t,r){var o=Wo(t,[]);return new fe(function(s){var a,i=!1;return Promise.resolve(o).then(function(c){return e(c,t.getContext())}).then(t.setContext).then(function(){i||(a=r(t).subscribe({next:s.next.bind(s),error:s.error.bind(s),complete:s.complete.bind(s)}))}).catch(s.error.bind(s)),function(){i=!0,a&&a.unsubscribe()}})})}const vs=async()=>{const e="https://auth.australia-southeast1.gcp.commercetools.com/oauth/token",o="Basic "+btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN")+":"+encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));try{const s=await pe.post(e,new URLSearchParams({grant_type:"client_credentials"}),{headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:o}});return s.status===200&&s.data.access_token?s.data.access_token:(console.error("Failed to fetch token:",s.data),null)}catch(s){return pe.isAxiosError(s)?console.error("Error fetching token:",s.response||s.message):console.error("Unexpected error:",s),null}},js="https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql",ks=Ut.createHttpLink({uri:`${js}`}),Ss=bs(async(e,{headers:t})=>{const r=await vs();return{headers:{...t,authorization:`Bearer ${r}`}}}),Ns=new Ut.ApolloClient({link:Ss.concat(ks),cache:new Ut.InMemoryCache,defaultOptions:{watchQuery:{fetchPolicy:"cache-and-network"}}}),Cs=e=>{const{tanyaConfig:t}=e;return n.jsx(Ut.ApolloProvider,{client:Ns,children:n.jsx($o,{children:n.jsx(Jo,{tanyaConfig:t})})})};function _s(e,t){const r=e.icons,o=e.aliases||Object.create(null),s=Object.create(null);function a(i){if(r[i])return s[i]=[];if(!(i in s)){s[i]=null;const c=o[i]&&o[i].parent,l=c&&a(c);l&&(s[i]=[c].concat(l))}return s[i]}return Object.keys(r).concat(Object.keys(o)).forEach(a),s}const Mn=Object.freeze({left:0,top:0,width:16,height:16}),Kt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Cr=Object.freeze({...Mn,...Kt}),mr=Object.freeze({...Cr,body:"",hidden:!1});function Is(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const o=((e.rotate||0)+(t.rotate||0))%4;return o&&(r.rotate=o),r}function nn(e,t){const r=Is(e,t);for(const o in mr)o in Kt?o in e&&!(o in r)&&(r[o]=Kt[o]):o in t?r[o]=t[o]:o in e&&(r[o]=e[o]);return r}function Fs(e,t,r){const o=e.icons,s=e.aliases||Object.create(null);let a={};function i(c){a=nn(o[c]||s[c],a)}return i(t),r.forEach(i),nn(e,a)}function qn(e,t){const r=[];if(typeof e!="object"||typeof e.icons!="object")return r;e.not_found instanceof Array&&e.not_found.forEach(s=>{t(s,null),r.push(s)});const o=_s(e);for(const s in o){const a=o[s];a&&(t(s,Fs(e,s,a)),r.push(s))}return r}const Ps={provider:"",aliases:{},not_found:{},...Mn};function or(e,t){for(const r in t)if(r in e&&typeof e[r]!=typeof t[r])return!1;return!0}function Rn(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!or(e,Ps))return null;const r=t.icons;for(const s in r){const a=r[s];if(!s||typeof a.body!="string"||!or(a,mr))return null}const o=t.aliases||Object.create(null);for(const s in o){const a=o[s],i=a.parent;if(!s||typeof i!="string"||!r[i]&&!o[i]||!or(a,mr))return null}return t}const on=Object.create(null);function Es(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function xt(e,t){const r=on[e]||(on[e]=Object.create(null));return r[t]||(r[t]=Es(e,t))}function Bn(e,t){return Rn(t)?qn(t,(r,o)=>{o?e.icons[r]=o:e.missing.add(r)}):[]}function Ts(e,t,r){try{if(typeof r.body=="string")return e.icons[t]={...r},!0}catch{}return!1}const Un=/^[a-z0-9]+(-[a-z0-9]+)*$/,Wt=(e,t,r,o="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;o=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const c=s.pop(),l=s.pop(),h={provider:s.length>0?s[0]:o,prefix:l,name:c};return t&&!Mt(h)?null:h}const a=s[0],i=a.split("-");if(i.length>1){const c={provider:o,prefix:i.shift(),name:i.join("-")};return t&&!Mt(c)?null:c}if(r&&o===""){const c={provider:o,prefix:"",name:a};return t&&!Mt(c,r)?null:c}return null},Mt=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;let Ft=!1;function Hn(e){return typeof e=="boolean"&&(Ft=e),Ft}function sn(e){const t=typeof e=="string"?Wt(e,!0,Ft):e;if(t){const r=xt(t.provider,t.prefix),o=t.name;return r.icons[o]||(r.missing.has(o)?null:void 0)}}function Os(e,t){const r=Wt(e,!0,Ft);if(!r)return!1;const o=xt(r.provider,r.prefix);return t?Ts(o,r.name,t):(o.missing.add(r.name),!0)}function As(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),Ft&&!t&&!e.prefix){let s=!1;return Rn(e)&&(e.prefix="",qn(e,(a,i)=>{Os(a,i)&&(s=!0)})),s}const r=e.prefix;if(!Mt({prefix:r,name:"a"}))return!1;const o=xt(t,r);return!!Bn(o,e)}const Vn=Object.freeze({width:null,height:null}),Yn=Object.freeze({...Vn,...Kt}),$s=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ls=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function an(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const o=e.split($s);if(o===null||!o.length)return e;const s=[];let a=o.shift(),i=Ls.test(a);for(;;){if(i){const c=parseFloat(a);isNaN(c)?s.push(a):s.push(Math.ceil(c*t*r)/r)}else s.push(a);if(a=o.shift(),a===void 0)return s.join("");i=!i}}function Ds(e,t="defs"){let r="";const o=e.indexOf("<"+t);for(;o>=0;){const s=e.indexOf(">",o),a=e.indexOf("</"+t);if(s===-1||a===-1)break;const i=e.indexOf(">",a);if(i===-1)break;r+=e.slice(s+1,a).trim(),e=e.slice(0,o).trim()+e.slice(i+1)}return{defs:r,content:e}}function zs(e,t){return e?"<defs>"+e+"</defs>"+t:t}function Ms(e,t,r){const o=Ds(e);return zs(o.defs,t+o.content+r)}const qs=e=>e==="unset"||e==="undefined"||e==="none";function Rs(e,t){const r={...Cr,...e},o={...Yn,...t},s={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,o].forEach(_=>{const S=[],I=_.hFlip,B=_.vFlip;let x=_.rotate;I?B?x+=2:(S.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),S.push("scale(-1 1)"),s.top=s.left=0):B&&(S.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),S.push("scale(1 -1)"),s.top=s.left=0);let H;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:H=s.height/2+s.top,S.unshift("rotate(90 "+H.toString()+" "+H.toString()+")");break;case 2:S.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:H=s.width/2+s.left,S.unshift("rotate(-90 "+H.toString()+" "+H.toString()+")");break}x%2===1&&(s.left!==s.top&&(H=s.left,s.left=s.top,s.top=H),s.width!==s.height&&(H=s.width,s.width=s.height,s.height=H)),S.length&&(a=Ms(a,'<g transform="'+S.join(" ")+'">',"</g>"))});const i=o.width,c=o.height,l=s.width,h=s.height;let p,y;i===null?(y=c===null?"1em":c==="auto"?h:c,p=an(y,l/h)):(p=i==="auto"?l:i,y=c===null?an(p,h/l):c==="auto"?h:c);const w={},k=(_,S)=>{qs(S)||(w[_]=S.toString())};k("width",p),k("height",y);const N=[s.left,s.top,l,h];return w.viewBox=N.join(" "),{attributes:w,viewBox:N,body:a}}const Bs=/\sid="(\S+)"/g,Us="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Hs=0;function Vs(e,t=Us){const r=[];let o;for(;o=Bs.exec(e);)r.push(o[1]);if(!r.length)return e;const s="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(a=>{const i=typeof t=="function"?t(a):t+(Hs++).toString(),c=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+i+s+"$3")}),e=e.replace(new RegExp(s,"g"),""),e}const hr=Object.create(null);function Ys(e,t){hr[e]=t}function pr(e){return hr[e]||hr[""]}function _r(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const Ir=Object.create(null),Nt=["https://api.simplesvg.com","https://api.unisvg.com"],qt=[];for(;Nt.length>0;)Nt.length===1||Math.random()>.5?qt.push(Nt.shift()):qt.push(Nt.pop());Ir[""]=_r({resources:["https://api.iconify.design"].concat(qt)});function Js(e,t){const r=_r(t);return r===null?!1:(Ir[e]=r,!0)}function Fr(e){return Ir[e]}const Ks=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let ln=Ks();function Ws(e,t){const r=Fr(e);if(!r)return 0;let o;if(!r.maxURL)o=0;else{let s=0;r.resources.forEach(i=>{s=Math.max(s,i.length)});const a=t+".json?icons=";o=r.maxURL-s-r.path.length-a.length}return o}function Gs(e){return e===404}const Qs=(e,t,r)=>{const o=[],s=Ws(e,t),a="icons";let i={type:a,provider:e,prefix:t,icons:[]},c=0;return r.forEach((l,h)=>{c+=l.length+1,c>=s&&h>0&&(o.push(i),i={type:a,provider:e,prefix:t,icons:[]},c=l.length),i.icons.push(l)}),o.push(i),o};function Xs(e){if(typeof e=="string"){const t=Fr(e);if(t)return t.path}return"/"}const Zs=(e,t,r)=>{if(!ln){r("abort",424);return}let o=Xs(t.provider);switch(t.type){case"icons":{const a=t.prefix,c=t.icons.join(","),l=new URLSearchParams({icons:c});o+=a+".json?"+l.toString();break}case"custom":{const a=t.uri;o+=a.slice(0,1)==="/"?a.slice(1):a;break}default:r("abort",400);return}let s=503;ln(e+o).then(a=>{const i=a.status;if(i!==200){setTimeout(()=>{r(Gs(i)?"abort":"next",i)});return}return s=501,a.json()}).then(a=>{if(typeof a!="object"||a===null){setTimeout(()=>{a===404?r("abort",a):r("next",s)});return}setTimeout(()=>{r("success",a)})}).catch(()=>{r("next",s)})},ea={prepare:Qs,send:Zs};function Jn(e,t){e.forEach(r=>{const o=r.loaderCallbacks;o&&(r.loaderCallbacks=o.filter(s=>s.id!==t))})}function ta(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let r=!1;const o=e.provider,s=e.prefix;t.forEach(a=>{const i=a.icons,c=i.pending.length;i.pending=i.pending.filter(l=>{if(l.prefix!==s)return!0;const h=l.name;if(e.icons[h])i.loaded.push({provider:o,prefix:s,name:h});else if(e.missing.has(h))i.missing.push({provider:o,prefix:s,name:h});else return r=!0,!0;return!1}),i.pending.length!==c&&(r||Jn([e],a.id),a.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),a.abort))})}))}let ra=0;function na(e,t,r){const o=ra++,s=Jn.bind(null,r,o);if(!t.pending.length)return s;const a={id:o,icons:t,callback:e,abort:s};return r.forEach(i=>{(i.loaderCallbacks||(i.loaderCallbacks=[])).push(a)}),s}function oa(e){const t={loaded:[],missing:[],pending:[]},r=Object.create(null);e.sort((s,a)=>s.provider!==a.provider?s.provider.localeCompare(a.provider):s.prefix!==a.prefix?s.prefix.localeCompare(a.prefix):s.name.localeCompare(a.name));let o={provider:"",prefix:"",name:""};return e.forEach(s=>{if(o.name===s.name&&o.prefix===s.prefix&&o.provider===s.provider)return;o=s;const a=s.provider,i=s.prefix,c=s.name,l=r[a]||(r[a]=Object.create(null)),h=l[i]||(l[i]=xt(a,i));let p;c in h.icons?p=t.loaded:i===""||h.missing.has(c)?p=t.missing:p=t.pending;const y={provider:a,prefix:i,name:c};p.push(y)}),t}function sa(e,t=!0,r=!1){const o=[];return e.forEach(s=>{const a=typeof s=="string"?Wt(s,t,r):s;a&&o.push(a)}),o}const aa={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function ia(e,t,r,o){const s=e.resources.length,a=e.random?Math.floor(Math.random()*s):e.index;let i;if(e.random){let P=e.resources.slice(0);for(i=[];P.length>1;){const U=Math.floor(Math.random()*P.length);i.push(P[U]),P=P.slice(0,U).concat(P.slice(U+1))}i=i.concat(P)}else i=e.resources.slice(a).concat(e.resources.slice(0,a));const c=Date.now();let l="pending",h=0,p,y=null,w=[],k=[];typeof o=="function"&&k.push(o);function N(){y&&(clearTimeout(y),y=null)}function _(){l==="pending"&&(l="aborted"),N(),w.forEach(P=>{P.status==="pending"&&(P.status="aborted")}),w=[]}function S(P,U){U&&(k=[]),typeof P=="function"&&k.push(P)}function I(){return{startTime:c,payload:t,status:l,queriesSent:h,queriesPending:w.length,subscribe:S,abort:_}}function B(){l="failed",k.forEach(P=>{P(void 0,p)})}function x(){w.forEach(P=>{P.status==="pending"&&(P.status="aborted")}),w=[]}function H(P,U,ge){const oe=U!=="success";switch(w=w.filter(G=>G!==P),l){case"pending":break;case"failed":if(oe||!e.dataAfterTimeout)return;break;default:return}if(U==="abort"){p=ge,B();return}if(oe){p=ge,w.length||(i.length?Ee():B());return}if(N(),x(),!e.random){const G=e.resources.indexOf(P.resource);G!==-1&&G!==e.index&&(e.index=G)}l="completed",k.forEach(G=>{G(ge)})}function Ee(){if(l!=="pending")return;N();const P=i.shift();if(P===void 0){if(w.length){y=setTimeout(()=>{N(),l==="pending"&&(x(),B())},e.timeout);return}B();return}const U={status:"pending",resource:P,callback:(ge,oe)=>{H(U,ge,oe)}};w.push(U),h++,y=setTimeout(Ee,e.rotate),r(P,t,U.callback)}return setTimeout(Ee),I}function Kn(e){const t={...aa,...e};let r=[];function o(){r=r.filter(c=>c().status==="pending")}function s(c,l,h){const p=ia(t,c,l,(y,w)=>{o(),h&&h(y,w)});return r.push(p),p}function a(c){return r.find(l=>c(l))||null}return{query:s,find:a,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:o}}function cn(){}const sr=Object.create(null);function la(e){if(!sr[e]){const t=Fr(e);if(!t)return;const r=Kn(t),o={config:t,redundancy:r};sr[e]=o}return sr[e]}function ca(e,t,r){let o,s;if(typeof e=="string"){const a=pr(e);if(!a)return r(void 0,424),cn;s=a.send;const i=la(e);i&&(o=i.redundancy)}else{const a=_r(e);if(a){o=Kn(a);const i=e.resources?e.resources[0]:"",c=pr(i);c&&(s=c.send)}}return!o||!s?(r(void 0,424),cn):o.query(t,s,r)().abort}function dn(){}function da(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,ta(e)}))}function ua(e){const t=[],r=[];return e.forEach(o=>{(o.match(Un)?t:r).push(o)}),{valid:t,invalid:r}}function Ct(e,t,r){function o(){const s=e.pendingIcons;t.forEach(a=>{s&&s.delete(a),e.icons[a]||e.missing.add(a)})}if(r&&typeof r=="object")try{if(!Bn(e,r).length){o();return}}catch(s){console.error(s)}o(),da(e)}function un(e,t){e instanceof Promise?e.then(r=>{t(r)}).catch(()=>{t(null)}):t(e)}function fa(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:r,prefix:o}=e,s=e.iconsToLoad;if(delete e.iconsToLoad,!s||!s.length)return;const a=e.loadIcon;if(e.loadIcons&&(s.length>1||!a)){un(e.loadIcons(s,o,r),p=>{Ct(e,s,p)});return}if(a){s.forEach(p=>{const y=a(p,o,r);un(y,w=>{const k=w?{prefix:o,icons:{[p]:w}}:null;Ct(e,[p],k)})});return}const{valid:i,invalid:c}=ua(s);if(c.length&&Ct(e,c,null),!i.length)return;const l=o.match(Un)?pr(r):null;if(!l){Ct(e,i,null);return}l.prepare(r,o,i).forEach(p=>{ca(r,p,y=>{Ct(e,p.icons,y)})})}))}const ma=(e,t)=>{const r=sa(e,!0,Hn()),o=oa(r);if(!o.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(o.loaded,o.missing,o.pending,dn)}),()=>{l=!1}}const s=Object.create(null),a=[];let i,c;return o.pending.forEach(l=>{const{provider:h,prefix:p}=l;if(p===c&&h===i)return;i=h,c=p,a.push(xt(h,p));const y=s[h]||(s[h]=Object.create(null));y[p]||(y[p]=[])}),o.pending.forEach(l=>{const{provider:h,prefix:p,name:y}=l,w=xt(h,p),k=w.pendingIcons||(w.pendingIcons=new Set);k.has(y)||(k.add(y),s[h][p].push(y))}),a.forEach(l=>{const h=s[l.provider][l.prefix];h.length&&fa(l,h)}),t?na(t,o,a):dn};function ha(e,t){const r={...e};for(const o in t){const s=t[o],a=typeof s;o in Vn?(s===null||s&&(a==="string"||a==="number"))&&(r[o]=s):a===typeof r[o]&&(r[o]=o==="rotate"?s%4:s)}return r}const pa=/[\s,]+/;function ga(e,t){t.split(pa).forEach(r=>{switch(r.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function xa(e,t=0){const r=e.replace(/^-?[0-9.]*/,"");function o(s){for(;s<0;)s+=4;return s%4}if(r===""){const s=parseInt(e);return isNaN(s)?0:o(s)}else if(r!==e){let s=0;switch(r){case"%":s=25;break;case"deg":s=90}if(s){let a=parseFloat(e.slice(0,e.length-r.length));return isNaN(a)?0:(a=a/s,a%1===0?o(a):0)}}return t}function ya(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const o in t)r+=" "+o+'="'+t[o]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}function wa(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function ba(e){return"data:image/svg+xml,"+wa(e)}function va(e){return'url("'+ba(e)+'")'}let _t;function ja(){try{_t=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{_t=null}}function ka(e){return _t===void 0&&ja(),_t?_t.createHTML(e):e}const Wn={...Yn,inline:!1},Sa={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Na={display:"inline-block"},gr={backgroundColor:"currentColor"},Gn={backgroundColor:"transparent"},fn={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},mn={WebkitMask:gr,mask:gr,background:Gn};for(const e in mn){const t=mn[e];for(const r in fn)t[e+r]=fn[r]}const Ca={...Wn,inline:!0};function hn(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const _a=(e,t,r)=>{const o=t.inline?Ca:Wn,s=ha(o,t),a=t.mode||"svg",i={},c=t.style||{},l={...a==="svg"?Sa:{}};if(r){const S=Wt(r,!1,!0);if(S){const I=["iconify"],B=["provider","prefix"];for(const x of B)S[x]&&I.push("iconify--"+S[x]);l.className=I.join(" ")}}for(let S in t){const I=t[S];if(I!==void 0)switch(S){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":case"fallback":break;case"_ref":l.ref=I;break;case"className":l[S]=(l[S]?l[S]+" ":"")+I;break;case"inline":case"hFlip":case"vFlip":s[S]=I===!0||I==="true"||I===1;break;case"flip":typeof I=="string"&&ga(s,I);break;case"color":i.color=I;break;case"rotate":typeof I=="string"?s[S]=xa(I):typeof I=="number"&&(s[S]=I);break;case"ariaHidden":case"aria-hidden":I!==!0&&I!=="true"&&delete l["aria-hidden"];break;default:o[S]===void 0&&(l[S]=I)}}const h=Rs(e,s),p=h.attributes;if(s.inline&&(i.verticalAlign="-0.125em"),a==="svg"){l.style={...i,...c},Object.assign(l,p);let S=0,I=t.id;return typeof I=="string"&&(I=I.replace(/-/g,"_")),l.dangerouslySetInnerHTML={__html:ka(Vs(h.body,I?()=>I+"ID"+S++:"iconifyReact"))},g.createElement("svg",l)}const{body:y,width:w,height:k}=e,N=a==="mask"||(a==="bg"?!1:y.indexOf("currentColor")!==-1),_=ya(y,{...p,width:w+"",height:k+""});return l.style={...i,"--svg":va(_),width:hn(p.width),height:hn(p.height),...Na,...N?gr:Gn,...c},g.createElement("span",l)};Hn(!0);Ys("",ea);if(typeof document<"u"&&typeof window<"u"){const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!As(o))&&console.error(r)}catch{console.error(r)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let r in t){const o="IconifyProviders["+r+"] is invalid.";try{const s=t[r];if(typeof s!="object"||!s||s.resources===void 0)continue;Js(r,s)||console.error(o)}catch{console.error(o)}}}}function Qn(e){const[t,r]=g.useState(!!e.ssr),[o,s]=g.useState({});function a(k){if(k){const N=e.icon;if(typeof N=="object")return{name:"",data:N};const _=sn(N);if(_)return{name:N,data:_}}return{name:""}}const[i,c]=g.useState(a(!!e.ssr));function l(){const k=o.callback;k&&(k(),s({}))}function h(k){if(JSON.stringify(i)!==JSON.stringify(k))return l(),c(k),!0}function p(){var k;const N=e.icon;if(typeof N=="object"){h({name:"",data:N});return}const _=sn(N);if(h({name:N,data:_}))if(_===void 0){const S=ma([N],p);s({callback:S})}else _&&((k=e.onLoad)===null||k===void 0||k.call(e,N))}g.useEffect(()=>(r(!0),l),[]),g.useEffect(()=>{t&&p()},[e.icon,t]);const{name:y,data:w}=i;return w?_a({...Cr,...w},e,y):e.children?e.children:e.fallback?e.fallback:g.createElement("span",{})}const ne=g.forwardRef((e,t)=>Qn({...e,_ref:t}));g.forwardRef((e,t)=>Qn({inline:!0,...e,_ref:t}));const qe="USD",pn=e=>{var o,s,a;const t=e==null?void 0:e.availability;if(!t)return!1;const r=(a=(s=(o=t.channels)==null?void 0:o.results)==null?void 0:s[0])==null?void 0:a.availability;return r?r.isOnStock===!0&&(r.availableQuantity??0)>0:!1},xr=(e,t=qe)=>{const r=(e==null?void 0:e.prices)??[];if(!r.length)return null;const o=i=>{var h,p;const c=i.find(y=>{var w;return!!((w=y.discounted)!=null&&w.value)});if(c)return{cent:c.discounted.value.centAmount,cur:c.discounted.value.currencyCode,regularCent:(h=c.value)==null?void 0:h.centAmount};const l=(p=i[0])==null?void 0:p.value;return l?{cent:l.centAmount,cur:l.currencyCode}:null},s=r.filter(i=>{var c,l;return((l=((c=i.discounted)==null?void 0:c.value)||i.value)==null?void 0:l.currencyCode)===t}),a=o(s);return a||o(r)||null},Ia=(e,t)=>{if(!Array.isArray(e))return"";const r=e.find(o=>o.name===t)||e.find(o=>{var s;return((s=o.name)==null?void 0:s.toLowerCase())===t.toLowerCase()});return!r||!r.value?"":typeof r.value=="object"?r.value.label||"":r.value},Fa=e=>{let t="";if(Array.isArray(e)){const r=e.find(o=>o.name==="size")||e.find(o=>o.name==="Size");r&&r.value&&(t=typeof r.value=="object"?r.value.label||"":r.value)}return{sizeLabel:t}},Me=e=>Ia((e==null?void 0:e.attributesRaw)??[],"color"),Ve=e=>Fa((e==null?void 0:e.attributesRaw)??[]).sizeLabel,et=(e,t,r)=>{for(const o of e){const s=Me(o.variant),a=Ve(o.variant);if((t?s===t:!0)&&(r?a===r:!0))return o}return null},He=e=>e.charAt(0).toUpperCase()+e.slice(1),tt={standard:{label:"Standard Delivery",fee:0,subtitle:"Arrives in 4–6 days (Free)",icon:"mdi:clock-outline"},express:{label:"Express Delivery",fee:5,subtitle:"Arrives in 1–2 days (+$5)",icon:"mdi:flash"},sameday:{label:"Same-Day Delivery",fee:10,subtitle:"Available in select locations (+$10)",icon:"mdi:truck-fast-outline"}},Pa={standard:"GROUND",express:"2-DAY SHIPPING",sameday:"OVERNIGHT"},Pe=(e,t)=>{try{return e.toLocaleString("en-US",{style:"currency",currency:t||"USD"})}catch{return`${t} ${e.toFixed(2)}`}},Xn=e=>e==null?void 0:e.masterVariant,gn=e=>Array.isArray(e==null?void 0:e.variants)?e.variants:[],Rt=e=>{const t=Xn(e);return t?[t,...gn(e)]:gn(e)},Ea=(e,t=0)=>Rt(e)[t],Ta=e=>{var t,r;return((r=(t=e==null?void 0:e.images)==null?void 0:t[0])==null?void 0:r.url)??""},xn=(e,t)=>{var r,o,s,a,i,c,l,h;return Ta(t)||((a=(s=(o=(r=e.imageGroups)==null?void 0:r[0])==null?void 0:o.images)==null?void 0:s[0])==null?void 0:a.link)||((h=(l=(c=(i=e.image_groups)==null?void 0:i[0])==null?void 0:c.images)==null?void 0:l[0])==null?void 0:h.link)||""},yn=e=>(e==null?void 0:e.name)||(e==null?void 0:e.title)||(e==null?void 0:e.productName)||"any",Bt=e=>{var a,i,c,l,h,p;const t=e?xr(e,qe):null;if(t!=null&&t.cent&&(t!=null&&t.cur))return{amount:+(t.cent/100),currency:t.cur,regularAmount:t.regularCent?t.regularCent/100:void 0};const r=(c=(i=(a=e==null?void 0:e.prices)==null?void 0:a[0])==null?void 0:i.value)==null?void 0:c.centAmount,o=((p=(h=(l=e==null?void 0:e.prices)==null?void 0:l[0])==null?void 0:h.value)==null?void 0:p.currencyCode)??qe;return{amount:Number.isFinite(r)?+(Number(r)/100):0,currency:o}},wn=(e,t)=>{const{amount:r}=Bt(t);if(r)return r;const o=(e==null?void 0:e.price)??(e==null?void 0:e.sellingPrice)??(e==null?void 0:e.unitPrice)??(e==null?void 0:e.mrp)??0,s=Number(o);return Number.isFinite(s)?s:0},bn=e=>{var t;return(e==null?void 0:e.sku)||((t=e==null?void 0:e.variant)==null?void 0:t.sku)||(e==null?void 0:e.selectedSku)||""},Oa=e=>{var t;return(e==null?void 0:e.color)||(e==null?void 0:e.selectedColor)||((t=e==null?void 0:e.variant)==null?void 0:t.color)||""},Aa=e=>{var t;return(e==null?void 0:e.size)||(e==null?void 0:e.selectedSize)||((t=e==null?void 0:e.variant)==null?void 0:t.size)||""},vn=20,$a=({open:e,onClose:t,product:r,index:o,addressListProp:s,addressLoading:a})=>{console.log(r,"the product for ai shopping");const i=null,c=null,l=Rt(r),h=Math.min(Math.max(0,o||0),Math.max(0,l.length-1)),p=l.length,[y,w]=g.useState(h),[k,N]=g.useState(null),[_,S]=g.useState(null),I=g.useRef(null),B=g.useRef(null),x=Ea(r,y),[H,Ee]=g.useState(""),[P,U]=g.useState(!1),[ge,oe]=g.useState(!1),[G,Ce]=g.useState(!1),[Te,me]=g.useState(""),[L,E]=g.useState(!1),[R,Ke]=g.useState(null),[Be,ye]=g.useState([]),[ke,ct]=g.useState([]),[We,z]=g.useState([]),[ie,_e]=g.useState(!1),[Se,Gt]=g.useState(),[Qt,f]=g.useState(!0),[O,A]=g.useState(!1),[V,D]=g.useState(!1),[T,le]=g.useState("standard"),[q,$]=g.useState(!1),[Q,te]=g.useState(!1),[we,be]=g.useState("card"),[X,K]=g.useState(!1),[ve,Z]=g.useState(!1),[j,Y]=g.useState(!1),[W,ce]=g.useState(null),[je,Ge]=g.useState(null),[dt,Pt]=g.useState(""),[De,Et]=g.useState(!1),ut=g.useRef(null);g.useEffect(()=>{const d=Rt(r),m=Math.min(Math.max(0,o||0),Math.max(0,d.length-1));w(m);const u=Xn(r),v=Me(u),F=Ve(u);I.current=v||null,B.current=F||null,N(v||null),S(F||null)},[o,r]),g.useEffect(()=>{ut.current&&(ut.current.scrollTop=ut.current.scrollHeight)},[Be,ie,O,V,q,Q,X,ve,j,P,ge]);const C="var(--tanya)",Oe="var(--tanya-contrast)",Qe=C,wt="#804c9e",Zn=()=>{console.log("AgenticShopping feedback:",{rating:je,comment:dt}),Et(!0)},eo=()=>{Ge(null),Pt(""),Et(!0)},Pr=d=>{const u=((d==null?void 0:d.intentMandateId)||(d==null?void 0:d.intent_mandate_id)||(d==null?void 0:d.id)||null)??W;return e?n.jsxs("div",{className:"mt-3 flex items-start gap-3 rounded-lg border border-green-200 bg-green-50 p-4 text-green-800",children:[n.jsx("div",{className:"success-tick-animation",children:n.jsx(ne,{icon:"mdi:check-circle",width:"28",color:"#16a34a"})}),n.jsxs("div",{className:"text-sm w-full",children:[n.jsx("div",{className:"font-semibold",children:"Success!"}),n.jsx("div",{children:"Your smart order has been saved. I’ll watch the price and auto-purchase when the conditions are met."}),u&&n.jsxs("div",{className:"mt-2 text-xs font-medium",children:["Your Smart Order ID: ",n.jsx("span",{className:"font-semibold text-blue-600 cursor-pointer underline",children:u})]}),!De&&n.jsxs("div",{className:"mt-4 rounded-lg bg-white/70 p-3 text-gray-900",children:[n.jsx("h4",{className:"font-semibold mb-1",children:"Please post your feedback here"}),n.jsx("p",{className:"text-sm text-gray-700 mb-3",children:"Rate us on how much our response was helpful"}),n.jsx("div",{className:"flex items-center gap-1 mb-3",children:[1,2,3,4,5].map(v=>n.jsx("button",{type:"button",onClick:()=>Ge(v),className:"p-0.5",children:n.jsx(ne,{icon:je&&je>=v?"mdi:star":"mdi:star-outline",width:"20",className:"text-yellow-500"})},v))}),n.jsx("label",{className:"block text-sm text-gray-700 mb-1",children:"Tell us more about the response"}),n.jsx("textarea",{value:dt,onChange:v=>Pt(v.target.value),rows:3,className:"mt-1 w-full rounded-md border border-gray-300 p-2 text-sm outline-none focus:ring-1 focus:ring-gray-300",placeholder:"Your feedback helps us improve..."}),n.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[n.jsx("button",{type:"button",onClick:eo,className:"px-4 py-2 rounded-full border text-sm font-medium hover:bg-gray-50",children:"Cancel"}),n.jsx("button",{type:"button",onClick:Zn,className:"px-4 py-2 rounded-full text-sm font-semibold text-white shadow",style:{background:C},disabled:!je&&!dt.trim(),children:"Submit"})]})]}),De&&n.jsx("div",{className:"mt-3 text-xs text-green-900 font-medium",children:"Thanks for your feedback! 💚"})]})]}):null},to=async()=>{try{z(s)}catch(d){console.error("Error fetching addresses:",d)}},bt=(d,m)=>{ye(u=>[...u,{query:"",response:"__SNAPSHOT__",snapshotStage:d,snapshotPayload:m}])},Er=(d,m)=>{ye(u=>u.map(v=>v.response==="__CARD__"?{...v,response:"__SNAPSHOT__",snapshotStage:d??v.snapshotStage,snapshotPayload:m??v.snapshotPayload}:v))},ro=()=>{ye(d=>d.filter(m=>!(m.query===""&&m.response!=="__SNAPSHOT__"&&m.response!=="__TEXT__")))},Tt=()=>{Z(!1),_e(!1),D(!1),te(!1),A(!1),$(!1),K(!1),Y(!1),E(!1),Ke(null),ro(),U(!1),oe(!1)},no=()=>{_e(!1),A(!1),D(!1),le("standard"),$(!1),te(!1),be("card"),K(!1),Z(!1),Y(!1),f(!0),Ke(null),localStorage.removeItem("agentic_order"),localStorage.removeItem("agentic_order_address"),localStorage.removeItem("agentic_order_delivery"),localStorage.removeItem("agentic_order_payment"),localStorage.removeItem("agentic_order_final")},Ne=g.useMemo(()=>Rt(r).map((m,u)=>({index:u,variant:m,images:((m==null?void 0:m.images)||[]).map(v=>(v==null?void 0:v.url)||"").filter(Boolean)})),[r]),vt=g.useMemo(()=>{if(!Ne.length)return!1;const d=k||void 0,m=_||void 0,u=(v,F)=>{var M;const b=et(Ne,v||void 0,F||void 0);return!!(b&&((M=b.variant)!=null&&M.sku))};return d&&m?u(d,m):d&&!m?u(d,null):!d&&m?u(void 0,m):!!(x&&x.sku)},[Ne,k,_,x]),oo=G||L||!vt,jt=d=>{const m=Number((d==null?void 0:d.quantity)??1);return Number.isFinite(m)&&m>0?m:1},Tr=d=>{const m=jt(d),u=Number((d==null?void 0:d.max_price_minor)??0);return Number.isFinite(u)&&u>0?+(u/100):+(wn(r,x)*m)},Or=d=>{var J;const m=R,u=Bt(x),v=d||(m==null?void 0:m.currency)||u.currency||qe,F=Tr(m),b=+(F*.08).toFixed(2),M=((J=tt[T])==null?void 0:J.fee)||0;return{product_total:F,tax:b,shipping_fee:M,currency:v}},Xt=async(d,m,u)=>{Er(),no(),Ce(!0),E(!0),U(!1),oe(!1);const v=ke.slice(-vn);try{const F=await ir(i,c);if(!F)throw new Error("Failed to fetch token");const b=localStorage.getItem("customerNumber"),M=localStorage.getItem("isLoggedIn"),de=`https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({registered:String(M||!1),userId:String(b||new Date().getTime())}).toString()}`,ee=await fetch(`${de}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${F}`},body:JSON.stringify({flowId:"MTMI0P4LC6",flowAliasId:"BCUA138F2Q",input:{instruction:`Use SKU ${m}. Currency is USD. ${d}`,metadata:{productId:(r==null?void 0:r.id)??null,skuId:m??null,variantIndex:u},context:v}})});if(!ee.body)throw new Error("Readable stream not supported");const xe=ee.body.getReader(),re=new TextDecoder;let Ie="",Fe="",Ae="";for(;;){const{done:he,value:Ue}=await xe.read();if(he)break;Ie+=re.decode(Ue,{stream:!0});const ft=Ie.split(`
17
+ `);Ie=ft.pop()||"";for(const mt of ft){if(!mt.startsWith("data:"))continue;const Xe=mt.slice(5).trim();try{const ze=JSON.parse(Xe),$e=ze.index,ue=ze.data;$e===0?Fe=String(ue??""):$e===1&&(Ae=String(ue??""))}catch(ze){console.error("Error parsing JSON chunk:",ze)}}}let se=null;if(Fe){const he=String(Fe).replace(/\\n/g,"").trim();if(he.startsWith("{")&&he.endsWith("}"))try{se=JSON.parse(he),se.product_id=m,se.sku_id=m,localStorage.setItem("agentic_order",JSON.stringify(se))}catch(Ue){console.log(Ue)}}Ke(se),se&&ye(he=>[...he,{query:"",response:"__CARD__",snapshotPayload:{extractedDetails:se}}]),ct(he=>[...he,{userQuery:d,mainResponse:Fe||"",keywords:Ae||""}].slice(-vn))}catch(F){console.error("Error sending message to Tanya:",F),E(!1)}finally{Ce(!1)}},Ar=async d=>{if(L||G||!vt)return;const m=Te.trim();if(!m)return;ye(b=>[...b,{query:m,response:""}]),me(""),Ee(m);const u=x==null?void 0:x.sku,v=bn(r),F=u||v||"";if(p<=1){if(F){Xt(m,F,y);return}oe(!0),E(!0);return}F?(U(!0),E(!0)):(oe(!0),E(!0))},so=()=>{const d=x==null?void 0:x.sku;d&&Xt(H,d,y)},ao=()=>{U(!1),oe(!0),E(!0)},io=()=>{if(!x||!x.sku)return;const d=x.sku;Xt(H,d,y)},lo=async()=>{_e(!0),D(!1),te(!1),Z(!1),A(!1),$(!1),K(!1),Y(!1),await to(),Er("initial",{extractedDetails:R??void 0})},co=()=>{if(!Se)return;const d=We.find(m=>String(m.addressId??m.id)===Se)||null;d&&(localStorage.setItem("agentic_order_address",JSON.stringify(d)),A(!0),D(!0),$(!1),te(!1),K(!1),Z(!1),Y(!1),bt("address",d))},uo=()=>{A(!1),D(!1),$(!1),te(!1),K(!1),Z(!1),Y(!1),localStorage.removeItem("agentic_order_address")},fo=()=>{T&&(localStorage.setItem("agentic_order_delivery",T),$(!0),te(!0),K(!1),Z(!1),Y(!1),bt("delivery",{method:T,...tt[T]}))},$r=()=>{D(!1),$(!1),te(!1),K(!1),Z(!1),Y(!1),E(!1),Tt(),ye(d=>[...d,{query:"",response:"__TEXT__",snapshotPayload:{text:"No worries! I’ve cancelled this request. You can start again anytime — just tell me what you’d like to buy or track"}}])},mo=()=>{$(!1),te(!1),K(!1),Z(!1),Y(!1),localStorage.removeItem("agentic_order_delivery")},ho=()=>{we&&(localStorage.setItem("agentic_order_payment",we),K(!0),Z(!0),Y(!1),bt("payment",{method:we}))},po=()=>{te(!1),K(!1),Z(!1),Y(!1),E(!1),Tt(),ye(d=>[...d,{query:"",response:"__TEXT__",snapshotPayload:{text:"No worries! I’ve cancelled this request. You can start again anytime — just tell me what you’d like to buy or track"}}])},go=()=>{K(!1),Z(!1),Y(!1),localStorage.removeItem("agentic_order_payment")},xo=async()=>{try{Ce(!0);const d=R||{},m=JSON.parse(localStorage.getItem("agentic_order_address")||"null"),u=localStorage.getItem("agentic_order_delivery"),v=localStorage.getItem("agentic_order_payment")||"card",{product_total:F,tax:b,shipping_fee:M,currency:J}=Or(),de=d.shopper_id||localStorage.getItem("customerId")||void 0,ee=(m==null?void 0:m.addressId)||(m==null?void 0:m.id)||void 0,xe=u?Pa[u]:"GROUND",re="card-visa",Ie=x==null?void 0:x.sku,Fe=(r==null?void 0:r.id)||"",Ae=jt(d),se=typeof d.max_price_minor=="number"?d.max_price_minor:Math.round(F*100),ft={shopper_id:de,shipping_address_id:ee,shipping_method_id:xe,payment_method_id:re,sku:Ie,platform:"SFCC",storeCode:"Sites-SiteGenesis-Site",product_id:Fe,quantity:Ae,max_price_minor:se,currency:J,instruction_text:H};if(!de||!ee){console.error("Missing shopper_id or shipping_address_id for intent-mandate",{shopperId:de,shippingAddressId:ee}),alert("Missing customer or address information. Please re-select address and try again."),Ce(!1);return}const Xe=(await yt()).access_token;if(!Xe)throw new Error("Failed to fetch auth token for intent-mandate");const{serverUrl:ze}=st(),$e=await fetch(`${ze}/api/intent-mandate`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${Xe}`},body:JSON.stringify(ft)});if(!$e.ok){const ko=await $e.text().catch(()=>"");console.error("intent-mandate failed",$e.status,ko),alert("Something went wrong while saving your smart order. Please try again."),Ce(!1);return}const ue=await $e.json().catch(()=>null);console.log("intent-mandate success:",ue);const Ze=(ue==null?void 0:ue.intent_mandate_id)||(ue==null?void 0:ue.intent_mandateId)||(ue==null?void 0:ue.key)||null;Ze&&ce(Ze);const Ot={...d,address:m,delivery:u,payment:v,summary:{product_total:F,tax:b,shipping_fee:M,currency:J},intent_mandate_id:Ze};localStorage.setItem("agentic_order_final",JSON.stringify(Ot)),Y(!0),f(!1),bt("final",Ot),bt("success",{intentMandateId:Ze}),Tt()}catch(d){console.error("Error in handleConfirmWatch / intent-mandate:",d),alert("Unable to complete your smart order right now. Please try again in a moment.")}finally{Ce(!1)}},Lr=()=>{Tt(),ye(d=>[...d,{query:"",response:"__TEXT__",snapshotPayload:{text:"No worries! I’ve cancelled this request. You can start again anytime — just tell me what you’d like to buy or track"}}])},yo=()=>{const d=xn(r,x),m=yn(r),u=(r==null?void 0:r.id)||"",v=Me(x)||"",F=Ve(x)||"",{amount:b}=Bt(x),M=!!(r!=null&&r.id),J=x&&M?pn(x):!1;return console.log(d,m,u,v,F,b,M,J,"base product"),n.jsx("div",{className:"mx-4 mt-2 rounded-xl border border-gray-200 bg-white p-4",children:n.jsxs("div",{className:"flex flex-col sm:flex-row items-center sm:items-center gap-4",children:[n.jsx("div",{className:"flex-shrink-0 flex justify-center sm:justify-start",children:n.jsx("div",{className:"w-[150px] h-[150px] rounded-lg bg-gray-50 border border-gray-200 flex items-center justify-center overflow-hidden",children:d?n.jsx("img",{src:d,alt:m,className:"object-contain w-full h-full"}):n.jsx(ne,{icon:"mdi:image-outline",width:"28",className:"opacity-60"})})}),n.jsxs("div",{className:"flex-grow flex flex-col justify-center text-center",children:[n.jsx("div",{className:"text-2xl font-bold text-gray-900 mb-1",children:m}),n.jsx("div",{className:"text-sm text-gray-700 mb-1",children:[u&&`SKU: ${u}`,v&&`Color: ${v}`,F&&`Size: ${F}`].filter(Boolean).join(" • ")||"—"}),n.jsx("div",{className:"mt-1 text-xl font-semibold text-gray-900",children:M?Pe(Number(b)||0,qe):"Currently unavailable"}),M&&!J&&n.jsx("div",{className:"mt-1 text-xs font-medium text-red-600",children:"Currently out of stock"})]})]})})},Dr=({showSubmit:d=!0})=>{const m={},u=Ne.map(b=>Me(b.variant)).filter(b=>!!b&&!m[b]&&(m[b]=!0)),v={},F=Ne.map(b=>Ve(b.variant)).filter(b=>!!b&&!v[b]&&(v[b]=!0));return n.jsxs("div",{className:"mx-4 mt-4 mb-2 rounded-xl border border-gray-200 bg-white p-4 animate-fade-in",children:[n.jsx("h3",{className:"font-semibold text-gray-800",children:"Choose a variant"}),u.length>0&&n.jsxs("div",{className:"mt-4",children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[n.jsx("div",{className:"text-sm font-bold",children:"Color :"}),k&&n.jsx("div",{className:"text-sm text-gray-600",children:k})]}),n.jsx("div",{className:"flex flex-wrap gap-4 mt-2",children:u.map(b=>{var Ae;const M=k===b,J=_||B.current||null,de=J?et(Ne,b,J):et(Ne,b,null),ee=!!de,xe=ee&&pn(de.variant),re=ee&&xe?xr(de.variant,qe)||xr(de.variant):null,Ie=Ne.find(se=>Me(se.variant)===b),Fe=(Ae=Ie==null?void 0:Ie.images)==null?void 0:Ae[0];return n.jsxs("div",{className:`flex flex-col items-center w-28 border rounded-md p-2
18
+ ${M?"border-2 border-tanya-light":"border-gray-300"}
19
+ ${!ee||!xe?"opacity-60":""}`,children:[n.jsx("button",{onClick:()=>{N(b);const se=_||B.current||null,he=se&&et(Ne,b,se)||et(Ne,b,null);he&&w(he.index)},className:"w-full h-20 flex items-center justify-center overflow-hidden",title:b,children:Fe?n.jsx("img",{src:Fe,alt:b,className:"w/full h-full object-contain"}):n.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs px-1",children:b})}),n.jsx("div",{className:"w-full border-t my-2"}),ee&&!xe&&n.jsx("div",{className:"text-[11px] text-red-600 text-center",children:"Out of stock"}),!ee&&n.jsx("div",{className:"text-[11px] text-red-600 text-center",children:"any not offered"}),ee&&xe&&re&&n.jsxs("div",{className:"text-xs text-gray-800 font-medium text-center",children:[Pe(re.cent/100,re.cur),re.regularCent&&re.regularCent>re.cent&&n.jsx("span",{className:"ml-1 line-through text-gray-500",children:Pe(re.regularCent/100,re.cur)})]})]},`color-${b}`)})})]}),F.length>0&&n.jsxs("div",{className:"mt-4",children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[n.jsx("div",{className:"text-sm font-bold",children:"Size :"}),_&&n.jsx("div",{className:"text-sm text-gray-600",children:_})]}),n.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:F.map(b=>{const M=_===b;return n.jsx("button",{onClick:()=>{S(b);const J=k&&et(Ne,k,b)||et(Ne,void 0,b);J&&w(J.index)},className:`px-4 py-2 rounded-md border text-sm ${M?"border-2 border-tanya-light font-semibold":"border-gray-300"}`,title:b,children:b},`size-${b}`)})})]}),d&&n.jsx("div",{className:"mt-4 flex justify-end",children:n.jsx("button",{onClick:io,className:"px-6 py-2.5 rounded-full font-semibold text-white shadow-md",style:{background:C},disabled:!vt,children:"Submit"})})]})},zr=(d,m=!0)=>{!(d!=null&&d.extractedDetails)&&d&&(d={extractedDetails:d});const u=(d==null?void 0:d.extractedDetails)||R;if(!u)return null;const v=jt(u),{currency:F}=Bt(x),b=wn(r,x),M=Number((u==null?void 0:u.max_price_minor)??0),de=Number.isFinite(M)&&M>0?+(M/100):+(b*v),ee=(u==null?void 0:u.currency)||F||qe,xe=x!=null&&x.sku?x.sku:u.product_id;return n.jsxs("div",{className:"px-6 pb-6 flex flex-col items-center space-y-4",style:{backgroundColor:"#14377D"},children:[n.jsx("p",{className:"text-base font-semibold text-center mt-2",style:{color:Oe},children:"Here’s what I found from your instruction:"}),n.jsxs("div",{className:"w-full max-w-md bg-white rounded-xl shadow-inner p-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-y-2 text-sm",children:[n.jsx("p",{className:"font-semibold text-gray-600",children:"SKU:"}),n.jsx("p",{className:"text-gray-800",children:xe}),n.jsx("p",{className:"font-semibold text-gray-600",children:"Quantity:"}),n.jsx("p",{className:"text-gray-800",children:jt(u)}),n.jsx("p",{className:"font-semibold text-gray-600",children:"Currency:"}),n.jsx("p",{className:"text-gray-800",children:ee}),n.jsx("p",{className:"font-semibold text-gray-600",children:"Maximum Total Price:"}),n.jsx("p",{className:"text-gray-800",children:Pe(de,ee)})]}),n.jsxs("div",{className:"mt-3 flex flex-wrap gap-2 text-xs",children:[Me(x)&&n.jsxs("span",{className:"rounded-full bg-gray-100 px-2 py-1",children:["Color: ",Me(x)]}),Ve(x)&&n.jsxs("span",{className:"rounded-full bg-gray-100 px-2 py-1",children:["Size: ",Ve(x)]}),(x==null?void 0:x.sku)&&n.jsxs("span",{className:"rounded-full bg-gray-100 px-2 py-1",children:["SKU: ",x.sku]})]})]}),!m&&n.jsxs(n.Fragment,{children:[n.jsxs("p",{className:"text-sm font-medium text-gray-700 text-center max-w-[90%] leading-relaxed",style:{color:Oe},children:["Would you like me to ",n.jsx("strong",{children:"lock this in"})," and monitor it for you?"]}),n.jsxs("div",{className:"flex flex-wrap justify-center gap-4",children:[n.jsxs("button",{onClick:lo,disabled:ie,className:`relative inline-flex items-center justify-center px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${ie?"opacity-60 cursor-not-allowed":"hover:-translate-y-0.5 hover:shadow-lg"}`,style:{background:`${C}`},children:[n.jsx(ne,{icon:"fluent:checkmark-circle-24-filled",className:"mr-2",width:"18",height:"18"}),"Yes, lock it in"]}),n.jsxs("button",{onClick:Lr,disabled:ie,className:`relative inline-flex items-center justify-center px-6 py-2.5 rounded-full font-semibold border transition-all duration-300 ${ie?"opacity-60 cursor-not-allowed":"hover:-translate-y-0.5 hover:shadow-lg"}`,style:{borderColor:C,color:Oe},children:[n.jsx(ne,{icon:"fluent:dismiss-circle-24-filled",className:"mr-2",width:"18",height:"18"}),"No"]})]})]})]})},Mr=(d,m=!0)=>{var mt,Xe,ze,$e,ue,Ze;const u=d||{},v=((mt=u==null?void 0:u.summary)==null?void 0:mt.currency)||(R==null?void 0:R.currency)||qe,F=xn(r,x),b=yn(r),M=x!=null&&x.sku?x.sku:(r==null?void 0:r.id)??(R==null?void 0:R.product_id),J=(x==null?void 0:x.sku)??bn(r),de=Me(x)||Oa(r),ee=Ve(x)||Aa(r),xe=jt(u),re=((Xe=u==null?void 0:u.summary)==null?void 0:Xe.product_total)!=null?+u.summary.product_total:Tr(u),Ie=xe>0?+(re/xe).toFixed(2):0,Fe=re,Ae=((ze=u==null?void 0:u.summary)==null?void 0:ze.tax)??+(re*.08).toFixed(2),se=(($e=u==null?void 0:u.summary)==null?void 0:$e.shipping_fee)??(((ue=tt[T])==null?void 0:ue.fee)||0),he=u!=null&&u.address?[u.address.addressLine1,u.address.addressLine2,u.address.street,[u.address.city,u.address.state,u.address.postalCode].filter(Boolean).join(", "),u.address.country].filter(Boolean).map(Ot=>He(String(Ot))).join(", "):"—",Ue=(u==null?void 0:u.payment)||"card",ft=Ue==="card"?n.jsxs(n.Fragment,{children:["Credit Card — Mastercard",n.jsx("br",{}),"•••• 7820 Exp: 12/26"]}):n.jsx(n.Fragment,{children:He(Ue)});return n.jsxs("div",{className:"mx-auto mt-3 mb-3 rounded-2xl bg-white",children:[n.jsx("div",{className:"px-6 pt-5 pb-3",children:n.jsxs("h3",{className:"font-semibold text-lg mb-2 text-gray-800 flex items-center gap-2",children:[n.jsx(ne,{icon:"mdi:receipt-text-check-outline",width:"24",color:C}),"All set! Here’s what your smart order looks like 🧾"]})}),n.jsx("div",{className:"px-6 pb-4",children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-12 gap-4 rounded-xl border border-gray-200 bg-gray-50 p-3",children:[n.jsx("div",{className:"sm:col-span-2 flex",children:n.jsx("div",{className:"w-30 h-26 sm:w-30 sm:h-26 overflow-hidden rounded-lg bg-white border border-gray-200 flex items-center justify-center mx-auto sm:mx-0",children:F?n.jsx("img",{src:F,alt:b,className:"w-full h-full object-contain"}):n.jsx(ne,{icon:"mdi:image-outline",width:"24",className:"opacity-50"})})}),n.jsxs("div",{className:"sm:col-span-10",children:[n.jsxs("div",{className:"mb-3",children:[n.jsx("div",{className:"text-lg text-center font-bold text-gray-900",children:b}),n.jsxs("div",{className:"text-xs text-center font-bold text-gray-600",children:[n.jsx("span",{className:"font-medium",children:"SKU:"})," ",M??"—"]}),(J||de||ee)&&n.jsxs("div",{className:"text-xs text-gray-600 mt-0.5 text-center",children:[J&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"font-medium",children:"SKU:"})," ",J,"  "]}),de&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"font-medium",children:"Color:"})," ",de,"  "]}),ee&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"font-medium",children:"Size:"})," ",ee]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md-grid-cols-3 md:grid-cols-3 gap-3",children:[n.jsxs("div",{className:"flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center",children:[n.jsx("div",{className:"text-[11px] uppercase tracking-wide text-gray-500",children:"Unit Price"}),n.jsx("div",{className:"mt-0.5 text-base font-bold text-gray-900",children:Pe(Ie,v)})]}),n.jsxs("div",{className:"flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center",children:[n.jsx("div",{className:"text-[11px] uppercase tracking-wide text-gray-500",children:"Quantity"}),n.jsx("div",{className:"mt-0.5 text-base font-bold text-gray-900",children:xe})]}),n.jsxs("div",{className:"flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center",children:[n.jsx("div",{className:"text-[11px] uppercase tracking-wide text-gray-500",children:"Subtotal"}),n.jsx("div",{className:"mt-0.5 text-base font-bold text-gray-900",children:Pe(Fe,v)})]})]})]})]})}),n.jsxs("div",{className:"px-6 pb-2",children:[n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-3",children:[n.jsxs("div",{className:"flex flex-col items-center rounded-xl border border-gray-200 bg-gray-50 p-3",children:[n.jsx("div",{className:"text-xs uppercase tracking-wide text-gray-500",children:"🏠 Address"}),n.jsx("div",{className:"mt-1 text-sm font-semibold text-gray-900 text-center",children:he})]}),n.jsxs("div",{className:"flex flex-col items-center rounded-xl border border-gray-200 bg-gray-50 p-3",children:[n.jsx("div",{className:"text-xs uppercase tracking-wide text-gray-500",children:"💳 Payment"}),n.jsx("div",{className:"mt-1 text-sm font-semibold text-gray-900 text-center",children:ft})]}),n.jsxs("div",{className:"flex flex-col items-center rounded-xl border border-gray-200 bg-gray-50 p-3",children:[n.jsx("div",{className:"text-xs uppercase tracking-wide text-gray-500",children:"🚚 Delivery"}),n.jsx("div",{className:"mt-1 text-sm font-semibold text-gray-900 text-center",children:u!=null&&u.delivery&&((Ze=tt[u.delivery])==null?void 0:Ze.label)||"—"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[n.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-gray-200 bg-gray-50 p-4 text-center",children:[n.jsx("div",{className:"text-xs uppercase tracking-wide text-gray-500",children:"💰 any(s)"}),n.jsx("div",{className:"mt-1 text-2xl font-bold text-gray-900",children:Pe(re,v)})]}),n.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-gray-200 bg-gray-50 p-4 text-center",children:[n.jsx("div",{className:"text-xs uppercase tracking-wide text-gray-500",children:"🏛️ Taxes"}),n.jsx("div",{className:"mt-1 text-2xl font-bold text-gray-900",children:Pe(Ae,v)})]}),n.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-gray-200 bg-gray-50 p-4 text-center",children:[n.jsx("div",{className:"text-xs uppercase tracking-wide text-gray-500",children:"🚚 Shipping"}),n.jsx("div",{className:"mt-1 text-2xl font-bold text-gray-900",children:Pe(se,v)})]})]}),n.jsxs("div",{className:"mt-4 rounded-xl p-4 text-center text-white shadow-sm",style:{background:Qe},children:[n.jsx("div",{className:"text-sm/5 opacity-95",children:"🔹 Total Payable"}),n.jsx("div",{className:"mt-1 text-3xl font-extrabold tracking-tight",children:Pe(re+Ae+se,v)})]})]}),!m&&n.jsxs("div",{className:"px-6 pb-5",children:[!j&&n.jsx("p",{className:"mt-3 text-center text-sm text-gray-700",children:"Everything looks good! Do you want me to watch this product and buy it automatically when it meets your condition?"}),j&&Pr({intentMandateId:W}),Qt&&!j&&n.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-center gap-3",children:[n.jsx("button",{onClick:xo,className:"inline-flex items-center justify-center rounded-full px-6 py-2.5 font-semibold text-white shadow-md transition-transform duration-150 hover:-translate-y-0.5 hover:shadow-lg",style:{background:Qe},children:"Confirm"}),n.jsx("button",{onClick:Lr,className:"inline-flex items-center justify-center rounded-full border px-6 py-2.5 font-semibold hover:bg-gray-50",style:{borderColor:Qe,color:Qe},children:"Cancel"})]})]})]})},wo=d=>{if(!d)return null;const m=[d.addressLine1,d.addressLine2,d.street,[d.city,d.state,d.postalCode].filter(Boolean).join(", "),d.country].filter(u=>!!u).map(u=>He(u)).join(", ");return n.jsx("div",{className:"px-6 py-4",style:{backgroundColor:"var(--tanya-light)"},children:n.jsxs("div",{className:"rounded-xl border border-gray-200 bg-white p-4",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(ne,{icon:"mdi:home-map-marker",width:"20",color:C}),n.jsx("div",{className:"font-semibold text-gray-800",children:"Delivery Address"})]}),n.jsx("div",{className:"text-sm text-gray-800",children:m})]})})},bo=d=>{const m=d==null?void 0:d.method,u=m?tt[m]:void 0;return n.jsx("div",{className:"px-6 py-4",style:{backgroundColor:"var(--tanya-light)"},children:n.jsxs("div",{className:"rounded-xl border border-gray-200 bg-white p-4",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx(ne,{icon:"mdi:truck-delivery",width:"20",color:C}),n.jsx("div",{className:"font-semibold text-gray-800",children:"Delivery Method"})]}),n.jsx("div",{className:"text-sm text-gray-800",children:u?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ne,{icon:u.icon,width:"18"}),n.jsx("span",{className:"font-medium",children:u.label})]}),n.jsx("div",{className:"text-gray-600",children:u.subtitle})]}):"—"})]})})},vo=d=>{const m=(d==null?void 0:d.method)||"card";return n.jsx("div",{className:"px-6 py-4",style:{backgroundColor:"var(--tanya-light)"},children:n.jsxs("div",{className:"rounded-xl border border-gray-200 bg-white p-4",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx(ne,{icon:"mdi:credit-card-outline",width:"20",color:C}),n.jsx("div",{className:"font-semibold text-gray-800",children:"Payment Method"})]}),n.jsx("div",{className:"text-sm text-gray-800",children:m==="card"?n.jsxs(n.Fragment,{children:["Credit Card — Mastercard",n.jsx("br",{}),"•••• 7820   Exp: 12/26"]}):He(m)})]})})},jo=(d,m)=>{const u=d.snapshotStage;if(!u||u==="address"&&ie||u==="delivery"&&V||u==="payment"&&Q||u==="final"&&ve)return null;switch(u){case"initial":return zr(d.snapshotPayload,!m);case"address":return wo(d.snapshotPayload);case"delivery":return bo(d.snapshotPayload);case"payment":return vo(d.snapshotPayload);case"final":return Mr(d.snapshotPayload,!m);case"success":return Pr(d.snapshotPayload);default:return null}};return Co.createPortal(n.jsxs("div",{className:"fixed inset-0",style:{zIndex:2147483647},"aria-modal":"true",role:"dialog",children:[n.jsx("div",{className:"absolute inset-0",style:{background:"rgba(0,0,0,0.25)"},onClick:t}),n.jsx("div",{className:"absolute right-0 ",children:n.jsxs("div",{className:"w-[64.7vw] h-screen bg-white rounded-xl overflow-hidden flex flex-col shadow-xl",children:[n.jsxs("div",{style:{display:"flex",justifyContent:"space-between",borderTopLeftRadius:"0.75rem",borderBottomLeftRadius:"0.75rem",padding:"0.25rem",background:wt},children:[n.jsxs("div",{style:{display:"flex",color:"#ffffff",alignItems:"center",gap:"0.5rem"},children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"256",height:"256",viewBox:"0 0 256 256",children:n.jsxs("g",{fill:"currentColor",children:[n.jsx("path",{d:"m194.82 151.43l-55.09 20.3l-20.3 55.09a7.92 7.92 0 0 1-14.86 0l-20.3-55.09l-55.09-20.3a7.92 7.92 0 0 1 0-14.86l55.09-20.3l20.3-55.09a7.92 7.92 0 0 1 14.86 0l20.3 55.09l55.09 20.3a7.92 7.92 0 0 1 0 14.86",opacity:"0.2"}),n.jsx("path",{d:"M197.58 129.06L146 110l-19-51.62a15.92 15.92 0 0 0-29.88 0L78 110l-51.62 19a15.92 15.92 0 0 0 0 29.88L78 178l19 51.62a15.92 15.92 0 0 0 29.88 0L146 178l51.62-19a15.92 15.92 0 0 0 0-29.88ZM137 164.22a8 8 0 0 0-4.74 4.74L112 223.85L91.78 169a8 8 0 0 0-4.78-4.78L32.15 144L87 123.78a8 8 0 0 0 4.78-4.78L112 64.15L132.22 119a8 8 0 0 0 4.74 4.74L191.85 144ZM144 40a8 8 0 0 1 8-8h16V16a8 8 0 0 1 16 0v16h16a8 8 0 0 1 0 16h-16v16a8 8 0 0 1-16 0V48h-16a8 8 0 0 1-8-8m104 48a8 8 0 0 1-8 8h-8v8a8 8 0 0 1-16 0v-8h-8a8 8 0 0 1 0-16h8v-8a8 8 0 0 1 16 0v8h8a8 8 0 0 1 8 8"})]})}),n.jsx("div",{children:n.jsx("p",{className:"font-bold",children:"Agentic Shopping with TANYA"})})]}),n.jsx("div",{style:{display:"flex",alignItems:"center",gap:"1.25rem",margin:"0.75rem"},children:n.jsx(ne,{icon:"fluent:dismiss-24-filled",color:"#ffffff",width:"24",height:"24",className:"cursor-pointer",onClick:t})})]}),n.jsxs("div",{ref:ut,className:"overflow-y-auto pr-5 pb-4 space-y-4 hide-scrollbar flex-grow",children:[n.jsxs("div",{className:"text-sm text-[16px] rounded-r-xl p-3 m-3 rounded-bl-xl w-3/4 text-tanya-contrast",style:{backgroundColor:"#e5dbeb"},children:["Welcome to your smart shopping companion!",n.jsxs("p",{children:["Simply share your instruction — like “If this product goes below $",parseInt(r.price)-5," grab it for me.”"]}),n.jsx("p",{children:"I’ll monitor it, calculate total prices, and place the order when your conditions are met."})]}),n.jsx(yo,{}),p>1&&n.jsx(Dr,{showSubmit:!1}),Be.map((d,m)=>{var F;const u=m===Be.length-1,v=!!d.snapshotStage;return n.jsxs("div",{children:[d.query&&n.jsx("div",{className:"flex justify-end",children:n.jsx("p",{className:"text-sm rounded-l-xl p-3 m-3 mb-4 rounded-br-xl max-w-[75%]",style:{color:"#ffffff",backgroundColor:"var(--tanya)"},children:d.query})}),d.response==="__TEXT__"&&((F=d.snapshotPayload)==null?void 0:F.text)&&n.jsx("div",{className:"mt-2",children:n.jsx("div",{className:"text-sm text-tanya-contrast px-7 py-4 rounded-r-xl rounded-bl-2xl w-full",style:{backgroundColor:"var(--tanya-light)",margin:"0.75rem"},children:n.jsx("div",{className:"flex items-center gap-2",children:n.jsx("p",{children:d.snapshotPayload.text})})})}),u&&P&&p>1&&n.jsxs("div",{className:"mx-4 mt-2 rounded-xl border border-gray-200 bg-white p-4 animate-fade-in",children:[n.jsxs("div",{className:"text-sm text-gray-800",children:["Proceed with color:"," ",n.jsx("span",{className:"font-semibold",children:Me(x)||"—"}),", size:"," ",n.jsx("span",{className:"font-semibold",children:Ve(x)||"—"}),"?"]}),n.jsxs("div",{className:"mt-3 flex gap-3",children:[n.jsx("button",{onClick:so,className:"px-5 py-2 rounded-full text-white font-semibold",style:{background:C},children:"Yes"}),n.jsx("button",{onClick:ao,className:"px-5 py-2 rounded-full font-semibold border",style:{borderColor:C,color:C},children:"No, change SKU"})]})]}),u&&ge&&n.jsx(Dr,{showSubmit:!0}),u&&G&&n.jsx("div",{className:"mt-4",children:n.jsx("div",{className:"text-sm text-tanya-contrast px-7 py-4 rounded-r-xl rounded-bl-2xl w-full",style:{backgroundColor:"var(--tanya-light)",margin:"0.75rem"},children:n.jsx("div",{className:"flex items-center gap-2 tanya-pulse-text",children:n.jsx("p",{children:"Reading your instruction and setting things up…"})})})}),(v||d.response==="__CARD__")&&(!G||!u)&&n.jsx("div",{className:"mt-6 mb-4 mx-4 animate-fade-in",style:{backgroundColor:"#fff",borderRadius:"1rem",boxShadow:"0 2px 8px rgba(0,0,0,0.08)",overflow:"hidden"},children:v?jo(d,u):zr(d.snapshotPayload,!1)})]},m)}),ie&&n.jsxs("div",{className:"mt-6 mb-6 mx-6 rounded-xl p-6 shadow-md border border-gray-200 bg-white animate-fade-in",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("h3",{className:"font-semibold text-lg text-gray-800 flex items-center gap-2",children:[n.jsx(ne,{icon:"mdi:home-map-marker",width:"24",color:"var(--tanya-light)"}),"Select a Delivery Address"]}),O&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"ml-2 text-xs px-2 py-1 rounded-full bg-green-100 text-green-700 font-semibold",children:"Selected"}),!j&&n.jsx("button",{onClick:uo,className:"ml-2 text-xs px-2 py-1 rounded-full border hover:bg-gray-50",style:{borderColor:"var(--tanya-light)",color:"var(--tanya-light)"},title:"Change address",children:"Change"})]})]}),n.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Choose where you’d like us to deliver this item."}),a?n.jsxs("div",{className:"flex items-center py-6",children:[n.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2",style:{borderBottomColor:"var(--tanya-light)"}}),n.jsx("p",{className:"ml-3 text-gray-600",children:"Fetching your addresses..."})]}):We.length>0?n.jsxs("div",{className:`space-y-3 ${O?"opacity-70":""}`,children:[We.map(d=>{const m=[d.addressLine1,d.addressLine2].filter(Boolean).map(J=>He(J||"")).join(" "),u=He(d.city||""),v=`${He(d.state||"")}${d.state&&d.postalCode?", ":""}${d.postalCode||""}`,F=He(d.country||""),b=String(d.addressId??d.id),M=Se===b;return n.jsxs("label",{className:`flex items-start gap-3 p-4 border rounded-lg cursor-pointer transition hover:shadow-sm ${M?"border-tanya-light":"border-gray-300"} ${O?"pointer-events-none":""}`,title:O?"Address already submitted":"",children:[n.jsx("input",{type:"radio",name:"address",className:"mt-1 accent-tanya-light",checked:M,disabled:O,onChange:()=>Gt(b),value:b}),n.jsxs("div",{className:"flex-1",children:[n.jsx("div",{className:"font-semibold text-gray-800",children:m||"Address"}),n.jsxs("div",{className:"text-sm text-gray-700",children:[u,n.jsx("br",{}),v,n.jsx("br",{}),F]})]})]},b)}),n.jsxs("div",{className:"flex justify-between pt-2",children:[n.jsx("button",{onClick:$r,className:"px-6 py-2.5 rounded-full font-semibold border transition-all hover:-translate-y-0.5 hover:shadow-sm",style:{borderColor:"var(--tanya-light)",color:"var(--tanya-light)"},children:"Cancel"}),n.jsx("button",{onClick:co,disabled:O,className:`px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${O?"opacity-60 cursor-not-allowed":"hover:-translate-y-0.5 hover:shadow-lg"}`,style:{background:C},children:O?"Address Submitted":"Submit Address"})]})]}):n.jsx("div",{className:"text-center py-8 text-gray-600",children:"No addresses found. Please add a new one in your profile."})]}),V&&n.jsxs("div",{className:"mt-2 mb-6 mx-6 rounded-xl p-6 shadow-md border border-gray-200 bg-white animate-fade-in",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("h3",{className:"font-semibold text-lg text-gray-800 flex items-center gap-2",children:[n.jsx(ne,{icon:"mdi:truck-delivery",width:"24",color:"var(--tanya-light)"}),"Great! Now choose how fast you want it delivered 🚚"]}),q&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"ml-2 text-xs px-2 py-1 rounded-full bg-green-100 text-green-700 font-semibold",children:"Selected"}),!j&&n.jsx("button",{onClick:mo,className:"ml-2 text-xs px-2 py-1 rounded-full border hover:bg-gray-50",style:{borderColor:"var(--tanya-light)",color:"var(--tanya-light)"},title:"Change shipping method",children:"Change"})]})]}),n.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Which one would you like me to use for this order?"}),n.jsx("div",{className:`space-y-3 ${q?"opacity-70":""}`,children:Object.keys(tt).map(d=>{const m=tt[d],u=T===d;return n.jsxs("label",{className:`flex items-start gap-3 p-4 border rounded-lg cursor-pointer transition hover:shadow-sm ${u?"border-tanya-light":"border-gray-300"} ${q?"pointer-events-none":""}`,title:q?"Delivery already submitted":"",children:[n.jsx("input",{type:"radio",name:"delivery",className:"mt-1 accent-tanya-light",checked:u,disabled:q,onChange:()=>le(d)}),n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"font-semibold text-gray-800 flex items-center gap-2",children:[n.jsx(ne,{icon:m.icon,width:"18"})," ",m.label]}),n.jsx("div",{className:"text-sm text-gray-700",children:m.subtitle})]}),n.jsx("div",{className:"text-sm font-semibold text-gray-800",children:m.fee===0?"Free":Pe(m.fee,(R==null?void 0:R.currency)||qe)})]},d)})}),n.jsxs("div",{className:"flex justify-between pt-4",children:[n.jsx("button",{onClick:$r,className:"px-6 py-2.5 rounded-full font-semibold border transition-all hover:-translate-y-0.5 hover:shadow-sm",style:{borderColor:"var(--tanya-light)",color:"var(--tanya-light)"},children:"Cancel"}),n.jsx("button",{onClick:fo,disabled:q,className:`px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${q?"opacity-60 cursor-not-allowed":"hover:-translate-y-0.5 hover:shadow-lg"}`,style:{background:"var(--tanya)"},children:q?"Delivery Submitted":"Submit Delivery Option"})]})]}),Q&&n.jsxs("div",{className:"mt-2 mb-6 mx-6 rounded-xl p-6 shadow-md border border-gray-200 bg-white animate-fade-in",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("h3",{className:"font-semibold text-lg text-gray-800 flex items-center gap-2",children:[n.jsx(ne,{icon:"mdi:credit-card-outline",width:"24",color:"var(--tanya-light)"}),"Almost done! 💳"]}),X&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"ml-2 text-xs px-2 py-1 rounded-full bg-green-100 text-green-700 font-semibold",children:"Selected"}),!j&&n.jsx("button",{onClick:go,className:"ml-2 text-xs px-2 py-1 rounded-full border hover:bg-gray-50",style:{borderColor:"var(--tanya-light)",color:"var(--tanya-light)"},title:"Change payment method",children:"Change"})]})]}),n.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Please choose a payment method for this order:"}),n.jsx("div",{className:`space-y-3 ${X?"opacity-70":""}`,children:n.jsxs("label",{className:`flex items-start gap-3 p-4 border rounded-lg cursor-pointer transition hover:shadow-sm ${we==="card"?"border-tanya-light":"border-gray-300"} ${X?"pointer-events-none":""}`,title:X?"Payment already submitted":"",children:[n.jsx("input",{type:"radio",name:"payment",className:"mt-1 accent-tanya-light",checked:we==="card",disabled:X,onChange:()=>be("card")}),n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"font-semibold text-gray-800 flex items-center gap-2",children:[n.jsx(ne,{icon:"mdi:credit-card-chip-outline",width:"18"})," ","Credit Card"]}),we==="card"&&n.jsxs("div",{className:"text-sm text-gray-700 mt-1",children:["Mastercard    •••• 7820",n.jsx("br",{}),"Expiry: 12/26"]})]})]})}),n.jsxs("div",{className:"flex justify-between pt-4",children:[n.jsx("button",{onClick:po,className:"px-6 py-2.5 rounded-full font-semibold border transition-all hover:-translate-y-0.5 hover:shadow-sm",style:{borderColor:"var(--tanya-light)",color:"var(--tanya-light)"},children:"Cancel"}),n.jsx("button",{onClick:ho,disabled:X,className:`px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${X?"opacity-60 cursor-not-allowed":"hover:-translate-y-0.5 hover:shadow-lg"}`,style:{background:"var(--tanya)"},children:X?"Payment Submitted":"Submit Payment Method"})]})]}),ve&&Mr({...R,address:JSON.parse(localStorage.getItem("agentic_order_address")||"null"),delivery:localStorage.getItem("agentic_order_delivery"),payment:localStorage.getItem("agentic_order_payment"),summary:Or(R==null?void 0:R.currency)},!1)]}),n.jsxs("div",{className:"sticky bottom-0 w-[96%] drop-shadow-xl flex items-center rounded-full bg-white border border-gray-300 m-[15px]",children:[n.jsx("input",{placeholder:L?"Complete the current step…":vt?`What would you like me to do? (e.g., If this product goes below $${parseInt(r.price)-5}, grab it for me.)`:"Oops! This combination isn’t available for this product. Try a different option.",disabled:oo,className:`w-full rounded-full p-4 outline-none border-none focus:ring-0 focus:border-transparent disabled:bg-gray-100 disabled:cursor-not-allowed
20
+ ${vt?"":"placeholder:text-red-400 text-red-500"}`,value:Te,onKeyDown:d=>{d.key==="Enter"&&!G&&!L&&Ar()},onChange:d=>me(d.target.value)}),n.jsx("button",{type:"submit",disabled:G||L,className:"mr-6 font-medium",style:{color:"var(--tanya-light)"},onClick:()=>Ar(),children:G?n.jsx("div",{className:"m-3 animate-spin rounded-full h-6 w-6 border-b-2",style:{borderBottom:"2px solid"}}):n.jsx(ne,{icon:"fluent:send-48-filled",color:"var(--tanya-light)",width:"24",height:"24"})})]})]})})]}),document.body)};exports.AgenticShoppingButton=$a;exports.TanyaChatbot=Cs;exports.TanyaChatbotProvider=Fo;
22
21
  //# sourceMappingURL=tanya-chatbot.cjs.js.map