tanya-chatbot 0.6.2 → 0.6.4
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,24 +411,24 @@ 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((F) => F.product.product), o = Rt((F) => F.store.store), [n, c] = L(!!r);
|
|
425
425
|
if (H(() => {
|
|
426
426
|
c(!!r);
|
|
427
427
|
}, [r]), !r) return null;
|
|
428
428
|
const l = async () => {
|
|
429
|
-
var
|
|
429
|
+
var F, z, X, dt, Y, ut, _t, Ot, pt, Ct, It, ft, $t, zt, nt, B;
|
|
430
430
|
try {
|
|
431
|
-
if (!((z = (
|
|
431
|
+
if (!((z = (F = r == null ? void 0 : r.variants) == null ? void 0 : F[0]) != null && z.product_id) && !(r.type.item || r.type.bundle) && !((dt = (X = r == null ? void 0 : r.variants) == null ? void 0 : X[0]) != null && dt.productId)) {
|
|
432
432
|
R.error("Variants not available", {
|
|
433
433
|
position: "bottom-right",
|
|
434
434
|
autoClose: 1e3
|
|
@@ -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;
|
|
@@ -512,7 +512,9 @@ const it = (t) => {
|
|
|
512
512
|
}));
|
|
513
513
|
}
|
|
514
514
|
}, d = () => {
|
|
515
|
-
|
|
515
|
+
if (!r) return;
|
|
516
|
+
const F = window.location.origin + r.id;
|
|
517
|
+
console.log("path", F), window.location.href = F;
|
|
516
518
|
};
|
|
517
519
|
return console.log(r, "the prod"), /* @__PURE__ */ u(re, { children: [
|
|
518
520
|
/* @__PURE__ */ a(
|
|
@@ -520,7 +522,7 @@ const it = (t) => {
|
|
|
520
522
|
{
|
|
521
523
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
522
524
|
onClick: () => {
|
|
523
|
-
c(!1), setTimeout(() => e(oe(null)),
|
|
525
|
+
c(!1), setTimeout(() => e(oe(null)), Se);
|
|
524
526
|
}
|
|
525
527
|
}
|
|
526
528
|
),
|
|
@@ -533,21 +535,21 @@ const it = (t) => {
|
|
|
533
535
|
${n ? "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"}
|
|
534
536
|
`,
|
|
535
537
|
style: { willChange: "transform, opacity" },
|
|
536
|
-
onClick: (
|
|
538
|
+
onClick: (F) => F.stopPropagation(),
|
|
537
539
|
children: [
|
|
538
540
|
/* @__PURE__ */ u("div", { className: "mt-3 flex flex-row justify-between w-full ", children: [
|
|
539
541
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "text-[#000000] font-bold font-nunitoSans", children: r.name }) }),
|
|
540
542
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
541
|
-
|
|
543
|
+
"div",
|
|
542
544
|
{
|
|
543
|
-
icon: "mdi:close",
|
|
544
545
|
className: "text-[#555555] w-6 h-6 cursor-pointer",
|
|
545
546
|
onClick: () => {
|
|
546
547
|
c(!1), setTimeout(
|
|
547
548
|
() => e(oe(null)),
|
|
548
|
-
|
|
549
|
+
Se
|
|
549
550
|
);
|
|
550
|
-
}
|
|
551
|
+
},
|
|
552
|
+
children: "✕"
|
|
551
553
|
}
|
|
552
554
|
) })
|
|
553
555
|
] }),
|
|
@@ -561,7 +563,7 @@ const it = (t) => {
|
|
|
561
563
|
}
|
|
562
564
|
) }),
|
|
563
565
|
/* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-2", children: r.imageGroups.slice(1, 2).map(
|
|
564
|
-
(
|
|
566
|
+
(F) => F.images.slice(1, 2).map((z) => /* @__PURE__ */ a(
|
|
565
567
|
"img",
|
|
566
568
|
{
|
|
567
569
|
src: z.link,
|
|
@@ -615,10 +617,10 @@ const it = (t) => {
|
|
|
615
617
|
" ratings"
|
|
616
618
|
] })
|
|
617
619
|
] }) }),
|
|
618
|
-
/* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((
|
|
620
|
+
/* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((F, z) => {
|
|
619
621
|
var X;
|
|
620
622
|
return /* @__PURE__ */ a(
|
|
621
|
-
|
|
623
|
+
pr,
|
|
622
624
|
{
|
|
623
625
|
icon: "mdi:star",
|
|
624
626
|
width: "20",
|
|
@@ -635,7 +637,7 @@ const it = (t) => {
|
|
|
635
637
|
"div",
|
|
636
638
|
{
|
|
637
639
|
className: "flex flex-col items-center justify-between font-nunitoSans font-semibold w-5/6 text-black gap-2",
|
|
638
|
-
style: { marginTop: "
|
|
640
|
+
style: { marginTop: "70px" },
|
|
639
641
|
children: [
|
|
640
642
|
/* @__PURE__ */ a(
|
|
641
643
|
"button",
|
|
@@ -683,7 +685,7 @@ const it = (t) => {
|
|
|
683
685
|
Others: "others"
|
|
684
686
|
}, c = xt(null), l = xt(null), d = xt(null), s = xt(null), [m, h] = L(null);
|
|
685
687
|
xt(null);
|
|
686
|
-
const [I, v] = L(!1), [V,
|
|
688
|
+
const [I, v] = L(!1), [V, F] = L(!1), [z, X] = L(!1), [dt, Y] = L(!1), [ut, _t] = L(!1), [Ot, pt] = L(!1), [Ct, It] = L(""), [ft, $t] = L(""), zt = (i) => ({
|
|
687
689
|
id: i.id,
|
|
688
690
|
title: i.name,
|
|
689
691
|
image: i.image ?? "",
|
|
@@ -711,9 +713,9 @@ const it = (t) => {
|
|
|
711
713
|
i && localStorage.setItem(`chat-token-${t.siteId}`, i);
|
|
712
714
|
}, [nt]);
|
|
713
715
|
const Wt = () => {
|
|
714
|
-
X(!0), setTimeout(() =>
|
|
716
|
+
X(!0), setTimeout(() => F(!0), 10);
|
|
715
717
|
}, At = () => {
|
|
716
|
-
|
|
718
|
+
F(!1), setTimeout(() => X(!1), 300);
|
|
717
719
|
};
|
|
718
720
|
H(() => {
|
|
719
721
|
I ? Wt() : At();
|
|
@@ -822,8 +824,8 @@ const it = (t) => {
|
|
|
822
824
|
try {
|
|
823
825
|
const W = JSON.parse(p);
|
|
824
826
|
W.index === 0 && B(
|
|
825
|
-
(
|
|
826
|
-
(A, et) => et ===
|
|
827
|
+
(N) => N.map(
|
|
828
|
+
(A, et) => et === N.length - 1 ? {
|
|
827
829
|
...A,
|
|
828
830
|
secondaryResponse: W.data,
|
|
829
831
|
secondaryLoading: !1
|
|
@@ -832,8 +834,8 @@ const it = (t) => {
|
|
|
832
834
|
);
|
|
833
835
|
} catch (W) {
|
|
834
836
|
B(
|
|
835
|
-
(
|
|
836
|
-
(A, et) => et ===
|
|
837
|
+
(N) => N.map(
|
|
838
|
+
(A, et) => et === N.length - 1 ? { ...A, secondaryLoading: !1 } : A
|
|
837
839
|
)
|
|
838
840
|
), console.error("Secondary flow JSON parse error:", W);
|
|
839
841
|
}
|
|
@@ -895,33 +897,33 @@ const it = (t) => {
|
|
|
895
897
|
if (p.startsWith("data:")) {
|
|
896
898
|
const W = p.slice(5).trim();
|
|
897
899
|
try {
|
|
898
|
-
const
|
|
899
|
-
|
|
900
|
+
const N = JSON.parse(W);
|
|
901
|
+
N.index == 1 && (M = N.data), B(
|
|
900
902
|
(A) => A.map(
|
|
901
903
|
(et, Lt) => Lt === A.length - 1 ? {
|
|
902
904
|
...et,
|
|
903
|
-
[
|
|
905
|
+
[N.index == 0 ? "response" : N.index == 1 ? "keywords" : N.index == 2 ? "potentialQuestions" : "end"]: N.data
|
|
904
906
|
} : et
|
|
905
907
|
)
|
|
906
908
|
);
|
|
907
|
-
} catch (
|
|
908
|
-
console.error("Error parsing JSON:",
|
|
909
|
+
} catch (N) {
|
|
910
|
+
console.error("Error parsing JSON:", N);
|
|
909
911
|
}
|
|
910
912
|
}
|
|
911
913
|
}
|
|
912
|
-
|
|
914
|
+
er(tr(M));
|
|
913
915
|
} catch (w) {
|
|
914
916
|
console.error("Error sending message to Tanya:", w);
|
|
915
917
|
} finally {
|
|
916
918
|
_t(!1);
|
|
917
919
|
}
|
|
918
920
|
}
|
|
919
|
-
},
|
|
921
|
+
}, tr = (i) => {
|
|
920
922
|
const x = i.match(
|
|
921
923
|
/top five relevant product or category names are: (.*)/i
|
|
922
924
|
), S = (x ? x[1] : i).split(", ").map((D) => D.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
|
|
923
925
|
return [...new Set(S)].filter(Boolean).join(",");
|
|
924
|
-
},
|
|
926
|
+
}, er = async (i) => {
|
|
925
927
|
var w, _, S;
|
|
926
928
|
const x = typeof i == "string" ? i.split(",") : i;
|
|
927
929
|
pt(!0);
|
|
@@ -965,11 +967,11 @@ const it = (t) => {
|
|
|
965
967
|
} finally {
|
|
966
968
|
pt(!1);
|
|
967
969
|
}
|
|
968
|
-
},
|
|
970
|
+
}, rr = async (i, x) => {
|
|
969
971
|
var w, _, S, g, D, O, C, T, Z, wt, q, M, K, J, tt;
|
|
970
972
|
Y(!0);
|
|
971
973
|
try {
|
|
972
|
-
const p = await
|
|
974
|
+
const p = await Me(i.id);
|
|
973
975
|
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
976
|
Y(!1), R.error("Variants not found", {
|
|
975
977
|
position: "bottom-right",
|
|
@@ -984,21 +986,21 @@ const it = (t) => {
|
|
|
984
986
|
}
|
|
985
987
|
];
|
|
986
988
|
console.log(W, "product data", "app version", Bt);
|
|
987
|
-
const
|
|
989
|
+
const N = JSON.parse(
|
|
988
990
|
sessionStorage.getItem("customerData") || "{}"
|
|
989
|
-
), A = (
|
|
991
|
+
), A = (N == null ? void 0 : N.basketId) || localStorage.getItem(Yt), et = !1, Lt = localStorage.getItem(Tt), we = Date.now();
|
|
990
992
|
if (!et || !Lt || we >= parseInt(Lt)) {
|
|
991
|
-
const
|
|
992
|
-
let { customer_token: gt } = await
|
|
993
|
-
|
|
993
|
+
const or = await Ue();
|
|
994
|
+
let { customer_token: gt } = await qe(
|
|
995
|
+
or
|
|
994
996
|
);
|
|
995
997
|
if (gt = "Bearer " + m.access_token, !gt) {
|
|
996
998
|
console.error("Failed to get customer_token");
|
|
997
999
|
return;
|
|
998
1000
|
}
|
|
999
|
-
const
|
|
1000
|
-
if (Kt(gt), localStorage.setItem(Tt,
|
|
1001
|
-
const ge = await
|
|
1001
|
+
const nr = we + 300 * 1e3;
|
|
1002
|
+
if (Kt(gt), localStorage.setItem(Tt, nr.toString()), console.log(A, "basketIdFromCustomer"), A) {
|
|
1003
|
+
const ge = await Re({
|
|
1002
1004
|
basketId: A,
|
|
1003
1005
|
customer_token: gt
|
|
1004
1006
|
});
|
|
@@ -1019,14 +1021,14 @@ const it = (t) => {
|
|
|
1019
1021
|
return;
|
|
1020
1022
|
}
|
|
1021
1023
|
}
|
|
1022
|
-
const
|
|
1024
|
+
const ar = {
|
|
1023
1025
|
productItems: [
|
|
1024
1026
|
{
|
|
1025
1027
|
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
1028
|
quantity: 1
|
|
1027
1029
|
}
|
|
1028
1030
|
]
|
|
1029
|
-
}, f = await
|
|
1031
|
+
}, f = await He(gt, ar);
|
|
1030
1032
|
if (console.log(
|
|
1031
1033
|
f,
|
|
1032
1034
|
f == null ? void 0 : f.basket_id,
|
|
@@ -1068,7 +1070,7 @@ const it = (t) => {
|
|
|
1068
1070
|
Y(!1);
|
|
1069
1071
|
};
|
|
1070
1072
|
return H(() => {
|
|
1071
|
-
z ? setTimeout(() =>
|
|
1073
|
+
z ? setTimeout(() => F(!0), 10) : F(!1);
|
|
1072
1074
|
}, [z]), /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ u(yr, { open: I, onOpenChange: v, children: [
|
|
1073
1075
|
/* @__PURE__ */ a(
|
|
1074
1076
|
vr,
|
|
@@ -1514,7 +1516,7 @@ const it = (t) => {
|
|
|
1514
1516
|
"button",
|
|
1515
1517
|
{
|
|
1516
1518
|
onClick: () => {
|
|
1517
|
-
|
|
1519
|
+
rr(
|
|
1518
1520
|
zt(
|
|
1519
1521
|
i.productSnapshot
|
|
1520
1522
|
),
|
|
@@ -1646,9 +1648,9 @@ function $r(t, e) {
|
|
|
1646
1648
|
e.indexOf(o[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[n]) && (r[o[n]] = t[o[n]]);
|
|
1647
1649
|
return r;
|
|
1648
1650
|
}
|
|
1649
|
-
var Qt = "Invariant Violation",
|
|
1651
|
+
var Qt = "Invariant Violation", _e = Object.setPrototypeOf, zr = _e === void 0 ? function(t, e) {
|
|
1650
1652
|
return t.__proto__ = e, t;
|
|
1651
|
-
} :
|
|
1653
|
+
} : _e, Ve = (
|
|
1652
1654
|
/** @class */
|
|
1653
1655
|
(function(t) {
|
|
1654
1656
|
Or(e, t);
|
|
@@ -1662,12 +1664,12 @@ var Qt = "Invariant Violation", Ce = Object.setPrototypeOf, zr = Ce === void 0 ?
|
|
|
1662
1664
|
);
|
|
1663
1665
|
function at(t, e) {
|
|
1664
1666
|
if (!t)
|
|
1665
|
-
throw new
|
|
1667
|
+
throw new Ve(e);
|
|
1666
1668
|
}
|
|
1667
|
-
var
|
|
1669
|
+
var Ye = ["debug", "log", "warn", "error", "silent"], Ar = Ye.indexOf("log");
|
|
1668
1670
|
function Ut(t) {
|
|
1669
1671
|
return function() {
|
|
1670
|
-
if (
|
|
1672
|
+
if (Ye.indexOf(t) >= Ar) {
|
|
1671
1673
|
var e = console[t] || console.log;
|
|
1672
1674
|
return e.apply(console, arguments);
|
|
1673
1675
|
}
|
|
@@ -1676,7 +1678,7 @@ function Ut(t) {
|
|
|
1676
1678
|
(function(t) {
|
|
1677
1679
|
t.debug = Ut("debug"), t.log = Ut("log"), t.warn = Ut("warn"), t.error = Ut("error");
|
|
1678
1680
|
})(at || (at = {}));
|
|
1679
|
-
var
|
|
1681
|
+
var Ke = "3.14.0";
|
|
1680
1682
|
function yt(t) {
|
|
1681
1683
|
try {
|
|
1682
1684
|
return t();
|
|
@@ -1700,10 +1702,10 @@ const ie = yt(function() {
|
|
|
1700
1702
|
yt(function() {
|
|
1701
1703
|
return yt.constructor("return this")();
|
|
1702
1704
|
});
|
|
1703
|
-
var
|
|
1705
|
+
var Ce = /* @__PURE__ */ new Map();
|
|
1704
1706
|
function jr(t) {
|
|
1705
|
-
var e =
|
|
1706
|
-
return
|
|
1707
|
+
var e = Ce.get(t) || 1;
|
|
1708
|
+
return Ce.set(t, e + 1), "".concat(t, ":").concat(e, ":").concat(Math.random().toString(36).slice(2));
|
|
1707
1709
|
}
|
|
1708
1710
|
function Dr(t, e) {
|
|
1709
1711
|
var r = jr("stringifyForDisplay");
|
|
@@ -1732,13 +1734,13 @@ var Zt = Object.assign(function(e, r) {
|
|
|
1732
1734
|
warn: qt(at.warn),
|
|
1733
1735
|
error: qt(at.error)
|
|
1734
1736
|
});
|
|
1735
|
-
function
|
|
1737
|
+
function Je(t) {
|
|
1736
1738
|
for (var e = [], r = 1; r < arguments.length; r++)
|
|
1737
1739
|
e[r - 1] = arguments[r];
|
|
1738
|
-
return new
|
|
1740
|
+
return new Ve(ce(t, e) || de(t, e));
|
|
1739
1741
|
}
|
|
1740
|
-
var
|
|
1741
|
-
function
|
|
1742
|
+
var Ie = Symbol.for("ApolloErrorMessageHandler_" + Ke);
|
|
1743
|
+
function We(t) {
|
|
1742
1744
|
if (typeof t == "string")
|
|
1743
1745
|
return t;
|
|
1744
1746
|
try {
|
|
@@ -1749,14 +1751,14 @@ function Ge(t) {
|
|
|
1749
1751
|
}
|
|
1750
1752
|
function ce(t, e) {
|
|
1751
1753
|
if (e === void 0 && (e = []), !!t)
|
|
1752
|
-
return ie[
|
|
1754
|
+
return ie[Ie] && ie[Ie](t, e.map(We));
|
|
1753
1755
|
}
|
|
1754
1756
|
function de(t, e) {
|
|
1755
1757
|
if (e === void 0 && (e = []), !!t)
|
|
1756
1758
|
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:
|
|
1759
|
+
version: Ke,
|
|
1758
1760
|
message: t,
|
|
1759
|
-
args: e.map(
|
|
1761
|
+
args: e.map(We)
|
|
1760
1762
|
})));
|
|
1761
1763
|
}
|
|
1762
1764
|
function Lr(t) {
|
|
@@ -1766,8 +1768,8 @@ function Lr(t) {
|
|
|
1766
1768
|
return e.name.value;
|
|
1767
1769
|
})[0] || null;
|
|
1768
1770
|
}
|
|
1769
|
-
let
|
|
1770
|
-
const
|
|
1771
|
+
let E = null;
|
|
1772
|
+
const Fe = {};
|
|
1771
1773
|
let Br = 1;
|
|
1772
1774
|
const Ur = () => class {
|
|
1773
1775
|
constructor() {
|
|
@@ -1779,58 +1781,58 @@ const Ur = () => class {
|
|
|
1779
1781
|
].join(":");
|
|
1780
1782
|
}
|
|
1781
1783
|
hasValue() {
|
|
1782
|
-
for (let e =
|
|
1784
|
+
for (let e = E; e; e = e.parent)
|
|
1783
1785
|
if (this.id in e.slots) {
|
|
1784
1786
|
const r = e.slots[this.id];
|
|
1785
|
-
if (r ===
|
|
1787
|
+
if (r === Fe)
|
|
1786
1788
|
break;
|
|
1787
|
-
return e !==
|
|
1789
|
+
return e !== E && (E.slots[this.id] = r), !0;
|
|
1788
1790
|
}
|
|
1789
|
-
return
|
|
1791
|
+
return E && (E.slots[this.id] = Fe), !1;
|
|
1790
1792
|
}
|
|
1791
1793
|
getValue() {
|
|
1792
1794
|
if (this.hasValue())
|
|
1793
|
-
return
|
|
1795
|
+
return E.slots[this.id];
|
|
1794
1796
|
}
|
|
1795
1797
|
withValue(e, r, o, n) {
|
|
1796
1798
|
const c = {
|
|
1797
1799
|
__proto__: null,
|
|
1798
1800
|
[this.id]: e
|
|
1799
|
-
}, l =
|
|
1800
|
-
|
|
1801
|
+
}, l = E;
|
|
1802
|
+
E = { parent: l, slots: c };
|
|
1801
1803
|
try {
|
|
1802
1804
|
return r.apply(n, o);
|
|
1803
1805
|
} finally {
|
|
1804
|
-
|
|
1806
|
+
E = l;
|
|
1805
1807
|
}
|
|
1806
1808
|
}
|
|
1807
1809
|
// Capture the current context and wrap a callback function so that it
|
|
1808
1810
|
// reestablishes the captured context when called.
|
|
1809
1811
|
static bind(e) {
|
|
1810
|
-
const r =
|
|
1812
|
+
const r = E;
|
|
1811
1813
|
return function() {
|
|
1812
|
-
const o =
|
|
1814
|
+
const o = E;
|
|
1813
1815
|
try {
|
|
1814
|
-
return
|
|
1816
|
+
return E = r, e.apply(this, arguments);
|
|
1815
1817
|
} finally {
|
|
1816
|
-
|
|
1818
|
+
E = o;
|
|
1817
1819
|
}
|
|
1818
1820
|
};
|
|
1819
1821
|
}
|
|
1820
1822
|
// Immediately run a callback function without any captured context.
|
|
1821
1823
|
static noContext(e, r, o) {
|
|
1822
|
-
if (
|
|
1823
|
-
const n =
|
|
1824
|
+
if (E) {
|
|
1825
|
+
const n = E;
|
|
1824
1826
|
try {
|
|
1825
|
-
return
|
|
1827
|
+
return E = null, e.apply(o, r);
|
|
1826
1828
|
} finally {
|
|
1827
|
-
|
|
1829
|
+
E = n;
|
|
1828
1830
|
}
|
|
1829
1831
|
} else
|
|
1830
1832
|
return e.apply(o, r);
|
|
1831
1833
|
}
|
|
1832
1834
|
};
|
|
1833
|
-
function
|
|
1835
|
+
function Ne(t) {
|
|
1834
1836
|
try {
|
|
1835
1837
|
return t();
|
|
1836
1838
|
} catch {
|
|
@@ -1839,18 +1841,18 @@ function Ee(t) {
|
|
|
1839
1841
|
const te = "@wry/context:Slot", qr = (
|
|
1840
1842
|
// Prefer globalThis when available.
|
|
1841
1843
|
// https://github.com/benjamn/wryware/issues/347
|
|
1842
|
-
|
|
1844
|
+
Ne(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
|
|
1843
1845
|
// bundlers to the appropriate identifier (window, self, ...) depending on the
|
|
1844
1846
|
// bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224
|
|
1845
|
-
|
|
1847
|
+
Ne(() => global) || // Otherwise, use a dummy host that's local to this module. We used to fall
|
|
1846
1848
|
// back to using the Array constructor as a namespace, but that was flagged in
|
|
1847
1849
|
// https://github.com/benjamn/wryware/issues/347, and can be avoided.
|
|
1848
1850
|
/* @__PURE__ */ Object.create(null)
|
|
1849
|
-
),
|
|
1851
|
+
), Ee = qr, ue = Ee[te] || // Earlier versions of this package stored the globalKey property on the Array
|
|
1850
1852
|
// constructor, so we check there as well, to prevent Slot class duplication.
|
|
1851
1853
|
Array[te] || (function(t) {
|
|
1852
1854
|
try {
|
|
1853
|
-
Object.defineProperty(
|
|
1855
|
+
Object.defineProperty(Ee, te, {
|
|
1854
1856
|
value: t,
|
|
1855
1857
|
enumerable: !1,
|
|
1856
1858
|
writable: !1,
|
|
@@ -1882,26 +1884,26 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1882
1884
|
}
|
|
1883
1885
|
function Hr(t, e) {
|
|
1884
1886
|
if (t) {
|
|
1885
|
-
if (typeof t == "string") return
|
|
1887
|
+
if (typeof t == "string") return Te(t, e);
|
|
1886
1888
|
var r = Object.prototype.toString.call(t).slice(8, -1);
|
|
1887
1889
|
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
|
|
1890
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return Te(t, e);
|
|
1889
1891
|
}
|
|
1890
1892
|
}
|
|
1891
|
-
function
|
|
1893
|
+
function Te(t, e) {
|
|
1892
1894
|
(e == null || e > t.length) && (e = t.length);
|
|
1893
1895
|
for (var r = 0, o = new Array(e); r < e; r++)
|
|
1894
1896
|
o[r] = t[r];
|
|
1895
1897
|
return o;
|
|
1896
1898
|
}
|
|
1897
|
-
function
|
|
1899
|
+
function Pe(t, e) {
|
|
1898
1900
|
for (var r = 0; r < e.length; r++) {
|
|
1899
1901
|
var o = e[r];
|
|
1900
1902
|
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
|
|
1901
1903
|
}
|
|
1902
1904
|
}
|
|
1903
1905
|
function pe(t, e, r) {
|
|
1904
|
-
return e &&
|
|
1906
|
+
return e && Pe(t.prototype, e), r && Pe(t, r), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
1905
1907
|
}
|
|
1906
1908
|
var fe = function() {
|
|
1907
1909
|
return typeof Symbol == "function";
|
|
@@ -1911,7 +1913,7 @@ var fe = function() {
|
|
|
1911
1913
|
return me(t) ? Symbol[t] : "@@" + t;
|
|
1912
1914
|
};
|
|
1913
1915
|
fe() && !me("observable") && (Symbol.observable = Symbol("observable"));
|
|
1914
|
-
var Rr = he("iterator"), se = he("observable"),
|
|
1916
|
+
var Rr = he("iterator"), se = he("observable"), Ge = he("species");
|
|
1915
1917
|
function Jt(t, e) {
|
|
1916
1918
|
var r = t[e];
|
|
1917
1919
|
if (r != null) {
|
|
@@ -1921,7 +1923,7 @@ function Jt(t, e) {
|
|
|
1921
1923
|
}
|
|
1922
1924
|
function Nt(t) {
|
|
1923
1925
|
var e = t.constructor;
|
|
1924
|
-
return e !== void 0 && (e = e[
|
|
1926
|
+
return e !== void 0 && (e = e[Ge], e === null && (e = void 0)), e !== void 0 ? e : P;
|
|
1925
1927
|
}
|
|
1926
1928
|
function Vr(t) {
|
|
1927
1929
|
return t instanceof P;
|
|
@@ -1940,7 +1942,7 @@ function Ht(t) {
|
|
|
1940
1942
|
}
|
|
1941
1943
|
});
|
|
1942
1944
|
}
|
|
1943
|
-
function
|
|
1945
|
+
function Xe(t) {
|
|
1944
1946
|
var e = t._cleanup;
|
|
1945
1947
|
if (e !== void 0 && (t._cleanup = void 0, !!e))
|
|
1946
1948
|
try {
|
|
@@ -1961,11 +1963,11 @@ function Yr(t) {
|
|
|
1961
1963
|
var e = t._queue;
|
|
1962
1964
|
if (e) {
|
|
1963
1965
|
t._queue = void 0, t._state = "ready";
|
|
1964
|
-
for (var r = 0; r < e.length && (
|
|
1966
|
+
for (var r = 0; r < e.length && (Qe(t, e[r].type, e[r].value), t._state !== "closed"); ++r)
|
|
1965
1967
|
;
|
|
1966
1968
|
}
|
|
1967
1969
|
}
|
|
1968
|
-
function
|
|
1970
|
+
function Qe(t, e, r) {
|
|
1969
1971
|
t._state = "running";
|
|
1970
1972
|
var o = t._observer;
|
|
1971
1973
|
try {
|
|
@@ -1985,7 +1987,7 @@ function Ze(t, e, r) {
|
|
|
1985
1987
|
} catch (c) {
|
|
1986
1988
|
kt(c);
|
|
1987
1989
|
}
|
|
1988
|
-
t._state === "closed" ?
|
|
1990
|
+
t._state === "closed" ? Xe(t) : t._state === "running" && (t._state = "ready");
|
|
1989
1991
|
}
|
|
1990
1992
|
function ee(t, e, r) {
|
|
1991
1993
|
if (t._state !== "closed") {
|
|
@@ -2005,7 +2007,7 @@ function ee(t, e, r) {
|
|
|
2005
2007
|
});
|
|
2006
2008
|
return;
|
|
2007
2009
|
}
|
|
2008
|
-
|
|
2010
|
+
Qe(t, e, r);
|
|
2009
2011
|
}
|
|
2010
2012
|
}
|
|
2011
2013
|
var Kr = /* @__PURE__ */ (function() {
|
|
@@ -2021,7 +2023,7 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2021
2023
|
}
|
|
2022
2024
|
var e = t.prototype;
|
|
2023
2025
|
return e.unsubscribe = function() {
|
|
2024
|
-
this._state !== "closed" && (le(this),
|
|
2026
|
+
this._state !== "closed" && (le(this), Xe(this));
|
|
2025
2027
|
}, pe(t, [{
|
|
2026
2028
|
key: "closed",
|
|
2027
2029
|
get: function() {
|
|
@@ -2266,7 +2268,7 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2266
2268
|
});
|
|
2267
2269
|
});
|
|
2268
2270
|
}, pe(t, null, [{
|
|
2269
|
-
key:
|
|
2271
|
+
key: Ge,
|
|
2270
2272
|
get: function() {
|
|
2271
2273
|
return this;
|
|
2272
2274
|
}
|
|
@@ -2298,8 +2300,8 @@ function Wr(t) {
|
|
|
2298
2300
|
var vt;
|
|
2299
2301
|
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
2302
|
Wr(vt);
|
|
2301
|
-
var
|
|
2302
|
-
$e
|
|
2303
|
+
var Oe = P.prototype, $e = "@@observable";
|
|
2304
|
+
Oe[$e] || (Oe[$e] = function() {
|
|
2303
2305
|
return this;
|
|
2304
2306
|
});
|
|
2305
2307
|
function Gr(t) {
|
|
@@ -2312,7 +2314,7 @@ function Gr(t) {
|
|
|
2312
2314
|
], r = 0, o = Object.keys(t); r < o.length; r++) {
|
|
2313
2315
|
var n = o[r];
|
|
2314
2316
|
if (e.indexOf(n) < 0)
|
|
2315
|
-
throw
|
|
2317
|
+
throw Je(58, n);
|
|
2316
2318
|
}
|
|
2317
2319
|
return t;
|
|
2318
2320
|
}
|
|
@@ -2346,16 +2348,16 @@ function ro(t) {
|
|
|
2346
2348
|
function oo(t, e) {
|
|
2347
2349
|
ro(t) || e();
|
|
2348
2350
|
}
|
|
2349
|
-
function
|
|
2351
|
+
function ze(t, e) {
|
|
2350
2352
|
return e ? e(t) : P.of();
|
|
2351
2353
|
}
|
|
2352
2354
|
function Et(t) {
|
|
2353
|
-
return typeof t == "function" ? new
|
|
2355
|
+
return typeof t == "function" ? new Ze(t) : t;
|
|
2354
2356
|
}
|
|
2355
2357
|
function Mt(t) {
|
|
2356
2358
|
return t.request.length <= 1;
|
|
2357
2359
|
}
|
|
2358
|
-
var
|
|
2360
|
+
var Ze = (
|
|
2359
2361
|
/** @class */
|
|
2360
2362
|
(function() {
|
|
2361
2363
|
function t(e) {
|
|
@@ -2370,7 +2372,7 @@ var tr = (
|
|
|
2370
2372
|
return r.concat(o);
|
|
2371
2373
|
});
|
|
2372
2374
|
}, t.split = function(e, r, o) {
|
|
2373
|
-
var n = Et(r), c = Et(o || new t(
|
|
2375
|
+
var n = Et(r), c = Et(o || new t(ze)), l;
|
|
2374
2376
|
return Mt(n) && Mt(c) ? l = new t(function(d) {
|
|
2375
2377
|
return e(d) ? n.request(d) || P.of() : c.request(d) || P.of();
|
|
2376
2378
|
}) : l = new t(function(d, s) {
|
|
@@ -2393,11 +2395,11 @@ var tr = (
|
|
|
2393
2395
|
}) || P.of();
|
|
2394
2396
|
}), Object.assign(c, { left: o, right: n });
|
|
2395
2397
|
}, t.prototype.split = function(e, r, o) {
|
|
2396
|
-
return this.concat(t.split(e, r, o || new t(
|
|
2398
|
+
return this.concat(t.split(e, r, o || new t(ze)));
|
|
2397
2399
|
}, t.prototype.concat = function(e) {
|
|
2398
2400
|
return t.concat(this, e);
|
|
2399
2401
|
}, t.prototype.request = function(e, r) {
|
|
2400
|
-
throw
|
|
2402
|
+
throw Je(48);
|
|
2401
2403
|
}, t.prototype.onError = function(e, r) {
|
|
2402
2404
|
if (globalThis.__DEV__ !== !1 && oo("onError", function() {
|
|
2403
2405
|
globalThis.__DEV__ !== !1 && Zt.warn(49);
|
|
@@ -2410,7 +2412,7 @@ var tr = (
|
|
|
2410
2412
|
})()
|
|
2411
2413
|
);
|
|
2412
2414
|
function no(t) {
|
|
2413
|
-
return new
|
|
2415
|
+
return new Ze(function(e, r) {
|
|
2414
2416
|
var o = $r(e, []);
|
|
2415
2417
|
return new P(function(n) {
|
|
2416
2418
|
var c, l = !1;
|
|
@@ -2446,7 +2448,7 @@ const ao = async () => {
|
|
|
2446
2448
|
} catch (n) {
|
|
2447
2449
|
return $.isAxiosError(n) ? console.error("Error fetching token:", n.response || n.message) : console.error("Unexpected error:", n), null;
|
|
2448
2450
|
}
|
|
2449
|
-
}, io = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", so =
|
|
2451
|
+
}, io = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", so = ir({
|
|
2450
2452
|
uri: `${io}`
|
|
2451
2453
|
}), lo = no(async (t, { headers: e }) => {
|
|
2452
2454
|
const r = await ao();
|
|
@@ -2456,9 +2458,9 @@ const ao = async () => {
|
|
|
2456
2458
|
authorization: `Bearer ${r}`
|
|
2457
2459
|
}
|
|
2458
2460
|
};
|
|
2459
|
-
}), co = new
|
|
2461
|
+
}), co = new sr({
|
|
2460
2462
|
link: lo.concat(so),
|
|
2461
|
-
cache: new
|
|
2463
|
+
cache: new lr(),
|
|
2462
2464
|
defaultOptions: {
|
|
2463
2465
|
watchQuery: {
|
|
2464
2466
|
fetchPolicy: "cache-and-network"
|
|
@@ -2466,7 +2468,7 @@ const ao = async () => {
|
|
|
2466
2468
|
}
|
|
2467
2469
|
}), Fo = (t) => {
|
|
2468
2470
|
const { tanyaConfig: e } = t;
|
|
2469
|
-
return /* @__PURE__ */ a(
|
|
2471
|
+
return /* @__PURE__ */ a(cr, { client: co, children: /* @__PURE__ */ a(xr, { children: /* @__PURE__ */ a(Pr, { tanyaConfig: e }) }) });
|
|
2470
2472
|
};
|
|
2471
2473
|
export {
|
|
2472
2474
|
Fo as TanyaChatbot,
|