tanya-chatbot 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tanya-chatbot.cjs.js +11 -11
- package/dist/tanya-chatbot.cjs.js.map +1 -1
- package/dist/tanya-chatbot.es.js +730 -758
- package/dist/tanya-chatbot.es.js.map +1 -1
- package/package.json +1 -1
package/dist/tanya-chatbot.es.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { useEffect as
|
|
1
|
+
import { useEffect as tt, useState as $, useRef as _t } from "react";
|
|
2
2
|
import { jsx as a, jsxs as u, Fragment as re } from "react/jsx-runtime";
|
|
3
|
-
import { createHttpLink as
|
|
4
|
-
import { Provider as
|
|
5
|
-
import { createSlice as De, configureStore as
|
|
6
|
-
import * as
|
|
3
|
+
import { createHttpLink as ar, ApolloClient as ir, InMemoryCache as sr, ApolloProvider as lr } from "@apollo/client";
|
|
4
|
+
import { Provider as cr, useDispatch as je, useSelector as Mt } from "react-redux";
|
|
5
|
+
import { createSlice as De, configureStore as dr } from "@reduxjs/toolkit";
|
|
6
|
+
import * as Ae from "@radix-ui/react-popover";
|
|
7
7
|
import "clsx";
|
|
8
8
|
import "tailwind-merge";
|
|
9
|
-
import
|
|
9
|
+
import T from "axios";
|
|
10
10
|
import "crypto-js";
|
|
11
|
-
import { Icon as
|
|
12
|
-
import { toast as
|
|
13
|
-
const pr = '*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.top-full{top:100%}.z-40{z-index:40}.z-50{z-index:50}.m-1{margin:.25rem}.m-3{margin:.75rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.mb-1{margin-bottom:.25rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-24{margin-bottom:6rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.h-12{height:3rem}.h-28{height:7rem}.h-3{height:.75rem}.h-6{height:1.5rem}.h-\\[120px\\]{height:120px}.h-\\[200px\\]{height:200px}.h-\\[60px\\]{height:60px}.h-\\[90vh\\]{height:90vh}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.w-28{width:7rem}.w-3{width:.75rem}.w-5\\/6{width:83.333333%}.w-6{width:1.5rem}.w-72{width:18rem}.w-\\[100vw\\]{width:100vw}.w-\\[120px\\]{width:120px}.w-\\[150px\\]{width:150px}.w-\\[60px\\]{width:60px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[75\\%\\]{max-width:75%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[5px\\]{border-radius:5px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:.75rem}.rounded-l-\\[20px\\]{border-top-left-radius:20px;border-bottom-left-radius:20px}.rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-r-xl{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-bl-2xl{border-bottom-left-radius:1rem}.rounded-br-xl{border-bottom-right-radius:.75rem}.rounded-tr-\\[20px\\]{border-top-right-radius:20px}.rounded-tr-\\[5px\\]{border-top-right-radius:5px}.border{border-width:1px}.border-0{border-width:0px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-t-2{border-top-width:2px}.border-none{border-style:none}.border-\\[\\#C9C2DE\\]{--tw-border-opacity: 1;border-color:rgb(201 194 222 / var(--tw-border-opacity, 1))}.border-\\[\\#E5E5E5\\]{--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.bg-\\[\\#553D94\\]{--tw-bg-opacity: 1;background-color:rgb(85 61 148 / var(--tw-bg-opacity, 1))}.bg-\\[\\#6851C6\\]{--tw-bg-opacity: 1;background-color:rgb(104 81 198 / var(--tw-bg-opacity, 1))}.bg-\\[\\#804C9E0D\\]{background-color:#804c9e0d}.bg-\\[\\#A21CAF\\]{--tw-bg-opacity: 1;background-color:rgb(162 28 175 / var(--tw-bg-opacity, 1))}.bg-\\[\\#AB192D\\]{--tw-bg-opacity: 1;background-color:rgb(171 25 45 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E2DBFF\\]{--tw-bg-opacity: 1;background-color:rgb(226 219 255 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E3DEEF\\]{--tw-bg-opacity: 1;background-color:rgb(227 222 239 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F3F3F3\\]{--tw-bg-opacity: 1;background-color:rgb(243 243 243 / var(--tw-bg-opacity, 1))}.bg-\\[\\#FFFFFF\\],.bg-\\[\\#ffffff\\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-black\\/30{background-color:#0000004d}.bg-indigo-300{--tw-bg-opacity: 1;background-color:rgb(165 180 252 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\\[1px\\]{padding:1px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pl-2{padding-left:.5rem}.pr-5{padding-right:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-nunitoSans{font-family:Nunito Sans}.text-\\[12px\\]{font-size:12px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-snug{line-height:1.375}.text-\\[\\#000000\\]{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-\\[\\#14121F\\]{--tw-text-opacity: 1;color:rgb(20 18 31 / var(--tw-text-opacity, 1))}.text-\\[\\#18181B\\]{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.text-\\[\\#232323\\]{--tw-text-opacity: 1;color:rgb(35 35 35 / var(--tw-text-opacity, 1))}.text-\\[\\#323135\\]{--tw-text-opacity: 1;color:rgb(50 49 53 / var(--tw-text-opacity, 1))}.text-\\[\\#494949\\]{--tw-text-opacity: 1;color:rgb(73 73 73 / var(--tw-text-opacity, 1))}.text-\\[\\#555555\\]{--tw-text-opacity: 1;color:rgb(85 85 85 / var(--tw-text-opacity, 1))}.text-\\[\\#5B5B5B\\]{--tw-text-opacity: 1;color:rgb(91 91 91 / var(--tw-text-opacity, 1))}.text-\\[\\#68656E\\]{--tw-text-opacity: 1;color:rgb(104 101 110 / var(--tw-text-opacity, 1))}.text-\\[\\#959595\\]{--tw-text-opacity: 1;color:rgb(149 149 149 / var(--tw-text-opacity, 1))}.text-\\[\\#EC5050\\]{--tw-text-opacity: 1;color:rgb(236 80 80 / var(--tw-text-opacity, 1))}.text-\\[\\#FBFBFC\\]{--tw-text-opacity: 1;color:rgb(251 251 252 / var(--tw-text-opacity, 1))}.text-\\[\\#FFFFFF\\]{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-80{opacity:.8}.shadow-\\[0px_2px_2px_0px_\\#9292BC40\\]{--tw-shadow: 0px 2px 2px 0px #9292BC40;--tw-shadow-colored: 0px 2px 2px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0px_4px_10px_0px_\\#5F499840\\]{--tw-shadow: 0px 4px 10px 0px #5F499840;--tw-shadow-colored: 0px 4px 10px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.running{animation-play-state:running}html,body,#root{margin:0;padding:0}:root{line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;padding:0}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.hover\\:scale-125:hover{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:text-\\[\\#6952C7\\]:hover{--tw-text-opacity: 1;color:rgb(105 82 199 / var(--tw-text-opacity, 1))}.hover\\:opacity-90:hover{opacity:.9}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}@media(min-width:640px){.sm\\:w-\\[80vw\\]{width:80vw}}@media(min-width:768px){.md\\:h-\\[100vh\\]{height:100vh}.md\\:w-1\\/2{width:50%}.md\\:w-\\[770px\\]{width:770px}.md\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:flex-row{flex-direction:row}}@media(min-width:1024px){.lg\\:h-\\[100vh\\]{height:100vh}.lg\\:w-1\\/2{width:50%}.lg\\:w-2\\/3{width:66.666667%}.lg\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:flex-row{flex-direction:row}.lg\\:rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.lg\\:rounded-bl-xl{border-bottom-left-radius:.75rem}}';
|
|
14
|
-
function
|
|
15
|
-
return
|
|
11
|
+
import { Icon as we } from "@iconify/react";
|
|
12
|
+
import { toast as M } from "react-toastify";
|
|
13
|
+
const ur = '*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.top-full{top:100%}.z-40{z-index:40}.z-50{z-index:50}.m-1{margin:.25rem}.m-3{margin:.75rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.mb-1{margin-bottom:.25rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-24{margin-bottom:6rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.h-12{height:3rem}.h-28{height:7rem}.h-3{height:.75rem}.h-6{height:1.5rem}.h-\\[120px\\]{height:120px}.h-\\[200px\\]{height:200px}.h-\\[60px\\]{height:60px}.h-\\[90vh\\]{height:90vh}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.w-28{width:7rem}.w-3{width:.75rem}.w-5\\/6{width:83.333333%}.w-6{width:1.5rem}.w-72{width:18rem}.w-\\[100vw\\]{width:100vw}.w-\\[120px\\]{width:120px}.w-\\[150px\\]{width:150px}.w-\\[60px\\]{width:60px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[75\\%\\]{max-width:75%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[5px\\]{border-radius:5px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:.75rem}.rounded-l-\\[20px\\]{border-top-left-radius:20px;border-bottom-left-radius:20px}.rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-r-xl{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-bl-2xl{border-bottom-left-radius:1rem}.rounded-br-xl{border-bottom-right-radius:.75rem}.rounded-tr-\\[20px\\]{border-top-right-radius:20px}.rounded-tr-\\[5px\\]{border-top-right-radius:5px}.border{border-width:1px}.border-0{border-width:0px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-t-2{border-top-width:2px}.border-none{border-style:none}.border-\\[\\#C9C2DE\\]{--tw-border-opacity: 1;border-color:rgb(201 194 222 / var(--tw-border-opacity, 1))}.border-\\[\\#E5E5E5\\]{--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.bg-\\[\\#553D94\\]{--tw-bg-opacity: 1;background-color:rgb(85 61 148 / var(--tw-bg-opacity, 1))}.bg-\\[\\#6851C6\\]{--tw-bg-opacity: 1;background-color:rgb(104 81 198 / var(--tw-bg-opacity, 1))}.bg-\\[\\#804C9E0D\\]{background-color:#804c9e0d}.bg-\\[\\#A21CAF\\]{--tw-bg-opacity: 1;background-color:rgb(162 28 175 / var(--tw-bg-opacity, 1))}.bg-\\[\\#AB192D\\]{--tw-bg-opacity: 1;background-color:rgb(171 25 45 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E2DBFF\\]{--tw-bg-opacity: 1;background-color:rgb(226 219 255 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E3DEEF\\]{--tw-bg-opacity: 1;background-color:rgb(227 222 239 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F3F3F3\\]{--tw-bg-opacity: 1;background-color:rgb(243 243 243 / var(--tw-bg-opacity, 1))}.bg-\\[\\#FFFFFF\\],.bg-\\[\\#ffffff\\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-black\\/30{background-color:#0000004d}.bg-indigo-300{--tw-bg-opacity: 1;background-color:rgb(165 180 252 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\\[1px\\]{padding:1px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pl-2{padding-left:.5rem}.pr-5{padding-right:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-nunitoSans{font-family:Nunito Sans}.text-\\[12px\\]{font-size:12px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-snug{line-height:1.375}.text-\\[\\#000000\\]{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-\\[\\#14121F\\]{--tw-text-opacity: 1;color:rgb(20 18 31 / var(--tw-text-opacity, 1))}.text-\\[\\#18181B\\]{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.text-\\[\\#232323\\]{--tw-text-opacity: 1;color:rgb(35 35 35 / var(--tw-text-opacity, 1))}.text-\\[\\#323135\\]{--tw-text-opacity: 1;color:rgb(50 49 53 / var(--tw-text-opacity, 1))}.text-\\[\\#494949\\]{--tw-text-opacity: 1;color:rgb(73 73 73 / var(--tw-text-opacity, 1))}.text-\\[\\#555555\\]{--tw-text-opacity: 1;color:rgb(85 85 85 / var(--tw-text-opacity, 1))}.text-\\[\\#5B5B5B\\]{--tw-text-opacity: 1;color:rgb(91 91 91 / var(--tw-text-opacity, 1))}.text-\\[\\#68656E\\]{--tw-text-opacity: 1;color:rgb(104 101 110 / var(--tw-text-opacity, 1))}.text-\\[\\#959595\\]{--tw-text-opacity: 1;color:rgb(149 149 149 / var(--tw-text-opacity, 1))}.text-\\[\\#EC5050\\]{--tw-text-opacity: 1;color:rgb(236 80 80 / var(--tw-text-opacity, 1))}.text-\\[\\#FBFBFC\\]{--tw-text-opacity: 1;color:rgb(251 251 252 / var(--tw-text-opacity, 1))}.text-\\[\\#FFFFFF\\]{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-80{opacity:.8}.shadow-\\[0px_2px_2px_0px_\\#9292BC40\\]{--tw-shadow: 0px 2px 2px 0px #9292BC40;--tw-shadow-colored: 0px 2px 2px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0px_4px_10px_0px_\\#5F499840\\]{--tw-shadow: 0px 4px 10px 0px #5F499840;--tw-shadow-colored: 0px 4px 10px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.running{animation-play-state:running}html,body,#root{margin:0;padding:0}:root{line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;padding:0}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.hover\\:scale-125:hover{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:text-\\[\\#6952C7\\]:hover{--tw-text-opacity: 1;color:rgb(105 82 199 / var(--tw-text-opacity, 1))}.hover\\:opacity-90:hover{opacity:.9}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}@media(min-width:640px){.sm\\:w-\\[80vw\\]{width:80vw}}@media(min-width:768px){.md\\:h-\\[100vh\\]{height:100vh}.md\\:w-1\\/2{width:50%}.md\\:w-\\[770px\\]{width:770px}.md\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:flex-row{flex-direction:row}}@media(min-width:1024px){.lg\\:h-\\[100vh\\]{height:100vh}.lg\\:w-1\\/2{width:50%}.lg\\:w-2\\/3{width:66.666667%}.lg\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:flex-row{flex-direction:row}.lg\\:rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.lg\\:rounded-bl-xl{border-bottom-left-radius:.75rem}}';
|
|
14
|
+
function bo() {
|
|
15
|
+
return tt(() => {
|
|
16
16
|
if (typeof document < "u") {
|
|
17
17
|
const t = document.createElement("style");
|
|
18
|
-
return t.textContent =
|
|
18
|
+
return t.textContent = ur, document.head.appendChild(t), () => {
|
|
19
19
|
document.head.removeChild(t);
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
}, []), null;
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const pr = {
|
|
25
25
|
store: {
|
|
26
26
|
storeCode: "",
|
|
27
27
|
storeName: "",
|
|
@@ -55,30 +55,30 @@ const fr = {
|
|
|
55
55
|
mobile: []
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, Le = De({
|
|
59
59
|
name: "store",
|
|
60
|
-
initialState:
|
|
60
|
+
initialState: pr,
|
|
61
61
|
reducers: {
|
|
62
62
|
setStore: (t, e) => {
|
|
63
63
|
t.store = e.payload;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
}), { setStore:
|
|
66
|
+
}), { setStore: yo } = Le.actions, fr = Le.reducer, mr = {
|
|
67
67
|
product: null
|
|
68
|
-
},
|
|
68
|
+
}, Be = De({
|
|
69
69
|
name: "product",
|
|
70
|
-
initialState:
|
|
70
|
+
initialState: mr,
|
|
71
71
|
reducers: {
|
|
72
72
|
setProduct: (t, e) => {
|
|
73
73
|
t.product = e.payload;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
}), { setProduct: oe } =
|
|
76
|
+
}), { setProduct: oe } = Be.actions, hr = Be.reducer, wr = dr({
|
|
77
77
|
reducer: {
|
|
78
|
-
store:
|
|
79
|
-
product:
|
|
78
|
+
store: fr,
|
|
79
|
+
product: hr
|
|
80
80
|
}
|
|
81
|
-
}),
|
|
81
|
+
}), gr = ({ children: t }) => /* @__PURE__ */ a(cr, { store: wr, children: t }), Ht = (t) => {
|
|
82
82
|
const e = new CustomEvent("reactCartUpdated", {
|
|
83
83
|
detail: {
|
|
84
84
|
cartUpdated: !0,
|
|
@@ -90,28 +90,28 @@ const fr = {
|
|
|
90
90
|
function xr({
|
|
91
91
|
...t
|
|
92
92
|
}) {
|
|
93
|
-
return /* @__PURE__ */ a(
|
|
93
|
+
return /* @__PURE__ */ a(Ae.Root, { "data-slot": "popover", ...t });
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function br({
|
|
96
96
|
...t
|
|
97
97
|
}) {
|
|
98
|
-
return /* @__PURE__ */ a(
|
|
98
|
+
return /* @__PURE__ */ a(Ae.Trigger, { "data-slot": "popover-trigger", ...t });
|
|
99
99
|
}
|
|
100
|
-
const
|
|
100
|
+
const yt = () => ({ 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" }), Ue = async () => {
|
|
101
101
|
const t = "https://tanya-sfcc-server.vercel.app/";
|
|
102
102
|
try {
|
|
103
|
-
const e = await
|
|
104
|
-
`${t}api/auth/token-bm-grant?baseUrl=${
|
|
103
|
+
const e = await T.post(
|
|
104
|
+
`${t}api/auth/token-bm-grant?baseUrl=${rt()}&siteId=${R()}`
|
|
105
105
|
);
|
|
106
106
|
return e.status === 200 && e.data.access_token ? e.data.access_token : (console.error("Failed to fetch token:", e.data), null);
|
|
107
107
|
} catch (e) {
|
|
108
|
-
return
|
|
108
|
+
return T.isAxiosError(e) ? console.error("Error fetching token:", e.response || e.message) : console.error("Unexpected error:", e), null;
|
|
109
109
|
}
|
|
110
|
-
},
|
|
110
|
+
}, qe = async (t) => {
|
|
111
111
|
const e = "https://tanya-sfcc-server.vercel.app/";
|
|
112
112
|
try {
|
|
113
|
-
const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, o = await
|
|
114
|
-
`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${
|
|
113
|
+
const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, o = await T.post(
|
|
114
|
+
`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${rt()}&siteId=${R()}&pubCfg=${ot()}&envRef=${nt()}&orgRef=${at()}`,
|
|
115
115
|
{},
|
|
116
116
|
{
|
|
117
117
|
headers: {
|
|
@@ -122,24 +122,24 @@ const st = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
|
|
|
122
122
|
);
|
|
123
123
|
return o.status === 200 && o.data ? o.data : null;
|
|
124
124
|
} catch (r) {
|
|
125
|
-
return
|
|
125
|
+
return T.isAxiosError(r) ? console.error("Error creating basket:", r.response || r.message) : console.error("Unexpected error:", r), null;
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
|
-
async function
|
|
129
|
-
var
|
|
130
|
-
const t =
|
|
128
|
+
async function Tt() {
|
|
129
|
+
var x;
|
|
130
|
+
const t = R(), e = "access_token_" + t, r = "expires_in_" + t, o = localStorage.getItem(r), n = localStorage.getItem(e);
|
|
131
131
|
console.log(n);
|
|
132
|
-
const
|
|
132
|
+
const l = ((x = JSON.parse(sessionStorage.getItem("customerData") || "{}")) == null ? void 0 : x.isGuest) || !0;
|
|
133
133
|
if (o && n && (/* @__PURE__ */ new Date()).getTime() < parseInt(o))
|
|
134
134
|
return console.log("access token found in local storage"), { access_token: n, expires_in: o };
|
|
135
|
-
const { serverUrl:
|
|
135
|
+
const { serverUrl: c } = yt(), d = JSON.parse(
|
|
136
136
|
sessionStorage.getItem("customerData") || "{}"
|
|
137
137
|
).dwsid, i = JSON.parse(
|
|
138
138
|
sessionStorage.getItem("customerData") || "{}"
|
|
139
139
|
).usrRef;
|
|
140
140
|
try {
|
|
141
|
-
const
|
|
142
|
-
`${
|
|
141
|
+
const h = l ? "unregister-auth" : "register-auth", S = await T.get(
|
|
142
|
+
`${c}sc-api/${h}?dwsid=${d}&email=${i}&pubCfg=${ot()}&envRef=${nt()}&orgRef=${at()}&siteId=${R()}&token=true`,
|
|
143
143
|
{
|
|
144
144
|
withCredentials: !0
|
|
145
145
|
}
|
|
@@ -147,23 +147,23 @@ async function Ot() {
|
|
|
147
147
|
return localStorage.setItem(e, S.data.access_token), localStorage.setItem(
|
|
148
148
|
r,
|
|
149
149
|
String((/* @__PURE__ */ new Date()).getTime() + S.data.expires_in * 1e3)
|
|
150
|
-
), localStorage.setItem("isGuest",
|
|
151
|
-
} catch (
|
|
152
|
-
console.log(
|
|
150
|
+
), localStorage.setItem("isGuest", l ? "true" : "false"), S.data;
|
|
151
|
+
} catch (h) {
|
|
152
|
+
console.log(h);
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
const
|
|
155
|
+
const rt = () => sessionStorage.getItem("Host"), R = () => sessionStorage.getItem("SiteId"), ot = () => sessionStorage.getItem("pubCfg"), nt = () => sessionStorage.getItem("envRef"), at = () => sessionStorage.getItem("orgRef"), ge = async (t) => {
|
|
156
156
|
console.log("fetching results");
|
|
157
|
-
const { serverUrl: e, basePath: r } =
|
|
157
|
+
const { serverUrl: e, basePath: r } = yt();
|
|
158
158
|
let o = "";
|
|
159
159
|
{
|
|
160
|
-
const n = await
|
|
160
|
+
const n = await Tt();
|
|
161
161
|
console.log("the token from getSearchResults", n), o = n.access_token;
|
|
162
162
|
}
|
|
163
163
|
try {
|
|
164
|
-
const n =
|
|
165
|
-
return (await
|
|
166
|
-
`${e}${r}/search-sfcc?baseUrl=${n}&query=${t}&siteId=${
|
|
164
|
+
const n = rt();
|
|
165
|
+
return (await T.get(
|
|
166
|
+
`${e}${r}/search-sfcc?baseUrl=${n}&query=${t}&siteId=${R()}&pubCfg=${ot()}&envRef=${nt()}&orgRef=${at()}`,
|
|
167
167
|
{
|
|
168
168
|
headers: {
|
|
169
169
|
"Content-Type": "application/json",
|
|
@@ -174,13 +174,13 @@ const Z = () => sessionStorage.getItem("Host"), q = () => sessionStorage.getItem
|
|
|
174
174
|
} catch (n) {
|
|
175
175
|
throw console.error("Error fetching search results:", n), n;
|
|
176
176
|
}
|
|
177
|
-
},
|
|
177
|
+
}, Me = async (t) => {
|
|
178
178
|
if (!t) throw new Error("Product ID is required");
|
|
179
|
-
const { serverUrl: e, basePath: r } =
|
|
179
|
+
const { serverUrl: e, basePath: r } = yt(), o = rt();
|
|
180
180
|
console.log("calling access");
|
|
181
|
-
const { access_token: n } = await
|
|
182
|
-
return console.log(n), (await
|
|
183
|
-
`${e}${r}/product-sfcc/${t}?baseUrl=${o}&siteId=${
|
|
181
|
+
const { access_token: n } = await Tt();
|
|
182
|
+
return console.log(n), (await T.get(
|
|
183
|
+
`${e}${r}/product-sfcc/${t}?baseUrl=${o}&siteId=${R()}&pubCfg=${ot()}&envRef=${nt()}&orgRef=${at()}`,
|
|
184
184
|
{
|
|
185
185
|
headers: {
|
|
186
186
|
"Content-Type": "application/json",
|
|
@@ -188,24 +188,24 @@ const Z = () => sessionStorage.getItem("Host"), q = () => sessionStorage.getItem
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
)).data;
|
|
191
|
-
},
|
|
191
|
+
}, yr = async (t) => {
|
|
192
192
|
if (!t) throw new Error("customerId is required");
|
|
193
|
-
const e = await
|
|
193
|
+
const e = await Ue(), { customer_token: r } = await qe(
|
|
194
194
|
e
|
|
195
|
-
), { serverUrl: o, basePath: n } =
|
|
196
|
-
return (await
|
|
197
|
-
`${o}${n}/get-interest?baseUrl=${
|
|
195
|
+
), { serverUrl: o, basePath: n } = yt(), c = (await Tt()).access_token;
|
|
196
|
+
return (await T.get(
|
|
197
|
+
`${o}${n}/get-interest?baseUrl=${rt()}&customerId=${t}&siteId=${R()}&pubCfg=${ot()}&envRef=${nt()}&orgRef=${at()}`,
|
|
198
198
|
{
|
|
199
199
|
headers: {
|
|
200
200
|
"Content-Type": "application/json",
|
|
201
|
-
Authorization: `Bearer ${
|
|
201
|
+
Authorization: `Bearer ${c}`
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
)).data;
|
|
205
|
-
}, xe = (t) => String(typeof t == "string" ? t : t["en-US"] || t),
|
|
205
|
+
}, xe = (t) => String(typeof t == "string" ? t : t["en-US"] || t), be = (t) => t != null && t.image ? [t.image] : "variants" in t ? t.variants[0].images : t.masterVariant.images.map((e) => e.url), vr = (t, e) => t.toLocaleString("en-US", {
|
|
206
206
|
style: "currency",
|
|
207
207
|
currency: e || "USD"
|
|
208
|
-
}),
|
|
208
|
+
}), ye = (t) => {
|
|
209
209
|
var e, r, o;
|
|
210
210
|
return "variants" in t ? {
|
|
211
211
|
centAmount: (e = t.variants[0]) == null ? void 0 : e.prices.EUR.max,
|
|
@@ -214,37 +214,37 @@ const Z = () => sessionStorage.getItem("Host"), q = () => sessionStorage.getItem
|
|
|
214
214
|
centAmount: (r = t.masterVariant) == null ? void 0 : r.prices[0].value.centAmount,
|
|
215
215
|
currencyCode: (o = t.masterVariant) == null ? void 0 : o.prices[0].value.currencyCode
|
|
216
216
|
};
|
|
217
|
-
},
|
|
217
|
+
}, kr = (t) => t.charAt(0).toUpperCase() + t.slice(1), ve = (t, e) => t.length < e ? t : t.slice(0, e) + "...", Xt = (t) => t.split("\\n").map((e, r) => {
|
|
218
218
|
const o = e.match(/^(\d+)\.\s(.+)/);
|
|
219
219
|
return o ? `<p key=${r} class="mb-2"><strong>${o[1]}.</strong> ${o[2]}</p>` : e.trim() ? `<p key=${r} class="mb-2">${e}</p>` : "<br/>";
|
|
220
220
|
}).join("");
|
|
221
|
-
function
|
|
222
|
-
const t = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [e, r] =
|
|
223
|
-
return
|
|
221
|
+
function Sr() {
|
|
222
|
+
const t = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [e, r] = $(t);
|
|
223
|
+
return tt(() => {
|
|
224
224
|
const o = () => r(t());
|
|
225
225
|
return window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
|
|
226
226
|
}, []), e;
|
|
227
227
|
}
|
|
228
|
-
const
|
|
228
|
+
const Cr = ({
|
|
229
229
|
product: t
|
|
230
230
|
}) => {
|
|
231
|
-
const e =
|
|
231
|
+
const e = je(), r = Sr(), [o, n] = $(0), l = () => {
|
|
232
232
|
n(
|
|
233
233
|
(i) => i + r >= t.length ? 0 : i + r
|
|
234
234
|
);
|
|
235
|
-
},
|
|
235
|
+
}, c = () => {
|
|
236
236
|
n(
|
|
237
237
|
(i) => i - r < 0 ? t.length - (t.length % r || r) : i - r
|
|
238
238
|
);
|
|
239
239
|
}, d = async (i) => {
|
|
240
|
-
const
|
|
241
|
-
e(oe(
|
|
240
|
+
const x = await Me(i);
|
|
241
|
+
e(oe(x));
|
|
242
242
|
};
|
|
243
243
|
return /* @__PURE__ */ a("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */ u("div", { className: "flex items-center justify-center gap-4 relative", children: [
|
|
244
244
|
(t == null ? void 0 : t.length) > r && /* @__PURE__ */ a(
|
|
245
245
|
"button",
|
|
246
246
|
{
|
|
247
|
-
onClick:
|
|
247
|
+
onClick: c,
|
|
248
248
|
className: "absolute z-50 left-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",
|
|
249
249
|
style: {
|
|
250
250
|
height: "30px",
|
|
@@ -255,7 +255,7 @@ const _r = ({
|
|
|
255
255
|
}
|
|
256
256
|
),
|
|
257
257
|
/* @__PURE__ */ a("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: t.slice(o, o + r).map((i) => {
|
|
258
|
-
var
|
|
258
|
+
var x, h, S, _;
|
|
259
259
|
return /* @__PURE__ */ u(
|
|
260
260
|
"div",
|
|
261
261
|
{
|
|
@@ -267,7 +267,7 @@ const _r = ({
|
|
|
267
267
|
/* @__PURE__ */ a("div", { className: "w-full p-2 flex items-center justify-center bg-white", children: /* @__PURE__ */ a(
|
|
268
268
|
"img",
|
|
269
269
|
{
|
|
270
|
-
src: ((
|
|
270
|
+
src: ((x = be(i)[0]) == null ? void 0 : x.link) || be(i)[0] || // fallback if it's a string
|
|
271
271
|
"https://via.placeholder.com/120",
|
|
272
272
|
alt: i != null && i.productName ? i.productName : "Product",
|
|
273
273
|
className: "w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"
|
|
@@ -279,8 +279,8 @@ const _r = ({
|
|
|
279
279
|
className: "text-white w-full p-2 text-[12px] text-center h-[60px]",
|
|
280
280
|
children: [
|
|
281
281
|
/* @__PURE__ */ u("div", { className: "relative inline-block group", children: [
|
|
282
|
-
/* @__PURE__ */ a("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: i != null && i.productName ? i.productName : i != null && i.product_name ? i.product_name :
|
|
283
|
-
xe((
|
|
282
|
+
/* @__PURE__ */ a("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: i != null && i.productName ? i.productName : i != null && i.product_name ? i.product_name : ve(
|
|
283
|
+
xe((h = i == null ? void 0 : i.name) == null ? void 0 : h["en-US"]),
|
|
284
284
|
60
|
|
285
285
|
) || "Product" }),
|
|
286
286
|
/* @__PURE__ */ a(
|
|
@@ -294,7 +294,7 @@ const _r = ({
|
|
|
294
294
|
marginBottom: "5px",
|
|
295
295
|
zIndex: 50
|
|
296
296
|
},
|
|
297
|
-
children: i != null && i.productName ? i.productName : i != null && i.product_name ? i.product_name :
|
|
297
|
+
children: i != null && i.productName ? i.productName : i != null && i.product_name ? i.product_name : ve(
|
|
298
298
|
xe((S = i == null ? void 0 : i.name) == null ? void 0 : S["en-US"]),
|
|
299
299
|
60
|
|
300
300
|
) || "Product"
|
|
@@ -302,9 +302,9 @@ const _r = ({
|
|
|
302
302
|
)
|
|
303
303
|
] }),
|
|
304
304
|
/* @__PURE__ */ u("div", { className: " flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1", children: [
|
|
305
|
-
/* @__PURE__ */ a("p", { children:
|
|
306
|
-
i != null && i.price ? Number(i == null ? void 0 : i.price) :
|
|
307
|
-
(
|
|
305
|
+
/* @__PURE__ */ a("p", { children: vr(
|
|
306
|
+
i != null && i.price ? Number(i == null ? void 0 : i.price) : ye(i).centAmount || 0,
|
|
307
|
+
(_ = ye(i)) == null ? void 0 : _.currencyCode
|
|
308
308
|
) }),
|
|
309
309
|
/* @__PURE__ */ u("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
|
|
310
310
|
"$",
|
|
@@ -322,7 +322,7 @@ const _r = ({
|
|
|
322
322
|
(t == null ? void 0 : t.length) > r && /* @__PURE__ */ a(
|
|
323
323
|
"button",
|
|
324
324
|
{
|
|
325
|
-
onClick:
|
|
325
|
+
onClick: l,
|
|
326
326
|
className: "absolute z-50 right-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",
|
|
327
327
|
style: {
|
|
328
328
|
height: "30px",
|
|
@@ -333,7 +333,7 @@ const _r = ({
|
|
|
333
333
|
}
|
|
334
334
|
)
|
|
335
335
|
] }) });
|
|
336
|
-
},
|
|
336
|
+
}, _r = ({ chat: t, storeDetails: e }) => /* @__PURE__ */ a("div", { className: "bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full", children: t.map((r, o) => /* @__PURE__ */ u(
|
|
337
337
|
"div",
|
|
338
338
|
{
|
|
339
339
|
className: "mb-4 p-3 rounded-xl",
|
|
@@ -346,11 +346,11 @@ const _r = ({
|
|
|
346
346
|
"div",
|
|
347
347
|
{
|
|
348
348
|
className: "font-nunitoSans font-bold text-sm text-[#494949] p-2 w-fit rounded-[20px]",
|
|
349
|
-
children:
|
|
349
|
+
children: kr(r.keyword) || "No keyword"
|
|
350
350
|
}
|
|
351
351
|
),
|
|
352
352
|
/* @__PURE__ */ a(
|
|
353
|
-
|
|
353
|
+
Cr,
|
|
354
354
|
{
|
|
355
355
|
product: r.items,
|
|
356
356
|
storeDetails: e
|
|
@@ -359,13 +359,13 @@ const _r = ({
|
|
|
359
359
|
]
|
|
360
360
|
},
|
|
361
361
|
o
|
|
362
|
-
)) }),
|
|
363
|
-
const { serverUrl: r, basePath: o } =
|
|
362
|
+
)) }), He = async (t, e) => {
|
|
363
|
+
const { serverUrl: r, basePath: o } = yt(), n = `${r}`;
|
|
364
364
|
console.log(`customer_token
|
|
365
365
|
`, t);
|
|
366
366
|
try {
|
|
367
|
-
return (await
|
|
368
|
-
`${n}${o}/basket/create?baseUrl=${
|
|
367
|
+
return (await T.post(
|
|
368
|
+
`${n}${o}/basket/create?baseUrl=${rt()}&siteId=${R()}&pubCfg=${ot()}&envRef=${nt()}&orgRef=${at()}`,
|
|
369
369
|
e,
|
|
370
370
|
{
|
|
371
371
|
headers: {
|
|
@@ -374,14 +374,14 @@ const _r = ({
|
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
)).data;
|
|
377
|
-
} catch (
|
|
378
|
-
return
|
|
377
|
+
} catch (l) {
|
|
378
|
+
return T.isAxiosError(l) ? console.error("Error creating basket:", l.response || l.message) : console.error("Unexpected error:", l), null;
|
|
379
379
|
}
|
|
380
380
|
}, Vt = async (t, e, r) => {
|
|
381
|
-
const { serverUrl: o, basePath: n } =
|
|
381
|
+
const { serverUrl: o, basePath: n } = yt(), l = `${o}`;
|
|
382
382
|
try {
|
|
383
|
-
const
|
|
384
|
-
`${
|
|
383
|
+
const c = await T.post(
|
|
384
|
+
`${l}${n}/basket/add-product/${t}?baseUrl=${rt()}&siteId=${R()}&pubCfg=${ot()}&envRef=${nt()}&orgRef=${at()}`,
|
|
385
385
|
e,
|
|
386
386
|
{
|
|
387
387
|
headers: {
|
|
@@ -390,161 +390,136 @@ const _r = ({
|
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
);
|
|
393
|
-
return
|
|
394
|
-
} catch (
|
|
395
|
-
return
|
|
393
|
+
return c.status === 200 && c.data ? c.data : null;
|
|
394
|
+
} catch (c) {
|
|
395
|
+
return T.isAxiosError(c) ? console.error(
|
|
396
396
|
"Error adding products to basket:",
|
|
397
|
-
|
|
398
|
-
) : console.error("Unexpected error:",
|
|
397
|
+
c.response || c.message
|
|
398
|
+
) : console.error("Unexpected error:", c), null;
|
|
399
399
|
}
|
|
400
|
-
},
|
|
401
|
-
|
|
402
|
-
customer_token: e
|
|
403
|
-
}) => {
|
|
404
|
-
var s;
|
|
405
|
-
const { serverUrl: r, basePath: o } = st(), n = `${r}`;
|
|
400
|
+
}, Yt = "sfcc_basket_id", ke = "sfcc_customer_token", Et = "sfcc_token_expiry", Fr = 300 * 1e3, Ft = "1.0.0";
|
|
401
|
+
const et = (t) => {
|
|
406
402
|
try {
|
|
407
|
-
|
|
408
|
-
`${n}${o}/basket/${t}?baseUrl=${Z()}&siteId=${q()}&pubCfg=${tt()}&envRef=${et()}&orgRef=${rt()}`,
|
|
409
|
-
{
|
|
410
|
-
headers: {
|
|
411
|
-
"Content-Type": "application/json",
|
|
412
|
-
Authorization: e
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
);
|
|
416
|
-
return { status: l.status, data: l.data };
|
|
417
|
-
} catch (l) {
|
|
418
|
-
return E.isAxiosError(l) ? { status: (s = l.response) == null ? void 0 : s.status, data: null } : { status: null, data: null };
|
|
419
|
-
}
|
|
420
|
-
}, Rt = "sfcc_basket_id", Se = "sfcc_customer_token", Tt = "sfcc_token_expiry", Fr = 300 * 1e3, Ft = "1.0.0";
|
|
421
|
-
const xt = (t) => {
|
|
422
|
-
try {
|
|
423
|
-
t ? localStorage.setItem(Rt, t) : localStorage.removeItem(Rt);
|
|
403
|
+
t ? localStorage.setItem(Yt, t) : localStorage.removeItem(Yt);
|
|
424
404
|
} catch (e) {
|
|
425
405
|
console.error("Error saving basket ID to storage:", e);
|
|
426
406
|
}
|
|
427
|
-
},
|
|
407
|
+
}, Rt = (t) => {
|
|
428
408
|
try {
|
|
429
409
|
if (t) {
|
|
430
|
-
localStorage.setItem(
|
|
410
|
+
localStorage.setItem(ke, t);
|
|
431
411
|
const e = Date.now() + Fr;
|
|
432
|
-
localStorage.setItem(
|
|
412
|
+
localStorage.setItem(Et, e.toString());
|
|
433
413
|
} else
|
|
434
|
-
localStorage.removeItem(
|
|
414
|
+
localStorage.removeItem(ke);
|
|
435
415
|
} catch (e) {
|
|
436
416
|
console.error("Error storing token:", e);
|
|
437
417
|
}
|
|
438
|
-
},
|
|
439
|
-
var d, i,
|
|
440
|
-
const t =
|
|
441
|
-
if (
|
|
418
|
+
}, Se = 300, Ir = () => {
|
|
419
|
+
var d, i, x, h, S, _;
|
|
420
|
+
const t = je(), e = Mt((F) => F.product.product), r = Mt((F) => F.store.store), [o, n] = $(!!e);
|
|
421
|
+
if (tt(() => {
|
|
442
422
|
n(!!e);
|
|
443
423
|
}, [e]), !e) return null;
|
|
444
|
-
const
|
|
445
|
-
var
|
|
424
|
+
const l = async () => {
|
|
425
|
+
var F, D, K, it, H, st, vt, Ot, Q, kt, St, lt, Pt, $t, Ct, O;
|
|
446
426
|
console.log(e, "the prod");
|
|
447
427
|
try {
|
|
448
|
-
if (!((
|
|
449
|
-
|
|
428
|
+
if (!((D = (F = e == null ? void 0 : e.variants) == null ? void 0 : F[0]) != null && D.product_id) && !(e.type.item || e.type.bundle) && !((it = (K = e == null ? void 0 : e.variants) == null ? void 0 : K[0]) != null && it.productId)) {
|
|
429
|
+
M.error("Variants not available", {
|
|
450
430
|
position: "bottom-right",
|
|
451
431
|
autoClose: 1e3
|
|
452
432
|
}), console.error("No product variant found");
|
|
453
433
|
return;
|
|
454
434
|
}
|
|
455
|
-
const
|
|
435
|
+
const C = [
|
|
456
436
|
{
|
|
457
|
-
product_id: ((
|
|
437
|
+
product_id: ((H = e.variants) == null ? void 0 : H[0].product_id) || ((st = e.variants) == null ? void 0 : st[0].productId) || (e == null ? void 0 : e.id),
|
|
458
438
|
quantity: 1
|
|
459
439
|
}
|
|
460
440
|
];
|
|
461
|
-
console.log(
|
|
462
|
-
const
|
|
441
|
+
console.log(C, "the product data");
|
|
442
|
+
const k = JSON.parse(
|
|
463
443
|
sessionStorage.getItem("customerData") || "{}"
|
|
464
|
-
),
|
|
465
|
-
if (!Jt || !
|
|
466
|
-
let
|
|
444
|
+
), ct = (k == null ? void 0 : k.basketId) || localStorage.getItem(Yt), Jt = !1, zt = localStorage.getItem(Et), jt = Date.now();
|
|
445
|
+
if (!Jt || !zt || jt >= parseInt(zt)) {
|
|
446
|
+
let z = "";
|
|
467
447
|
{
|
|
468
|
-
const
|
|
469
|
-
console.log("token from auth data"),
|
|
448
|
+
const A = await Tt();
|
|
449
|
+
console.log("token from auth data"), z = "Bearer " + A.access_token;
|
|
470
450
|
}
|
|
471
|
-
if (
|
|
451
|
+
if (!z) {
|
|
472
452
|
console.error("Failed to get customer_token");
|
|
473
453
|
return;
|
|
474
454
|
}
|
|
475
|
-
const
|
|
476
|
-
if (
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
pauseOnHover: !0,
|
|
493
|
-
draggable: !0
|
|
494
|
-
}), Ht(nt));
|
|
495
|
-
return;
|
|
496
|
-
}
|
|
455
|
+
const dt = jt + 300 * 1e3;
|
|
456
|
+
if (Rt(z), localStorage.setItem(Et, dt.toString()), ct) {
|
|
457
|
+
console.log(ct, "basket id from customer");
|
|
458
|
+
const A = await Vt(
|
|
459
|
+
ct,
|
|
460
|
+
C,
|
|
461
|
+
z
|
|
462
|
+
);
|
|
463
|
+
(((vt = A == null ? void 0 : A.product_items) == null ? void 0 : vt.length) > 0 || ((Ot = A == null ? void 0 : A.productItems) == null ? void 0 : Ot.length) > 0) && (M.success("Added to cart", {
|
|
464
|
+
position: "bottom-right",
|
|
465
|
+
autoClose: 3e3,
|
|
466
|
+
hideProgressBar: !1,
|
|
467
|
+
closeOnClick: !0,
|
|
468
|
+
pauseOnHover: !0,
|
|
469
|
+
draggable: !0
|
|
470
|
+
}), Ht(ct));
|
|
471
|
+
return;
|
|
497
472
|
}
|
|
498
|
-
const
|
|
473
|
+
const Dt = {
|
|
499
474
|
productItems: [
|
|
500
475
|
{
|
|
501
|
-
productId: ((
|
|
476
|
+
productId: ((Q = e.variants) == null ? void 0 : Q[0].product_id) || ((kt = e.variants) == null ? void 0 : kt[0].productId) || (e == null ? void 0 : e.id),
|
|
502
477
|
quantity: 1
|
|
503
478
|
}
|
|
504
479
|
]
|
|
505
480
|
};
|
|
506
481
|
console.log("before create basket");
|
|
507
|
-
const
|
|
482
|
+
const m = await He(z, Dt);
|
|
508
483
|
if (console.log(
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
484
|
+
m,
|
|
485
|
+
m == null ? void 0 : m.basket_id,
|
|
486
|
+
m == null ? void 0 : m.basketId,
|
|
512
487
|
"the basket response"
|
|
513
|
-
), !(
|
|
488
|
+
), !(m != null && m.basket_id) && !(m != null && m.basketId)) {
|
|
514
489
|
console.error("Failed to create basket");
|
|
515
490
|
return;
|
|
516
491
|
}
|
|
517
492
|
console.log(
|
|
518
493
|
"setting stored id",
|
|
519
|
-
(
|
|
520
|
-
),
|
|
521
|
-
(
|
|
494
|
+
(m == null ? void 0 : m.basket_id) || (m == null ? void 0 : m.basketId)
|
|
495
|
+
), et(
|
|
496
|
+
(m == null ? void 0 : m.basket_id) || (m == null ? void 0 : m.basketId)
|
|
522
497
|
), console.log("adding product to basket");
|
|
523
|
-
const
|
|
524
|
-
(
|
|
525
|
-
|
|
526
|
-
|
|
498
|
+
const J = await Vt(
|
|
499
|
+
(m == null ? void 0 : m.basket_id) || (m == null ? void 0 : m.basketId),
|
|
500
|
+
C,
|
|
501
|
+
z
|
|
527
502
|
);
|
|
528
|
-
console.log("object added to basket"), (((
|
|
503
|
+
console.log("object added to basket"), (((St = J == null ? void 0 : J.product_items) == null ? void 0 : St.length) > 0 || ((lt = J == null ? void 0 : J.productItems) == null ? void 0 : lt.length) > 0) && M.success("Added to cart", {
|
|
529
504
|
position: "bottom-right",
|
|
530
505
|
autoClose: 3e3,
|
|
531
506
|
hideProgressBar: !1,
|
|
532
507
|
closeOnClick: !0,
|
|
533
508
|
pauseOnHover: !0,
|
|
534
509
|
draggable: !0
|
|
535
|
-
}), Ht(
|
|
510
|
+
}), Ht(m.basket_id || (m == null ? void 0 : m.basketId));
|
|
536
511
|
}
|
|
537
|
-
} catch (
|
|
538
|
-
console.error("Error adding to cart:",
|
|
512
|
+
} catch (C) {
|
|
513
|
+
console.error("Error adding to cart:", C), M.error("Failed to add product to cart", {
|
|
539
514
|
position: "bottom-right",
|
|
540
515
|
autoClose: 3e3
|
|
541
|
-
}), ((
|
|
542
|
-
((
|
|
516
|
+
}), ((Pt = C == null ? void 0 : C.response) == null ? void 0 : Pt.status) === 404 || // Basket not found
|
|
517
|
+
(($t = C == null ? void 0 : C.response) == null ? void 0 : $t.status) === 401 ? (((Ct = C == null ? void 0 : C.response) == null ? void 0 : Ct.status) === 404 && et(null), ((O = C == null ? void 0 : C.response) == null ? void 0 : O.status) === 401 && (et(null), Rt(null))) : (console.error("Failed to add product to basket:", C.message), M.error("Failed to add product to cart", {
|
|
543
518
|
position: "bottom-right",
|
|
544
519
|
autoClose: 3e3
|
|
545
520
|
}));
|
|
546
521
|
}
|
|
547
|
-
},
|
|
522
|
+
}, c = () => {
|
|
548
523
|
e && (window.location.href = e.c_pdpUrl);
|
|
549
524
|
};
|
|
550
525
|
return console.log(e, "the prod"), /* @__PURE__ */ u(re, { children: [
|
|
@@ -553,7 +528,7 @@ const xt = (t) => {
|
|
|
553
528
|
{
|
|
554
529
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
555
530
|
onClick: () => {
|
|
556
|
-
n(!1), setTimeout(() => t(oe(null)),
|
|
531
|
+
n(!1), setTimeout(() => t(oe(null)), Se);
|
|
557
532
|
}
|
|
558
533
|
}
|
|
559
534
|
),
|
|
@@ -566,19 +541,19 @@ const xt = (t) => {
|
|
|
566
541
|
${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"}
|
|
567
542
|
`,
|
|
568
543
|
style: { willChange: "transform, opacity" },
|
|
569
|
-
onClick: (
|
|
544
|
+
onClick: (F) => F.stopPropagation(),
|
|
570
545
|
children: [
|
|
571
546
|
/* @__PURE__ */ u("div", { className: "mt-3 flex flex-row justify-between w-full ", children: [
|
|
572
547
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "text-[#000000] font-bold font-nunitoSans", children: e.name }) }),
|
|
573
548
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
574
|
-
|
|
549
|
+
we,
|
|
575
550
|
{
|
|
576
551
|
icon: "mdi:close",
|
|
577
552
|
className: "text-[#555555] w-6 h-6 cursor-pointer",
|
|
578
553
|
onClick: () => {
|
|
579
554
|
n(!1), setTimeout(
|
|
580
555
|
() => t(oe(null)),
|
|
581
|
-
|
|
556
|
+
Se
|
|
582
557
|
);
|
|
583
558
|
}
|
|
584
559
|
}
|
|
@@ -588,20 +563,20 @@ const xt = (t) => {
|
|
|
588
563
|
/* @__PURE__ */ a("div", { className: "flex flex-row items-center justify-center w-[120px] h-[120px] my-5", children: /* @__PURE__ */ a(
|
|
589
564
|
"img",
|
|
590
565
|
{
|
|
591
|
-
src: (
|
|
566
|
+
src: (h = (x = (i = (d = e.imageGroups) == null ? void 0 : d[0]) == null ? void 0 : i.images) == null ? void 0 : x[0]) == null ? void 0 : h.link,
|
|
592
567
|
alt: e.name,
|
|
593
568
|
className: "rounded-[10px]"
|
|
594
569
|
}
|
|
595
570
|
) }),
|
|
596
571
|
/* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-2", children: e.imageGroups.slice(1, 2).map(
|
|
597
|
-
(
|
|
572
|
+
(F) => F.images.slice(1, 2).map((D) => /* @__PURE__ */ a(
|
|
598
573
|
"img",
|
|
599
574
|
{
|
|
600
|
-
src:
|
|
575
|
+
src: D.link,
|
|
601
576
|
alt: e.name,
|
|
602
577
|
className: "rounded-[10px] w-[60px] h-[60px]"
|
|
603
578
|
},
|
|
604
|
-
|
|
579
|
+
D.link
|
|
605
580
|
))
|
|
606
581
|
) })
|
|
607
582
|
] }),
|
|
@@ -644,23 +619,23 @@ const xt = (t) => {
|
|
|
644
619
|
] }),
|
|
645
620
|
/* @__PURE__ */ a("div", { className: "text-[#323135] font-semibold text-sm", children: "Overall Rating" }),
|
|
646
621
|
/* @__PURE__ */ u("div", { className: "text-[#68656E] font-semibold text-sm", children: [
|
|
647
|
-
((
|
|
622
|
+
((_ = e == null ? void 0 : e.rating) == null ? void 0 : _.count) || 0,
|
|
648
623
|
" ratings"
|
|
649
624
|
] })
|
|
650
625
|
] }) }),
|
|
651
|
-
/* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((
|
|
652
|
-
var
|
|
626
|
+
/* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((F, D) => {
|
|
627
|
+
var K;
|
|
653
628
|
return /* @__PURE__ */ a(
|
|
654
|
-
|
|
629
|
+
we,
|
|
655
630
|
{
|
|
656
631
|
icon: "mdi:star",
|
|
657
632
|
width: "20",
|
|
658
633
|
height: "20",
|
|
659
634
|
className: `text-yellow-500
|
|
660
|
-
${((
|
|
635
|
+
${((K = e == null ? void 0 : e.rating) == null ? void 0 : K.rate) > D ? "text-yellow-500" : "text-gray-300"}
|
|
661
636
|
`
|
|
662
637
|
},
|
|
663
|
-
|
|
638
|
+
D
|
|
664
639
|
);
|
|
665
640
|
}) })
|
|
666
641
|
] }),
|
|
@@ -675,7 +650,7 @@ const xt = (t) => {
|
|
|
675
650
|
{
|
|
676
651
|
className: "rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer",
|
|
677
652
|
style: { backgroundColor: r.tanyaThemeColor },
|
|
678
|
-
onClick:
|
|
653
|
+
onClick: l,
|
|
679
654
|
children: "Add to Cart"
|
|
680
655
|
}
|
|
681
656
|
),
|
|
@@ -684,7 +659,7 @@ const xt = (t) => {
|
|
|
684
659
|
{
|
|
685
660
|
className: "rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer mb-16",
|
|
686
661
|
style: { backgroundColor: r.tanyaThemeColor },
|
|
687
|
-
onClick:
|
|
662
|
+
onClick: c,
|
|
688
663
|
children: "View more"
|
|
689
664
|
}
|
|
690
665
|
)
|
|
@@ -695,162 +670,165 @@ const xt = (t) => {
|
|
|
695
670
|
}
|
|
696
671
|
)
|
|
697
672
|
] });
|
|
698
|
-
},
|
|
699
|
-
tanyaConfig: t
|
|
673
|
+
}, Nr = ({
|
|
674
|
+
tanyaConfig: t,
|
|
675
|
+
basketId: e
|
|
700
676
|
}) => {
|
|
701
|
-
const
|
|
677
|
+
const r = [
|
|
702
678
|
"Myself",
|
|
703
679
|
"My Child",
|
|
704
680
|
"My Grandchild",
|
|
705
681
|
"Niece/Nephew",
|
|
706
682
|
"My Friends",
|
|
707
683
|
"Others"
|
|
708
|
-
],
|
|
684
|
+
], o = {
|
|
709
685
|
Myself: "himself/herself",
|
|
710
686
|
"My Child": "his/her child",
|
|
711
687
|
"My Grandchild": "his/her grandchild",
|
|
712
688
|
"Niece/Nephew": "his/her niece/nephew",
|
|
713
689
|
"My Friends": "his/her friends",
|
|
714
690
|
Others: "others"
|
|
715
|
-
},
|
|
716
|
-
id:
|
|
717
|
-
title:
|
|
718
|
-
image:
|
|
719
|
-
price:
|
|
720
|
-
}), [Ct, O] =
|
|
721
|
-
|
|
722
|
-
},
|
|
723
|
-
|
|
691
|
+
}, n = _t(null), l = _t(null), c = _t(null), d = _t(null), [i, x] = $(null), [h, S] = $(!1), [_, F] = $(!1), [D, K] = $(!1), [it, H] = $(!1), [st, vt] = $(!1), [Ot, Q] = $(!1), [kt, St] = $(""), [lt, Pt] = $(""), $t = (s) => ({
|
|
692
|
+
id: s.id,
|
|
693
|
+
title: s.name,
|
|
694
|
+
image: s.image ?? "",
|
|
695
|
+
price: s.price ?? 0
|
|
696
|
+
}), [Ct, O] = $([]), C = _t(null), k = Mt((s) => s.store.store), ct = Mt((s) => s.product.product), Jt = () => {
|
|
697
|
+
K(!0), setTimeout(() => F(!0), 10);
|
|
698
|
+
}, zt = () => {
|
|
699
|
+
F(!1), setTimeout(() => K(!1), 300);
|
|
724
700
|
};
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
}, [
|
|
728
|
-
const jt = (
|
|
729
|
-
|
|
701
|
+
tt(() => {
|
|
702
|
+
h ? Jt() : zt();
|
|
703
|
+
}, [h]);
|
|
704
|
+
const jt = (s) => {
|
|
705
|
+
Pt(o[s]);
|
|
730
706
|
};
|
|
731
|
-
|
|
732
|
-
|
|
707
|
+
tt(() => {
|
|
708
|
+
C.current && (C.current.scrollTop += 150);
|
|
733
709
|
}, [Ct]);
|
|
734
|
-
let
|
|
735
|
-
const
|
|
736
|
-
if (
|
|
737
|
-
return
|
|
710
|
+
let z = null, dt = null;
|
|
711
|
+
const Dt = async () => {
|
|
712
|
+
if (z && dt && Date.now() < dt)
|
|
713
|
+
return z;
|
|
738
714
|
try {
|
|
739
|
-
const
|
|
715
|
+
const s = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token", v = new URLSearchParams({
|
|
740
716
|
grant_type: "client_credentials",
|
|
741
717
|
client_id: "4i8rd70sgt961tc4dhskgf08c",
|
|
742
718
|
client_secret: "bnsfq1220loh2cn2cm2ttn8fdhdpt0u8m1fgj8vfk2rn61aurjg",
|
|
743
719
|
scope: "default-m2m-resource-server-8xzfzo/read"
|
|
744
|
-
}),
|
|
720
|
+
}), w = await fetch(s, {
|
|
745
721
|
method: "POST",
|
|
746
722
|
headers: {
|
|
747
723
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
748
724
|
},
|
|
749
|
-
body:
|
|
725
|
+
body: v
|
|
750
726
|
});
|
|
751
|
-
if (!
|
|
727
|
+
if (!w.ok)
|
|
752
728
|
throw new Error(
|
|
753
|
-
`Token request failed! status: ${
|
|
729
|
+
`Token request failed! status: ${w.status}`
|
|
754
730
|
);
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
const
|
|
758
|
-
return
|
|
759
|
-
} catch (
|
|
760
|
-
return console.error("Error obtaining JWT token:",
|
|
731
|
+
const b = await w.json();
|
|
732
|
+
z = b.access_token;
|
|
733
|
+
const p = b.expires_in || 3600;
|
|
734
|
+
return dt = Date.now() + (p - 60) * 1e3, z;
|
|
735
|
+
} catch (s) {
|
|
736
|
+
return console.error("Error obtaining JWT token:", s), z = null, dt = null, null;
|
|
761
737
|
}
|
|
762
|
-
},
|
|
763
|
-
const
|
|
764
|
-
|
|
738
|
+
}, m = async () => {
|
|
739
|
+
const s = await Tt();
|
|
740
|
+
s != null && x(s);
|
|
765
741
|
};
|
|
766
|
-
|
|
742
|
+
tt(() => {
|
|
767
743
|
if (t != null && t.siteId) {
|
|
768
|
-
const { clientID:
|
|
769
|
-
sessionStorage.setItem("Host",
|
|
744
|
+
const { clientID: s, host: v, organizationID: w, shortCode: b, siteId: p } = t;
|
|
745
|
+
sessionStorage.setItem("Host", v), sessionStorage.setItem("SiteId", p), sessionStorage.setItem("pubCfg", btoa(s)), sessionStorage.setItem("envRef", b), sessionStorage.setItem("orgRef", w);
|
|
770
746
|
}
|
|
771
|
-
|
|
772
|
-
}, [])
|
|
773
|
-
|
|
774
|
-
|
|
747
|
+
m(), console.log("scapi environment v1");
|
|
748
|
+
}, []), tt(() => {
|
|
749
|
+
e && (console.log("setting the basket id", e), et(e));
|
|
750
|
+
}, [e]);
|
|
751
|
+
const J = async () => {
|
|
752
|
+
const s = JSON.parse(
|
|
775
753
|
sessionStorage.getItem("customerData") || "{}"
|
|
776
754
|
).customerId;
|
|
777
|
-
return (await
|
|
778
|
-
},
|
|
755
|
+
return (await yr(s || "")).c_interests;
|
|
756
|
+
}, A = async (s, v) => {
|
|
779
757
|
console.log("in secondary flow", Ft);
|
|
780
|
-
const
|
|
781
|
-
if (console.log(
|
|
758
|
+
const w = await J();
|
|
759
|
+
if (console.log(w, "interests of customer", Ft), !!w)
|
|
782
760
|
try {
|
|
783
761
|
O(
|
|
784
|
-
(
|
|
785
|
-
(V,
|
|
762
|
+
(U) => U.map(
|
|
763
|
+
(V, Y) => Y === U.length - 1 ? { ...V, secondaryLoading: !0 } : V
|
|
786
764
|
)
|
|
787
765
|
);
|
|
788
|
-
const
|
|
789
|
-
if (!
|
|
790
|
-
const
|
|
791
|
-
registered: String(
|
|
792
|
-
userId: String(
|
|
766
|
+
const b = await Dt();
|
|
767
|
+
if (!b) throw new Error("Failed to fetch token");
|
|
768
|
+
const p = localStorage.getItem("customerNumber"), g = localStorage.getItem("isLoggedIn"), ut = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
769
|
+
registered: String(g || !1),
|
|
770
|
+
userId: String(p || (/* @__PURE__ */ new Date()).getTime())
|
|
793
771
|
}).toString()}`, pt = JSON.stringify({
|
|
794
772
|
flowId: "Q166PR519W",
|
|
795
773
|
flowAliasId: "HKFUVLWVH2",
|
|
796
774
|
input: {
|
|
797
775
|
loyaltyPoints: "",
|
|
798
|
-
productName:
|
|
799
|
-
productPoints: String(
|
|
800
|
-
interests:
|
|
776
|
+
productName: s,
|
|
777
|
+
productPoints: String(v || 0),
|
|
778
|
+
interests: w
|
|
801
779
|
}
|
|
802
|
-
}),
|
|
780
|
+
}), L = await fetch(ut, {
|
|
803
781
|
signal: AbortSignal.timeout(3e4),
|
|
804
782
|
method: "POST",
|
|
805
783
|
headers: {
|
|
806
784
|
"Content-Type": "application/json",
|
|
807
|
-
Authorization: `Bearer ${
|
|
785
|
+
Authorization: `Bearer ${b}`
|
|
808
786
|
},
|
|
809
787
|
body: pt
|
|
810
788
|
});
|
|
811
|
-
if (!
|
|
812
|
-
const ft =
|
|
813
|
-
let
|
|
789
|
+
if (!L.body) throw new Error("Readable stream not supported");
|
|
790
|
+
const ft = L.body.getReader(), mt = new TextDecoder();
|
|
791
|
+
let B = "";
|
|
814
792
|
for (; ; ) {
|
|
815
|
-
const { done:
|
|
816
|
-
if (
|
|
817
|
-
|
|
818
|
-
const
|
|
793
|
+
const { done: U, value: V } = await ft.read();
|
|
794
|
+
if (U) break;
|
|
795
|
+
B += mt.decode(V, { stream: !0 });
|
|
796
|
+
const Y = B.split(`
|
|
819
797
|
`);
|
|
820
|
-
|
|
821
|
-
for (const
|
|
822
|
-
if (
|
|
823
|
-
const
|
|
798
|
+
B = Y.pop() || "";
|
|
799
|
+
for (const W of Y)
|
|
800
|
+
if (W.startsWith("data:")) {
|
|
801
|
+
const f = W.slice(5).trim();
|
|
824
802
|
try {
|
|
825
|
-
const
|
|
826
|
-
|
|
803
|
+
const q = JSON.parse(f);
|
|
804
|
+
q.index === 0 && O(
|
|
827
805
|
(I) => I.map(
|
|
828
|
-
(
|
|
829
|
-
...
|
|
830
|
-
secondaryResponse:
|
|
806
|
+
(P, G) => G === I.length - 1 ? {
|
|
807
|
+
...P,
|
|
808
|
+
secondaryResponse: q.data,
|
|
831
809
|
secondaryLoading: !1
|
|
832
|
-
} :
|
|
810
|
+
} : P
|
|
833
811
|
)
|
|
834
812
|
);
|
|
835
|
-
} catch (
|
|
813
|
+
} catch (q) {
|
|
836
814
|
O(
|
|
837
815
|
(I) => I.map(
|
|
838
|
-
(
|
|
816
|
+
(P, G) => G === I.length - 1 ? { ...P, secondaryLoading: !1 } : P
|
|
839
817
|
)
|
|
840
|
-
), console.error("Secondary flow JSON parse error:",
|
|
818
|
+
), console.error("Secondary flow JSON parse error:", q);
|
|
841
819
|
}
|
|
842
820
|
}
|
|
843
821
|
}
|
|
844
|
-
} catch (
|
|
845
|
-
console.error("Secondary flow error:",
|
|
822
|
+
} catch (b) {
|
|
823
|
+
console.error("Secondary flow error:", b);
|
|
846
824
|
}
|
|
847
|
-
},
|
|
848
|
-
const
|
|
849
|
-
if (
|
|
850
|
-
vt(!0), St(""),
|
|
851
|
-
...
|
|
825
|
+
}, Wt = async (s) => {
|
|
826
|
+
const v = s || kt.trim();
|
|
827
|
+
if (v) {
|
|
828
|
+
vt(!0), St(""), n.current = null, l.current = null, c.current = null, d.current = null, O((w) => [
|
|
829
|
+
...w,
|
|
852
830
|
{
|
|
853
|
-
query:
|
|
831
|
+
query: v,
|
|
854
832
|
response: "Thinking for what suits you best...",
|
|
855
833
|
potentialQuestions: "",
|
|
856
834
|
products: [],
|
|
@@ -858,52 +836,52 @@ const xt = (t) => {
|
|
|
858
836
|
}
|
|
859
837
|
]);
|
|
860
838
|
try {
|
|
861
|
-
const
|
|
862
|
-
if (!
|
|
839
|
+
const w = lt, b = localStorage.getItem("customerNumber"), p = localStorage.getItem("isLoggedIn"), g = await Dt();
|
|
840
|
+
if (!g)
|
|
863
841
|
throw new Error("Failed to obtain access token");
|
|
864
842
|
const ut = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
865
|
-
registered: String(
|
|
866
|
-
userId: String(
|
|
843
|
+
registered: String(p || !1),
|
|
844
|
+
userId: String(b || (/* @__PURE__ */ new Date()).getTime())
|
|
867
845
|
}).toString()}`, pt = JSON.stringify({
|
|
868
846
|
flowId: "MMHQKYI1NE",
|
|
869
847
|
flowAliasId: "SZF9ZK1ATE",
|
|
870
848
|
input: {
|
|
871
|
-
userPrompt:
|
|
872
|
-
whom:
|
|
849
|
+
userPrompt: v,
|
|
850
|
+
whom: w
|
|
873
851
|
}
|
|
874
|
-
}),
|
|
852
|
+
}), L = await fetch(ut, {
|
|
875
853
|
signal: AbortSignal.timeout(3e4),
|
|
876
854
|
method: "POST",
|
|
877
855
|
headers: {
|
|
878
856
|
"Content-Type": "application/json",
|
|
879
|
-
Authorization: `Bearer ${
|
|
857
|
+
Authorization: `Bearer ${g}`
|
|
880
858
|
},
|
|
881
859
|
body: pt
|
|
882
860
|
});
|
|
883
|
-
if (!
|
|
884
|
-
throw new Error(`HTTP error! status: ${
|
|
885
|
-
if (!
|
|
886
|
-
const ft =
|
|
887
|
-
let
|
|
861
|
+
if (!L.ok)
|
|
862
|
+
throw new Error(`HTTP error! status: ${L.status}`);
|
|
863
|
+
if (!L.body) throw new Error("Readable stream not supported");
|
|
864
|
+
const ft = L.body.getReader(), mt = new TextDecoder();
|
|
865
|
+
let B = "", U = "";
|
|
888
866
|
for (; ; ) {
|
|
889
|
-
|
|
890
|
-
const { done: V, value:
|
|
867
|
+
Q(!0);
|
|
868
|
+
const { done: V, value: Y } = await ft.read();
|
|
891
869
|
if (V) break;
|
|
892
|
-
|
|
893
|
-
const
|
|
870
|
+
B += mt.decode(Y, { stream: !0 });
|
|
871
|
+
const W = B.split(`
|
|
894
872
|
`);
|
|
895
|
-
|
|
896
|
-
for (const
|
|
897
|
-
if (
|
|
898
|
-
const
|
|
873
|
+
B = W.pop() || "";
|
|
874
|
+
for (const f of W)
|
|
875
|
+
if (f.startsWith("data:")) {
|
|
876
|
+
const q = f.slice(5).trim();
|
|
899
877
|
try {
|
|
900
|
-
const I = JSON.parse(
|
|
901
|
-
I.index == 1 && (
|
|
902
|
-
(
|
|
903
|
-
(
|
|
904
|
-
...
|
|
878
|
+
const I = JSON.parse(q);
|
|
879
|
+
I.index == 1 && (U = I.data), O(
|
|
880
|
+
(P) => P.map(
|
|
881
|
+
(G, At) => At === P.length - 1 ? {
|
|
882
|
+
...G,
|
|
905
883
|
[I.index == 0 ? "response" : I.index == 1 ? "keywords" : I.index == 2 ? "potentialQuestions" : "end"]: I.data
|
|
906
|
-
} :
|
|
884
|
+
} : G
|
|
907
885
|
)
|
|
908
886
|
);
|
|
909
887
|
} catch (I) {
|
|
@@ -911,183 +889,177 @@ const xt = (t) => {
|
|
|
911
889
|
}
|
|
912
890
|
}
|
|
913
891
|
}
|
|
914
|
-
|
|
915
|
-
} catch (
|
|
916
|
-
console.error("Error sending message to Tanya:",
|
|
892
|
+
tr(Ze(U));
|
|
893
|
+
} catch (w) {
|
|
894
|
+
console.error("Error sending message to Tanya:", w);
|
|
917
895
|
} finally {
|
|
918
896
|
vt(!1);
|
|
919
897
|
}
|
|
920
898
|
}
|
|
921
|
-
},
|
|
922
|
-
const
|
|
899
|
+
}, Ze = (s) => {
|
|
900
|
+
const v = s.match(
|
|
923
901
|
/top five relevant product or category names are: (.*)/i
|
|
924
|
-
),
|
|
925
|
-
return [...new Set(
|
|
926
|
-
},
|
|
927
|
-
if (typeof
|
|
928
|
-
console.log(
|
|
929
|
-
const
|
|
930
|
-
for (const
|
|
931
|
-
const
|
|
932
|
-
if (
|
|
933
|
-
(
|
|
934
|
-
(
|
|
935
|
-
...
|
|
902
|
+
), p = (v ? v[1] : s).split(", ").map((j) => j.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
|
|
903
|
+
return [...new Set(p)].filter(Boolean).join(",");
|
|
904
|
+
}, tr = async (s) => {
|
|
905
|
+
if (typeof s == "string") {
|
|
906
|
+
console.log(s, "keywords");
|
|
907
|
+
const v = s.split(",");
|
|
908
|
+
for (const w of v) {
|
|
909
|
+
const b = await ge(w);
|
|
910
|
+
if (Q(!1), (b == null ? void 0 : b.length) > 0 && (O(
|
|
911
|
+
(p) => p.map(
|
|
912
|
+
(g, j) => j === p.length - 1 ? {
|
|
913
|
+
...g,
|
|
936
914
|
products: [
|
|
937
|
-
...
|
|
938
|
-
{ keyword:
|
|
915
|
+
...g.products || [],
|
|
916
|
+
{ keyword: w, items: b, loading: !1 }
|
|
939
917
|
]
|
|
940
|
-
} :
|
|
918
|
+
} : g
|
|
941
919
|
)
|
|
942
|
-
), !
|
|
943
|
-
const
|
|
944
|
-
|
|
945
|
-
const
|
|
946
|
-
|
|
920
|
+
), !n.current || l.current == null)) {
|
|
921
|
+
const p = b[0];
|
|
922
|
+
n.current = String((p == null ? void 0 : p.product_name) ?? ""), c.current = p.image.link, l.current = p.product_id;
|
|
923
|
+
const g = typeof (p == null ? void 0 : p.price) == "number" ? p.price : void 0;
|
|
924
|
+
d.current = typeof g == "number" && Number.isFinite(g) ? g : null;
|
|
947
925
|
}
|
|
948
926
|
}
|
|
949
927
|
} else
|
|
950
|
-
for (const
|
|
951
|
-
const
|
|
952
|
-
|
|
953
|
-
(
|
|
954
|
-
(
|
|
955
|
-
...
|
|
928
|
+
for (const v of s) {
|
|
929
|
+
const w = await ge(v);
|
|
930
|
+
Q(!1), (w == null ? void 0 : w.length) > 0 && O(
|
|
931
|
+
(b) => b.map(
|
|
932
|
+
(p, g) => g === b.length - 1 ? {
|
|
933
|
+
...p,
|
|
956
934
|
products: [
|
|
957
|
-
...
|
|
958
|
-
{ keyword:
|
|
935
|
+
...p.products || [],
|
|
936
|
+
{ keyword: v, items: w, loading: !1 }
|
|
959
937
|
]
|
|
960
|
-
} :
|
|
938
|
+
} : p
|
|
961
939
|
)
|
|
962
940
|
);
|
|
963
941
|
}
|
|
964
|
-
if (
|
|
942
|
+
if (n.current) {
|
|
965
943
|
O(
|
|
966
|
-
(
|
|
967
|
-
(
|
|
968
|
-
...
|
|
944
|
+
(w) => w.map(
|
|
945
|
+
(b, p) => p === w.length - 1 ? {
|
|
946
|
+
...b,
|
|
969
947
|
productSnapshot: {
|
|
970
|
-
id:
|
|
971
|
-
name:
|
|
972
|
-
image:
|
|
973
|
-
price:
|
|
948
|
+
id: l.current,
|
|
949
|
+
name: n.current,
|
|
950
|
+
image: c.current,
|
|
951
|
+
price: d.current ?? null,
|
|
974
952
|
points: 0,
|
|
975
953
|
quantity: 1
|
|
976
954
|
}
|
|
977
|
-
} :
|
|
955
|
+
} : b
|
|
978
956
|
)
|
|
979
957
|
);
|
|
980
|
-
const
|
|
958
|
+
const v = JSON.parse(
|
|
981
959
|
sessionStorage.getItem("customerData") || "{}"
|
|
982
960
|
);
|
|
983
|
-
(
|
|
961
|
+
(v == null ? void 0 : v.isGuest) == !1 ? (console.log("running secondary flow", Ft), A(n.current, 0)) : console.log("not running secondary flow", Ft);
|
|
984
962
|
}
|
|
985
|
-
|
|
986
|
-
},
|
|
987
|
-
var
|
|
963
|
+
Q(!1);
|
|
964
|
+
}, er = async (s, v) => {
|
|
965
|
+
var w, b, p, g, j, ut, pt, L, ft, mt, B, U, V, Y, W;
|
|
988
966
|
H(!0);
|
|
989
967
|
try {
|
|
990
|
-
const
|
|
991
|
-
if (!((
|
|
992
|
-
H(!1),
|
|
968
|
+
const f = await Me(s.id);
|
|
969
|
+
if (!((b = (w = f == null ? void 0 : f.variants) == null ? void 0 : w[0]) != null && b.product_id || (g = (p = f == null ? void 0 : f.variants) == null ? void 0 : p[0]) != null && g.productId) && !(f.type.item || f.type.bundle)) {
|
|
970
|
+
H(!1), M.error("Variants not found", {
|
|
993
971
|
position: "bottom-right",
|
|
994
972
|
autoClose: 1e3
|
|
995
973
|
}), console.error("No product variant found");
|
|
996
974
|
return;
|
|
997
975
|
}
|
|
998
|
-
const
|
|
976
|
+
const q = [
|
|
999
977
|
{
|
|
1000
|
-
product_id: ((
|
|
1001
|
-
quantity:
|
|
978
|
+
product_id: ((j = f.variants) == null ? void 0 : j[0].product_id) || ((ut = f.variants) == null ? void 0 : ut[0].productId) || (f == null ? void 0 : f.id),
|
|
979
|
+
quantity: v
|
|
1002
980
|
}
|
|
1003
981
|
];
|
|
1004
|
-
console.log(
|
|
982
|
+
console.log(q, "product data", "app version", Ft);
|
|
1005
983
|
const I = JSON.parse(
|
|
1006
984
|
sessionStorage.getItem("customerData") || "{}"
|
|
1007
|
-
),
|
|
1008
|
-
if (!
|
|
1009
|
-
const
|
|
1010
|
-
let { customer_token:
|
|
1011
|
-
|
|
985
|
+
), P = (I == null ? void 0 : I.basketId) || localStorage.getItem(Yt), G = !1, At = localStorage.getItem(Et), he = Date.now();
|
|
986
|
+
if (!G || !At || he >= parseInt(At)) {
|
|
987
|
+
const rr = await Ue();
|
|
988
|
+
let { customer_token: ht } = await qe(
|
|
989
|
+
rr
|
|
1012
990
|
);
|
|
1013
|
-
if (
|
|
991
|
+
if (ht = "Bearer " + i.access_token, !ht) {
|
|
1014
992
|
console.error("Failed to get customer_token");
|
|
1015
993
|
return;
|
|
1016
994
|
}
|
|
1017
|
-
const
|
|
1018
|
-
if (
|
|
1019
|
-
const
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
closeOnClick: !0,
|
|
1034
|
-
pauseOnHover: !0,
|
|
1035
|
-
draggable: !0
|
|
1036
|
-
}), Ht(T), H(!1));
|
|
1037
|
-
return;
|
|
1038
|
-
}
|
|
995
|
+
const or = he + 300 * 1e3;
|
|
996
|
+
if (Rt(ht), localStorage.setItem(Et, or.toString()), console.log(P, "basketIdFromCustomer"), P) {
|
|
997
|
+
const Gt = await Vt(
|
|
998
|
+
P,
|
|
999
|
+
q,
|
|
1000
|
+
ht
|
|
1001
|
+
);
|
|
1002
|
+
((pt = Gt == null ? void 0 : Gt.product_items) == null ? void 0 : pt.length) > 0 && (M.success("Added to cart", {
|
|
1003
|
+
position: "bottom-right",
|
|
1004
|
+
autoClose: 3e3,
|
|
1005
|
+
hideProgressBar: !1,
|
|
1006
|
+
closeOnClick: !0,
|
|
1007
|
+
pauseOnHover: !0,
|
|
1008
|
+
draggable: !0
|
|
1009
|
+
}), Ht(P), H(!1));
|
|
1010
|
+
return;
|
|
1039
1011
|
}
|
|
1040
|
-
const
|
|
1012
|
+
const nr = {
|
|
1041
1013
|
productItems: [
|
|
1042
1014
|
{
|
|
1043
|
-
productId: ((
|
|
1015
|
+
productId: ((L = f.variants) == null ? void 0 : L[0].product_id) || ((ft = f.variants) == null ? void 0 : ft[0].productId) || (f == null ? void 0 : f.id),
|
|
1044
1016
|
quantity: 1
|
|
1045
1017
|
}
|
|
1046
1018
|
]
|
|
1047
|
-
},
|
|
1019
|
+
}, y = await He(ht, nr);
|
|
1048
1020
|
if (console.log(
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1021
|
+
y,
|
|
1022
|
+
y == null ? void 0 : y.basket_id,
|
|
1023
|
+
y == null ? void 0 : y.basketId,
|
|
1052
1024
|
"the basket response"
|
|
1053
|
-
), !(
|
|
1025
|
+
), !(y != null && y.basket_id || !(y != null && y.basketId))) {
|
|
1054
1026
|
H(!1), console.error("Failed to create basket");
|
|
1055
1027
|
return;
|
|
1056
1028
|
}
|
|
1057
|
-
|
|
1058
|
-
(
|
|
1029
|
+
et(
|
|
1030
|
+
(y == null ? void 0 : y.basket_id) || (y == null ? void 0 : y.basketId)
|
|
1059
1031
|
);
|
|
1060
|
-
const
|
|
1061
|
-
(
|
|
1062
|
-
|
|
1063
|
-
|
|
1032
|
+
const wt = await Vt(
|
|
1033
|
+
(y == null ? void 0 : y.basket_id) || (y == null ? void 0 : y.basketId),
|
|
1034
|
+
q,
|
|
1035
|
+
ht
|
|
1064
1036
|
);
|
|
1065
|
-
(((mt =
|
|
1037
|
+
(((mt = wt == null ? void 0 : wt.product_items) == null ? void 0 : mt.length) > 0 || ((B = wt == null ? void 0 : wt.productItems) == null ? void 0 : B.length) > 0) && M.success("Added to cart", {
|
|
1066
1038
|
position: "bottom-right",
|
|
1067
1039
|
autoClose: 3e3,
|
|
1068
1040
|
hideProgressBar: !1,
|
|
1069
1041
|
closeOnClick: !0,
|
|
1070
1042
|
pauseOnHover: !0,
|
|
1071
1043
|
draggable: !0
|
|
1072
|
-
}), Ht(
|
|
1044
|
+
}), Ht(y.basket_id || (y == null ? void 0 : y.basketId));
|
|
1073
1045
|
}
|
|
1074
|
-
} catch (
|
|
1075
|
-
H(!1), console.error("Error adding to cart:",
|
|
1046
|
+
} catch (f) {
|
|
1047
|
+
H(!1), console.error("Error adding to cart:", f), M.error("Failed to add product to cart", {
|
|
1076
1048
|
position: "bottom-right",
|
|
1077
1049
|
autoClose: 3e3
|
|
1078
|
-
}), ((
|
|
1079
|
-
((V =
|
|
1050
|
+
}), ((U = f == null ? void 0 : f.response) == null ? void 0 : U.status) === 404 || // Basket not found
|
|
1051
|
+
((V = f == null ? void 0 : f.response) == null ? void 0 : V.status) === 401 ? (((Y = f == null ? void 0 : f.response) == null ? void 0 : Y.status) === 404 && et(null), ((W = f == null ? void 0 : f.response) == null ? void 0 : W.status) === 401 && (et(null), Rt(null))) : (console.error("Failed to add product to basket:", f.message), M.error("Failed to add product to cart", {
|
|
1080
1052
|
position: "bottom-right",
|
|
1081
1053
|
autoClose: 3e3
|
|
1082
1054
|
}));
|
|
1083
1055
|
}
|
|
1084
1056
|
H(!1);
|
|
1085
1057
|
};
|
|
1086
|
-
return /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ u(xr, { open:
|
|
1058
|
+
return /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ u(xr, { open: h, onOpenChange: S, children: [
|
|
1087
1059
|
/* @__PURE__ */ a(
|
|
1088
|
-
|
|
1060
|
+
br,
|
|
1089
1061
|
{
|
|
1090
|
-
onClick: () =>
|
|
1062
|
+
onClick: () => S(!0),
|
|
1091
1063
|
style: {
|
|
1092
1064
|
// background: storeDetails.tanyaThemeColor,
|
|
1093
1065
|
},
|
|
@@ -1147,12 +1119,12 @@ const xt = (t) => {
|
|
|
1147
1119
|
) })
|
|
1148
1120
|
}
|
|
1149
1121
|
),
|
|
1150
|
-
|
|
1122
|
+
D && /* @__PURE__ */ u(re, { children: [
|
|
1151
1123
|
/* @__PURE__ */ a(
|
|
1152
1124
|
"div",
|
|
1153
1125
|
{
|
|
1154
1126
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
1155
|
-
onClick: () =>
|
|
1127
|
+
onClick: () => S(!1)
|
|
1156
1128
|
}
|
|
1157
1129
|
),
|
|
1158
1130
|
/* @__PURE__ */ u(
|
|
@@ -1163,9 +1135,9 @@ const xt = (t) => {
|
|
|
1163
1135
|
top-0 right-0
|
|
1164
1136
|
transition-transform duration-300 ease-in-out
|
|
1165
1137
|
lg:transform
|
|
1166
|
-
${
|
|
1138
|
+
${_ ? "lg:translate-x-0" : "lg:translate-x-full"}
|
|
1167
1139
|
// For mobile: animate from bottom
|
|
1168
|
-
${
|
|
1140
|
+
${_ ? "translate-y-0" : "translate-y-full"}
|
|
1169
1141
|
lg:translate-y-0
|
|
1170
1142
|
`,
|
|
1171
1143
|
style: {
|
|
@@ -1182,7 +1154,7 @@ const xt = (t) => {
|
|
|
1182
1154
|
{
|
|
1183
1155
|
style: {
|
|
1184
1156
|
display: "flex",
|
|
1185
|
-
color:
|
|
1157
|
+
color: k.tanyaThemeContrastColor,
|
|
1186
1158
|
alignItems: "center",
|
|
1187
1159
|
gap: "0.5rem"
|
|
1188
1160
|
},
|
|
@@ -1243,7 +1215,7 @@ const xt = (t) => {
|
|
|
1243
1215
|
gap: "1.25rem",
|
|
1244
1216
|
margin: "0.75rem"
|
|
1245
1217
|
},
|
|
1246
|
-
children: /* @__PURE__ */ a("button", { onClick: () =>
|
|
1218
|
+
children: /* @__PURE__ */ a("button", { onClick: () => S(!1), children: /* @__PURE__ */ u(
|
|
1247
1219
|
"svg",
|
|
1248
1220
|
{
|
|
1249
1221
|
width: "24",
|
|
@@ -1295,46 +1267,46 @@ const xt = (t) => {
|
|
|
1295
1267
|
/* @__PURE__ */ u(
|
|
1296
1268
|
"div",
|
|
1297
1269
|
{
|
|
1298
|
-
className: `flex flex-col h-full ${
|
|
1270
|
+
className: `flex flex-col h-full ${ct ? "lg:w-2/3 w-full" : "w-full"}`,
|
|
1299
1271
|
children: [
|
|
1300
1272
|
/* @__PURE__ */ u(
|
|
1301
1273
|
"div",
|
|
1302
1274
|
{
|
|
1303
|
-
ref:
|
|
1275
|
+
ref: C,
|
|
1304
1276
|
className: "overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",
|
|
1305
1277
|
children: [
|
|
1306
|
-
(
|
|
1278
|
+
(k == null ? void 0 : k.whomRequired) && /* @__PURE__ */ u(
|
|
1307
1279
|
"div",
|
|
1308
1280
|
{
|
|
1309
1281
|
className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
|
|
1310
1282
|
children: [
|
|
1311
1283
|
/* @__PURE__ */ a("div", { className: "flex gap-2 bg-[#FFFFFF]", children: /* @__PURE__ */ a("p", { className: "font-bold font-nunitoSans text-[#494949]", children: "Is this for you or someone else?" }) }),
|
|
1312
|
-
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children:
|
|
1284
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: r.map((s) => /* @__PURE__ */ a(
|
|
1313
1285
|
"button",
|
|
1314
1286
|
{
|
|
1315
|
-
onClick: () => jt(
|
|
1287
|
+
onClick: () => jt(s),
|
|
1316
1288
|
className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
|
|
1317
1289
|
style: {
|
|
1318
|
-
backgroundColor:
|
|
1319
|
-
borderColor:
|
|
1290
|
+
backgroundColor: lt === o[s] ? "#FFFFFF" : "#F3F3F3",
|
|
1291
|
+
borderColor: lt === o[s] ? "#BBB3DD" : ""
|
|
1320
1292
|
},
|
|
1321
|
-
children:
|
|
1293
|
+
children: s
|
|
1322
1294
|
},
|
|
1323
|
-
|
|
1295
|
+
s
|
|
1324
1296
|
)) })
|
|
1325
1297
|
]
|
|
1326
1298
|
}
|
|
1327
1299
|
),
|
|
1328
|
-
Ct.map((
|
|
1329
|
-
var
|
|
1300
|
+
Ct.map((s, v) => {
|
|
1301
|
+
var w, b;
|
|
1330
1302
|
return /* @__PURE__ */ u("div", { children: [
|
|
1331
|
-
/* @__PURE__ */ a("div", { className: "flex justify-end", children: /* @__PURE__ */ a("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:
|
|
1332
|
-
|
|
1303
|
+
/* @__PURE__ */ a("div", { className: "flex justify-end", children: /* @__PURE__ */ a("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: s.query }) }),
|
|
1304
|
+
s.response && s.response.includes("Thinking") ? /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
1333
1305
|
"div",
|
|
1334
1306
|
{
|
|
1335
1307
|
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",
|
|
1336
1308
|
dangerouslySetInnerHTML: {
|
|
1337
|
-
__html: Xt(
|
|
1309
|
+
__html: Xt(s.response)
|
|
1338
1310
|
}
|
|
1339
1311
|
}
|
|
1340
1312
|
) }) : /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
@@ -1342,41 +1314,41 @@ const xt = (t) => {
|
|
|
1342
1314
|
{
|
|
1343
1315
|
className: "font-nunitoSans font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
|
|
1344
1316
|
dangerouslySetInnerHTML: {
|
|
1345
|
-
__html: Xt(
|
|
1317
|
+
__html: Xt(s.response)
|
|
1346
1318
|
}
|
|
1347
1319
|
}
|
|
1348
1320
|
) }),
|
|
1349
|
-
|
|
1350
|
-
(
|
|
1351
|
-
|
|
1321
|
+
Ot && !s.response.includes("Thinking") && ((w = s.products) == null ? void 0 : w.length) == 0 && /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("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" }) }),
|
|
1322
|
+
(s == null ? void 0 : s.products) && ((b = s == null ? void 0 : s.products) == null ? void 0 : b.length) > 0 && /* @__PURE__ */ a(
|
|
1323
|
+
_r,
|
|
1352
1324
|
{
|
|
1353
|
-
chat:
|
|
1354
|
-
storeDetails:
|
|
1325
|
+
chat: s.products,
|
|
1326
|
+
storeDetails: k
|
|
1355
1327
|
}
|
|
1356
1328
|
),
|
|
1357
|
-
|
|
1329
|
+
s.potentialQuestions.length > 0 && /* @__PURE__ */ u("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
|
|
1358
1330
|
/* @__PURE__ */ a(
|
|
1359
1331
|
"p",
|
|
1360
1332
|
{
|
|
1361
1333
|
className: "font-nunitoSans font-bold text-sm text-[#494949]",
|
|
1362
|
-
style: { color:
|
|
1334
|
+
style: { color: k.themeDarkColor },
|
|
1363
1335
|
children: "Why not explore these inquiries..."
|
|
1364
1336
|
}
|
|
1365
1337
|
),
|
|
1366
|
-
|
|
1338
|
+
s.potentialQuestions.split(",").map((p, g) => /* @__PURE__ */ a(
|
|
1367
1339
|
"button",
|
|
1368
1340
|
{
|
|
1369
|
-
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${
|
|
1370
|
-
onClick: () =>
|
|
1341
|
+
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${k.themeDarkColor} m-1 rounded-xl px-2 py-1`,
|
|
1342
|
+
onClick: () => Wt(p),
|
|
1371
1343
|
style: {
|
|
1372
|
-
backgroundColor:
|
|
1344
|
+
backgroundColor: k.tanyaThemeColorLight
|
|
1373
1345
|
},
|
|
1374
|
-
children:
|
|
1346
|
+
children: p
|
|
1375
1347
|
},
|
|
1376
|
-
|
|
1348
|
+
g
|
|
1377
1349
|
))
|
|
1378
1350
|
] }),
|
|
1379
|
-
|
|
1351
|
+
s.secondaryLoading && /* @__PURE__ */ a("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ u(
|
|
1380
1352
|
"div",
|
|
1381
1353
|
{
|
|
1382
1354
|
className: "tanya-surprise-wrapper bg-indigo-300 text-sm px-7 py-4 rounded-r-xl rounded-bl-2xl w-full relative overflow-hidden",
|
|
@@ -1394,7 +1366,7 @@ const xt = (t) => {
|
|
|
1394
1366
|
"p",
|
|
1395
1367
|
{
|
|
1396
1368
|
className: "font-semibold tanya-pulse",
|
|
1397
|
-
style: { color:
|
|
1369
|
+
style: { color: k.themeDarkColor },
|
|
1398
1370
|
children: "I’ve found a special surprise crafted just for you… hang on a sec!"
|
|
1399
1371
|
}
|
|
1400
1372
|
),
|
|
@@ -1402,35 +1374,35 @@ const xt = (t) => {
|
|
|
1402
1374
|
"p",
|
|
1403
1375
|
{
|
|
1404
1376
|
className: "tanya-dots mt-1",
|
|
1405
|
-
style: { color:
|
|
1377
|
+
style: { color: k.themeDarkColor },
|
|
1406
1378
|
children: "• • •"
|
|
1407
1379
|
}
|
|
1408
1380
|
)
|
|
1409
1381
|
]
|
|
1410
1382
|
}
|
|
1411
1383
|
) }),
|
|
1412
|
-
|
|
1384
|
+
s.secondaryResponse && /* @__PURE__ */ a(re, { children: /* @__PURE__ */ u("div", { className: "mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]", children: [
|
|
1413
1385
|
/* @__PURE__ */ a(
|
|
1414
1386
|
"div",
|
|
1415
1387
|
{
|
|
1416
1388
|
className: "text-sm text-[#232323] bg-[#FFFFFF] px-7 py-4 rounded-br-xl rounded-bl-2xl w-full",
|
|
1417
1389
|
style: {
|
|
1418
|
-
backgroundColor:
|
|
1390
|
+
backgroundColor: k.tanyaThemeColorLight
|
|
1419
1391
|
},
|
|
1420
1392
|
dangerouslySetInnerHTML: {
|
|
1421
1393
|
__html: Xt(
|
|
1422
|
-
|
|
1394
|
+
s.secondaryResponse
|
|
1423
1395
|
)
|
|
1424
1396
|
}
|
|
1425
1397
|
}
|
|
1426
1398
|
),
|
|
1427
|
-
|
|
1399
|
+
s.productSnapshot && // chat.productSnapshot.points > 0 &&
|
|
1428
1400
|
/* @__PURE__ */ a("div", { className: "mt-4 w-full", children: /* @__PURE__ */ u(
|
|
1429
1401
|
"div",
|
|
1430
1402
|
{
|
|
1431
1403
|
className: "flex gap-4 items-stretch rounded-2xl p-4",
|
|
1432
1404
|
style: {
|
|
1433
|
-
backgroundColor:
|
|
1405
|
+
backgroundColor: k.tanyaThemeColorLight
|
|
1434
1406
|
},
|
|
1435
1407
|
children: [
|
|
1436
1408
|
/* @__PURE__ */ a(
|
|
@@ -1442,11 +1414,11 @@ const xt = (t) => {
|
|
|
1442
1414
|
height: 112,
|
|
1443
1415
|
borderColor: "#eee"
|
|
1444
1416
|
},
|
|
1445
|
-
children:
|
|
1417
|
+
children: s.productSnapshot.image ? /* @__PURE__ */ a(
|
|
1446
1418
|
"img",
|
|
1447
1419
|
{
|
|
1448
|
-
src:
|
|
1449
|
-
alt:
|
|
1420
|
+
src: s.productSnapshot.image,
|
|
1421
|
+
alt: s.productSnapshot.name,
|
|
1450
1422
|
className: "w-full h-full object-cover"
|
|
1451
1423
|
}
|
|
1452
1424
|
) : /* @__PURE__ */ a("div", { className: "w-full h-full flex items-center justify-center text-xs text-gray-500", children: "No Image" })
|
|
@@ -1454,18 +1426,18 @@ const xt = (t) => {
|
|
|
1454
1426
|
),
|
|
1455
1427
|
/* @__PURE__ */ u("div", { className: "flex flex-col flex-1 justify-between", children: [
|
|
1456
1428
|
/* @__PURE__ */ u("div", { children: [
|
|
1457
|
-
/* @__PURE__ */ a("p", { className: "font-semibold text-[15px] leading-snug", children:
|
|
1458
|
-
/* @__PURE__ */ a("p", { className: "mt-1 text-[14px] font-medium", children:
|
|
1429
|
+
/* @__PURE__ */ a("p", { className: "font-semibold text-[15px] leading-snug", children: s.productSnapshot.name }),
|
|
1430
|
+
/* @__PURE__ */ a("p", { className: "mt-1 text-[14px] font-medium", children: s.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
|
|
1459
1431
|
style: "currency",
|
|
1460
|
-
currency: (
|
|
1432
|
+
currency: (k == null ? void 0 : k.currency) || "USD"
|
|
1461
1433
|
}).format(
|
|
1462
|
-
|
|
1434
|
+
s.productSnapshot.price
|
|
1463
1435
|
) : "" }),
|
|
1464
|
-
|
|
1436
|
+
s.productSnapshot.points > 0 && /* @__PURE__ */ u("p", { className: "mt-1 text-xs opacity-80", children: [
|
|
1465
1437
|
"You will earn",
|
|
1466
1438
|
" ",
|
|
1467
1439
|
/* @__PURE__ */ u("strong", { children: [
|
|
1468
|
-
|
|
1440
|
+
s.productSnapshot.points,
|
|
1469
1441
|
" ",
|
|
1470
1442
|
"points"
|
|
1471
1443
|
] })
|
|
@@ -1478,45 +1450,45 @@ const xt = (t) => {
|
|
|
1478
1450
|
{
|
|
1479
1451
|
className: "px-3 py-1 text-sm",
|
|
1480
1452
|
onClick: () => O(
|
|
1481
|
-
(
|
|
1482
|
-
(
|
|
1483
|
-
...
|
|
1453
|
+
(p) => p.map(
|
|
1454
|
+
(g, j) => j === v && g.productSnapshot ? {
|
|
1455
|
+
...g,
|
|
1484
1456
|
productSnapshot: {
|
|
1485
|
-
...
|
|
1457
|
+
...g.productSnapshot,
|
|
1486
1458
|
quantity: Math.max(
|
|
1487
1459
|
1,
|
|
1488
|
-
|
|
1460
|
+
g.productSnapshot.quantity - 1
|
|
1489
1461
|
)
|
|
1490
1462
|
}
|
|
1491
|
-
} :
|
|
1463
|
+
} : g
|
|
1492
1464
|
)
|
|
1493
1465
|
),
|
|
1494
1466
|
style: {
|
|
1495
1467
|
background: "transparent",
|
|
1496
|
-
color:
|
|
1468
|
+
color: k.themeDarkColor
|
|
1497
1469
|
},
|
|
1498
1470
|
children: "−"
|
|
1499
1471
|
}
|
|
1500
1472
|
),
|
|
1501
|
-
/* @__PURE__ */ a("div", { className: "px-3 py-1 text-sm select-none", children:
|
|
1473
|
+
/* @__PURE__ */ a("div", { className: "px-3 py-1 text-sm select-none", children: s.productSnapshot.quantity }),
|
|
1502
1474
|
/* @__PURE__ */ a(
|
|
1503
1475
|
"button",
|
|
1504
1476
|
{
|
|
1505
1477
|
className: "px-3 py-1 text-sm",
|
|
1506
1478
|
onClick: () => O(
|
|
1507
|
-
(
|
|
1508
|
-
(
|
|
1509
|
-
...
|
|
1479
|
+
(p) => p.map(
|
|
1480
|
+
(g, j) => j === v && g.productSnapshot ? {
|
|
1481
|
+
...g,
|
|
1510
1482
|
productSnapshot: {
|
|
1511
|
-
...
|
|
1512
|
-
quantity:
|
|
1483
|
+
...g.productSnapshot,
|
|
1484
|
+
quantity: g.productSnapshot.quantity + 1
|
|
1513
1485
|
}
|
|
1514
|
-
} :
|
|
1486
|
+
} : g
|
|
1515
1487
|
)
|
|
1516
1488
|
),
|
|
1517
1489
|
style: {
|
|
1518
1490
|
background: "transparent",
|
|
1519
|
-
color:
|
|
1491
|
+
color: k.themeDarkColor
|
|
1520
1492
|
},
|
|
1521
1493
|
children: "+"
|
|
1522
1494
|
}
|
|
@@ -1526,21 +1498,21 @@ const xt = (t) => {
|
|
|
1526
1498
|
"button",
|
|
1527
1499
|
{
|
|
1528
1500
|
onClick: () => {
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1501
|
+
er(
|
|
1502
|
+
$t(
|
|
1503
|
+
s.productSnapshot
|
|
1532
1504
|
),
|
|
1533
|
-
|
|
1505
|
+
s.productSnapshot.quantity
|
|
1534
1506
|
);
|
|
1535
1507
|
},
|
|
1536
|
-
disabled:
|
|
1508
|
+
disabled: it,
|
|
1537
1509
|
className: "px-4 py-2 rounded-full font-medium",
|
|
1538
1510
|
style: {
|
|
1539
|
-
background:
|
|
1540
|
-
color: (
|
|
1541
|
-
opacity:
|
|
1511
|
+
background: k.tanyaThemeColor,
|
|
1512
|
+
color: (k == null ? void 0 : k.tanyaThemeContrastColor) || "#fff",
|
|
1513
|
+
opacity: it ? 0.8 : 1
|
|
1542
1514
|
},
|
|
1543
|
-
children:
|
|
1515
|
+
children: it ? "Adding..." : "Add to cart"
|
|
1544
1516
|
}
|
|
1545
1517
|
)
|
|
1546
1518
|
] })
|
|
@@ -1550,7 +1522,7 @@ const xt = (t) => {
|
|
|
1550
1522
|
) })
|
|
1551
1523
|
] }) }),
|
|
1552
1524
|
/* @__PURE__ */ a("div", { className: "mb-20" })
|
|
1553
|
-
] },
|
|
1525
|
+
] }, v);
|
|
1554
1526
|
})
|
|
1555
1527
|
]
|
|
1556
1528
|
}
|
|
@@ -1570,9 +1542,9 @@ const xt = (t) => {
|
|
|
1570
1542
|
placeholder: "How can I help you...",
|
|
1571
1543
|
value: kt,
|
|
1572
1544
|
autoFocus: !0,
|
|
1573
|
-
onChange: (
|
|
1574
|
-
onKeyDown: (
|
|
1575
|
-
|
|
1545
|
+
onChange: (s) => St(s.target.value),
|
|
1546
|
+
onKeyDown: (s) => {
|
|
1547
|
+
s.key === "Enter" && !st && Wt();
|
|
1576
1548
|
}
|
|
1577
1549
|
}
|
|
1578
1550
|
),
|
|
@@ -1580,16 +1552,16 @@ const xt = (t) => {
|
|
|
1580
1552
|
"button",
|
|
1581
1553
|
{
|
|
1582
1554
|
type: "submit",
|
|
1583
|
-
disabled:
|
|
1555
|
+
disabled: st,
|
|
1584
1556
|
className: "p-3",
|
|
1585
|
-
onClick: () =>
|
|
1586
|
-
children:
|
|
1557
|
+
onClick: () => Wt(),
|
|
1558
|
+
children: st ? /* @__PURE__ */ a(
|
|
1587
1559
|
"div",
|
|
1588
1560
|
{
|
|
1589
1561
|
className: "p-3 animate-spin rounded-full h-3 w-3 border-b-2",
|
|
1590
1562
|
style: {
|
|
1591
1563
|
borderBottom: "2px solid",
|
|
1592
|
-
color:
|
|
1564
|
+
color: k.tanyaThemeColor
|
|
1593
1565
|
}
|
|
1594
1566
|
}
|
|
1595
1567
|
) : /* @__PURE__ */ a(
|
|
@@ -1617,7 +1589,7 @@ const xt = (t) => {
|
|
|
1617
1589
|
]
|
|
1618
1590
|
}
|
|
1619
1591
|
),
|
|
1620
|
-
/* @__PURE__ */ a(
|
|
1592
|
+
/* @__PURE__ */ a(Ir, {})
|
|
1621
1593
|
] })
|
|
1622
1594
|
]
|
|
1623
1595
|
}
|
|
@@ -1632,7 +1604,7 @@ var ne = function(t, e) {
|
|
|
1632
1604
|
for (var n in o) Object.prototype.hasOwnProperty.call(o, n) && (r[n] = o[n]);
|
|
1633
1605
|
}, ne(t, e);
|
|
1634
1606
|
};
|
|
1635
|
-
function
|
|
1607
|
+
function Er(t, e) {
|
|
1636
1608
|
if (typeof e != "function" && e !== null)
|
|
1637
1609
|
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
1638
1610
|
ne(t, e);
|
|
@@ -1641,16 +1613,16 @@ function Tr(t, e) {
|
|
|
1641
1613
|
}
|
|
1642
1614
|
t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
|
|
1643
1615
|
}
|
|
1644
|
-
var
|
|
1645
|
-
return
|
|
1616
|
+
var X = function() {
|
|
1617
|
+
return X = Object.assign || function(e) {
|
|
1646
1618
|
for (var r, o = 1, n = arguments.length; o < n; o++) {
|
|
1647
1619
|
r = arguments[o];
|
|
1648
|
-
for (var
|
|
1620
|
+
for (var l in r) Object.prototype.hasOwnProperty.call(r, l) && (e[l] = r[l]);
|
|
1649
1621
|
}
|
|
1650
1622
|
return e;
|
|
1651
|
-
},
|
|
1623
|
+
}, X.apply(this, arguments);
|
|
1652
1624
|
};
|
|
1653
|
-
function
|
|
1625
|
+
function Tr(t, e) {
|
|
1654
1626
|
var r = {};
|
|
1655
1627
|
for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (r[o] = t[o]);
|
|
1656
1628
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -1658,28 +1630,28 @@ function Or(t, e) {
|
|
|
1658
1630
|
e.indexOf(o[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[n]) && (r[o[n]] = t[o[n]]);
|
|
1659
1631
|
return r;
|
|
1660
1632
|
}
|
|
1661
|
-
var Qt = "Invariant Violation",
|
|
1633
|
+
var Qt = "Invariant Violation", Ce = Object.setPrototypeOf, Or = Ce === void 0 ? function(t, e) {
|
|
1662
1634
|
return t.__proto__ = e, t;
|
|
1663
|
-
} :
|
|
1635
|
+
} : Ce, Ve = (
|
|
1664
1636
|
/** @class */
|
|
1665
1637
|
(function(t) {
|
|
1666
|
-
|
|
1638
|
+
Er(e, t);
|
|
1667
1639
|
function e(r) {
|
|
1668
1640
|
r === void 0 && (r = Qt);
|
|
1669
1641
|
var o = t.call(this, typeof r == "number" ? Qt + ": " + r + " (see https://github.com/apollographql/invariant-packages)" : r) || this;
|
|
1670
|
-
return o.framesToPop = 1, o.name = Qt,
|
|
1642
|
+
return o.framesToPop = 1, o.name = Qt, Or(o, e.prototype), o;
|
|
1671
1643
|
}
|
|
1672
1644
|
return e;
|
|
1673
1645
|
})(Error)
|
|
1674
1646
|
);
|
|
1675
|
-
function
|
|
1647
|
+
function Z(t, e) {
|
|
1676
1648
|
if (!t)
|
|
1677
|
-
throw new
|
|
1649
|
+
throw new Ve(e);
|
|
1678
1650
|
}
|
|
1679
|
-
var
|
|
1651
|
+
var Ye = ["debug", "log", "warn", "error", "silent"], Pr = Ye.indexOf("log");
|
|
1680
1652
|
function Lt(t) {
|
|
1681
1653
|
return function() {
|
|
1682
|
-
if (
|
|
1654
|
+
if (Ye.indexOf(t) >= Pr) {
|
|
1683
1655
|
var e = console[t] || console.log;
|
|
1684
1656
|
return e.apply(console, arguments);
|
|
1685
1657
|
}
|
|
@@ -1687,21 +1659,21 @@ function Lt(t) {
|
|
|
1687
1659
|
}
|
|
1688
1660
|
(function(t) {
|
|
1689
1661
|
t.debug = Lt("debug"), t.log = Lt("log"), t.warn = Lt("warn"), t.error = Lt("error");
|
|
1690
|
-
})(
|
|
1691
|
-
var
|
|
1692
|
-
function
|
|
1662
|
+
})(Z || (Z = {}));
|
|
1663
|
+
var Re = "3.14.0";
|
|
1664
|
+
function gt(t) {
|
|
1693
1665
|
try {
|
|
1694
1666
|
return t();
|
|
1695
1667
|
} catch {
|
|
1696
1668
|
}
|
|
1697
1669
|
}
|
|
1698
|
-
const ae =
|
|
1670
|
+
const ae = gt(function() {
|
|
1699
1671
|
return globalThis;
|
|
1700
|
-
}) ||
|
|
1672
|
+
}) || gt(function() {
|
|
1701
1673
|
return window;
|
|
1702
|
-
}) ||
|
|
1674
|
+
}) || gt(function() {
|
|
1703
1675
|
return self;
|
|
1704
|
-
}) ||
|
|
1676
|
+
}) || gt(function() {
|
|
1705
1677
|
return global;
|
|
1706
1678
|
}) || // We don't expect the Function constructor ever to be invoked at runtime, as
|
|
1707
1679
|
// long as at least one of globalThis, window, self, or global is defined, so
|
|
@@ -1709,16 +1681,16 @@ const ae = wt(function() {
|
|
|
1709
1681
|
// detect syntactic usage of the Function constructor. If you think you can
|
|
1710
1682
|
// improve your static analysis to detect this obfuscation, think again. This
|
|
1711
1683
|
// is an arms race you cannot win, at least not in JavaScript.
|
|
1712
|
-
|
|
1713
|
-
return
|
|
1684
|
+
gt(function() {
|
|
1685
|
+
return gt.constructor("return this")();
|
|
1714
1686
|
});
|
|
1715
|
-
var
|
|
1716
|
-
function
|
|
1717
|
-
var e =
|
|
1718
|
-
return
|
|
1687
|
+
var _e = /* @__PURE__ */ new Map();
|
|
1688
|
+
function $r(t) {
|
|
1689
|
+
var e = _e.get(t) || 1;
|
|
1690
|
+
return _e.set(t, e + 1), "".concat(t, ":").concat(e, ":").concat(Math.random().toString(36).slice(2));
|
|
1719
1691
|
}
|
|
1720
|
-
function
|
|
1721
|
-
var r =
|
|
1692
|
+
function zr(t, e) {
|
|
1693
|
+
var r = $r("stringifyForDisplay");
|
|
1722
1694
|
return JSON.stringify(t, function(o, n) {
|
|
1723
1695
|
return n === void 0 ? r : n;
|
|
1724
1696
|
}, e).split(JSON.stringify(r)).join("<undefined>");
|
|
@@ -1737,51 +1709,51 @@ function Bt(t) {
|
|
|
1737
1709
|
var Zt = Object.assign(function(e, r) {
|
|
1738
1710
|
for (var o = [], n = 2; n < arguments.length; n++)
|
|
1739
1711
|
o[n - 2] = arguments[n];
|
|
1740
|
-
e ||
|
|
1712
|
+
e || Z(e, le(r, o) || ce(r, o));
|
|
1741
1713
|
}, {
|
|
1742
|
-
debug: Bt(
|
|
1743
|
-
log: Bt(
|
|
1744
|
-
warn: Bt(
|
|
1745
|
-
error: Bt(
|
|
1714
|
+
debug: Bt(Z.debug),
|
|
1715
|
+
log: Bt(Z.log),
|
|
1716
|
+
warn: Bt(Z.warn),
|
|
1717
|
+
error: Bt(Z.error)
|
|
1746
1718
|
});
|
|
1747
|
-
function
|
|
1719
|
+
function Ke(t) {
|
|
1748
1720
|
for (var e = [], r = 1; r < arguments.length; r++)
|
|
1749
1721
|
e[r - 1] = arguments[r];
|
|
1750
|
-
return new
|
|
1722
|
+
return new Ve(le(t, e) || ce(t, e));
|
|
1751
1723
|
}
|
|
1752
|
-
var Fe = Symbol.for("ApolloErrorMessageHandler_" +
|
|
1753
|
-
function
|
|
1724
|
+
var Fe = Symbol.for("ApolloErrorMessageHandler_" + Re);
|
|
1725
|
+
function Je(t) {
|
|
1754
1726
|
if (typeof t == "string")
|
|
1755
1727
|
return t;
|
|
1756
1728
|
try {
|
|
1757
|
-
return
|
|
1729
|
+
return zr(t, 2).slice(0, 1e3);
|
|
1758
1730
|
} catch {
|
|
1759
1731
|
return "<non-serializable>";
|
|
1760
1732
|
}
|
|
1761
1733
|
}
|
|
1762
1734
|
function le(t, e) {
|
|
1763
1735
|
if (e === void 0 && (e = []), !!t)
|
|
1764
|
-
return ae[Fe] && ae[Fe](t, e.map(
|
|
1736
|
+
return ae[Fe] && ae[Fe](t, e.map(Je));
|
|
1765
1737
|
}
|
|
1766
1738
|
function ce(t, e) {
|
|
1767
1739
|
if (e === void 0 && (e = []), !!t)
|
|
1768
1740
|
return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
|
|
1769
|
-
version:
|
|
1741
|
+
version: Re,
|
|
1770
1742
|
message: t,
|
|
1771
|
-
args: e.map(
|
|
1743
|
+
args: e.map(Je)
|
|
1772
1744
|
})));
|
|
1773
1745
|
}
|
|
1774
|
-
function
|
|
1746
|
+
function jr(t) {
|
|
1775
1747
|
return t.definitions.filter(function(e) {
|
|
1776
1748
|
return e.kind === "OperationDefinition" && !!e.name;
|
|
1777
1749
|
}).map(function(e) {
|
|
1778
1750
|
return e.name.value;
|
|
1779
1751
|
})[0] || null;
|
|
1780
1752
|
}
|
|
1781
|
-
let
|
|
1782
|
-
const
|
|
1753
|
+
let N = null;
|
|
1754
|
+
const Ie = {};
|
|
1783
1755
|
let Dr = 1;
|
|
1784
|
-
const
|
|
1756
|
+
const Ar = () => class {
|
|
1785
1757
|
constructor() {
|
|
1786
1758
|
this.id = [
|
|
1787
1759
|
"slot",
|
|
@@ -1791,78 +1763,78 @@ const Lr = () => class {
|
|
|
1791
1763
|
].join(":");
|
|
1792
1764
|
}
|
|
1793
1765
|
hasValue() {
|
|
1794
|
-
for (let e =
|
|
1766
|
+
for (let e = N; e; e = e.parent)
|
|
1795
1767
|
if (this.id in e.slots) {
|
|
1796
1768
|
const r = e.slots[this.id];
|
|
1797
|
-
if (r ===
|
|
1769
|
+
if (r === Ie)
|
|
1798
1770
|
break;
|
|
1799
|
-
return e !==
|
|
1771
|
+
return e !== N && (N.slots[this.id] = r), !0;
|
|
1800
1772
|
}
|
|
1801
|
-
return
|
|
1773
|
+
return N && (N.slots[this.id] = Ie), !1;
|
|
1802
1774
|
}
|
|
1803
1775
|
getValue() {
|
|
1804
1776
|
if (this.hasValue())
|
|
1805
|
-
return
|
|
1777
|
+
return N.slots[this.id];
|
|
1806
1778
|
}
|
|
1807
1779
|
withValue(e, r, o, n) {
|
|
1808
|
-
const
|
|
1780
|
+
const l = {
|
|
1809
1781
|
__proto__: null,
|
|
1810
1782
|
[this.id]: e
|
|
1811
|
-
},
|
|
1812
|
-
|
|
1783
|
+
}, c = N;
|
|
1784
|
+
N = { parent: c, slots: l };
|
|
1813
1785
|
try {
|
|
1814
1786
|
return r.apply(n, o);
|
|
1815
1787
|
} finally {
|
|
1816
|
-
|
|
1788
|
+
N = c;
|
|
1817
1789
|
}
|
|
1818
1790
|
}
|
|
1819
1791
|
// Capture the current context and wrap a callback function so that it
|
|
1820
1792
|
// reestablishes the captured context when called.
|
|
1821
1793
|
static bind(e) {
|
|
1822
|
-
const r =
|
|
1794
|
+
const r = N;
|
|
1823
1795
|
return function() {
|
|
1824
|
-
const o =
|
|
1796
|
+
const o = N;
|
|
1825
1797
|
try {
|
|
1826
|
-
return
|
|
1798
|
+
return N = r, e.apply(this, arguments);
|
|
1827
1799
|
} finally {
|
|
1828
|
-
|
|
1800
|
+
N = o;
|
|
1829
1801
|
}
|
|
1830
1802
|
};
|
|
1831
1803
|
}
|
|
1832
1804
|
// Immediately run a callback function without any captured context.
|
|
1833
1805
|
static noContext(e, r, o) {
|
|
1834
|
-
if (
|
|
1835
|
-
const n =
|
|
1806
|
+
if (N) {
|
|
1807
|
+
const n = N;
|
|
1836
1808
|
try {
|
|
1837
|
-
return
|
|
1809
|
+
return N = null, e.apply(o, r);
|
|
1838
1810
|
} finally {
|
|
1839
|
-
|
|
1811
|
+
N = n;
|
|
1840
1812
|
}
|
|
1841
1813
|
} else
|
|
1842
1814
|
return e.apply(o, r);
|
|
1843
1815
|
}
|
|
1844
1816
|
};
|
|
1845
|
-
function
|
|
1817
|
+
function Ne(t) {
|
|
1846
1818
|
try {
|
|
1847
1819
|
return t();
|
|
1848
1820
|
} catch {
|
|
1849
1821
|
}
|
|
1850
1822
|
}
|
|
1851
|
-
const te = "@wry/context:Slot",
|
|
1823
|
+
const te = "@wry/context:Slot", Lr = (
|
|
1852
1824
|
// Prefer globalThis when available.
|
|
1853
1825
|
// https://github.com/benjamn/wryware/issues/347
|
|
1854
|
-
|
|
1826
|
+
Ne(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
|
|
1855
1827
|
// bundlers to the appropriate identifier (window, self, ...) depending on the
|
|
1856
1828
|
// bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224
|
|
1857
|
-
|
|
1829
|
+
Ne(() => global) || // Otherwise, use a dummy host that's local to this module. We used to fall
|
|
1858
1830
|
// back to using the Array constructor as a namespace, but that was flagged in
|
|
1859
1831
|
// https://github.com/benjamn/wryware/issues/347, and can be avoided.
|
|
1860
1832
|
/* @__PURE__ */ Object.create(null)
|
|
1861
|
-
),
|
|
1833
|
+
), Ee = Lr, de = Ee[te] || // Earlier versions of this package stored the globalKey property on the Array
|
|
1862
1834
|
// constructor, so we check there as well, to prevent Slot class duplication.
|
|
1863
1835
|
Array[te] || (function(t) {
|
|
1864
1836
|
try {
|
|
1865
|
-
Object.defineProperty(
|
|
1837
|
+
Object.defineProperty(Ee, te, {
|
|
1866
1838
|
value: t,
|
|
1867
1839
|
enumerable: !1,
|
|
1868
1840
|
writable: !1,
|
|
@@ -1877,12 +1849,12 @@ Array[te] || (function(t) {
|
|
|
1877
1849
|
} finally {
|
|
1878
1850
|
return t;
|
|
1879
1851
|
}
|
|
1880
|
-
})(
|
|
1852
|
+
})(Ar()), { bind: ko, noContext: So } = de;
|
|
1881
1853
|
new de();
|
|
1882
|
-
function
|
|
1854
|
+
function Br(t, e) {
|
|
1883
1855
|
var r = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
1884
1856
|
if (r) return (r = r.call(t)).next.bind(r);
|
|
1885
|
-
if (Array.isArray(t) || (r =
|
|
1857
|
+
if (Array.isArray(t) || (r = Ur(t)) || e) {
|
|
1886
1858
|
r && (t = r);
|
|
1887
1859
|
var o = 0;
|
|
1888
1860
|
return function() {
|
|
@@ -1892,28 +1864,28 @@ function Ur(t, e) {
|
|
|
1892
1864
|
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1893
1865
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1894
1866
|
}
|
|
1895
|
-
function
|
|
1867
|
+
function Ur(t, e) {
|
|
1896
1868
|
if (t) {
|
|
1897
|
-
if (typeof t == "string") return
|
|
1869
|
+
if (typeof t == "string") return Te(t, e);
|
|
1898
1870
|
var r = Object.prototype.toString.call(t).slice(8, -1);
|
|
1899
1871
|
if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set") return Array.from(t);
|
|
1900
|
-
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return
|
|
1872
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return Te(t, e);
|
|
1901
1873
|
}
|
|
1902
1874
|
}
|
|
1903
|
-
function
|
|
1875
|
+
function Te(t, e) {
|
|
1904
1876
|
(e == null || e > t.length) && (e = t.length);
|
|
1905
1877
|
for (var r = 0, o = new Array(e); r < e; r++)
|
|
1906
1878
|
o[r] = t[r];
|
|
1907
1879
|
return o;
|
|
1908
1880
|
}
|
|
1909
|
-
function
|
|
1881
|
+
function Oe(t, e) {
|
|
1910
1882
|
for (var r = 0; r < e.length; r++) {
|
|
1911
1883
|
var o = e[r];
|
|
1912
1884
|
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
|
|
1913
1885
|
}
|
|
1914
1886
|
}
|
|
1915
1887
|
function ue(t, e, r) {
|
|
1916
|
-
return e &&
|
|
1888
|
+
return e && Oe(t.prototype, e), r && Oe(t, r), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
1917
1889
|
}
|
|
1918
1890
|
var pe = function() {
|
|
1919
1891
|
return typeof Symbol == "function";
|
|
@@ -1923,7 +1895,7 @@ var pe = function() {
|
|
|
1923
1895
|
return fe(t) ? Symbol[t] : "@@" + t;
|
|
1924
1896
|
};
|
|
1925
1897
|
pe() && !fe("observable") && (Symbol.observable = Symbol("observable"));
|
|
1926
|
-
var
|
|
1898
|
+
var qr = me("iterator"), ie = me("observable"), We = me("species");
|
|
1927
1899
|
function Kt(t, e) {
|
|
1928
1900
|
var r = t[e];
|
|
1929
1901
|
if (r != null) {
|
|
@@ -1931,15 +1903,15 @@ function Kt(t, e) {
|
|
|
1931
1903
|
return r;
|
|
1932
1904
|
}
|
|
1933
1905
|
}
|
|
1934
|
-
function
|
|
1906
|
+
function It(t) {
|
|
1935
1907
|
var e = t.constructor;
|
|
1936
|
-
return e !== void 0 && (e = e[
|
|
1908
|
+
return e !== void 0 && (e = e[We], e === null && (e = void 0)), e !== void 0 ? e : E;
|
|
1937
1909
|
}
|
|
1938
|
-
function
|
|
1939
|
-
return t instanceof
|
|
1910
|
+
function Mr(t) {
|
|
1911
|
+
return t instanceof E;
|
|
1940
1912
|
}
|
|
1941
|
-
function
|
|
1942
|
-
|
|
1913
|
+
function bt(t) {
|
|
1914
|
+
bt.log ? bt.log(t) : setTimeout(function() {
|
|
1943
1915
|
throw t;
|
|
1944
1916
|
});
|
|
1945
1917
|
}
|
|
@@ -1948,11 +1920,11 @@ function qt(t) {
|
|
|
1948
1920
|
try {
|
|
1949
1921
|
t();
|
|
1950
1922
|
} catch (e) {
|
|
1951
|
-
|
|
1923
|
+
bt(e);
|
|
1952
1924
|
}
|
|
1953
1925
|
});
|
|
1954
1926
|
}
|
|
1955
|
-
function
|
|
1927
|
+
function Ge(t) {
|
|
1956
1928
|
var e = t._cleanup;
|
|
1957
1929
|
if (e !== void 0 && (t._cleanup = void 0, !!e))
|
|
1958
1930
|
try {
|
|
@@ -1963,21 +1935,21 @@ function Qe(t) {
|
|
|
1963
1935
|
r && r.call(e);
|
|
1964
1936
|
}
|
|
1965
1937
|
} catch (o) {
|
|
1966
|
-
|
|
1938
|
+
bt(o);
|
|
1967
1939
|
}
|
|
1968
1940
|
}
|
|
1969
1941
|
function se(t) {
|
|
1970
1942
|
t._observer = void 0, t._queue = void 0, t._state = "closed";
|
|
1971
1943
|
}
|
|
1972
|
-
function
|
|
1944
|
+
function Hr(t) {
|
|
1973
1945
|
var e = t._queue;
|
|
1974
1946
|
if (e) {
|
|
1975
1947
|
t._queue = void 0, t._state = "ready";
|
|
1976
|
-
for (var r = 0; r < e.length && (
|
|
1948
|
+
for (var r = 0; r < e.length && (Xe(t, e[r].type, e[r].value), t._state !== "closed"); ++r)
|
|
1977
1949
|
;
|
|
1978
1950
|
}
|
|
1979
1951
|
}
|
|
1980
|
-
function
|
|
1952
|
+
function Xe(t, e, r) {
|
|
1981
1953
|
t._state = "running";
|
|
1982
1954
|
var o = t._observer;
|
|
1983
1955
|
try {
|
|
@@ -1994,10 +1966,10 @@ function Ze(t, e, r) {
|
|
|
1994
1966
|
se(t), n && n.call(o);
|
|
1995
1967
|
break;
|
|
1996
1968
|
}
|
|
1997
|
-
} catch (
|
|
1998
|
-
|
|
1969
|
+
} catch (l) {
|
|
1970
|
+
bt(l);
|
|
1999
1971
|
}
|
|
2000
|
-
t._state === "closed" ?
|
|
1972
|
+
t._state === "closed" ? Ge(t) : t._state === "running" && (t._state = "ready");
|
|
2001
1973
|
}
|
|
2002
1974
|
function ee(t, e, r) {
|
|
2003
1975
|
if (t._state !== "closed") {
|
|
@@ -2013,27 +1985,27 @@ function ee(t, e, r) {
|
|
|
2013
1985
|
type: e,
|
|
2014
1986
|
value: r
|
|
2015
1987
|
}], qt(function() {
|
|
2016
|
-
return
|
|
1988
|
+
return Hr(t);
|
|
2017
1989
|
});
|
|
2018
1990
|
return;
|
|
2019
1991
|
}
|
|
2020
|
-
|
|
1992
|
+
Xe(t, e, r);
|
|
2021
1993
|
}
|
|
2022
1994
|
}
|
|
2023
|
-
var
|
|
1995
|
+
var Vr = /* @__PURE__ */ (function() {
|
|
2024
1996
|
function t(r, o) {
|
|
2025
1997
|
this._cleanup = void 0, this._observer = r, this._queue = void 0, this._state = "initializing";
|
|
2026
1998
|
var n = new Yr(this);
|
|
2027
1999
|
try {
|
|
2028
2000
|
this._cleanup = o.call(void 0, n);
|
|
2029
|
-
} catch (
|
|
2030
|
-
n.error(
|
|
2001
|
+
} catch (l) {
|
|
2002
|
+
n.error(l);
|
|
2031
2003
|
}
|
|
2032
2004
|
this._state === "initializing" && (this._state = "ready");
|
|
2033
2005
|
}
|
|
2034
2006
|
var e = t.prototype;
|
|
2035
2007
|
return e.unsubscribe = function() {
|
|
2036
|
-
this._state !== "closed" && (se(this),
|
|
2008
|
+
this._state !== "closed" && (se(this), Ge(this));
|
|
2037
2009
|
}, ue(t, [{
|
|
2038
2010
|
key: "closed",
|
|
2039
2011
|
get: function() {
|
|
@@ -2057,7 +2029,7 @@ var Rr = /* @__PURE__ */ (function() {
|
|
|
2057
2029
|
return this._subscription._state === "closed";
|
|
2058
2030
|
}
|
|
2059
2031
|
}]), t;
|
|
2060
|
-
})(),
|
|
2032
|
+
})(), E = /* @__PURE__ */ (function() {
|
|
2061
2033
|
function t(r) {
|
|
2062
2034
|
if (!(this instanceof t)) throw new TypeError("Observable cannot be called as a function");
|
|
2063
2035
|
if (typeof r != "function") throw new TypeError("Observable initializer must be a function");
|
|
@@ -2069,162 +2041,162 @@ var Rr = /* @__PURE__ */ (function() {
|
|
|
2069
2041
|
next: o,
|
|
2070
2042
|
error: arguments[1],
|
|
2071
2043
|
complete: arguments[2]
|
|
2072
|
-
}), new
|
|
2044
|
+
}), new Vr(o, this._subscriber);
|
|
2073
2045
|
}, e.forEach = function(o) {
|
|
2074
2046
|
var n = this;
|
|
2075
|
-
return new Promise(function(
|
|
2047
|
+
return new Promise(function(l, c) {
|
|
2076
2048
|
if (typeof o != "function") {
|
|
2077
|
-
|
|
2049
|
+
c(new TypeError(o + " is not a function"));
|
|
2078
2050
|
return;
|
|
2079
2051
|
}
|
|
2080
2052
|
function d() {
|
|
2081
|
-
i.unsubscribe(),
|
|
2053
|
+
i.unsubscribe(), l();
|
|
2082
2054
|
}
|
|
2083
2055
|
var i = n.subscribe({
|
|
2084
|
-
next: function(
|
|
2056
|
+
next: function(x) {
|
|
2085
2057
|
try {
|
|
2086
|
-
o(
|
|
2087
|
-
} catch (
|
|
2088
|
-
|
|
2058
|
+
o(x, d);
|
|
2059
|
+
} catch (h) {
|
|
2060
|
+
c(h), i.unsubscribe();
|
|
2089
2061
|
}
|
|
2090
2062
|
},
|
|
2091
|
-
error:
|
|
2092
|
-
complete:
|
|
2063
|
+
error: c,
|
|
2064
|
+
complete: l
|
|
2093
2065
|
});
|
|
2094
2066
|
});
|
|
2095
2067
|
}, e.map = function(o) {
|
|
2096
2068
|
var n = this;
|
|
2097
2069
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2098
|
-
var
|
|
2099
|
-
return new
|
|
2070
|
+
var l = It(this);
|
|
2071
|
+
return new l(function(c) {
|
|
2100
2072
|
return n.subscribe({
|
|
2101
2073
|
next: function(d) {
|
|
2102
2074
|
try {
|
|
2103
2075
|
d = o(d);
|
|
2104
2076
|
} catch (i) {
|
|
2105
|
-
return
|
|
2077
|
+
return c.error(i);
|
|
2106
2078
|
}
|
|
2107
|
-
|
|
2079
|
+
c.next(d);
|
|
2108
2080
|
},
|
|
2109
2081
|
error: function(d) {
|
|
2110
|
-
|
|
2082
|
+
c.error(d);
|
|
2111
2083
|
},
|
|
2112
2084
|
complete: function() {
|
|
2113
|
-
|
|
2085
|
+
c.complete();
|
|
2114
2086
|
}
|
|
2115
2087
|
});
|
|
2116
2088
|
});
|
|
2117
2089
|
}, e.filter = function(o) {
|
|
2118
2090
|
var n = this;
|
|
2119
2091
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2120
|
-
var
|
|
2121
|
-
return new
|
|
2092
|
+
var l = It(this);
|
|
2093
|
+
return new l(function(c) {
|
|
2122
2094
|
return n.subscribe({
|
|
2123
2095
|
next: function(d) {
|
|
2124
2096
|
try {
|
|
2125
2097
|
if (!o(d)) return;
|
|
2126
2098
|
} catch (i) {
|
|
2127
|
-
return
|
|
2099
|
+
return c.error(i);
|
|
2128
2100
|
}
|
|
2129
|
-
|
|
2101
|
+
c.next(d);
|
|
2130
2102
|
},
|
|
2131
2103
|
error: function(d) {
|
|
2132
|
-
|
|
2104
|
+
c.error(d);
|
|
2133
2105
|
},
|
|
2134
2106
|
complete: function() {
|
|
2135
|
-
|
|
2107
|
+
c.complete();
|
|
2136
2108
|
}
|
|
2137
2109
|
});
|
|
2138
2110
|
});
|
|
2139
2111
|
}, e.reduce = function(o) {
|
|
2140
2112
|
var n = this;
|
|
2141
2113
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2142
|
-
var
|
|
2143
|
-
return new
|
|
2114
|
+
var l = It(this), c = arguments.length > 1, d = !1, i = arguments[1], x = i;
|
|
2115
|
+
return new l(function(h) {
|
|
2144
2116
|
return n.subscribe({
|
|
2145
2117
|
next: function(S) {
|
|
2146
|
-
var
|
|
2147
|
-
if (d = !0, !
|
|
2118
|
+
var _ = !d;
|
|
2119
|
+
if (d = !0, !_ || c)
|
|
2148
2120
|
try {
|
|
2149
|
-
|
|
2150
|
-
} catch (
|
|
2151
|
-
return
|
|
2121
|
+
x = o(x, S);
|
|
2122
|
+
} catch (F) {
|
|
2123
|
+
return h.error(F);
|
|
2152
2124
|
}
|
|
2153
2125
|
else
|
|
2154
|
-
|
|
2126
|
+
x = S;
|
|
2155
2127
|
},
|
|
2156
2128
|
error: function(S) {
|
|
2157
|
-
|
|
2129
|
+
h.error(S);
|
|
2158
2130
|
},
|
|
2159
2131
|
complete: function() {
|
|
2160
|
-
if (!d && !
|
|
2161
|
-
|
|
2132
|
+
if (!d && !c) return h.error(new TypeError("Cannot reduce an empty sequence"));
|
|
2133
|
+
h.next(x), h.complete();
|
|
2162
2134
|
}
|
|
2163
2135
|
});
|
|
2164
2136
|
});
|
|
2165
2137
|
}, e.concat = function() {
|
|
2166
|
-
for (var o = this, n = arguments.length,
|
|
2167
|
-
|
|
2168
|
-
var d =
|
|
2138
|
+
for (var o = this, n = arguments.length, l = new Array(n), c = 0; c < n; c++)
|
|
2139
|
+
l[c] = arguments[c];
|
|
2140
|
+
var d = It(this);
|
|
2169
2141
|
return new d(function(i) {
|
|
2170
|
-
var
|
|
2171
|
-
function S(
|
|
2172
|
-
|
|
2173
|
-
next: function(
|
|
2174
|
-
i.next(
|
|
2142
|
+
var x, h = 0;
|
|
2143
|
+
function S(_) {
|
|
2144
|
+
x = _.subscribe({
|
|
2145
|
+
next: function(F) {
|
|
2146
|
+
i.next(F);
|
|
2175
2147
|
},
|
|
2176
|
-
error: function(
|
|
2177
|
-
i.error(
|
|
2148
|
+
error: function(F) {
|
|
2149
|
+
i.error(F);
|
|
2178
2150
|
},
|
|
2179
2151
|
complete: function() {
|
|
2180
|
-
|
|
2152
|
+
h === l.length ? (x = void 0, i.complete()) : S(d.from(l[h++]));
|
|
2181
2153
|
}
|
|
2182
2154
|
});
|
|
2183
2155
|
}
|
|
2184
2156
|
return S(o), function() {
|
|
2185
|
-
|
|
2157
|
+
x && (x.unsubscribe(), x = void 0);
|
|
2186
2158
|
};
|
|
2187
2159
|
});
|
|
2188
2160
|
}, e.flatMap = function(o) {
|
|
2189
2161
|
var n = this;
|
|
2190
2162
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2191
|
-
var
|
|
2192
|
-
return new
|
|
2163
|
+
var l = It(this);
|
|
2164
|
+
return new l(function(c) {
|
|
2193
2165
|
var d = [], i = n.subscribe({
|
|
2194
|
-
next: function(
|
|
2166
|
+
next: function(h) {
|
|
2195
2167
|
if (o)
|
|
2196
2168
|
try {
|
|
2197
|
-
|
|
2198
|
-
} catch (
|
|
2199
|
-
return
|
|
2169
|
+
h = o(h);
|
|
2170
|
+
} catch (_) {
|
|
2171
|
+
return c.error(_);
|
|
2200
2172
|
}
|
|
2201
|
-
var S =
|
|
2202
|
-
next: function(
|
|
2203
|
-
|
|
2173
|
+
var S = l.from(h).subscribe({
|
|
2174
|
+
next: function(_) {
|
|
2175
|
+
c.next(_);
|
|
2204
2176
|
},
|
|
2205
|
-
error: function(
|
|
2206
|
-
|
|
2177
|
+
error: function(_) {
|
|
2178
|
+
c.error(_);
|
|
2207
2179
|
},
|
|
2208
2180
|
complete: function() {
|
|
2209
|
-
var
|
|
2210
|
-
|
|
2181
|
+
var _ = d.indexOf(S);
|
|
2182
|
+
_ >= 0 && d.splice(_, 1), x();
|
|
2211
2183
|
}
|
|
2212
2184
|
});
|
|
2213
2185
|
d.push(S);
|
|
2214
2186
|
},
|
|
2215
|
-
error: function(
|
|
2216
|
-
|
|
2187
|
+
error: function(h) {
|
|
2188
|
+
c.error(h);
|
|
2217
2189
|
},
|
|
2218
2190
|
complete: function() {
|
|
2219
|
-
|
|
2191
|
+
x();
|
|
2220
2192
|
}
|
|
2221
2193
|
});
|
|
2222
|
-
function
|
|
2223
|
-
i.closed && d.length === 0 &&
|
|
2194
|
+
function x() {
|
|
2195
|
+
i.closed && d.length === 0 && c.complete();
|
|
2224
2196
|
}
|
|
2225
2197
|
return function() {
|
|
2226
|
-
d.forEach(function(
|
|
2227
|
-
return
|
|
2198
|
+
d.forEach(function(h) {
|
|
2199
|
+
return h.unsubscribe();
|
|
2228
2200
|
}), i.unsubscribe();
|
|
2229
2201
|
};
|
|
2230
2202
|
});
|
|
@@ -2233,21 +2205,21 @@ var Rr = /* @__PURE__ */ (function() {
|
|
|
2233
2205
|
}, t.from = function(o) {
|
|
2234
2206
|
var n = typeof this == "function" ? this : t;
|
|
2235
2207
|
if (o == null) throw new TypeError(o + " is not an object");
|
|
2236
|
-
var
|
|
2237
|
-
if (
|
|
2238
|
-
var
|
|
2239
|
-
if (Object(
|
|
2240
|
-
return
|
|
2241
|
-
return
|
|
2208
|
+
var l = Kt(o, ie);
|
|
2209
|
+
if (l) {
|
|
2210
|
+
var c = l.call(o);
|
|
2211
|
+
if (Object(c) !== c) throw new TypeError(c + " is not an object");
|
|
2212
|
+
return Mr(c) && c.constructor === n ? c : new n(function(d) {
|
|
2213
|
+
return c.subscribe(d);
|
|
2242
2214
|
});
|
|
2243
2215
|
}
|
|
2244
|
-
if (fe("iterator") && (
|
|
2216
|
+
if (fe("iterator") && (l = Kt(o, qr), l))
|
|
2245
2217
|
return new n(function(d) {
|
|
2246
2218
|
qt(function() {
|
|
2247
2219
|
if (!d.closed) {
|
|
2248
|
-
for (var i =
|
|
2249
|
-
var
|
|
2250
|
-
if (d.next(
|
|
2220
|
+
for (var i = Br(l.call(o)), x; !(x = i()).done; ) {
|
|
2221
|
+
var h = x.value;
|
|
2222
|
+
if (d.next(h), d.closed) return;
|
|
2251
2223
|
}
|
|
2252
2224
|
d.complete();
|
|
2253
2225
|
}
|
|
@@ -2265,10 +2237,10 @@ var Rr = /* @__PURE__ */ (function() {
|
|
|
2265
2237
|
});
|
|
2266
2238
|
throw new TypeError(o + " is not observable");
|
|
2267
2239
|
}, t.of = function() {
|
|
2268
|
-
for (var o = arguments.length, n = new Array(o),
|
|
2269
|
-
n[
|
|
2270
|
-
var
|
|
2271
|
-
return new
|
|
2240
|
+
for (var o = arguments.length, n = new Array(o), l = 0; l < o; l++)
|
|
2241
|
+
n[l] = arguments[l];
|
|
2242
|
+
var c = typeof this == "function" ? this : t;
|
|
2243
|
+
return new c(function(d) {
|
|
2272
2244
|
qt(function() {
|
|
2273
2245
|
if (!d.closed) {
|
|
2274
2246
|
for (var i = 0; i < n.length; ++i)
|
|
@@ -2278,20 +2250,20 @@ var Rr = /* @__PURE__ */ (function() {
|
|
|
2278
2250
|
});
|
|
2279
2251
|
});
|
|
2280
2252
|
}, ue(t, null, [{
|
|
2281
|
-
key:
|
|
2253
|
+
key: We,
|
|
2282
2254
|
get: function() {
|
|
2283
2255
|
return this;
|
|
2284
2256
|
}
|
|
2285
2257
|
}]), t;
|
|
2286
2258
|
})();
|
|
2287
|
-
pe() && Object.defineProperty(
|
|
2259
|
+
pe() && Object.defineProperty(E, Symbol("extensions"), {
|
|
2288
2260
|
value: {
|
|
2289
2261
|
symbol: ie,
|
|
2290
|
-
hostReportError:
|
|
2262
|
+
hostReportError: bt
|
|
2291
2263
|
},
|
|
2292
2264
|
configurable: !0
|
|
2293
2265
|
});
|
|
2294
|
-
function
|
|
2266
|
+
function Rr(t) {
|
|
2295
2267
|
var e, r = t.Symbol;
|
|
2296
2268
|
if (typeof r == "function")
|
|
2297
2269
|
if (r.observable)
|
|
@@ -2307,14 +2279,14 @@ function Kr(t) {
|
|
|
2307
2279
|
e = "@@observable";
|
|
2308
2280
|
return e;
|
|
2309
2281
|
}
|
|
2310
|
-
var
|
|
2311
|
-
typeof self < "u" ?
|
|
2312
|
-
|
|
2313
|
-
var
|
|
2314
|
-
$e
|
|
2282
|
+
var xt;
|
|
2283
|
+
typeof self < "u" ? xt = self : typeof window < "u" ? xt = window : typeof global < "u" ? xt = global : typeof module < "u" ? xt = module : xt = Function("return this")();
|
|
2284
|
+
Rr(xt);
|
|
2285
|
+
var Pe = E.prototype, $e = "@@observable";
|
|
2286
|
+
Pe[$e] || (Pe[$e] = function() {
|
|
2315
2287
|
return this;
|
|
2316
2288
|
});
|
|
2317
|
-
function
|
|
2289
|
+
function Kr(t) {
|
|
2318
2290
|
for (var e = [
|
|
2319
2291
|
"query",
|
|
2320
2292
|
"operationName",
|
|
@@ -2324,15 +2296,15 @@ function Jr(t) {
|
|
|
2324
2296
|
], r = 0, o = Object.keys(t); r < o.length; r++) {
|
|
2325
2297
|
var n = o[r];
|
|
2326
2298
|
if (e.indexOf(n) < 0)
|
|
2327
|
-
throw
|
|
2299
|
+
throw Ke(58, n);
|
|
2328
2300
|
}
|
|
2329
2301
|
return t;
|
|
2330
2302
|
}
|
|
2331
|
-
function
|
|
2332
|
-
var r =
|
|
2333
|
-
typeof
|
|
2303
|
+
function Jr(t, e) {
|
|
2304
|
+
var r = X({}, t), o = function(l) {
|
|
2305
|
+
typeof l == "function" ? r = X(X({}, r), l(r)) : r = X(X({}, r), l);
|
|
2334
2306
|
}, n = function() {
|
|
2335
|
-
return
|
|
2307
|
+
return X({}, r);
|
|
2336
2308
|
};
|
|
2337
2309
|
return Object.defineProperty(e, "setContext", {
|
|
2338
2310
|
enumerable: !1,
|
|
@@ -2342,32 +2314,32 @@ function Wr(t, e) {
|
|
|
2342
2314
|
value: n
|
|
2343
2315
|
}), e;
|
|
2344
2316
|
}
|
|
2345
|
-
function
|
|
2317
|
+
function Wr(t) {
|
|
2346
2318
|
var e = {
|
|
2347
2319
|
variables: t.variables || {},
|
|
2348
2320
|
extensions: t.extensions || {},
|
|
2349
2321
|
operationName: t.operationName,
|
|
2350
2322
|
query: t.query
|
|
2351
2323
|
};
|
|
2352
|
-
return e.operationName || (e.operationName = typeof e.query != "string" ?
|
|
2324
|
+
return e.operationName || (e.operationName = typeof e.query != "string" ? jr(e.query) || void 0 : ""), e;
|
|
2353
2325
|
}
|
|
2354
|
-
var
|
|
2355
|
-
function
|
|
2356
|
-
return
|
|
2326
|
+
var Gr = Symbol.for("apollo.deprecations"), Xr = ae, Qr = new de();
|
|
2327
|
+
function Zr(t) {
|
|
2328
|
+
return Xr[Gr] || (Qr.getValue() || []).includes(t);
|
|
2357
2329
|
}
|
|
2358
|
-
function
|
|
2359
|
-
|
|
2330
|
+
function to(t, e) {
|
|
2331
|
+
Zr(t) || e();
|
|
2360
2332
|
}
|
|
2361
|
-
function
|
|
2362
|
-
return e ? e(t) :
|
|
2333
|
+
function ze(t, e) {
|
|
2334
|
+
return e ? e(t) : E.of();
|
|
2363
2335
|
}
|
|
2364
|
-
function
|
|
2365
|
-
return typeof t == "function" ? new
|
|
2336
|
+
function Nt(t) {
|
|
2337
|
+
return typeof t == "function" ? new Qe(t) : t;
|
|
2366
2338
|
}
|
|
2367
2339
|
function Ut(t) {
|
|
2368
2340
|
return t.request.length <= 1;
|
|
2369
2341
|
}
|
|
2370
|
-
var
|
|
2342
|
+
var Qe = (
|
|
2371
2343
|
/** @class */
|
|
2372
2344
|
(function() {
|
|
2373
2345
|
function t(e) {
|
|
@@ -2375,43 +2347,43 @@ var tr = (
|
|
|
2375
2347
|
}
|
|
2376
2348
|
return t.empty = function() {
|
|
2377
2349
|
return new t(function() {
|
|
2378
|
-
return
|
|
2350
|
+
return E.of();
|
|
2379
2351
|
});
|
|
2380
2352
|
}, t.from = function(e) {
|
|
2381
|
-
return e.length === 0 ? t.empty() : e.map(
|
|
2353
|
+
return e.length === 0 ? t.empty() : e.map(Nt).reduce(function(r, o) {
|
|
2382
2354
|
return r.concat(o);
|
|
2383
2355
|
});
|
|
2384
2356
|
}, t.split = function(e, r, o) {
|
|
2385
|
-
var n =
|
|
2386
|
-
return Ut(n) && Ut(
|
|
2387
|
-
return e(d) ? n.request(d) ||
|
|
2388
|
-
}) :
|
|
2389
|
-
return e(d) ? n.request(d, i) ||
|
|
2390
|
-
}), Object.assign(
|
|
2357
|
+
var n = Nt(r), l = Nt(o || new t(ze)), c;
|
|
2358
|
+
return Ut(n) && Ut(l) ? c = new t(function(d) {
|
|
2359
|
+
return e(d) ? n.request(d) || E.of() : l.request(d) || E.of();
|
|
2360
|
+
}) : c = new t(function(d, i) {
|
|
2361
|
+
return e(d) ? n.request(d, i) || E.of() : l.request(d, i) || E.of();
|
|
2362
|
+
}), Object.assign(c, { left: n, right: l });
|
|
2391
2363
|
}, t.execute = function(e, r) {
|
|
2392
|
-
return e.request(
|
|
2364
|
+
return e.request(Jr(r.context, Wr(Kr(r)))) || E.of();
|
|
2393
2365
|
}, t.concat = function(e, r) {
|
|
2394
|
-
var o =
|
|
2366
|
+
var o = Nt(e);
|
|
2395
2367
|
if (Ut(o))
|
|
2396
2368
|
return globalThis.__DEV__ !== !1 && Zt.warn(47, o), o;
|
|
2397
|
-
var n =
|
|
2398
|
-
return Ut(n) ?
|
|
2399
|
-
return o.request(
|
|
2400
|
-
return n.request(d) ||
|
|
2401
|
-
}) ||
|
|
2402
|
-
}) :
|
|
2403
|
-
return o.request(
|
|
2404
|
-
return n.request(i, d) ||
|
|
2405
|
-
}) ||
|
|
2406
|
-
}), Object.assign(
|
|
2369
|
+
var n = Nt(r), l;
|
|
2370
|
+
return Ut(n) ? l = new t(function(c) {
|
|
2371
|
+
return o.request(c, function(d) {
|
|
2372
|
+
return n.request(d) || E.of();
|
|
2373
|
+
}) || E.of();
|
|
2374
|
+
}) : l = new t(function(c, d) {
|
|
2375
|
+
return o.request(c, function(i) {
|
|
2376
|
+
return n.request(i, d) || E.of();
|
|
2377
|
+
}) || E.of();
|
|
2378
|
+
}), Object.assign(l, { left: o, right: n });
|
|
2407
2379
|
}, t.prototype.split = function(e, r, o) {
|
|
2408
|
-
return this.concat(t.split(e, r, o || new t(
|
|
2380
|
+
return this.concat(t.split(e, r, o || new t(ze)));
|
|
2409
2381
|
}, t.prototype.concat = function(e) {
|
|
2410
2382
|
return t.concat(this, e);
|
|
2411
2383
|
}, t.prototype.request = function(e, r) {
|
|
2412
|
-
throw
|
|
2384
|
+
throw Ke(48);
|
|
2413
2385
|
}, t.prototype.onError = function(e, r) {
|
|
2414
|
-
if (globalThis.__DEV__ !== !1 &&
|
|
2386
|
+
if (globalThis.__DEV__ !== !1 && to("onError", function() {
|
|
2415
2387
|
globalThis.__DEV__ !== !1 && Zt.warn(49);
|
|
2416
2388
|
}), r && r.error)
|
|
2417
2389
|
return r.error(e), !1;
|
|
@@ -2421,29 +2393,29 @@ var tr = (
|
|
|
2421
2393
|
}, t;
|
|
2422
2394
|
})()
|
|
2423
2395
|
);
|
|
2424
|
-
function
|
|
2425
|
-
return new
|
|
2426
|
-
var o =
|
|
2427
|
-
return new
|
|
2428
|
-
var
|
|
2396
|
+
function eo(t) {
|
|
2397
|
+
return new Qe(function(e, r) {
|
|
2398
|
+
var o = Tr(e, []);
|
|
2399
|
+
return new E(function(n) {
|
|
2400
|
+
var l, c = !1;
|
|
2429
2401
|
return Promise.resolve(o).then(function(d) {
|
|
2430
2402
|
return t(d, e.getContext());
|
|
2431
2403
|
}).then(e.setContext).then(function() {
|
|
2432
|
-
|
|
2404
|
+
c || (l = r(e).subscribe({
|
|
2433
2405
|
next: n.next.bind(n),
|
|
2434
2406
|
error: n.error.bind(n),
|
|
2435
2407
|
complete: n.complete.bind(n)
|
|
2436
2408
|
}));
|
|
2437
2409
|
}).catch(n.error.bind(n)), function() {
|
|
2438
|
-
|
|
2410
|
+
c = !0, l && l.unsubscribe();
|
|
2439
2411
|
};
|
|
2440
2412
|
});
|
|
2441
2413
|
});
|
|
2442
2414
|
}
|
|
2443
|
-
const
|
|
2415
|
+
const ro = async () => {
|
|
2444
2416
|
const t = "https://auth.australia-southeast1.gcp.commercetools.com/oauth/token", o = "Basic " + btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN") + ":" + encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));
|
|
2445
2417
|
try {
|
|
2446
|
-
const n = await
|
|
2418
|
+
const n = await T.post(
|
|
2447
2419
|
t,
|
|
2448
2420
|
new URLSearchParams({ grant_type: "client_credentials" }),
|
|
2449
2421
|
// Only grant_type in body
|
|
@@ -2456,32 +2428,32 @@ const oo = async () => {
|
|
|
2456
2428
|
);
|
|
2457
2429
|
return n.status === 200 && n.data.access_token ? n.data.access_token : (console.error("Failed to fetch token:", n.data), null);
|
|
2458
2430
|
} catch (n) {
|
|
2459
|
-
return
|
|
2431
|
+
return T.isAxiosError(n) ? console.error("Error fetching token:", n.response || n.message) : console.error("Unexpected error:", n), null;
|
|
2460
2432
|
}
|
|
2461
|
-
},
|
|
2462
|
-
uri: `${
|
|
2463
|
-
}),
|
|
2464
|
-
const r = await
|
|
2433
|
+
}, oo = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", no = ar({
|
|
2434
|
+
uri: `${oo}`
|
|
2435
|
+
}), ao = eo(async (t, { headers: e }) => {
|
|
2436
|
+
const r = await ro();
|
|
2465
2437
|
return {
|
|
2466
2438
|
headers: {
|
|
2467
2439
|
...e,
|
|
2468
2440
|
authorization: `Bearer ${r}`
|
|
2469
2441
|
}
|
|
2470
2442
|
};
|
|
2471
|
-
}),
|
|
2472
|
-
link:
|
|
2473
|
-
cache: new
|
|
2443
|
+
}), io = new ir({
|
|
2444
|
+
link: ao.concat(no),
|
|
2445
|
+
cache: new sr(),
|
|
2474
2446
|
defaultOptions: {
|
|
2475
2447
|
watchQuery: {
|
|
2476
2448
|
fetchPolicy: "cache-and-network"
|
|
2477
2449
|
}
|
|
2478
2450
|
}
|
|
2479
|
-
}),
|
|
2451
|
+
}), Co = (t) => {
|
|
2480
2452
|
const { tanyaConfig: e } = t;
|
|
2481
|
-
return /* @__PURE__ */ a(
|
|
2453
|
+
return /* @__PURE__ */ a(lr, { client: io, children: /* @__PURE__ */ a(gr, { children: /* @__PURE__ */ a(Nr, { tanyaConfig: e }) }) });
|
|
2482
2454
|
};
|
|
2483
2455
|
export {
|
|
2484
|
-
|
|
2485
|
-
|
|
2456
|
+
Co as TanyaChatbot,
|
|
2457
|
+
bo as TanyaChatbotProvider
|
|
2486
2458
|
};
|
|
2487
2459
|
//# sourceMappingURL=tanya-chatbot.es.js.map
|