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