tanya-chatbot 0.6.2 → 0.6.3
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.es.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useEffect as H, useState as L, useRef as xt } 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
|
|
6
|
-
import * as
|
|
3
|
+
import { createHttpLink as ir, ApolloClient as sr, InMemoryCache as lr, ApolloProvider as cr } from "@apollo/client";
|
|
4
|
+
import { Provider as dr, useDispatch as Ae, useSelector as Rt } from "react-redux";
|
|
5
|
+
import { createSlice as je, configureStore as ur } from "@reduxjs/toolkit";
|
|
6
|
+
import * as De from "@radix-ui/react-popover";
|
|
7
7
|
import "clsx";
|
|
8
8
|
import "tailwind-merge";
|
|
9
9
|
import $ from "axios";
|
|
10
10
|
import "crypto-js";
|
|
11
|
-
import { Icon as
|
|
11
|
+
import { Icon as pr } from "@iconify/react";
|
|
12
12
|
import { toast as R } from "react-toastify";
|
|
13
13
|
const fr = '*,: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
14
|
function ko() {
|
|
@@ -55,7 +55,7 @@ const mr = {
|
|
|
55
55
|
mobile: []
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, Le = je({
|
|
59
59
|
name: "store",
|
|
60
60
|
initialState: mr,
|
|
61
61
|
reducers: {
|
|
@@ -63,9 +63,9 @@ const mr = {
|
|
|
63
63
|
t.store = e.payload;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
}), { setStore: So } =
|
|
66
|
+
}), { setStore: So } = Le.actions, hr = Le.reducer, wr = {
|
|
67
67
|
product: null
|
|
68
|
-
},
|
|
68
|
+
}, Be = je({
|
|
69
69
|
name: "product",
|
|
70
70
|
initialState: wr,
|
|
71
71
|
reducers: {
|
|
@@ -73,12 +73,12 @@ const mr = {
|
|
|
73
73
|
t.product = e.payload;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
}), { setProduct: oe } =
|
|
76
|
+
}), { setProduct: oe } = Be.actions, gr = Be.reducer, br = ur({
|
|
77
77
|
reducer: {
|
|
78
78
|
store: hr,
|
|
79
79
|
product: gr
|
|
80
80
|
}
|
|
81
|
-
}), xr = ({ children: t }) => /* @__PURE__ */ a(
|
|
81
|
+
}), xr = ({ children: t }) => /* @__PURE__ */ a(dr, { store: br, children: t }), Vt = (t) => {
|
|
82
82
|
const e = new CustomEvent("reactCartUpdated", {
|
|
83
83
|
detail: {
|
|
84
84
|
cartUpdated: !0,
|
|
@@ -90,14 +90,14 @@ const mr = {
|
|
|
90
90
|
function yr({
|
|
91
91
|
...t
|
|
92
92
|
}) {
|
|
93
|
-
return /* @__PURE__ */ a(
|
|
93
|
+
return /* @__PURE__ */ a(De.Root, { "data-slot": "popover", ...t });
|
|
94
94
|
}
|
|
95
95
|
function vr({
|
|
96
96
|
...t
|
|
97
97
|
}) {
|
|
98
|
-
return /* @__PURE__ */ a(
|
|
98
|
+
return /* @__PURE__ */ a(De.Trigger, { "data-slot": "popover-trigger", ...t });
|
|
99
99
|
}
|
|
100
|
-
const St = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1.amazonaws.com/dev/api/bedrock/invoke/stream", xAPIKey: "BJBtjpPkqGatuoa3qJqdR8aHXSsHkgvGaootbubi", serverUrl: "https://tanya-sfcc-server.vercel.app/", basePath: "sc-api" }),
|
|
100
|
+
const St = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1.amazonaws.com/dev/api/bedrock/invoke/stream", xAPIKey: "BJBtjpPkqGatuoa3qJqdR8aHXSsHkgvGaootbubi", serverUrl: "https://tanya-sfcc-server.vercel.app/", basePath: "sc-api" }), Ue = async () => {
|
|
101
101
|
const t = "https://tanya-sfcc-server.vercel.app/";
|
|
102
102
|
try {
|
|
103
103
|
const e = await $.post(
|
|
@@ -107,7 +107,7 @@ const St = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
|
|
|
107
107
|
} catch (e) {
|
|
108
108
|
return $.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
113
|
const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, o = await $.post(
|
|
@@ -152,7 +152,7 @@ const ot = () => sessionStorage.getItem("Host"), G = () => sessionStorage.getIte
|
|
|
152
152
|
} catch (n) {
|
|
153
153
|
throw console.error("Error fetching search results:", n), n;
|
|
154
154
|
}
|
|
155
|
-
},
|
|
155
|
+
}, Me = async (t) => {
|
|
156
156
|
if (!t) throw new Error("Product ID is required");
|
|
157
157
|
const { serverUrl: e, basePath: r } = St(), o = ot();
|
|
158
158
|
console.log("calling access");
|
|
@@ -168,7 +168,7 @@ const ot = () => sessionStorage.getItem("Host"), G = () => sessionStorage.getIte
|
|
|
168
168
|
)).data;
|
|
169
169
|
}, Sr = async (t) => {
|
|
170
170
|
if (!t) throw new Error("customerId is required");
|
|
171
|
-
const e = await
|
|
171
|
+
const e = await Ue(), { customer_token: r } = await qe(
|
|
172
172
|
e
|
|
173
173
|
), { serverUrl: o, basePath: n } = St(), l = (await Pt()).access_token;
|
|
174
174
|
return (await $.get(
|
|
@@ -180,10 +180,10 @@ const ot = () => sessionStorage.getItem("Host"), G = () => sessionStorage.getIte
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
)).data;
|
|
183
|
-
},
|
|
183
|
+
}, be = (t) => String(typeof t == "string" ? t : t["en-US"] || t), xe = (t) => t != null && t.image ? [t.image] : "variants" in t ? t.variants[0].images : t.masterVariant.images.map((e) => e.url), _r = (t, e) => t.toLocaleString("en-US", {
|
|
184
184
|
style: "currency",
|
|
185
185
|
currency: e || "USD"
|
|
186
|
-
}),
|
|
186
|
+
}), ye = (t) => {
|
|
187
187
|
var e, r, o;
|
|
188
188
|
return "variants" in t ? {
|
|
189
189
|
centAmount: (e = t.variants[0]) == null ? void 0 : e.prices.EUR.max,
|
|
@@ -192,7 +192,7 @@ const ot = () => sessionStorage.getItem("Host"), G = () => sessionStorage.getIte
|
|
|
192
192
|
centAmount: (r = t.masterVariant) == null ? void 0 : r.prices[0].value.centAmount,
|
|
193
193
|
currencyCode: (o = t.masterVariant) == null ? void 0 : o.prices[0].value.currencyCode
|
|
194
194
|
};
|
|
195
|
-
}, Cr = (t) => t.charAt(0).toUpperCase() + t.slice(1),
|
|
195
|
+
}, Cr = (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) => {
|
|
196
196
|
const o = e.match(/^(\d+)\.\s(.+)/);
|
|
197
197
|
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/>";
|
|
198
198
|
}).join("");
|
|
@@ -206,7 +206,7 @@ function Ir() {
|
|
|
206
206
|
const Fr = ({
|
|
207
207
|
product: t
|
|
208
208
|
}) => {
|
|
209
|
-
const e =
|
|
209
|
+
const e = Ae(), r = Ir(), [o, n] = L(0), c = () => {
|
|
210
210
|
n(
|
|
211
211
|
(s) => s + r >= t.length ? 0 : s + r
|
|
212
212
|
);
|
|
@@ -215,7 +215,7 @@ const Fr = ({
|
|
|
215
215
|
(s) => s - r < 0 ? t.length - (t.length % r || r) : s - r
|
|
216
216
|
);
|
|
217
217
|
}, d = async (s) => {
|
|
218
|
-
const m = await
|
|
218
|
+
const m = await Me(s);
|
|
219
219
|
e(oe(m));
|
|
220
220
|
};
|
|
221
221
|
return /* @__PURE__ */ a("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */ u("div", { className: "flex items-center justify-center gap-4 relative", children: [
|
|
@@ -245,7 +245,7 @@ const Fr = ({
|
|
|
245
245
|
/* @__PURE__ */ a("div", { className: "w-full p-2 flex items-center justify-center bg-white", children: /* @__PURE__ */ a(
|
|
246
246
|
"img",
|
|
247
247
|
{
|
|
248
|
-
src: ((m =
|
|
248
|
+
src: ((m = xe(s)[0]) == null ? void 0 : m.link) || xe(s)[0] || // fallback if it's a string
|
|
249
249
|
"https://via.placeholder.com/120",
|
|
250
250
|
alt: s != null && s.productName ? s.productName : "Product",
|
|
251
251
|
className: "w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"
|
|
@@ -257,8 +257,8 @@ const Fr = ({
|
|
|
257
257
|
className: "text-white w-full p-2 text-[12px] text-center h-[60px]",
|
|
258
258
|
children: [
|
|
259
259
|
/* @__PURE__ */ u("div", { className: "relative inline-block group", children: [
|
|
260
|
-
/* @__PURE__ */ a("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: s != null && s.productName ? s.productName : s != null && s.product_name ? s.product_name :
|
|
261
|
-
|
|
260
|
+
/* @__PURE__ */ a("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: s != null && s.productName ? s.productName : s != null && s.product_name ? s.product_name : ve(
|
|
261
|
+
be((h = s == null ? void 0 : s.name) == null ? void 0 : h["en-US"]),
|
|
262
262
|
60
|
|
263
263
|
) || "Product" }),
|
|
264
264
|
/* @__PURE__ */ a(
|
|
@@ -272,8 +272,8 @@ const Fr = ({
|
|
|
272
272
|
marginBottom: "5px",
|
|
273
273
|
zIndex: 50
|
|
274
274
|
},
|
|
275
|
-
children: s != null && s.productName ? s.productName : s != null && s.product_name ? s.product_name :
|
|
276
|
-
|
|
275
|
+
children: s != null && s.productName ? s.productName : s != null && s.product_name ? s.product_name : ve(
|
|
276
|
+
be((I = s == null ? void 0 : s.name) == null ? void 0 : I["en-US"]),
|
|
277
277
|
60
|
|
278
278
|
) || "Product"
|
|
279
279
|
}
|
|
@@ -281,8 +281,8 @@ const Fr = ({
|
|
|
281
281
|
] }),
|
|
282
282
|
/* @__PURE__ */ u("div", { className: " flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1", children: [
|
|
283
283
|
/* @__PURE__ */ a("p", { children: _r(
|
|
284
|
-
s != null && s.price ? Number(s == null ? void 0 : s.price) :
|
|
285
|
-
(v =
|
|
284
|
+
s != null && s.price ? Number(s == null ? void 0 : s.price) : ye(s).centAmount || 0,
|
|
285
|
+
(v = ye(s)) == null ? void 0 : v.currencyCode
|
|
286
286
|
) }),
|
|
287
287
|
/* @__PURE__ */ u("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
|
|
288
288
|
"$",
|
|
@@ -337,7 +337,7 @@ const Fr = ({
|
|
|
337
337
|
]
|
|
338
338
|
},
|
|
339
339
|
o
|
|
340
|
-
)) }),
|
|
340
|
+
)) }), He = async (t, e) => {
|
|
341
341
|
var c, l;
|
|
342
342
|
const { serverUrl: r, basePath: o } = St(), n = `${r}`;
|
|
343
343
|
try {
|
|
@@ -381,7 +381,7 @@ const Fr = ({
|
|
|
381
381
|
l.response || l.message
|
|
382
382
|
) : console.error("Unexpected error:", l), null;
|
|
383
383
|
}
|
|
384
|
-
},
|
|
384
|
+
}, Re = async ({
|
|
385
385
|
basketId: t,
|
|
386
386
|
customer_token: e
|
|
387
387
|
}) => {
|
|
@@ -401,7 +401,7 @@ const Fr = ({
|
|
|
401
401
|
} catch (l) {
|
|
402
402
|
return $.isAxiosError(l) ? { status: (c = l.response) == null ? void 0 : c.status, data: null } : { status: null, data: null };
|
|
403
403
|
}
|
|
404
|
-
}, Yt = "sfcc_basket_id",
|
|
404
|
+
}, Yt = "sfcc_basket_id", ke = "sfcc_customer_token", Tt = "sfcc_token_expiry", Er = 300 * 1e3, Bt = "1.0.0";
|
|
405
405
|
const it = (t) => {
|
|
406
406
|
try {
|
|
407
407
|
t ? localStorage.setItem(Yt, t) : localStorage.removeItem(Yt);
|
|
@@ -411,17 +411,17 @@ const it = (t) => {
|
|
|
411
411
|
}, Kt = (t) => {
|
|
412
412
|
try {
|
|
413
413
|
if (t) {
|
|
414
|
-
localStorage.setItem(
|
|
414
|
+
localStorage.setItem(ke, t);
|
|
415
415
|
const e = Date.now() + Er;
|
|
416
416
|
localStorage.setItem(Tt, e.toString());
|
|
417
417
|
} else
|
|
418
|
-
localStorage.removeItem(
|
|
418
|
+
localStorage.removeItem(ke);
|
|
419
419
|
} catch (e) {
|
|
420
420
|
console.error("Error storing token:", e);
|
|
421
421
|
}
|
|
422
|
-
},
|
|
422
|
+
}, Se = 300, Tr = ({ addToCartPwa: t }) => {
|
|
423
423
|
var s, m, h, I, v, V;
|
|
424
|
-
const e =
|
|
424
|
+
const e = Ae(), r = Rt((E) => E.product.product), o = Rt((E) => E.store.store), [n, c] = L(!!r);
|
|
425
425
|
if (H(() => {
|
|
426
426
|
c(!!r);
|
|
427
427
|
}, [r]), !r) return null;
|
|
@@ -451,7 +451,7 @@ const it = (t) => {
|
|
|
451
451
|
}
|
|
452
452
|
const ht = jt + 300 * 1e3;
|
|
453
453
|
if (Kt(j), localStorage.setItem(Tt, ht.toString()), mt) {
|
|
454
|
-
const Ft = await
|
|
454
|
+
const Ft = await Re({
|
|
455
455
|
basketId: mt,
|
|
456
456
|
customer_token: j
|
|
457
457
|
});
|
|
@@ -479,7 +479,7 @@ const it = (t) => {
|
|
|
479
479
|
quantity: 1
|
|
480
480
|
}
|
|
481
481
|
]
|
|
482
|
-
}, y = await
|
|
482
|
+
}, y = await He(j, Dt);
|
|
483
483
|
if (!(y != null && y.basket_id) && !(y != null && y.basketId)) {
|
|
484
484
|
console.error("Failed to create basket");
|
|
485
485
|
return;
|
|
@@ -520,7 +520,7 @@ const it = (t) => {
|
|
|
520
520
|
{
|
|
521
521
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
522
522
|
onClick: () => {
|
|
523
|
-
c(!1), setTimeout(() => e(oe(null)),
|
|
523
|
+
c(!1), setTimeout(() => e(oe(null)), Se);
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
526
|
),
|
|
@@ -538,16 +538,16 @@ const it = (t) => {
|
|
|
538
538
|
/* @__PURE__ */ u("div", { className: "mt-3 flex flex-row justify-between w-full ", children: [
|
|
539
539
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "text-[#000000] font-bold font-nunitoSans", children: r.name }) }),
|
|
540
540
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
541
|
-
|
|
541
|
+
"div",
|
|
542
542
|
{
|
|
543
|
-
icon: "mdi:close",
|
|
544
543
|
className: "text-[#555555] w-6 h-6 cursor-pointer",
|
|
545
544
|
onClick: () => {
|
|
546
545
|
c(!1), setTimeout(
|
|
547
546
|
() => e(oe(null)),
|
|
548
|
-
|
|
547
|
+
Se
|
|
549
548
|
);
|
|
550
|
-
}
|
|
549
|
+
},
|
|
550
|
+
children: "✕"
|
|
551
551
|
}
|
|
552
552
|
) })
|
|
553
553
|
] }),
|
|
@@ -618,7 +618,7 @@ const it = (t) => {
|
|
|
618
618
|
/* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((E, z) => {
|
|
619
619
|
var X;
|
|
620
620
|
return /* @__PURE__ */ a(
|
|
621
|
-
|
|
621
|
+
pr,
|
|
622
622
|
{
|
|
623
623
|
icon: "mdi:star",
|
|
624
624
|
width: "20",
|
|
@@ -909,19 +909,19 @@ const it = (t) => {
|
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
911
|
}
|
|
912
|
-
|
|
912
|
+
er(tr(M));
|
|
913
913
|
} catch (w) {
|
|
914
914
|
console.error("Error sending message to Tanya:", w);
|
|
915
915
|
} finally {
|
|
916
916
|
_t(!1);
|
|
917
917
|
}
|
|
918
918
|
}
|
|
919
|
-
},
|
|
919
|
+
}, tr = (i) => {
|
|
920
920
|
const x = i.match(
|
|
921
921
|
/top five relevant product or category names are: (.*)/i
|
|
922
922
|
), S = (x ? x[1] : i).split(", ").map((D) => D.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
|
|
923
923
|
return [...new Set(S)].filter(Boolean).join(",");
|
|
924
|
-
},
|
|
924
|
+
}, er = async (i) => {
|
|
925
925
|
var w, _, S;
|
|
926
926
|
const x = typeof i == "string" ? i.split(",") : i;
|
|
927
927
|
pt(!0);
|
|
@@ -965,11 +965,11 @@ const it = (t) => {
|
|
|
965
965
|
} finally {
|
|
966
966
|
pt(!1);
|
|
967
967
|
}
|
|
968
|
-
},
|
|
968
|
+
}, rr = async (i, x) => {
|
|
969
969
|
var w, _, S, g, D, O, C, T, Z, wt, q, M, K, J, tt;
|
|
970
970
|
Y(!0);
|
|
971
971
|
try {
|
|
972
|
-
const p = await
|
|
972
|
+
const p = await Me(i.id);
|
|
973
973
|
if (!((_ = (w = p == null ? void 0 : p.variants) == null ? void 0 : w[0]) != null && _.product_id || (g = (S = p == null ? void 0 : p.variants) == null ? void 0 : S[0]) != null && g.productId) && !(p.type.item || p.type.bundle)) {
|
|
974
974
|
Y(!1), R.error("Variants not found", {
|
|
975
975
|
position: "bottom-right",
|
|
@@ -988,17 +988,17 @@ const it = (t) => {
|
|
|
988
988
|
sessionStorage.getItem("customerData") || "{}"
|
|
989
989
|
), A = (F == null ? void 0 : F.basketId) || localStorage.getItem(Yt), et = !1, Lt = localStorage.getItem(Tt), we = Date.now();
|
|
990
990
|
if (!et || !Lt || we >= parseInt(Lt)) {
|
|
991
|
-
const
|
|
992
|
-
let { customer_token: gt } = await
|
|
993
|
-
|
|
991
|
+
const or = await Ue();
|
|
992
|
+
let { customer_token: gt } = await qe(
|
|
993
|
+
or
|
|
994
994
|
);
|
|
995
995
|
if (gt = "Bearer " + m.access_token, !gt) {
|
|
996
996
|
console.error("Failed to get customer_token");
|
|
997
997
|
return;
|
|
998
998
|
}
|
|
999
|
-
const
|
|
1000
|
-
if (Kt(gt), localStorage.setItem(Tt,
|
|
1001
|
-
const ge = await
|
|
999
|
+
const nr = we + 300 * 1e3;
|
|
1000
|
+
if (Kt(gt), localStorage.setItem(Tt, nr.toString()), console.log(A, "basketIdFromCustomer"), A) {
|
|
1001
|
+
const ge = await Re({
|
|
1002
1002
|
basketId: A,
|
|
1003
1003
|
customer_token: gt
|
|
1004
1004
|
});
|
|
@@ -1019,14 +1019,14 @@ const it = (t) => {
|
|
|
1019
1019
|
return;
|
|
1020
1020
|
}
|
|
1021
1021
|
}
|
|
1022
|
-
const
|
|
1022
|
+
const ar = {
|
|
1023
1023
|
productItems: [
|
|
1024
1024
|
{
|
|
1025
1025
|
productId: ((T = p.variants) == null ? void 0 : T[0].product_id) || ((Z = p.variants) == null ? void 0 : Z[0].productId) || (p == null ? void 0 : p.id),
|
|
1026
1026
|
quantity: 1
|
|
1027
1027
|
}
|
|
1028
1028
|
]
|
|
1029
|
-
}, f = await
|
|
1029
|
+
}, f = await He(gt, ar);
|
|
1030
1030
|
if (console.log(
|
|
1031
1031
|
f,
|
|
1032
1032
|
f == null ? void 0 : f.basket_id,
|
|
@@ -1514,7 +1514,7 @@ const it = (t) => {
|
|
|
1514
1514
|
"button",
|
|
1515
1515
|
{
|
|
1516
1516
|
onClick: () => {
|
|
1517
|
-
|
|
1517
|
+
rr(
|
|
1518
1518
|
zt(
|
|
1519
1519
|
i.productSnapshot
|
|
1520
1520
|
),
|
|
@@ -1646,9 +1646,9 @@ function $r(t, e) {
|
|
|
1646
1646
|
e.indexOf(o[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[n]) && (r[o[n]] = t[o[n]]);
|
|
1647
1647
|
return r;
|
|
1648
1648
|
}
|
|
1649
|
-
var Qt = "Invariant Violation",
|
|
1649
|
+
var Qt = "Invariant Violation", _e = Object.setPrototypeOf, zr = _e === void 0 ? function(t, e) {
|
|
1650
1650
|
return t.__proto__ = e, t;
|
|
1651
|
-
} :
|
|
1651
|
+
} : _e, Ve = (
|
|
1652
1652
|
/** @class */
|
|
1653
1653
|
(function(t) {
|
|
1654
1654
|
Or(e, t);
|
|
@@ -1662,12 +1662,12 @@ var Qt = "Invariant Violation", Ce = Object.setPrototypeOf, zr = Ce === void 0 ?
|
|
|
1662
1662
|
);
|
|
1663
1663
|
function at(t, e) {
|
|
1664
1664
|
if (!t)
|
|
1665
|
-
throw new
|
|
1665
|
+
throw new Ve(e);
|
|
1666
1666
|
}
|
|
1667
|
-
var
|
|
1667
|
+
var Ye = ["debug", "log", "warn", "error", "silent"], Ar = Ye.indexOf("log");
|
|
1668
1668
|
function Ut(t) {
|
|
1669
1669
|
return function() {
|
|
1670
|
-
if (
|
|
1670
|
+
if (Ye.indexOf(t) >= Ar) {
|
|
1671
1671
|
var e = console[t] || console.log;
|
|
1672
1672
|
return e.apply(console, arguments);
|
|
1673
1673
|
}
|
|
@@ -1676,7 +1676,7 @@ function Ut(t) {
|
|
|
1676
1676
|
(function(t) {
|
|
1677
1677
|
t.debug = Ut("debug"), t.log = Ut("log"), t.warn = Ut("warn"), t.error = Ut("error");
|
|
1678
1678
|
})(at || (at = {}));
|
|
1679
|
-
var
|
|
1679
|
+
var Ke = "3.14.0";
|
|
1680
1680
|
function yt(t) {
|
|
1681
1681
|
try {
|
|
1682
1682
|
return t();
|
|
@@ -1700,10 +1700,10 @@ const ie = yt(function() {
|
|
|
1700
1700
|
yt(function() {
|
|
1701
1701
|
return yt.constructor("return this")();
|
|
1702
1702
|
});
|
|
1703
|
-
var
|
|
1703
|
+
var Ce = /* @__PURE__ */ new Map();
|
|
1704
1704
|
function jr(t) {
|
|
1705
|
-
var e =
|
|
1706
|
-
return
|
|
1705
|
+
var e = Ce.get(t) || 1;
|
|
1706
|
+
return Ce.set(t, e + 1), "".concat(t, ":").concat(e, ":").concat(Math.random().toString(36).slice(2));
|
|
1707
1707
|
}
|
|
1708
1708
|
function Dr(t, e) {
|
|
1709
1709
|
var r = jr("stringifyForDisplay");
|
|
@@ -1732,13 +1732,13 @@ var Zt = Object.assign(function(e, r) {
|
|
|
1732
1732
|
warn: qt(at.warn),
|
|
1733
1733
|
error: qt(at.error)
|
|
1734
1734
|
});
|
|
1735
|
-
function
|
|
1735
|
+
function Je(t) {
|
|
1736
1736
|
for (var e = [], r = 1; r < arguments.length; r++)
|
|
1737
1737
|
e[r - 1] = arguments[r];
|
|
1738
|
-
return new
|
|
1738
|
+
return new Ve(ce(t, e) || de(t, e));
|
|
1739
1739
|
}
|
|
1740
|
-
var
|
|
1741
|
-
function
|
|
1740
|
+
var Ie = Symbol.for("ApolloErrorMessageHandler_" + Ke);
|
|
1741
|
+
function We(t) {
|
|
1742
1742
|
if (typeof t == "string")
|
|
1743
1743
|
return t;
|
|
1744
1744
|
try {
|
|
@@ -1749,14 +1749,14 @@ function Ge(t) {
|
|
|
1749
1749
|
}
|
|
1750
1750
|
function ce(t, e) {
|
|
1751
1751
|
if (e === void 0 && (e = []), !!t)
|
|
1752
|
-
return ie[
|
|
1752
|
+
return ie[Ie] && ie[Ie](t, e.map(We));
|
|
1753
1753
|
}
|
|
1754
1754
|
function de(t, e) {
|
|
1755
1755
|
if (e === void 0 && (e = []), !!t)
|
|
1756
1756
|
return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
|
|
1757
|
-
version:
|
|
1757
|
+
version: Ke,
|
|
1758
1758
|
message: t,
|
|
1759
|
-
args: e.map(
|
|
1759
|
+
args: e.map(We)
|
|
1760
1760
|
})));
|
|
1761
1761
|
}
|
|
1762
1762
|
function Lr(t) {
|
|
@@ -1767,7 +1767,7 @@ function Lr(t) {
|
|
|
1767
1767
|
})[0] || null;
|
|
1768
1768
|
}
|
|
1769
1769
|
let N = null;
|
|
1770
|
-
const
|
|
1770
|
+
const Fe = {};
|
|
1771
1771
|
let Br = 1;
|
|
1772
1772
|
const Ur = () => class {
|
|
1773
1773
|
constructor() {
|
|
@@ -1782,11 +1782,11 @@ const Ur = () => class {
|
|
|
1782
1782
|
for (let e = N; e; e = e.parent)
|
|
1783
1783
|
if (this.id in e.slots) {
|
|
1784
1784
|
const r = e.slots[this.id];
|
|
1785
|
-
if (r ===
|
|
1785
|
+
if (r === Fe)
|
|
1786
1786
|
break;
|
|
1787
1787
|
return e !== N && (N.slots[this.id] = r), !0;
|
|
1788
1788
|
}
|
|
1789
|
-
return N && (N.slots[this.id] =
|
|
1789
|
+
return N && (N.slots[this.id] = Fe), !1;
|
|
1790
1790
|
}
|
|
1791
1791
|
getValue() {
|
|
1792
1792
|
if (this.hasValue())
|
|
@@ -1830,7 +1830,7 @@ const Ur = () => class {
|
|
|
1830
1830
|
return e.apply(o, r);
|
|
1831
1831
|
}
|
|
1832
1832
|
};
|
|
1833
|
-
function
|
|
1833
|
+
function Ne(t) {
|
|
1834
1834
|
try {
|
|
1835
1835
|
return t();
|
|
1836
1836
|
} catch {
|
|
@@ -1839,18 +1839,18 @@ function Ee(t) {
|
|
|
1839
1839
|
const te = "@wry/context:Slot", qr = (
|
|
1840
1840
|
// Prefer globalThis when available.
|
|
1841
1841
|
// https://github.com/benjamn/wryware/issues/347
|
|
1842
|
-
|
|
1842
|
+
Ne(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
|
|
1843
1843
|
// bundlers to the appropriate identifier (window, self, ...) depending on the
|
|
1844
1844
|
// bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224
|
|
1845
|
-
|
|
1845
|
+
Ne(() => global) || // Otherwise, use a dummy host that's local to this module. We used to fall
|
|
1846
1846
|
// back to using the Array constructor as a namespace, but that was flagged in
|
|
1847
1847
|
// https://github.com/benjamn/wryware/issues/347, and can be avoided.
|
|
1848
1848
|
/* @__PURE__ */ Object.create(null)
|
|
1849
|
-
),
|
|
1849
|
+
), Ee = qr, ue = Ee[te] || // Earlier versions of this package stored the globalKey property on the Array
|
|
1850
1850
|
// constructor, so we check there as well, to prevent Slot class duplication.
|
|
1851
1851
|
Array[te] || (function(t) {
|
|
1852
1852
|
try {
|
|
1853
|
-
Object.defineProperty(
|
|
1853
|
+
Object.defineProperty(Ee, te, {
|
|
1854
1854
|
value: t,
|
|
1855
1855
|
enumerable: !1,
|
|
1856
1856
|
writable: !1,
|
|
@@ -1882,26 +1882,26 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1882
1882
|
}
|
|
1883
1883
|
function Hr(t, e) {
|
|
1884
1884
|
if (t) {
|
|
1885
|
-
if (typeof t == "string") return
|
|
1885
|
+
if (typeof t == "string") return Te(t, e);
|
|
1886
1886
|
var r = Object.prototype.toString.call(t).slice(8, -1);
|
|
1887
1887
|
if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set") return Array.from(t);
|
|
1888
|
-
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return
|
|
1888
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return Te(t, e);
|
|
1889
1889
|
}
|
|
1890
1890
|
}
|
|
1891
|
-
function
|
|
1891
|
+
function Te(t, e) {
|
|
1892
1892
|
(e == null || e > t.length) && (e = t.length);
|
|
1893
1893
|
for (var r = 0, o = new Array(e); r < e; r++)
|
|
1894
1894
|
o[r] = t[r];
|
|
1895
1895
|
return o;
|
|
1896
1896
|
}
|
|
1897
|
-
function
|
|
1897
|
+
function Pe(t, e) {
|
|
1898
1898
|
for (var r = 0; r < e.length; r++) {
|
|
1899
1899
|
var o = e[r];
|
|
1900
1900
|
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
|
|
1901
1901
|
}
|
|
1902
1902
|
}
|
|
1903
1903
|
function pe(t, e, r) {
|
|
1904
|
-
return e &&
|
|
1904
|
+
return e && Pe(t.prototype, e), r && Pe(t, r), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
1905
1905
|
}
|
|
1906
1906
|
var fe = function() {
|
|
1907
1907
|
return typeof Symbol == "function";
|
|
@@ -1911,7 +1911,7 @@ var fe = function() {
|
|
|
1911
1911
|
return me(t) ? Symbol[t] : "@@" + t;
|
|
1912
1912
|
};
|
|
1913
1913
|
fe() && !me("observable") && (Symbol.observable = Symbol("observable"));
|
|
1914
|
-
var Rr = he("iterator"), se = he("observable"),
|
|
1914
|
+
var Rr = he("iterator"), se = he("observable"), Ge = he("species");
|
|
1915
1915
|
function Jt(t, e) {
|
|
1916
1916
|
var r = t[e];
|
|
1917
1917
|
if (r != null) {
|
|
@@ -1921,7 +1921,7 @@ function Jt(t, e) {
|
|
|
1921
1921
|
}
|
|
1922
1922
|
function Nt(t) {
|
|
1923
1923
|
var e = t.constructor;
|
|
1924
|
-
return e !== void 0 && (e = e[
|
|
1924
|
+
return e !== void 0 && (e = e[Ge], e === null && (e = void 0)), e !== void 0 ? e : P;
|
|
1925
1925
|
}
|
|
1926
1926
|
function Vr(t) {
|
|
1927
1927
|
return t instanceof P;
|
|
@@ -1940,7 +1940,7 @@ function Ht(t) {
|
|
|
1940
1940
|
}
|
|
1941
1941
|
});
|
|
1942
1942
|
}
|
|
1943
|
-
function
|
|
1943
|
+
function Xe(t) {
|
|
1944
1944
|
var e = t._cleanup;
|
|
1945
1945
|
if (e !== void 0 && (t._cleanup = void 0, !!e))
|
|
1946
1946
|
try {
|
|
@@ -1961,11 +1961,11 @@ function Yr(t) {
|
|
|
1961
1961
|
var e = t._queue;
|
|
1962
1962
|
if (e) {
|
|
1963
1963
|
t._queue = void 0, t._state = "ready";
|
|
1964
|
-
for (var r = 0; r < e.length && (
|
|
1964
|
+
for (var r = 0; r < e.length && (Qe(t, e[r].type, e[r].value), t._state !== "closed"); ++r)
|
|
1965
1965
|
;
|
|
1966
1966
|
}
|
|
1967
1967
|
}
|
|
1968
|
-
function
|
|
1968
|
+
function Qe(t, e, r) {
|
|
1969
1969
|
t._state = "running";
|
|
1970
1970
|
var o = t._observer;
|
|
1971
1971
|
try {
|
|
@@ -1985,7 +1985,7 @@ function Ze(t, e, r) {
|
|
|
1985
1985
|
} catch (c) {
|
|
1986
1986
|
kt(c);
|
|
1987
1987
|
}
|
|
1988
|
-
t._state === "closed" ?
|
|
1988
|
+
t._state === "closed" ? Xe(t) : t._state === "running" && (t._state = "ready");
|
|
1989
1989
|
}
|
|
1990
1990
|
function ee(t, e, r) {
|
|
1991
1991
|
if (t._state !== "closed") {
|
|
@@ -2005,7 +2005,7 @@ function ee(t, e, r) {
|
|
|
2005
2005
|
});
|
|
2006
2006
|
return;
|
|
2007
2007
|
}
|
|
2008
|
-
|
|
2008
|
+
Qe(t, e, r);
|
|
2009
2009
|
}
|
|
2010
2010
|
}
|
|
2011
2011
|
var Kr = /* @__PURE__ */ (function() {
|
|
@@ -2021,7 +2021,7 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2021
2021
|
}
|
|
2022
2022
|
var e = t.prototype;
|
|
2023
2023
|
return e.unsubscribe = function() {
|
|
2024
|
-
this._state !== "closed" && (le(this),
|
|
2024
|
+
this._state !== "closed" && (le(this), Xe(this));
|
|
2025
2025
|
}, pe(t, [{
|
|
2026
2026
|
key: "closed",
|
|
2027
2027
|
get: function() {
|
|
@@ -2266,7 +2266,7 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2266
2266
|
});
|
|
2267
2267
|
});
|
|
2268
2268
|
}, pe(t, null, [{
|
|
2269
|
-
key:
|
|
2269
|
+
key: Ge,
|
|
2270
2270
|
get: function() {
|
|
2271
2271
|
return this;
|
|
2272
2272
|
}
|
|
@@ -2298,8 +2298,8 @@ function Wr(t) {
|
|
|
2298
2298
|
var vt;
|
|
2299
2299
|
typeof self < "u" ? vt = self : typeof window < "u" ? vt = window : typeof global < "u" ? vt = global : typeof module < "u" ? vt = module : vt = Function("return this")();
|
|
2300
2300
|
Wr(vt);
|
|
2301
|
-
var
|
|
2302
|
-
$e
|
|
2301
|
+
var Oe = P.prototype, $e = "@@observable";
|
|
2302
|
+
Oe[$e] || (Oe[$e] = function() {
|
|
2303
2303
|
return this;
|
|
2304
2304
|
});
|
|
2305
2305
|
function Gr(t) {
|
|
@@ -2312,7 +2312,7 @@ function Gr(t) {
|
|
|
2312
2312
|
], r = 0, o = Object.keys(t); r < o.length; r++) {
|
|
2313
2313
|
var n = o[r];
|
|
2314
2314
|
if (e.indexOf(n) < 0)
|
|
2315
|
-
throw
|
|
2315
|
+
throw Je(58, n);
|
|
2316
2316
|
}
|
|
2317
2317
|
return t;
|
|
2318
2318
|
}
|
|
@@ -2346,16 +2346,16 @@ function ro(t) {
|
|
|
2346
2346
|
function oo(t, e) {
|
|
2347
2347
|
ro(t) || e();
|
|
2348
2348
|
}
|
|
2349
|
-
function
|
|
2349
|
+
function ze(t, e) {
|
|
2350
2350
|
return e ? e(t) : P.of();
|
|
2351
2351
|
}
|
|
2352
2352
|
function Et(t) {
|
|
2353
|
-
return typeof t == "function" ? new
|
|
2353
|
+
return typeof t == "function" ? new Ze(t) : t;
|
|
2354
2354
|
}
|
|
2355
2355
|
function Mt(t) {
|
|
2356
2356
|
return t.request.length <= 1;
|
|
2357
2357
|
}
|
|
2358
|
-
var
|
|
2358
|
+
var Ze = (
|
|
2359
2359
|
/** @class */
|
|
2360
2360
|
(function() {
|
|
2361
2361
|
function t(e) {
|
|
@@ -2370,7 +2370,7 @@ var tr = (
|
|
|
2370
2370
|
return r.concat(o);
|
|
2371
2371
|
});
|
|
2372
2372
|
}, t.split = function(e, r, o) {
|
|
2373
|
-
var n = Et(r), c = Et(o || new t(
|
|
2373
|
+
var n = Et(r), c = Et(o || new t(ze)), l;
|
|
2374
2374
|
return Mt(n) && Mt(c) ? l = new t(function(d) {
|
|
2375
2375
|
return e(d) ? n.request(d) || P.of() : c.request(d) || P.of();
|
|
2376
2376
|
}) : l = new t(function(d, s) {
|
|
@@ -2393,11 +2393,11 @@ var tr = (
|
|
|
2393
2393
|
}) || P.of();
|
|
2394
2394
|
}), Object.assign(c, { left: o, right: n });
|
|
2395
2395
|
}, t.prototype.split = function(e, r, o) {
|
|
2396
|
-
return this.concat(t.split(e, r, o || new t(
|
|
2396
|
+
return this.concat(t.split(e, r, o || new t(ze)));
|
|
2397
2397
|
}, t.prototype.concat = function(e) {
|
|
2398
2398
|
return t.concat(this, e);
|
|
2399
2399
|
}, t.prototype.request = function(e, r) {
|
|
2400
|
-
throw
|
|
2400
|
+
throw Je(48);
|
|
2401
2401
|
}, t.prototype.onError = function(e, r) {
|
|
2402
2402
|
if (globalThis.__DEV__ !== !1 && oo("onError", function() {
|
|
2403
2403
|
globalThis.__DEV__ !== !1 && Zt.warn(49);
|
|
@@ -2410,7 +2410,7 @@ var tr = (
|
|
|
2410
2410
|
})()
|
|
2411
2411
|
);
|
|
2412
2412
|
function no(t) {
|
|
2413
|
-
return new
|
|
2413
|
+
return new Ze(function(e, r) {
|
|
2414
2414
|
var o = $r(e, []);
|
|
2415
2415
|
return new P(function(n) {
|
|
2416
2416
|
var c, l = !1;
|
|
@@ -2446,7 +2446,7 @@ const ao = async () => {
|
|
|
2446
2446
|
} catch (n) {
|
|
2447
2447
|
return $.isAxiosError(n) ? console.error("Error fetching token:", n.response || n.message) : console.error("Unexpected error:", n), null;
|
|
2448
2448
|
}
|
|
2449
|
-
}, io = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", so =
|
|
2449
|
+
}, io = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", so = ir({
|
|
2450
2450
|
uri: `${io}`
|
|
2451
2451
|
}), lo = no(async (t, { headers: e }) => {
|
|
2452
2452
|
const r = await ao();
|
|
@@ -2456,9 +2456,9 @@ const ao = async () => {
|
|
|
2456
2456
|
authorization: `Bearer ${r}`
|
|
2457
2457
|
}
|
|
2458
2458
|
};
|
|
2459
|
-
}), co = new
|
|
2459
|
+
}), co = new sr({
|
|
2460
2460
|
link: lo.concat(so),
|
|
2461
|
-
cache: new
|
|
2461
|
+
cache: new lr(),
|
|
2462
2462
|
defaultOptions: {
|
|
2463
2463
|
watchQuery: {
|
|
2464
2464
|
fetchPolicy: "cache-and-network"
|
|
@@ -2466,7 +2466,7 @@ const ao = async () => {
|
|
|
2466
2466
|
}
|
|
2467
2467
|
}), Fo = (t) => {
|
|
2468
2468
|
const { tanyaConfig: e } = t;
|
|
2469
|
-
return /* @__PURE__ */ a(
|
|
2469
|
+
return /* @__PURE__ */ a(cr, { client: co, children: /* @__PURE__ */ a(xr, { children: /* @__PURE__ */ a(Pr, { tanyaConfig: e }) }) });
|
|
2470
2470
|
};
|
|
2471
2471
|
export {
|
|
2472
2472
|
Fo as TanyaChatbot,
|