tanya-chatbot 0.4.5 → 0.4.7
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,4 +1,4 @@
|
|
|
1
|
-
import { useEffect as
|
|
1
|
+
import { useEffect as Q, useState as z, useRef as Ft } from "react";
|
|
2
2
|
import { jsx as a, jsxs as u, Fragment as re } from "react/jsx-runtime";
|
|
3
3
|
import { createHttpLink as sr, ApolloClient as lr, InMemoryCache as cr, ApolloProvider as dr } from "@apollo/client";
|
|
4
4
|
import { Provider as ur, useDispatch as je, useSelector as Ht } from "react-redux";
|
|
@@ -12,7 +12,7 @@ import { Icon as ge } from "@iconify/react";
|
|
|
12
12
|
import { toast as M } from "react-toastify";
|
|
13
13
|
const fr = '*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.top-full{top:100%}.z-40{z-index:40}.z-50{z-index:50}.m-1{margin:.25rem}.m-3{margin:.75rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.mb-1{margin-bottom:.25rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-24{margin-bottom:6rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.h-12{height:3rem}.h-28{height:7rem}.h-3{height:.75rem}.h-6{height:1.5rem}.h-\\[120px\\]{height:120px}.h-\\[200px\\]{height:200px}.h-\\[60px\\]{height:60px}.h-\\[90vh\\]{height:90vh}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.w-28{width:7rem}.w-3{width:.75rem}.w-5\\/6{width:83.333333%}.w-6{width:1.5rem}.w-72{width:18rem}.w-\\[100vw\\]{width:100vw}.w-\\[120px\\]{width:120px}.w-\\[150px\\]{width:150px}.w-\\[60px\\]{width:60px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[75\\%\\]{max-width:75%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[5px\\]{border-radius:5px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:.75rem}.rounded-l-\\[20px\\]{border-top-left-radius:20px;border-bottom-left-radius:20px}.rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-r-xl{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-bl-2xl{border-bottom-left-radius:1rem}.rounded-br-xl{border-bottom-right-radius:.75rem}.rounded-tr-\\[20px\\]{border-top-right-radius:20px}.rounded-tr-\\[5px\\]{border-top-right-radius:5px}.border{border-width:1px}.border-0{border-width:0px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-t-2{border-top-width:2px}.border-none{border-style:none}.border-\\[\\#C9C2DE\\]{--tw-border-opacity: 1;border-color:rgb(201 194 222 / var(--tw-border-opacity, 1))}.border-\\[\\#E5E5E5\\]{--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.bg-\\[\\#553D94\\]{--tw-bg-opacity: 1;background-color:rgb(85 61 148 / var(--tw-bg-opacity, 1))}.bg-\\[\\#6851C6\\]{--tw-bg-opacity: 1;background-color:rgb(104 81 198 / var(--tw-bg-opacity, 1))}.bg-\\[\\#804C9E0D\\]{background-color:#804c9e0d}.bg-\\[\\#A21CAF\\]{--tw-bg-opacity: 1;background-color:rgb(162 28 175 / var(--tw-bg-opacity, 1))}.bg-\\[\\#AB192D\\]{--tw-bg-opacity: 1;background-color:rgb(171 25 45 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E2DBFF\\]{--tw-bg-opacity: 1;background-color:rgb(226 219 255 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E3DEEF\\]{--tw-bg-opacity: 1;background-color:rgb(227 222 239 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F3F3F3\\]{--tw-bg-opacity: 1;background-color:rgb(243 243 243 / var(--tw-bg-opacity, 1))}.bg-\\[\\#FFFFFF\\],.bg-\\[\\#ffffff\\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-black\\/30{background-color:#0000004d}.bg-indigo-300{--tw-bg-opacity: 1;background-color:rgb(165 180 252 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\\[1px\\]{padding:1px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pl-2{padding-left:.5rem}.pr-5{padding-right:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-nunitoSans{font-family:Nunito Sans}.text-\\[12px\\]{font-size:12px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-snug{line-height:1.375}.text-\\[\\#000000\\]{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-\\[\\#14121F\\]{--tw-text-opacity: 1;color:rgb(20 18 31 / var(--tw-text-opacity, 1))}.text-\\[\\#18181B\\]{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.text-\\[\\#232323\\]{--tw-text-opacity: 1;color:rgb(35 35 35 / var(--tw-text-opacity, 1))}.text-\\[\\#323135\\]{--tw-text-opacity: 1;color:rgb(50 49 53 / var(--tw-text-opacity, 1))}.text-\\[\\#494949\\]{--tw-text-opacity: 1;color:rgb(73 73 73 / var(--tw-text-opacity, 1))}.text-\\[\\#555555\\]{--tw-text-opacity: 1;color:rgb(85 85 85 / var(--tw-text-opacity, 1))}.text-\\[\\#5B5B5B\\]{--tw-text-opacity: 1;color:rgb(91 91 91 / var(--tw-text-opacity, 1))}.text-\\[\\#68656E\\]{--tw-text-opacity: 1;color:rgb(104 101 110 / var(--tw-text-opacity, 1))}.text-\\[\\#959595\\]{--tw-text-opacity: 1;color:rgb(149 149 149 / var(--tw-text-opacity, 1))}.text-\\[\\#EC5050\\]{--tw-text-opacity: 1;color:rgb(236 80 80 / var(--tw-text-opacity, 1))}.text-\\[\\#FBFBFC\\]{--tw-text-opacity: 1;color:rgb(251 251 252 / var(--tw-text-opacity, 1))}.text-\\[\\#FFFFFF\\]{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-80{opacity:.8}.shadow-\\[0px_2px_2px_0px_\\#9292BC40\\]{--tw-shadow: 0px 2px 2px 0px #9292BC40;--tw-shadow-colored: 0px 2px 2px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0px_4px_10px_0px_\\#5F499840\\]{--tw-shadow: 0px 4px 10px 0px #5F499840;--tw-shadow-colored: 0px 4px 10px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.running{animation-play-state:running}html,body,#root{margin:0;padding:0}:root{line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;padding:0}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.hover\\:scale-125:hover{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:text-\\[\\#6952C7\\]:hover{--tw-text-opacity: 1;color:rgb(105 82 199 / var(--tw-text-opacity, 1))}.hover\\:opacity-90:hover{opacity:.9}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}@media(min-width:640px){.sm\\:w-\\[80vw\\]{width:80vw}}@media(min-width:768px){.md\\:h-\\[100vh\\]{height:100vh}.md\\:w-1\\/2{width:50%}.md\\:w-\\[770px\\]{width:770px}.md\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:flex-row{flex-direction:row}}@media(min-width:1024px){.lg\\:h-\\[100vh\\]{height:100vh}.lg\\:w-1\\/2{width:50%}.lg\\:w-2\\/3{width:66.666667%}.lg\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:flex-row{flex-direction:row}.lg\\:rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.lg\\:rounded-bl-xl{border-bottom-left-radius:.75rem}}';
|
|
14
14
|
function vo() {
|
|
15
|
-
return
|
|
15
|
+
return Q(() => {
|
|
16
16
|
if (typeof document < "u") {
|
|
17
17
|
const t = document.createElement("style");
|
|
18
18
|
return t.textContent = fr, document.head.appendChild(t), () => {
|
|
@@ -101,7 +101,7 @@ const vt = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
|
|
|
101
101
|
const t = "https://tanya-sfcc-server.vercel.app/";
|
|
102
102
|
try {
|
|
103
103
|
const e = await T.post(
|
|
104
|
-
`${t}api/auth/token-bm-grant?baseUrl=${
|
|
104
|
+
`${t}api/auth/token-bm-grant?baseUrl=${Z()}&siteId=${Y()}`
|
|
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) {
|
|
@@ -111,7 +111,7 @@ const vt = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
|
|
|
111
111
|
const e = "https://tanya-sfcc-server.vercel.app/";
|
|
112
112
|
try {
|
|
113
113
|
const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, o = await T.post(
|
|
114
|
-
`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${
|
|
114
|
+
`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${Z()}&siteId=${Y()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
115
115
|
{},
|
|
116
116
|
{
|
|
117
117
|
headers: {
|
|
@@ -128,11 +128,9 @@ const vt = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
|
|
|
128
128
|
async function Pt() {
|
|
129
129
|
var c;
|
|
130
130
|
const t = Y(), e = "access_token_" + t, r = "expires_in_" + t, o = localStorage.getItem(r), n = localStorage.getItem(e);
|
|
131
|
-
|
|
132
|
-
return console.log("access token found in local storage"), { access_token: n, expires_in: o };
|
|
133
|
-
console.log("access token not found in local storage");
|
|
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 };
|
|
134
132
|
}
|
|
135
|
-
const
|
|
133
|
+
const Z = () => sessionStorage.getItem("Host"), Y = () => sessionStorage.getItem("SiteId"), at = () => sessionStorage.getItem("pubCfg"), it = () => sessionStorage.getItem("envRef"), st = () => sessionStorage.getItem("orgRef"), be = async (t) => {
|
|
136
134
|
console.log("fetching results");
|
|
137
135
|
const { serverUrl: e, basePath: r } = vt();
|
|
138
136
|
let o = "";
|
|
@@ -141,7 +139,7 @@ const Q = () => sessionStorage.getItem("Host"), Y = () => sessionStorage.getItem
|
|
|
141
139
|
console.log("the token from getSearchResults", n), o = n.access_token;
|
|
142
140
|
}
|
|
143
141
|
try {
|
|
144
|
-
const n =
|
|
142
|
+
const n = Z();
|
|
145
143
|
return (await T.get(
|
|
146
144
|
`${e}${r}/search-sfcc?baseUrl=${n}&query=${t}&siteId=${Y()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
147
145
|
{
|
|
@@ -156,7 +154,7 @@ const Q = () => sessionStorage.getItem("Host"), Y = () => sessionStorage.getItem
|
|
|
156
154
|
}
|
|
157
155
|
}, He = async (t) => {
|
|
158
156
|
if (!t) throw new Error("Product ID is required");
|
|
159
|
-
const { serverUrl: e, basePath: r } = vt(), o =
|
|
157
|
+
const { serverUrl: e, basePath: r } = vt(), o = Z();
|
|
160
158
|
console.log("calling access");
|
|
161
159
|
const { access_token: n } = await Pt();
|
|
162
160
|
return console.log(n), (await T.get(
|
|
@@ -172,13 +170,13 @@ const Q = () => sessionStorage.getItem("Host"), Y = () => sessionStorage.getItem
|
|
|
172
170
|
if (!t) throw new Error("customerId is required");
|
|
173
171
|
const e = await qe(), { customer_token: r } = await Me(
|
|
174
172
|
e
|
|
175
|
-
), { serverUrl: o, basePath: n } = vt(),
|
|
173
|
+
), { serverUrl: o, basePath: n } = vt(), l = (await Pt()).access_token;
|
|
176
174
|
return (await T.get(
|
|
177
|
-
`${o}${n}/get-interest?baseUrl=${
|
|
175
|
+
`${o}${n}/get-interest?baseUrl=${Z()}&customerId=${t}&siteId=${Y()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
178
176
|
{
|
|
179
177
|
headers: {
|
|
180
178
|
"Content-Type": "application/json",
|
|
181
|
-
Authorization: `Bearer ${
|
|
179
|
+
Authorization: `Bearer ${l}`
|
|
182
180
|
}
|
|
183
181
|
}
|
|
184
182
|
)).data;
|
|
@@ -194,13 +192,13 @@ const Q = () => sessionStorage.getItem("Host"), Y = () => sessionStorage.getItem
|
|
|
194
192
|
centAmount: (r = t.masterVariant) == null ? void 0 : r.prices[0].value.centAmount,
|
|
195
193
|
currencyCode: (o = t.masterVariant) == null ? void 0 : o.prices[0].value.currencyCode
|
|
196
194
|
};
|
|
197
|
-
},
|
|
195
|
+
}, Cr = (t) => t.charAt(0).toUpperCase() + t.slice(1), ke = (t, e) => t.length < e ? t : t.slice(0, e) + "...", Xt = (t) => t.split("\\n").map((e, r) => {
|
|
198
196
|
const o = e.match(/^(\d+)\.\s(.+)/);
|
|
199
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/>";
|
|
200
198
|
}).join("");
|
|
201
|
-
function
|
|
199
|
+
function _r() {
|
|
202
200
|
const t = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [e, r] = z(t);
|
|
203
|
-
return
|
|
201
|
+
return Q(() => {
|
|
204
202
|
const o = () => r(t());
|
|
205
203
|
return window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
|
|
206
204
|
}, []), e;
|
|
@@ -208,11 +206,11 @@ function Cr() {
|
|
|
208
206
|
const Fr = ({
|
|
209
207
|
product: t
|
|
210
208
|
}) => {
|
|
211
|
-
const e = je(), r =
|
|
209
|
+
const e = je(), r = _r(), [o, n] = z(0), c = () => {
|
|
212
210
|
n(
|
|
213
211
|
(i) => i + r >= t.length ? 0 : i + r
|
|
214
212
|
);
|
|
215
|
-
},
|
|
213
|
+
}, l = () => {
|
|
216
214
|
n(
|
|
217
215
|
(i) => i - r < 0 ? t.length - (t.length % r || r) : i - r
|
|
218
216
|
);
|
|
@@ -224,7 +222,7 @@ const Fr = ({
|
|
|
224
222
|
(t == null ? void 0 : t.length) > r && /* @__PURE__ */ a(
|
|
225
223
|
"button",
|
|
226
224
|
{
|
|
227
|
-
onClick:
|
|
225
|
+
onClick: l,
|
|
228
226
|
className: "absolute z-50 left-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",
|
|
229
227
|
style: {
|
|
230
228
|
height: "30px",
|
|
@@ -235,7 +233,7 @@ const Fr = ({
|
|
|
235
233
|
}
|
|
236
234
|
),
|
|
237
235
|
/* @__PURE__ */ a("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: t.slice(o, o + r).map((i) => {
|
|
238
|
-
var y, g,
|
|
236
|
+
var y, g, S, _;
|
|
239
237
|
return /* @__PURE__ */ u(
|
|
240
238
|
"div",
|
|
241
239
|
{
|
|
@@ -275,7 +273,7 @@ const Fr = ({
|
|
|
275
273
|
zIndex: 50
|
|
276
274
|
},
|
|
277
275
|
children: i != null && i.productName ? i.productName : i != null && i.product_name ? i.product_name : ke(
|
|
278
|
-
xe((
|
|
276
|
+
xe((S = i == null ? void 0 : i.name) == null ? void 0 : S["en-US"]),
|
|
279
277
|
60
|
|
280
278
|
) || "Product"
|
|
281
279
|
}
|
|
@@ -284,7 +282,7 @@ const Fr = ({
|
|
|
284
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: [
|
|
285
283
|
/* @__PURE__ */ a("p", { children: Sr(
|
|
286
284
|
i != null && i.price ? Number(i == null ? void 0 : i.price) : ve(i).centAmount || 0,
|
|
287
|
-
(
|
|
285
|
+
(_ = ve(i)) == null ? void 0 : _.currencyCode
|
|
288
286
|
) }),
|
|
289
287
|
/* @__PURE__ */ u("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
|
|
290
288
|
"$",
|
|
@@ -326,7 +324,7 @@ const Fr = ({
|
|
|
326
324
|
"div",
|
|
327
325
|
{
|
|
328
326
|
className: "font-nunitoSans font-bold text-sm text-[#494949] p-2 w-fit rounded-[20px]",
|
|
329
|
-
children:
|
|
327
|
+
children: Cr(r.keyword) || "No keyword"
|
|
330
328
|
}
|
|
331
329
|
),
|
|
332
330
|
/* @__PURE__ */ a(
|
|
@@ -340,13 +338,13 @@ const Fr = ({
|
|
|
340
338
|
},
|
|
341
339
|
o
|
|
342
340
|
)) }), Ve = async (t, e) => {
|
|
343
|
-
var c,
|
|
341
|
+
var c, l;
|
|
344
342
|
const { serverUrl: r, basePath: o } = vt(), n = `${r}`;
|
|
345
343
|
console.log(`customer_token
|
|
346
344
|
`, t);
|
|
347
345
|
try {
|
|
348
346
|
const d = await T.post(
|
|
349
|
-
`${n}${o}/basket/create?baseUrl=${
|
|
347
|
+
`${n}${o}/basket/create?baseUrl=${Z()}&siteId=${Y()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
350
348
|
e,
|
|
351
349
|
{
|
|
352
350
|
headers: {
|
|
@@ -358,7 +356,7 @@ const Fr = ({
|
|
|
358
356
|
return window.postMessage(
|
|
359
357
|
{
|
|
360
358
|
type: "WIDGET_CREATED_BASKET",
|
|
361
|
-
basketId: ((c = d.data) == null ? void 0 : c.basket_id) || ((
|
|
359
|
+
basketId: ((c = d.data) == null ? void 0 : c.basket_id) || ((l = d.data) == null ? void 0 : l.basketId)
|
|
362
360
|
},
|
|
363
361
|
"*"
|
|
364
362
|
), d.data;
|
|
@@ -368,8 +366,8 @@ const Fr = ({
|
|
|
368
366
|
}, Rt = async (t, e, r) => {
|
|
369
367
|
const { serverUrl: o, basePath: n } = vt(), c = `${o}`;
|
|
370
368
|
try {
|
|
371
|
-
const
|
|
372
|
-
`${c}${n}/basket/add-product/${t}?baseUrl=${
|
|
369
|
+
const l = await T.post(
|
|
370
|
+
`${c}${n}/basket/add-product/${t}?baseUrl=${Z()}&siteId=${Y()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
373
371
|
e,
|
|
374
372
|
{
|
|
375
373
|
headers: {
|
|
@@ -378,12 +376,12 @@ const Fr = ({
|
|
|
378
376
|
}
|
|
379
377
|
}
|
|
380
378
|
);
|
|
381
|
-
return
|
|
382
|
-
} catch (
|
|
383
|
-
return T.isAxiosError(
|
|
379
|
+
return l.status === 200 && l.data ? l.data : null;
|
|
380
|
+
} catch (l) {
|
|
381
|
+
return T.isAxiosError(l) ? console.error(
|
|
384
382
|
"Error adding products to basket:",
|
|
385
|
-
|
|
386
|
-
) : console.error("Unexpected error:",
|
|
383
|
+
l.response || l.message
|
|
384
|
+
) : console.error("Unexpected error:", l), null;
|
|
387
385
|
}
|
|
388
386
|
}, Re = async ({
|
|
389
387
|
basketId: t,
|
|
@@ -392,8 +390,8 @@ const Fr = ({
|
|
|
392
390
|
var c;
|
|
393
391
|
const { serverUrl: r, basePath: o } = vt(), n = `${r}`;
|
|
394
392
|
try {
|
|
395
|
-
const
|
|
396
|
-
`${n}${o}/basket/${t}?baseUrl=${
|
|
393
|
+
const l = await T.get(
|
|
394
|
+
`${n}${o}/basket/${t}?baseUrl=${Z()}&siteId=${Y()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
397
395
|
{
|
|
398
396
|
headers: {
|
|
399
397
|
"Content-Type": "application/json",
|
|
@@ -401,9 +399,9 @@ const Fr = ({
|
|
|
401
399
|
}
|
|
402
400
|
}
|
|
403
401
|
);
|
|
404
|
-
return { status:
|
|
405
|
-
} catch (
|
|
406
|
-
return T.isAxiosError(
|
|
402
|
+
return { status: l.status, data: l.data };
|
|
403
|
+
} catch (l) {
|
|
404
|
+
return T.isAxiosError(l) ? { status: (c = l.response) == null ? void 0 : c.status, data: null } : { status: null, data: null };
|
|
407
405
|
}
|
|
408
406
|
}, Yt = "sfcc_basket_id", Se = "sfcc_customer_token", Tt = "sfcc_token_expiry", Nr = 300 * 1e3, It = "1.0.0";
|
|
409
407
|
const nt = (t) => {
|
|
@@ -423,14 +421,14 @@ const nt = (t) => {
|
|
|
423
421
|
} catch (e) {
|
|
424
422
|
console.error("Error storing token:", e);
|
|
425
423
|
}
|
|
426
|
-
},
|
|
427
|
-
var d, i, y, g,
|
|
424
|
+
}, Ce = 300, Er = () => {
|
|
425
|
+
var d, i, y, g, S, _;
|
|
428
426
|
const t = je(), e = Ht((F) => F.product.product), r = Ht((F) => F.store.store), [o, n] = z(!!e);
|
|
429
|
-
if (
|
|
427
|
+
if (Q(() => {
|
|
430
428
|
n(!!e);
|
|
431
429
|
}, [e]), !e) return null;
|
|
432
430
|
const c = async () => {
|
|
433
|
-
var F, j, K, lt, H, ct, kt, Ot,
|
|
431
|
+
var F, j, K, lt, H, ct, kt, Ot, tt, St, Ct, dt, $t, zt, _t, O;
|
|
434
432
|
console.log(e, "the prod");
|
|
435
433
|
try {
|
|
436
434
|
if (!((j = (F = e == null ? void 0 : e.variants) == null ? void 0 : F[0]) != null && j.product_id) && !(e.type.item || e.type.bundle) && !((lt = (K = e == null ? void 0 : e.variants) == null ? void 0 : K[0]) != null && lt.productId)) {
|
|
@@ -440,16 +438,16 @@ const nt = (t) => {
|
|
|
440
438
|
}), console.error("No product variant found");
|
|
441
439
|
return;
|
|
442
440
|
}
|
|
443
|
-
const
|
|
441
|
+
const C = [
|
|
444
442
|
{
|
|
445
443
|
product_id: ((H = e.variants) == null ? void 0 : H[0].product_id) || ((ct = e.variants) == null ? void 0 : ct[0].productId) || (e == null ? void 0 : e.id),
|
|
446
444
|
quantity: 1
|
|
447
445
|
}
|
|
448
446
|
];
|
|
449
|
-
console.log(
|
|
447
|
+
console.log(C, "the product data");
|
|
450
448
|
const k = JSON.parse(
|
|
451
449
|
sessionStorage.getItem("customerData") || "{}"
|
|
452
|
-
),
|
|
450
|
+
), et = (k == null ? void 0 : k.basketId) || localStorage.getItem(Yt), Wt = !1, At = localStorage.getItem(Tt), jt = Date.now();
|
|
453
451
|
if (!Wt || !At || jt >= parseInt(At)) {
|
|
454
452
|
let $ = "";
|
|
455
453
|
{
|
|
@@ -461,15 +459,15 @@ const nt = (t) => {
|
|
|
461
459
|
return;
|
|
462
460
|
}
|
|
463
461
|
const ut = jt + 300 * 1e3;
|
|
464
|
-
if (Kt($), localStorage.setItem(Tt, ut.toString()),
|
|
462
|
+
if (Kt($), localStorage.setItem(Tt, ut.toString()), et) {
|
|
465
463
|
const pt = await Re({
|
|
466
|
-
basketId:
|
|
464
|
+
basketId: et,
|
|
467
465
|
customer_token: $
|
|
468
466
|
});
|
|
469
|
-
if (console.log(
|
|
467
|
+
if (console.log(et, "basket id from customer"), pt.status === 200 && pt) {
|
|
470
468
|
const D = await Rt(
|
|
471
|
-
|
|
472
|
-
|
|
469
|
+
et,
|
|
470
|
+
C,
|
|
473
471
|
$
|
|
474
472
|
);
|
|
475
473
|
(((kt = D == null ? void 0 : D.product_items) == null ? void 0 : kt.length) > 0 || ((Ot = D == null ? void 0 : D.productItems) == null ? void 0 : Ot.length) > 0) && (M.success("Added to cart", {
|
|
@@ -479,14 +477,14 @@ const nt = (t) => {
|
|
|
479
477
|
closeOnClick: !0,
|
|
480
478
|
pauseOnHover: !0,
|
|
481
479
|
draggable: !0
|
|
482
|
-
}), Vt(
|
|
480
|
+
}), Vt(et));
|
|
483
481
|
return;
|
|
484
482
|
}
|
|
485
483
|
}
|
|
486
484
|
const Dt = {
|
|
487
485
|
productItems: [
|
|
488
486
|
{
|
|
489
|
-
productId: ((
|
|
487
|
+
productId: ((tt = e.variants) == null ? void 0 : tt[0].product_id) || ((St = e.variants) == null ? void 0 : St[0].productId) || (e == null ? void 0 : e.id),
|
|
490
488
|
quantity: 1
|
|
491
489
|
}
|
|
492
490
|
]
|
|
@@ -510,10 +508,10 @@ const nt = (t) => {
|
|
|
510
508
|
), console.log("adding product to basket");
|
|
511
509
|
const J = await Rt(
|
|
512
510
|
(h == null ? void 0 : h.basket_id) || (h == null ? void 0 : h.basketId),
|
|
513
|
-
|
|
511
|
+
C,
|
|
514
512
|
$
|
|
515
513
|
);
|
|
516
|
-
console.log("object added to basket"), (((
|
|
514
|
+
console.log("object added to basket"), (((Ct = J == null ? void 0 : J.product_items) == null ? void 0 : Ct.length) > 0 || ((dt = J == null ? void 0 : J.productItems) == null ? void 0 : dt.length) > 0) && M.success("Added to cart", {
|
|
517
515
|
position: "bottom-right",
|
|
518
516
|
autoClose: 3e3,
|
|
519
517
|
hideProgressBar: !1,
|
|
@@ -522,17 +520,17 @@ const nt = (t) => {
|
|
|
522
520
|
draggable: !0
|
|
523
521
|
}), Vt(h.basket_id || (h == null ? void 0 : h.basketId));
|
|
524
522
|
}
|
|
525
|
-
} catch (
|
|
526
|
-
console.error("Error adding to cart:",
|
|
523
|
+
} catch (C) {
|
|
524
|
+
console.error("Error adding to cart:", C), M.error("Failed to add product to cart", {
|
|
527
525
|
position: "bottom-right",
|
|
528
526
|
autoClose: 3e3
|
|
529
|
-
}), (($t =
|
|
530
|
-
((zt =
|
|
527
|
+
}), (($t = C == null ? void 0 : C.response) == null ? void 0 : $t.status) === 404 || // Basket not found
|
|
528
|
+
((zt = C == null ? void 0 : C.response) == null ? void 0 : zt.status) === 401 ? (((_t = C == null ? void 0 : C.response) == null ? void 0 : _t.status) === 404 && nt(null), ((O = C == null ? void 0 : C.response) == null ? void 0 : O.status) === 401 && (nt(null), Kt(null))) : (console.error("Failed to add product to basket:", C.message), M.error("Failed to add product to cart", {
|
|
531
529
|
position: "bottom-right",
|
|
532
530
|
autoClose: 3e3
|
|
533
531
|
}));
|
|
534
532
|
}
|
|
535
|
-
},
|
|
533
|
+
}, l = () => {
|
|
536
534
|
e && (window.location.href = e.c_pdpUrl);
|
|
537
535
|
};
|
|
538
536
|
return console.log(e, "the prod"), /* @__PURE__ */ u(re, { children: [
|
|
@@ -541,7 +539,7 @@ const nt = (t) => {
|
|
|
541
539
|
{
|
|
542
540
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
543
541
|
onClick: () => {
|
|
544
|
-
n(!1), setTimeout(() => t(oe(null)),
|
|
542
|
+
n(!1), setTimeout(() => t(oe(null)), Ce);
|
|
545
543
|
}
|
|
546
544
|
}
|
|
547
545
|
),
|
|
@@ -566,7 +564,7 @@ const nt = (t) => {
|
|
|
566
564
|
onClick: () => {
|
|
567
565
|
n(!1), setTimeout(
|
|
568
566
|
() => t(oe(null)),
|
|
569
|
-
|
|
567
|
+
Ce
|
|
570
568
|
);
|
|
571
569
|
}
|
|
572
570
|
}
|
|
@@ -625,14 +623,14 @@ const nt = (t) => {
|
|
|
625
623
|
/* @__PURE__ */ u("div", { className: "mt-4 flex flex-col gap-2 w-full p-2", children: [
|
|
626
624
|
/* @__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: [
|
|
627
625
|
/* @__PURE__ */ u("div", { className: "text-[#323135] font-bold", children: [
|
|
628
|
-
((
|
|
626
|
+
((S = e == null ? void 0 : e.rating) == null ? void 0 : S.rate) || 0,
|
|
629
627
|
" /",
|
|
630
628
|
" ",
|
|
631
629
|
/* @__PURE__ */ a("span", { className: "text-[#68656E]", children: "5" })
|
|
632
630
|
] }),
|
|
633
631
|
/* @__PURE__ */ a("div", { className: "text-[#323135] font-semibold text-sm", children: "Overall Rating" }),
|
|
634
632
|
/* @__PURE__ */ u("div", { className: "text-[#68656E] font-semibold text-sm", children: [
|
|
635
|
-
((
|
|
633
|
+
((_ = e == null ? void 0 : e.rating) == null ? void 0 : _.count) || 0,
|
|
636
634
|
" ratings"
|
|
637
635
|
] })
|
|
638
636
|
] }) }),
|
|
@@ -672,7 +670,7 @@ const nt = (t) => {
|
|
|
672
670
|
{
|
|
673
671
|
className: "rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer mb-16",
|
|
674
672
|
style: { backgroundColor: r.tanyaThemeColor },
|
|
675
|
-
onClick:
|
|
673
|
+
onClick: l,
|
|
676
674
|
children: "View more"
|
|
677
675
|
}
|
|
678
676
|
)
|
|
@@ -701,36 +699,36 @@ const nt = (t) => {
|
|
|
701
699
|
"Niece/Nephew": "his/her niece/nephew",
|
|
702
700
|
"My Friends": "his/her friends",
|
|
703
701
|
Others: "others"
|
|
704
|
-
}, n = Ft(null), c = Ft(null),
|
|
705
|
-
id:
|
|
706
|
-
title:
|
|
707
|
-
image:
|
|
708
|
-
price:
|
|
709
|
-
}), [
|
|
702
|
+
}, n = Ft(null), c = Ft(null), l = Ft(null), d = Ft(null), [i, y] = z(null), [g, S] = z(!1), [_, F] = z(!1), [j, K] = z(!1), [lt, H] = z(!1), [ct, kt] = z(!1), [Ot, tt] = z(!1), [St, Ct] = z(""), [dt, $t] = z(""), zt = (s) => ({
|
|
703
|
+
id: s.id,
|
|
704
|
+
title: s.name,
|
|
705
|
+
image: s.image ?? "",
|
|
706
|
+
price: s.price ?? 0
|
|
707
|
+
}), [_t, O] = z([]), C = Ft(null), k = Ht((s) => s.store.store), et = Ht((s) => s.product.product), Wt = () => {
|
|
710
708
|
K(!0), setTimeout(() => F(!0), 10);
|
|
711
709
|
}, At = () => {
|
|
712
710
|
F(!1), setTimeout(() => K(!1), 300);
|
|
713
711
|
};
|
|
714
|
-
|
|
712
|
+
Q(() => {
|
|
715
713
|
g ? Wt() : At();
|
|
716
714
|
}, [g]);
|
|
717
|
-
const jt = (
|
|
718
|
-
$t(o[
|
|
715
|
+
const jt = (s) => {
|
|
716
|
+
$t(o[s]);
|
|
719
717
|
};
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
}, [
|
|
718
|
+
Q(() => {
|
|
719
|
+
C.current && (C.current.scrollTop += 150);
|
|
720
|
+
}, [_t]);
|
|
723
721
|
let $ = null, ut = null;
|
|
724
722
|
const Dt = async () => {
|
|
725
723
|
if ($ && ut && Date.now() < ut)
|
|
726
724
|
return $;
|
|
727
725
|
try {
|
|
728
|
-
const
|
|
726
|
+
const s = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token", v = new URLSearchParams({
|
|
729
727
|
grant_type: "client_credentials",
|
|
730
728
|
client_id: "4i8rd70sgt961tc4dhskgf08c",
|
|
731
729
|
client_secret: "bnsfq1220loh2cn2cm2ttn8fdhdpt0u8m1fgj8vfk2rn61aurjg",
|
|
732
730
|
scope: "default-m2m-resource-server-8xzfzo/read"
|
|
733
|
-
}), m = await fetch(
|
|
731
|
+
}), m = await fetch(s, {
|
|
734
732
|
method: "POST",
|
|
735
733
|
headers: {
|
|
736
734
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -745,28 +743,33 @@ const nt = (t) => {
|
|
|
745
743
|
$ = b.access_token;
|
|
746
744
|
const p = b.expires_in || 3600;
|
|
747
745
|
return ut = Date.now() + (p - 60) * 1e3, $;
|
|
748
|
-
} catch (
|
|
749
|
-
return console.error("Error obtaining JWT token:",
|
|
746
|
+
} catch (s) {
|
|
747
|
+
return console.error("Error obtaining JWT token:", s), $ = null, ut = null, null;
|
|
750
748
|
}
|
|
751
749
|
}, h = async () => {
|
|
752
|
-
const
|
|
753
|
-
|
|
750
|
+
const s = await Pt();
|
|
751
|
+
s != null && y(s);
|
|
754
752
|
};
|
|
755
|
-
|
|
753
|
+
Q(() => {
|
|
756
754
|
if (t != null && t.siteId) {
|
|
757
|
-
const { clientID:
|
|
758
|
-
sessionStorage.setItem("Host", v), sessionStorage.setItem("SiteId", p), sessionStorage.setItem("pubCfg", btoa(
|
|
755
|
+
const { clientID: s, host: v, organizationID: m, shortCode: b, siteId: p } = t;
|
|
756
|
+
sessionStorage.setItem("Host", v), sessionStorage.setItem("SiteId", p), sessionStorage.setItem("pubCfg", btoa(s)), sessionStorage.setItem("envRef", b), sessionStorage.setItem("orgRef", m);
|
|
759
757
|
}
|
|
760
758
|
h(), console.log("scapi environment v1");
|
|
761
|
-
}, []),
|
|
759
|
+
}, []), Q(() => {
|
|
762
760
|
e && (console.log("setting the basket id", e), nt(e));
|
|
763
|
-
}, [e])
|
|
761
|
+
}, [e]), Q(() => {
|
|
762
|
+
const s = async () => {
|
|
763
|
+
S(!1);
|
|
764
|
+
};
|
|
765
|
+
return window.addEventListener("reactCartUpdated", s), () => window.removeEventListener("reactCartUpdated", s);
|
|
766
|
+
}, []);
|
|
764
767
|
const J = async () => {
|
|
765
|
-
const
|
|
768
|
+
const s = JSON.parse(
|
|
766
769
|
sessionStorage.getItem("customerData") || "{}"
|
|
767
770
|
).customerId;
|
|
768
|
-
return (await kr(
|
|
769
|
-
}, pt = async (
|
|
771
|
+
return (await kr(s || "")).c_interests;
|
|
772
|
+
}, pt = async (s, v) => {
|
|
770
773
|
console.log("in secondary flow", It);
|
|
771
774
|
const m = await J();
|
|
772
775
|
if (console.log(m, "interests of customer", It), !!m)
|
|
@@ -786,7 +789,7 @@ const nt = (t) => {
|
|
|
786
789
|
flowAliasId: "HKFUVLWVH2",
|
|
787
790
|
input: {
|
|
788
791
|
loyaltyPoints: "",
|
|
789
|
-
productName:
|
|
792
|
+
productName: s,
|
|
790
793
|
productPoints: String(v || 0),
|
|
791
794
|
interests: m
|
|
792
795
|
}
|
|
@@ -835,10 +838,10 @@ const nt = (t) => {
|
|
|
835
838
|
} catch (b) {
|
|
836
839
|
console.error("Secondary flow error:", b);
|
|
837
840
|
}
|
|
838
|
-
}, D = async (
|
|
839
|
-
const v =
|
|
841
|
+
}, D = async (s) => {
|
|
842
|
+
const v = s || St.trim();
|
|
840
843
|
if (v) {
|
|
841
|
-
kt(!0),
|
|
844
|
+
kt(!0), Ct(""), n.current = null, c.current = null, l.current = null, d.current = null, O((m) => [
|
|
842
845
|
...m,
|
|
843
846
|
{
|
|
844
847
|
query: v,
|
|
@@ -877,7 +880,7 @@ const nt = (t) => {
|
|
|
877
880
|
const mt = L.body.getReader(), wt = new TextDecoder();
|
|
878
881
|
let B = "", U = "";
|
|
879
882
|
for (; ; ) {
|
|
880
|
-
|
|
883
|
+
tt(!0);
|
|
881
884
|
const { done: V, value: R } = await mt.read();
|
|
882
885
|
if (V) break;
|
|
883
886
|
B += wt.decode(R, { stream: !0 });
|
|
@@ -909,18 +912,18 @@ const nt = (t) => {
|
|
|
909
912
|
kt(!1);
|
|
910
913
|
}
|
|
911
914
|
}
|
|
912
|
-
}, er = (
|
|
913
|
-
const v =
|
|
915
|
+
}, er = (s) => {
|
|
916
|
+
const v = s.match(
|
|
914
917
|
/top five relevant product or category names are: (.*)/i
|
|
915
|
-
), p = (v ? v[1] :
|
|
918
|
+
), p = (v ? v[1] : s).split(", ").map((A) => A.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
|
|
916
919
|
return [...new Set(p)].filter(Boolean).join(",");
|
|
917
|
-
}, rr = async (
|
|
918
|
-
if (typeof
|
|
919
|
-
console.log(
|
|
920
|
-
const v =
|
|
920
|
+
}, rr = async (s) => {
|
|
921
|
+
if (typeof s == "string") {
|
|
922
|
+
console.log(s, "keywords");
|
|
923
|
+
const v = s.split(",");
|
|
921
924
|
for (const m of v) {
|
|
922
925
|
const b = await be(m);
|
|
923
|
-
if (
|
|
926
|
+
if (tt(!1), (b == null ? void 0 : b.length) > 0 && (O(
|
|
924
927
|
(p) => p.map(
|
|
925
928
|
(w, A) => A === p.length - 1 ? {
|
|
926
929
|
...w,
|
|
@@ -932,15 +935,15 @@ const nt = (t) => {
|
|
|
932
935
|
)
|
|
933
936
|
), !n.current || c.current == null)) {
|
|
934
937
|
const p = b[0];
|
|
935
|
-
n.current = String((p == null ? void 0 : p.product_name) ?? ""),
|
|
938
|
+
n.current = String((p == null ? void 0 : p.product_name) ?? ""), l.current = p.image.link, c.current = p.product_id;
|
|
936
939
|
const w = typeof (p == null ? void 0 : p.price) == "number" ? p.price : void 0;
|
|
937
940
|
d.current = typeof w == "number" && Number.isFinite(w) ? w : null;
|
|
938
941
|
}
|
|
939
942
|
}
|
|
940
943
|
} else
|
|
941
|
-
for (const v of
|
|
944
|
+
for (const v of s) {
|
|
942
945
|
const m = await be(v);
|
|
943
|
-
|
|
946
|
+
tt(!1), (m == null ? void 0 : m.length) > 0 && O(
|
|
944
947
|
(b) => b.map(
|
|
945
948
|
(p, w) => w === b.length - 1 ? {
|
|
946
949
|
...p,
|
|
@@ -960,7 +963,7 @@ const nt = (t) => {
|
|
|
960
963
|
productSnapshot: {
|
|
961
964
|
id: c.current,
|
|
962
965
|
name: n.current,
|
|
963
|
-
image:
|
|
966
|
+
image: l.current,
|
|
964
967
|
price: d.current ?? null,
|
|
965
968
|
points: 0,
|
|
966
969
|
quantity: 1
|
|
@@ -973,12 +976,12 @@ const nt = (t) => {
|
|
|
973
976
|
);
|
|
974
977
|
(v == null ? void 0 : v.isGuest) == !1 ? (console.log("running secondary flow", It), pt(n.current, 0)) : console.log("not running secondary flow", It);
|
|
975
978
|
}
|
|
976
|
-
|
|
977
|
-
}, or = async (
|
|
979
|
+
tt(!1);
|
|
980
|
+
}, or = async (s, v) => {
|
|
978
981
|
var m, b, p, w, A, ft, ht, L, mt, wt, B, U, V, R, W;
|
|
979
982
|
H(!0);
|
|
980
983
|
try {
|
|
981
|
-
const f = await He(
|
|
984
|
+
const f = await He(s.id);
|
|
982
985
|
if (!((b = (m = f == null ? void 0 : f.variants) == null ? void 0 : m[0]) != null && b.product_id || (w = (p = f == null ? void 0 : f.variants) == null ? void 0 : p[0]) != null && w.productId) && !(f.type.item || f.type.bundle)) {
|
|
983
986
|
H(!1), M.error("Variants not found", {
|
|
984
987
|
position: "bottom-right",
|
|
@@ -998,24 +1001,24 @@ const nt = (t) => {
|
|
|
998
1001
|
), P = (I == null ? void 0 : I.basketId) || localStorage.getItem(Yt), G = !1, Lt = localStorage.getItem(Tt), me = Date.now();
|
|
999
1002
|
if (!G || !Lt || me >= parseInt(Lt)) {
|
|
1000
1003
|
const nr = await qe();
|
|
1001
|
-
let { customer_token:
|
|
1004
|
+
let { customer_token: rt } = await Me(
|
|
1002
1005
|
nr
|
|
1003
1006
|
);
|
|
1004
|
-
if (
|
|
1007
|
+
if (rt = "Bearer " + i.access_token, !rt) {
|
|
1005
1008
|
console.error("Failed to get customer_token");
|
|
1006
1009
|
return;
|
|
1007
1010
|
}
|
|
1008
1011
|
const ar = me + 300 * 1e3;
|
|
1009
|
-
if (Kt(
|
|
1012
|
+
if (Kt(rt), localStorage.setItem(Tt, ar.toString()), console.log(P, "basketIdFromCustomer"), P) {
|
|
1010
1013
|
const we = await Re({
|
|
1011
1014
|
basketId: P,
|
|
1012
|
-
customer_token:
|
|
1015
|
+
customer_token: rt
|
|
1013
1016
|
});
|
|
1014
1017
|
if (we.status === 200 && we) {
|
|
1015
1018
|
const Gt = await Rt(
|
|
1016
1019
|
P,
|
|
1017
1020
|
q,
|
|
1018
|
-
|
|
1021
|
+
rt
|
|
1019
1022
|
);
|
|
1020
1023
|
((ht = Gt == null ? void 0 : Gt.product_items) == null ? void 0 : ht.length) > 0 && (M.success("Added to cart", {
|
|
1021
1024
|
position: "bottom-right",
|
|
@@ -1035,7 +1038,7 @@ const nt = (t) => {
|
|
|
1035
1038
|
quantity: 1
|
|
1036
1039
|
}
|
|
1037
1040
|
]
|
|
1038
|
-
}, x = await Ve(
|
|
1041
|
+
}, x = await Ve(rt, ir);
|
|
1039
1042
|
if (console.log(
|
|
1040
1043
|
x,
|
|
1041
1044
|
x == null ? void 0 : x.basket_id,
|
|
@@ -1051,7 +1054,7 @@ const nt = (t) => {
|
|
|
1051
1054
|
const gt = await Rt(
|
|
1052
1055
|
(x == null ? void 0 : x.basket_id) || (x == null ? void 0 : x.basketId),
|
|
1053
1056
|
q,
|
|
1054
|
-
|
|
1057
|
+
rt
|
|
1055
1058
|
);
|
|
1056
1059
|
(((wt = gt == null ? void 0 : gt.product_items) == null ? void 0 : wt.length) > 0 || ((B = gt == null ? void 0 : gt.productItems) == null ? void 0 : B.length) > 0) && M.success("Added to cart", {
|
|
1057
1060
|
position: "bottom-right",
|
|
@@ -1074,11 +1077,11 @@ const nt = (t) => {
|
|
|
1074
1077
|
}
|
|
1075
1078
|
H(!1);
|
|
1076
1079
|
};
|
|
1077
|
-
return /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ u(yr, { open: g, onOpenChange:
|
|
1080
|
+
return /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ u(yr, { open: g, onOpenChange: S, children: [
|
|
1078
1081
|
/* @__PURE__ */ a(
|
|
1079
1082
|
vr,
|
|
1080
1083
|
{
|
|
1081
|
-
onClick: () =>
|
|
1084
|
+
onClick: () => S(!0),
|
|
1082
1085
|
style: {
|
|
1083
1086
|
// background: storeDetails.tanyaThemeColor,
|
|
1084
1087
|
},
|
|
@@ -1143,7 +1146,7 @@ const nt = (t) => {
|
|
|
1143
1146
|
"div",
|
|
1144
1147
|
{
|
|
1145
1148
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
1146
|
-
onClick: () =>
|
|
1149
|
+
onClick: () => S(!1)
|
|
1147
1150
|
}
|
|
1148
1151
|
),
|
|
1149
1152
|
/* @__PURE__ */ u(
|
|
@@ -1154,9 +1157,9 @@ const nt = (t) => {
|
|
|
1154
1157
|
top-0 right-0
|
|
1155
1158
|
transition-transform duration-300 ease-in-out
|
|
1156
1159
|
lg:transform
|
|
1157
|
-
${
|
|
1160
|
+
${_ ? "lg:translate-x-0" : "lg:translate-x-full"}
|
|
1158
1161
|
// For mobile: animate from bottom
|
|
1159
|
-
${
|
|
1162
|
+
${_ ? "translate-y-0" : "translate-y-full"}
|
|
1160
1163
|
lg:translate-y-0
|
|
1161
1164
|
`,
|
|
1162
1165
|
style: {
|
|
@@ -1234,7 +1237,7 @@ const nt = (t) => {
|
|
|
1234
1237
|
gap: "1.25rem",
|
|
1235
1238
|
margin: "0.75rem"
|
|
1236
1239
|
},
|
|
1237
|
-
children: /* @__PURE__ */ a("button", { onClick: () =>
|
|
1240
|
+
children: /* @__PURE__ */ a("button", { onClick: () => S(!1), children: /* @__PURE__ */ u(
|
|
1238
1241
|
"svg",
|
|
1239
1242
|
{
|
|
1240
1243
|
width: "24",
|
|
@@ -1286,12 +1289,12 @@ const nt = (t) => {
|
|
|
1286
1289
|
/* @__PURE__ */ u(
|
|
1287
1290
|
"div",
|
|
1288
1291
|
{
|
|
1289
|
-
className: `flex flex-col h-full ${
|
|
1292
|
+
className: `flex flex-col h-full ${et ? "lg:w-2/3 w-full" : "w-full"}`,
|
|
1290
1293
|
children: [
|
|
1291
1294
|
/* @__PURE__ */ u(
|
|
1292
1295
|
"div",
|
|
1293
1296
|
{
|
|
1294
|
-
ref:
|
|
1297
|
+
ref: C,
|
|
1295
1298
|
className: "overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",
|
|
1296
1299
|
children: [
|
|
1297
1300
|
(k == null ? void 0 : k.whomRequired) && /* @__PURE__ */ u(
|
|
@@ -1300,32 +1303,32 @@ const nt = (t) => {
|
|
|
1300
1303
|
className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
|
|
1301
1304
|
children: [
|
|
1302
1305
|
/* @__PURE__ */ a("div", { className: "flex gap-2 bg-[#FFFFFF]", children: /* @__PURE__ */ a("p", { className: "font-bold font-nunitoSans text-[#494949]", children: "Is this for you or someone else?" }) }),
|
|
1303
|
-
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: r.map((
|
|
1306
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: r.map((s) => /* @__PURE__ */ a(
|
|
1304
1307
|
"button",
|
|
1305
1308
|
{
|
|
1306
|
-
onClick: () => jt(
|
|
1309
|
+
onClick: () => jt(s),
|
|
1307
1310
|
className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
|
|
1308
1311
|
style: {
|
|
1309
|
-
backgroundColor: dt === o[
|
|
1310
|
-
borderColor: dt === o[
|
|
1312
|
+
backgroundColor: dt === o[s] ? "#FFFFFF" : "#F3F3F3",
|
|
1313
|
+
borderColor: dt === o[s] ? "#BBB3DD" : ""
|
|
1311
1314
|
},
|
|
1312
|
-
children:
|
|
1315
|
+
children: s
|
|
1313
1316
|
},
|
|
1314
|
-
|
|
1317
|
+
s
|
|
1315
1318
|
)) })
|
|
1316
1319
|
]
|
|
1317
1320
|
}
|
|
1318
1321
|
),
|
|
1319
|
-
|
|
1322
|
+
_t.map((s, v) => {
|
|
1320
1323
|
var m, b;
|
|
1321
1324
|
return /* @__PURE__ */ u("div", { children: [
|
|
1322
|
-
/* @__PURE__ */ a("div", { className: "flex justify-end", children: /* @__PURE__ */ a("p", { className: "text-sm font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children:
|
|
1323
|
-
|
|
1325
|
+
/* @__PURE__ */ a("div", { className: "flex justify-end", children: /* @__PURE__ */ a("p", { className: "text-sm font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: s.query }) }),
|
|
1326
|
+
s.response && s.response.includes("Thinking") ? /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
1324
1327
|
"div",
|
|
1325
1328
|
{
|
|
1326
1329
|
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",
|
|
1327
1330
|
dangerouslySetInnerHTML: {
|
|
1328
|
-
__html: Xt(
|
|
1331
|
+
__html: Xt(s.response)
|
|
1329
1332
|
}
|
|
1330
1333
|
}
|
|
1331
1334
|
) }) : /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
@@ -1333,19 +1336,19 @@ const nt = (t) => {
|
|
|
1333
1336
|
{
|
|
1334
1337
|
className: "font-nunitoSans font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
|
|
1335
1338
|
dangerouslySetInnerHTML: {
|
|
1336
|
-
__html: Xt(
|
|
1339
|
+
__html: Xt(s.response)
|
|
1337
1340
|
}
|
|
1338
1341
|
}
|
|
1339
1342
|
) }),
|
|
1340
|
-
Ot && !
|
|
1341
|
-
(
|
|
1343
|
+
Ot && !s.response.includes("Thinking") && ((m = s.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" }) }),
|
|
1344
|
+
(s == null ? void 0 : s.products) && ((b = s == null ? void 0 : s.products) == null ? void 0 : b.length) > 0 && /* @__PURE__ */ a(
|
|
1342
1345
|
Ir,
|
|
1343
1346
|
{
|
|
1344
|
-
chat:
|
|
1347
|
+
chat: s.products,
|
|
1345
1348
|
storeDetails: k
|
|
1346
1349
|
}
|
|
1347
1350
|
),
|
|
1348
|
-
|
|
1351
|
+
s.potentialQuestions.length > 0 && /* @__PURE__ */ u("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
|
|
1349
1352
|
/* @__PURE__ */ a(
|
|
1350
1353
|
"p",
|
|
1351
1354
|
{
|
|
@@ -1354,7 +1357,7 @@ const nt = (t) => {
|
|
|
1354
1357
|
children: "Why not explore these inquiries..."
|
|
1355
1358
|
}
|
|
1356
1359
|
),
|
|
1357
|
-
|
|
1360
|
+
s.potentialQuestions.split(",").map((p, w) => /* @__PURE__ */ a(
|
|
1358
1361
|
"button",
|
|
1359
1362
|
{
|
|
1360
1363
|
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${k.themeDarkColor} m-1 rounded-xl px-2 py-1`,
|
|
@@ -1367,7 +1370,7 @@ const nt = (t) => {
|
|
|
1367
1370
|
w
|
|
1368
1371
|
))
|
|
1369
1372
|
] }),
|
|
1370
|
-
|
|
1373
|
+
s.secondaryLoading && /* @__PURE__ */ a("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ u(
|
|
1371
1374
|
"div",
|
|
1372
1375
|
{
|
|
1373
1376
|
className: "tanya-surprise-wrapper bg-indigo-300 text-sm px-7 py-4 rounded-r-xl rounded-bl-2xl w-full relative overflow-hidden",
|
|
@@ -1400,7 +1403,7 @@ const nt = (t) => {
|
|
|
1400
1403
|
]
|
|
1401
1404
|
}
|
|
1402
1405
|
) }),
|
|
1403
|
-
|
|
1406
|
+
s.secondaryResponse && /* @__PURE__ */ a(re, { children: /* @__PURE__ */ u("div", { className: "mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]", children: [
|
|
1404
1407
|
/* @__PURE__ */ a(
|
|
1405
1408
|
"div",
|
|
1406
1409
|
{
|
|
@@ -1410,12 +1413,12 @@ const nt = (t) => {
|
|
|
1410
1413
|
},
|
|
1411
1414
|
dangerouslySetInnerHTML: {
|
|
1412
1415
|
__html: Xt(
|
|
1413
|
-
|
|
1416
|
+
s.secondaryResponse
|
|
1414
1417
|
)
|
|
1415
1418
|
}
|
|
1416
1419
|
}
|
|
1417
1420
|
),
|
|
1418
|
-
|
|
1421
|
+
s.productSnapshot && // chat.productSnapshot.points > 0 &&
|
|
1419
1422
|
/* @__PURE__ */ a("div", { className: "mt-4 w-full", children: /* @__PURE__ */ u(
|
|
1420
1423
|
"div",
|
|
1421
1424
|
{
|
|
@@ -1433,11 +1436,11 @@ const nt = (t) => {
|
|
|
1433
1436
|
height: 112,
|
|
1434
1437
|
borderColor: "#eee"
|
|
1435
1438
|
},
|
|
1436
|
-
children:
|
|
1439
|
+
children: s.productSnapshot.image ? /* @__PURE__ */ a(
|
|
1437
1440
|
"img",
|
|
1438
1441
|
{
|
|
1439
|
-
src:
|
|
1440
|
-
alt:
|
|
1442
|
+
src: s.productSnapshot.image,
|
|
1443
|
+
alt: s.productSnapshot.name,
|
|
1441
1444
|
className: "w-full h-full object-cover"
|
|
1442
1445
|
}
|
|
1443
1446
|
) : /* @__PURE__ */ a("div", { className: "w-full h-full flex items-center justify-center text-xs text-gray-500", children: "No Image" })
|
|
@@ -1445,18 +1448,18 @@ const nt = (t) => {
|
|
|
1445
1448
|
),
|
|
1446
1449
|
/* @__PURE__ */ u("div", { className: "flex flex-col flex-1 justify-between", children: [
|
|
1447
1450
|
/* @__PURE__ */ u("div", { children: [
|
|
1448
|
-
/* @__PURE__ */ a("p", { className: "font-semibold text-[15px] leading-snug", children:
|
|
1449
|
-
/* @__PURE__ */ a("p", { className: "mt-1 text-[14px] font-medium", children:
|
|
1451
|
+
/* @__PURE__ */ a("p", { className: "font-semibold text-[15px] leading-snug", children: s.productSnapshot.name }),
|
|
1452
|
+
/* @__PURE__ */ a("p", { className: "mt-1 text-[14px] font-medium", children: s.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
|
|
1450
1453
|
style: "currency",
|
|
1451
1454
|
currency: (k == null ? void 0 : k.currency) || "USD"
|
|
1452
1455
|
}).format(
|
|
1453
|
-
|
|
1456
|
+
s.productSnapshot.price
|
|
1454
1457
|
) : "" }),
|
|
1455
|
-
|
|
1458
|
+
s.productSnapshot.points > 0 && /* @__PURE__ */ u("p", { className: "mt-1 text-xs opacity-80", children: [
|
|
1456
1459
|
"You will earn",
|
|
1457
1460
|
" ",
|
|
1458
1461
|
/* @__PURE__ */ u("strong", { children: [
|
|
1459
|
-
|
|
1462
|
+
s.productSnapshot.points,
|
|
1460
1463
|
" ",
|
|
1461
1464
|
"points"
|
|
1462
1465
|
] })
|
|
@@ -1489,7 +1492,7 @@ const nt = (t) => {
|
|
|
1489
1492
|
children: "−"
|
|
1490
1493
|
}
|
|
1491
1494
|
),
|
|
1492
|
-
/* @__PURE__ */ a("div", { className: "px-3 py-1 text-sm select-none", children:
|
|
1495
|
+
/* @__PURE__ */ a("div", { className: "px-3 py-1 text-sm select-none", children: s.productSnapshot.quantity }),
|
|
1493
1496
|
/* @__PURE__ */ a(
|
|
1494
1497
|
"button",
|
|
1495
1498
|
{
|
|
@@ -1519,9 +1522,9 @@ const nt = (t) => {
|
|
|
1519
1522
|
onClick: () => {
|
|
1520
1523
|
or(
|
|
1521
1524
|
zt(
|
|
1522
|
-
|
|
1525
|
+
s.productSnapshot
|
|
1523
1526
|
),
|
|
1524
|
-
|
|
1527
|
+
s.productSnapshot.quantity
|
|
1525
1528
|
);
|
|
1526
1529
|
},
|
|
1527
1530
|
disabled: lt,
|
|
@@ -1561,9 +1564,9 @@ const nt = (t) => {
|
|
|
1561
1564
|
placeholder: "How can I help you...",
|
|
1562
1565
|
value: St,
|
|
1563
1566
|
autoFocus: !0,
|
|
1564
|
-
onChange: (
|
|
1565
|
-
onKeyDown: (
|
|
1566
|
-
|
|
1567
|
+
onChange: (s) => Ct(s.target.value),
|
|
1568
|
+
onKeyDown: (s) => {
|
|
1569
|
+
s.key === "Enter" && !ct && D();
|
|
1567
1570
|
}
|
|
1568
1571
|
}
|
|
1569
1572
|
),
|
|
@@ -1649,9 +1652,9 @@ function Or(t, e) {
|
|
|
1649
1652
|
e.indexOf(o[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[n]) && (r[o[n]] = t[o[n]]);
|
|
1650
1653
|
return r;
|
|
1651
1654
|
}
|
|
1652
|
-
var Qt = "Invariant Violation",
|
|
1655
|
+
var Qt = "Invariant Violation", _e = Object.setPrototypeOf, $r = _e === void 0 ? function(t, e) {
|
|
1653
1656
|
return t.__proto__ = e, t;
|
|
1654
|
-
} :
|
|
1657
|
+
} : _e, Ye = (
|
|
1655
1658
|
/** @class */
|
|
1656
1659
|
(function(t) {
|
|
1657
1660
|
Pr(e, t);
|
|
@@ -1663,7 +1666,7 @@ var Qt = "Invariant Violation", Ce = Object.setPrototypeOf, $r = Ce === void 0 ?
|
|
|
1663
1666
|
return e;
|
|
1664
1667
|
})(Error)
|
|
1665
1668
|
);
|
|
1666
|
-
function
|
|
1669
|
+
function ot(t, e) {
|
|
1667
1670
|
if (!t)
|
|
1668
1671
|
throw new Ye(e);
|
|
1669
1672
|
}
|
|
@@ -1678,7 +1681,7 @@ function Bt(t) {
|
|
|
1678
1681
|
}
|
|
1679
1682
|
(function(t) {
|
|
1680
1683
|
t.debug = Bt("debug"), t.log = Bt("log"), t.warn = Bt("warn"), t.error = Bt("error");
|
|
1681
|
-
})(
|
|
1684
|
+
})(ot || (ot = {}));
|
|
1682
1685
|
var Je = "3.14.0";
|
|
1683
1686
|
function bt(t) {
|
|
1684
1687
|
try {
|
|
@@ -1728,12 +1731,12 @@ function Ut(t) {
|
|
|
1728
1731
|
var Zt = Object.assign(function(e, r) {
|
|
1729
1732
|
for (var o = [], n = 2; n < arguments.length; n++)
|
|
1730
1733
|
o[n - 2] = arguments[n];
|
|
1731
|
-
e ||
|
|
1734
|
+
e || ot(e, le(r, o) || ce(r, o));
|
|
1732
1735
|
}, {
|
|
1733
|
-
debug: Ut(
|
|
1734
|
-
log: Ut(
|
|
1735
|
-
warn: Ut(
|
|
1736
|
-
error: Ut(
|
|
1736
|
+
debug: Ut(ot.debug),
|
|
1737
|
+
log: Ut(ot.log),
|
|
1738
|
+
warn: Ut(ot.warn),
|
|
1739
|
+
error: Ut(ot.error)
|
|
1737
1740
|
});
|
|
1738
1741
|
function We(t) {
|
|
1739
1742
|
for (var e = [], r = 1; r < arguments.length; r++)
|
|
@@ -1799,12 +1802,12 @@ const Br = () => class {
|
|
|
1799
1802
|
const c = {
|
|
1800
1803
|
__proto__: null,
|
|
1801
1804
|
[this.id]: e
|
|
1802
|
-
},
|
|
1803
|
-
N = { parent:
|
|
1805
|
+
}, l = N;
|
|
1806
|
+
N = { parent: l, slots: c };
|
|
1804
1807
|
try {
|
|
1805
1808
|
return r.apply(n, o);
|
|
1806
1809
|
} finally {
|
|
1807
|
-
N =
|
|
1810
|
+
N = l;
|
|
1808
1811
|
}
|
|
1809
1812
|
}
|
|
1810
1813
|
// Capture the current context and wrap a callback function so that it
|
|
@@ -1868,7 +1871,7 @@ Array[te] || (function(t) {
|
|
|
1868
1871
|
} finally {
|
|
1869
1872
|
return t;
|
|
1870
1873
|
}
|
|
1871
|
-
})(Br()), { bind:
|
|
1874
|
+
})(Br()), { bind: Co, noContext: _o } = de;
|
|
1872
1875
|
new de();
|
|
1873
1876
|
function qr(t, e) {
|
|
1874
1877
|
var r = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
@@ -2063,9 +2066,9 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2063
2066
|
}), new Yr(o, this._subscriber);
|
|
2064
2067
|
}, e.forEach = function(o) {
|
|
2065
2068
|
var n = this;
|
|
2066
|
-
return new Promise(function(c,
|
|
2069
|
+
return new Promise(function(c, l) {
|
|
2067
2070
|
if (typeof o != "function") {
|
|
2068
|
-
|
|
2071
|
+
l(new TypeError(o + " is not a function"));
|
|
2069
2072
|
return;
|
|
2070
2073
|
}
|
|
2071
2074
|
function d() {
|
|
@@ -2076,10 +2079,10 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2076
2079
|
try {
|
|
2077
2080
|
o(y, d);
|
|
2078
2081
|
} catch (g) {
|
|
2079
|
-
|
|
2082
|
+
l(g), i.unsubscribe();
|
|
2080
2083
|
}
|
|
2081
2084
|
},
|
|
2082
|
-
error:
|
|
2085
|
+
error: l,
|
|
2083
2086
|
complete: c
|
|
2084
2087
|
});
|
|
2085
2088
|
});
|
|
@@ -2087,21 +2090,21 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2087
2090
|
var n = this;
|
|
2088
2091
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2089
2092
|
var c = Nt(this);
|
|
2090
|
-
return new c(function(
|
|
2093
|
+
return new c(function(l) {
|
|
2091
2094
|
return n.subscribe({
|
|
2092
2095
|
next: function(d) {
|
|
2093
2096
|
try {
|
|
2094
2097
|
d = o(d);
|
|
2095
2098
|
} catch (i) {
|
|
2096
|
-
return
|
|
2099
|
+
return l.error(i);
|
|
2097
2100
|
}
|
|
2098
|
-
|
|
2101
|
+
l.next(d);
|
|
2099
2102
|
},
|
|
2100
2103
|
error: function(d) {
|
|
2101
|
-
|
|
2104
|
+
l.error(d);
|
|
2102
2105
|
},
|
|
2103
2106
|
complete: function() {
|
|
2104
|
-
|
|
2107
|
+
l.complete();
|
|
2105
2108
|
}
|
|
2106
2109
|
});
|
|
2107
2110
|
});
|
|
@@ -2109,58 +2112,58 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2109
2112
|
var n = this;
|
|
2110
2113
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2111
2114
|
var c = Nt(this);
|
|
2112
|
-
return new c(function(
|
|
2115
|
+
return new c(function(l) {
|
|
2113
2116
|
return n.subscribe({
|
|
2114
2117
|
next: function(d) {
|
|
2115
2118
|
try {
|
|
2116
2119
|
if (!o(d)) return;
|
|
2117
2120
|
} catch (i) {
|
|
2118
|
-
return
|
|
2121
|
+
return l.error(i);
|
|
2119
2122
|
}
|
|
2120
|
-
|
|
2123
|
+
l.next(d);
|
|
2121
2124
|
},
|
|
2122
2125
|
error: function(d) {
|
|
2123
|
-
|
|
2126
|
+
l.error(d);
|
|
2124
2127
|
},
|
|
2125
2128
|
complete: function() {
|
|
2126
|
-
|
|
2129
|
+
l.complete();
|
|
2127
2130
|
}
|
|
2128
2131
|
});
|
|
2129
2132
|
});
|
|
2130
2133
|
}, e.reduce = function(o) {
|
|
2131
2134
|
var n = this;
|
|
2132
2135
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2133
|
-
var c = Nt(this),
|
|
2136
|
+
var c = Nt(this), l = arguments.length > 1, d = !1, i = arguments[1], y = i;
|
|
2134
2137
|
return new c(function(g) {
|
|
2135
2138
|
return n.subscribe({
|
|
2136
|
-
next: function(
|
|
2137
|
-
var
|
|
2138
|
-
if (d = !0, !
|
|
2139
|
+
next: function(S) {
|
|
2140
|
+
var _ = !d;
|
|
2141
|
+
if (d = !0, !_ || l)
|
|
2139
2142
|
try {
|
|
2140
|
-
y = o(y,
|
|
2143
|
+
y = o(y, S);
|
|
2141
2144
|
} catch (F) {
|
|
2142
2145
|
return g.error(F);
|
|
2143
2146
|
}
|
|
2144
2147
|
else
|
|
2145
|
-
y =
|
|
2148
|
+
y = S;
|
|
2146
2149
|
},
|
|
2147
|
-
error: function(
|
|
2148
|
-
g.error(
|
|
2150
|
+
error: function(S) {
|
|
2151
|
+
g.error(S);
|
|
2149
2152
|
},
|
|
2150
2153
|
complete: function() {
|
|
2151
|
-
if (!d && !
|
|
2154
|
+
if (!d && !l) return g.error(new TypeError("Cannot reduce an empty sequence"));
|
|
2152
2155
|
g.next(y), g.complete();
|
|
2153
2156
|
}
|
|
2154
2157
|
});
|
|
2155
2158
|
});
|
|
2156
2159
|
}, e.concat = function() {
|
|
2157
|
-
for (var o = this, n = arguments.length, c = new Array(n),
|
|
2158
|
-
c[
|
|
2160
|
+
for (var o = this, n = arguments.length, c = new Array(n), l = 0; l < n; l++)
|
|
2161
|
+
c[l] = arguments[l];
|
|
2159
2162
|
var d = Nt(this);
|
|
2160
2163
|
return new d(function(i) {
|
|
2161
2164
|
var y, g = 0;
|
|
2162
|
-
function _
|
|
2163
|
-
y =
|
|
2165
|
+
function S(_) {
|
|
2166
|
+
y = _.subscribe({
|
|
2164
2167
|
next: function(F) {
|
|
2165
2168
|
i.next(F);
|
|
2166
2169
|
},
|
|
@@ -2168,11 +2171,11 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2168
2171
|
i.error(F);
|
|
2169
2172
|
},
|
|
2170
2173
|
complete: function() {
|
|
2171
|
-
g === c.length ? (y = void 0, i.complete()) :
|
|
2174
|
+
g === c.length ? (y = void 0, i.complete()) : S(d.from(c[g++]));
|
|
2172
2175
|
}
|
|
2173
2176
|
});
|
|
2174
2177
|
}
|
|
2175
|
-
return
|
|
2178
|
+
return S(o), function() {
|
|
2176
2179
|
y && (y.unsubscribe(), y = void 0);
|
|
2177
2180
|
};
|
|
2178
2181
|
});
|
|
@@ -2180,38 +2183,38 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2180
2183
|
var n = this;
|
|
2181
2184
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2182
2185
|
var c = Nt(this);
|
|
2183
|
-
return new c(function(
|
|
2186
|
+
return new c(function(l) {
|
|
2184
2187
|
var d = [], i = n.subscribe({
|
|
2185
2188
|
next: function(g) {
|
|
2186
2189
|
if (o)
|
|
2187
2190
|
try {
|
|
2188
2191
|
g = o(g);
|
|
2189
|
-
} catch (
|
|
2190
|
-
return
|
|
2192
|
+
} catch (_) {
|
|
2193
|
+
return l.error(_);
|
|
2191
2194
|
}
|
|
2192
|
-
var
|
|
2193
|
-
next: function(
|
|
2194
|
-
|
|
2195
|
+
var S = c.from(g).subscribe({
|
|
2196
|
+
next: function(_) {
|
|
2197
|
+
l.next(_);
|
|
2195
2198
|
},
|
|
2196
|
-
error: function(
|
|
2197
|
-
|
|
2199
|
+
error: function(_) {
|
|
2200
|
+
l.error(_);
|
|
2198
2201
|
},
|
|
2199
2202
|
complete: function() {
|
|
2200
|
-
var
|
|
2201
|
-
|
|
2203
|
+
var _ = d.indexOf(S);
|
|
2204
|
+
_ >= 0 && d.splice(_, 1), y();
|
|
2202
2205
|
}
|
|
2203
2206
|
});
|
|
2204
|
-
d.push(
|
|
2207
|
+
d.push(S);
|
|
2205
2208
|
},
|
|
2206
2209
|
error: function(g) {
|
|
2207
|
-
|
|
2210
|
+
l.error(g);
|
|
2208
2211
|
},
|
|
2209
2212
|
complete: function() {
|
|
2210
2213
|
y();
|
|
2211
2214
|
}
|
|
2212
2215
|
});
|
|
2213
2216
|
function y() {
|
|
2214
|
-
i.closed && d.length === 0 &&
|
|
2217
|
+
i.closed && d.length === 0 && l.complete();
|
|
2215
2218
|
}
|
|
2216
2219
|
return function() {
|
|
2217
2220
|
d.forEach(function(g) {
|
|
@@ -2226,10 +2229,10 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2226
2229
|
if (o == null) throw new TypeError(o + " is not an object");
|
|
2227
2230
|
var c = Jt(o, ie);
|
|
2228
2231
|
if (c) {
|
|
2229
|
-
var
|
|
2230
|
-
if (Object(
|
|
2231
|
-
return Vr(
|
|
2232
|
-
return
|
|
2232
|
+
var l = c.call(o);
|
|
2233
|
+
if (Object(l) !== l) throw new TypeError(l + " is not an object");
|
|
2234
|
+
return Vr(l) && l.constructor === n ? l : new n(function(d) {
|
|
2235
|
+
return l.subscribe(d);
|
|
2233
2236
|
});
|
|
2234
2237
|
}
|
|
2235
2238
|
if (fe("iterator") && (c = Jt(o, Hr), c))
|
|
@@ -2258,8 +2261,8 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2258
2261
|
}, t.of = function() {
|
|
2259
2262
|
for (var o = arguments.length, n = new Array(o), c = 0; c < o; c++)
|
|
2260
2263
|
n[c] = arguments[c];
|
|
2261
|
-
var
|
|
2262
|
-
return new
|
|
2264
|
+
var l = typeof this == "function" ? this : t;
|
|
2265
|
+
return new l(function(d) {
|
|
2263
2266
|
Mt(function() {
|
|
2264
2267
|
if (!d.closed) {
|
|
2265
2268
|
for (var i = 0; i < n.length; ++i)
|
|
@@ -2373,12 +2376,12 @@ var tr = (
|
|
|
2373
2376
|
return r.concat(o);
|
|
2374
2377
|
});
|
|
2375
2378
|
}, t.split = function(e, r, o) {
|
|
2376
|
-
var n = Et(r), c = Et(o || new t(Ae)),
|
|
2377
|
-
return qt(n) && qt(c) ?
|
|
2379
|
+
var n = Et(r), c = Et(o || new t(Ae)), l;
|
|
2380
|
+
return qt(n) && qt(c) ? l = new t(function(d) {
|
|
2378
2381
|
return e(d) ? n.request(d) || E.of() : c.request(d) || E.of();
|
|
2379
|
-
}) :
|
|
2382
|
+
}) : l = new t(function(d, i) {
|
|
2380
2383
|
return e(d) ? n.request(d, i) || E.of() : c.request(d, i) || E.of();
|
|
2381
|
-
}), Object.assign(
|
|
2384
|
+
}), Object.assign(l, { left: n, right: c });
|
|
2382
2385
|
}, t.execute = function(e, r) {
|
|
2383
2386
|
return e.request(Gr(r.context, Xr(Wr(r)))) || E.of();
|
|
2384
2387
|
}, t.concat = function(e, r) {
|
|
@@ -2386,12 +2389,12 @@ var tr = (
|
|
|
2386
2389
|
if (qt(o))
|
|
2387
2390
|
return globalThis.__DEV__ !== !1 && Zt.warn(47, o), o;
|
|
2388
2391
|
var n = Et(r), c;
|
|
2389
|
-
return qt(n) ? c = new t(function(
|
|
2390
|
-
return o.request(
|
|
2392
|
+
return qt(n) ? c = new t(function(l) {
|
|
2393
|
+
return o.request(l, function(d) {
|
|
2391
2394
|
return n.request(d) || E.of();
|
|
2392
2395
|
}) || E.of();
|
|
2393
|
-
}) : c = new t(function(
|
|
2394
|
-
return o.request(
|
|
2396
|
+
}) : c = new t(function(l, d) {
|
|
2397
|
+
return o.request(l, function(i) {
|
|
2395
2398
|
return n.request(i, d) || E.of();
|
|
2396
2399
|
}) || E.of();
|
|
2397
2400
|
}), Object.assign(c, { left: o, right: n });
|
|
@@ -2416,17 +2419,17 @@ function oo(t) {
|
|
|
2416
2419
|
return new tr(function(e, r) {
|
|
2417
2420
|
var o = Or(e, []);
|
|
2418
2421
|
return new E(function(n) {
|
|
2419
|
-
var c,
|
|
2422
|
+
var c, l = !1;
|
|
2420
2423
|
return Promise.resolve(o).then(function(d) {
|
|
2421
2424
|
return t(d, e.getContext());
|
|
2422
2425
|
}).then(e.setContext).then(function() {
|
|
2423
|
-
|
|
2426
|
+
l || (c = r(e).subscribe({
|
|
2424
2427
|
next: n.next.bind(n),
|
|
2425
2428
|
error: n.error.bind(n),
|
|
2426
2429
|
complete: n.complete.bind(n)
|
|
2427
2430
|
}));
|
|
2428
2431
|
}).catch(n.error.bind(n)), function() {
|
|
2429
|
-
|
|
2432
|
+
l = !0, c && c.unsubscribe();
|
|
2430
2433
|
};
|
|
2431
2434
|
});
|
|
2432
2435
|
});
|