tanya-chatbot 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tanya-chatbot.cjs.js +12 -12
- package/dist/tanya-chatbot.cjs.js.map +1 -1
- package/dist/tanya-chatbot.es.js +1635 -1623
- package/dist/tanya-chatbot.es.js.map +1 -1
- package/package.json +2 -3
- package/dist/tanya-chatbot.css +0 -1
package/dist/tanya-chatbot.es.js
CHANGED
|
@@ -1,16 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import * as
|
|
1
|
+
import { useEffect as ct, forwardRef as hr, useState as D, createElement as fe, useRef as Ot } from "react";
|
|
2
|
+
import { jsx as l, jsxs as p, Fragment as pe } from "react/jsx-runtime";
|
|
3
|
+
import { createHttpLink as Qr, ApolloClient as Xr, InMemoryCache as Zr, ApolloProvider as tn } from "@apollo/client";
|
|
4
|
+
import { Provider as en, useDispatch as mr, useSelector as Kt } from "react-redux";
|
|
5
|
+
import { createSlice as gr, configureStore as rn } from "@reduxjs/toolkit";
|
|
6
|
+
import * as wr from "@radix-ui/react-popover";
|
|
7
7
|
import "clsx";
|
|
8
8
|
import "tailwind-merge";
|
|
9
|
-
import
|
|
9
|
+
import U from "axios";
|
|
10
10
|
import "crypto-js";
|
|
11
|
-
import { Icon as
|
|
12
|
-
import { toast as
|
|
13
|
-
const or = {
|
|
11
|
+
import { Icon as Le } from "@iconify/react";
|
|
12
|
+
import { toast as X } from "react-toastify";
|
|
13
|
+
const nn = '*,: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-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\\[1px\\]{padding:1px}.p-\\[5px\\]{padding:5px}.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;background-color:#1a1a1a;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 pa() {
|
|
15
|
+
return ct(() => {
|
|
16
|
+
if (typeof document < "u") {
|
|
17
|
+
const t = document.createElement("style");
|
|
18
|
+
return t.textContent = nn, document.head.appendChild(t), () => {
|
|
19
|
+
document.head.removeChild(t);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}, []), null;
|
|
23
|
+
}
|
|
24
|
+
const on = {
|
|
14
25
|
store: {
|
|
15
26
|
storeCode: "",
|
|
16
27
|
storeName: "",
|
|
@@ -44,123 +55,123 @@ const or = {
|
|
|
44
55
|
mobile: []
|
|
45
56
|
}
|
|
46
57
|
}
|
|
47
|
-
},
|
|
58
|
+
}, yr = gr({
|
|
48
59
|
name: "store",
|
|
49
|
-
initialState:
|
|
60
|
+
initialState: on,
|
|
50
61
|
reducers: {
|
|
51
|
-
setStore: (
|
|
52
|
-
|
|
62
|
+
setStore: (t, e) => {
|
|
63
|
+
t.store = e.payload;
|
|
53
64
|
}
|
|
54
65
|
}
|
|
55
|
-
}), { setStore:
|
|
66
|
+
}), { setStore: ha } = yr.actions, an = yr.reducer, sn = {
|
|
56
67
|
product: null
|
|
57
|
-
},
|
|
68
|
+
}, br = gr({
|
|
58
69
|
name: "product",
|
|
59
|
-
initialState:
|
|
70
|
+
initialState: sn,
|
|
60
71
|
reducers: {
|
|
61
|
-
setProduct: (
|
|
62
|
-
|
|
72
|
+
setProduct: (t, e) => {
|
|
73
|
+
t.product = e.payload;
|
|
63
74
|
}
|
|
64
75
|
}
|
|
65
|
-
}), { setProduct:
|
|
76
|
+
}), { setProduct: he } = br.actions, cn = br.reducer, ln = rn({
|
|
66
77
|
reducer: {
|
|
67
|
-
store:
|
|
68
|
-
product:
|
|
78
|
+
store: an,
|
|
79
|
+
product: cn
|
|
69
80
|
}
|
|
70
|
-
}),
|
|
71
|
-
const
|
|
81
|
+
}), un = ({ children: t }) => /* @__PURE__ */ l(en, { store: ln, children: t }), Ft = (t) => {
|
|
82
|
+
const e = new CustomEvent("reactCartUpdated", {
|
|
72
83
|
detail: {
|
|
73
84
|
cartUpdated: !0,
|
|
74
|
-
basketId:
|
|
85
|
+
basketId: t
|
|
75
86
|
// any other data SFCC needs
|
|
76
87
|
}
|
|
77
88
|
});
|
|
78
|
-
window.dispatchEvent(
|
|
89
|
+
window.dispatchEvent(e);
|
|
79
90
|
};
|
|
80
|
-
function
|
|
81
|
-
...
|
|
91
|
+
function dn({
|
|
92
|
+
...t
|
|
82
93
|
}) {
|
|
83
|
-
return /* @__PURE__ */ l(
|
|
94
|
+
return /* @__PURE__ */ l(wr.Root, { "data-slot": "popover", ...t });
|
|
84
95
|
}
|
|
85
|
-
function
|
|
86
|
-
...
|
|
96
|
+
function fn({
|
|
97
|
+
...t
|
|
87
98
|
}) {
|
|
88
|
-
return /* @__PURE__ */ l(
|
|
99
|
+
return /* @__PURE__ */ l(wr.Trigger, { "data-slot": "popover-trigger", ...t });
|
|
89
100
|
}
|
|
90
|
-
const
|
|
91
|
-
const
|
|
101
|
+
const wt = () => ({ 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" }), xr = async () => {
|
|
102
|
+
const t = "https://tanya-sfcc-server.vercel.app/";
|
|
92
103
|
try {
|
|
93
|
-
const
|
|
94
|
-
`${
|
|
104
|
+
const e = await U.post(
|
|
105
|
+
`${t}api/auth/token-bm-grant?baseUrl=${lt()}&siteId=${rt()}`
|
|
95
106
|
);
|
|
96
|
-
return
|
|
97
|
-
} catch (
|
|
98
|
-
return
|
|
107
|
+
return e.status === 200 && e.data.access_token ? e.data.access_token : (console.error("Failed to fetch token:", e.data), null);
|
|
108
|
+
} catch (e) {
|
|
109
|
+
return U.isAxiosError(e) ? console.error("Error fetching token:", e.response || e.message) : console.error("Unexpected error:", e), null;
|
|
99
110
|
}
|
|
100
|
-
},
|
|
101
|
-
const
|
|
111
|
+
}, vr = async (t) => {
|
|
112
|
+
const e = "https://tanya-sfcc-server.vercel.app/";
|
|
102
113
|
try {
|
|
103
|
-
const
|
|
104
|
-
`${
|
|
114
|
+
const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, n = await U.post(
|
|
115
|
+
`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${lt()}&siteId=${rt()}&pubCfg=${ut()}&envRef=${dt()}&orgRef=${ft()}`,
|
|
105
116
|
{},
|
|
106
117
|
{
|
|
107
118
|
headers: {
|
|
108
119
|
"Content-Type": "application/json",
|
|
109
|
-
Authorization: `Bearer ${
|
|
120
|
+
Authorization: `Bearer ${t}`
|
|
110
121
|
}
|
|
111
122
|
}
|
|
112
123
|
);
|
|
113
|
-
return
|
|
114
|
-
} catch (
|
|
115
|
-
return
|
|
124
|
+
return n.status === 200 && n.data ? n.data : null;
|
|
125
|
+
} catch (r) {
|
|
126
|
+
return U.isAxiosError(r) ? console.error("Error creating basket:", r.response || r.message) : console.error("Unexpected error:", r), null;
|
|
116
127
|
}
|
|
117
128
|
};
|
|
118
|
-
async function
|
|
119
|
-
const
|
|
129
|
+
async function Zt() {
|
|
130
|
+
const t = localStorage.getItem("expires_in"), e = localStorage.getItem("access_token"), r = JSON.parse(
|
|
120
131
|
sessionStorage.getItem("customerData") || "{}"
|
|
121
132
|
).isGuest;
|
|
122
|
-
if (
|
|
123
|
-
return console.log("access token found in local storage"), { access_token:
|
|
124
|
-
const { serverUrl:
|
|
133
|
+
if (t && e && (/* @__PURE__ */ new Date()).getTime() < parseInt(t) && r === JSON.parse(localStorage.getItem("isGuest") || "false"))
|
|
134
|
+
return console.log("access token found in local storage"), { access_token: e, expires_in: t };
|
|
135
|
+
const { serverUrl: n } = wt(), o = JSON.parse(
|
|
125
136
|
sessionStorage.getItem("customerData") || "{}"
|
|
126
|
-
).dwsid,
|
|
137
|
+
).dwsid, a = JSON.parse(
|
|
127
138
|
sessionStorage.getItem("customerData") || "{}"
|
|
128
139
|
).usrRef;
|
|
129
140
|
try {
|
|
130
|
-
const i =
|
|
131
|
-
`${
|
|
141
|
+
const i = r ? "unregister-auth" : "register-auth", c = await U.get(
|
|
142
|
+
`${n}sc-api/${i}?dwsid=${o}&email=${a}&pubCfg=${ut()}&envRef=${dt()}&orgRef=${ft()}&siteId=${rt()}`
|
|
132
143
|
);
|
|
133
144
|
return localStorage.setItem("access_token", c.data.access_token), localStorage.setItem(
|
|
134
145
|
"expires_in",
|
|
135
146
|
String((/* @__PURE__ */ new Date()).getTime() + c.data.expires_in * 1e3)
|
|
136
|
-
), localStorage.setItem("isGuest",
|
|
147
|
+
), localStorage.setItem("isGuest", r.toString()), console.log(c.data), c.data;
|
|
137
148
|
} catch (i) {
|
|
138
149
|
console.log(i);
|
|
139
150
|
}
|
|
140
151
|
}
|
|
141
|
-
const
|
|
142
|
-
const { serverUrl:
|
|
152
|
+
const lt = () => sessionStorage.getItem("Host"), rt = () => sessionStorage.getItem("SiteId"), ut = () => sessionStorage.getItem("pubCfg"), dt = () => sessionStorage.getItem("envRef"), ft = () => sessionStorage.getItem("orgRef"), ze = async (t, e) => {
|
|
153
|
+
const { serverUrl: r, basePath: n } = wt();
|
|
143
154
|
try {
|
|
144
|
-
const o =
|
|
145
|
-
return (await
|
|
146
|
-
`${
|
|
155
|
+
const o = lt();
|
|
156
|
+
return (await U.get(
|
|
157
|
+
`${r}${n}/search-sfcc?baseUrl=${o}&query=${t}&siteId=${rt()}&pubCfg=${ut()}&envRef=${dt()}&orgRef=${ft()}`,
|
|
147
158
|
{
|
|
148
159
|
headers: {
|
|
149
160
|
"Content-Type": "application/json",
|
|
150
|
-
Authorization: `Bearer ${
|
|
161
|
+
Authorization: `Bearer ${e}`
|
|
151
162
|
}
|
|
152
163
|
}
|
|
153
164
|
)).data.hits;
|
|
154
165
|
} catch (o) {
|
|
155
166
|
throw console.error("Error fetching search results:", o), o;
|
|
156
167
|
}
|
|
157
|
-
},
|
|
158
|
-
if (!
|
|
159
|
-
const { serverUrl:
|
|
168
|
+
}, kr = async (t) => {
|
|
169
|
+
if (!t) throw new Error("Product ID is required");
|
|
170
|
+
const { serverUrl: e, basePath: r } = wt(), n = lt();
|
|
160
171
|
console.log("calling access");
|
|
161
|
-
const { access_token: o } = await
|
|
162
|
-
return console.log(o), (await
|
|
163
|
-
`${
|
|
172
|
+
const { access_token: o } = await Zt();
|
|
173
|
+
return console.log(o), (await U.get(
|
|
174
|
+
`${e}${r}/product-sfcc/${t}?baseUrl=${n}&siteId=${rt()}&pubCfg=${ut()}&envRef=${dt()}&orgRef=${ft()}`,
|
|
164
175
|
{
|
|
165
176
|
headers: {
|
|
166
177
|
"Content-Type": "application/json",
|
|
@@ -168,13 +179,13 @@ const ce = () => sessionStorage.getItem("Host"), ne = () => sessionStorage.getIt
|
|
|
168
179
|
}
|
|
169
180
|
}
|
|
170
181
|
)).data;
|
|
171
|
-
},
|
|
172
|
-
if (!
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
), { serverUrl:
|
|
176
|
-
return (await
|
|
177
|
-
`${
|
|
182
|
+
}, pn = async (t) => {
|
|
183
|
+
if (!t) throw new Error("customerId is required");
|
|
184
|
+
const e = await xr(), { customer_token: r } = await vr(
|
|
185
|
+
e
|
|
186
|
+
), { serverUrl: n, basePath: o } = wt(), i = (await Zt()).access_token;
|
|
187
|
+
return (await U.get(
|
|
188
|
+
`${n}${o}/get-interest?baseUrl=${lt()}&customerId=${t}&siteId=${rt()}&pubCfg=${ut()}&envRef=${dt()}&orgRef=${ft()}`,
|
|
178
189
|
{
|
|
179
190
|
headers: {
|
|
180
191
|
"Content-Type": "application/json",
|
|
@@ -182,527 +193,527 @@ const ce = () => sessionStorage.getItem("Host"), ne = () => sessionStorage.getIt
|
|
|
182
193
|
}
|
|
183
194
|
}
|
|
184
195
|
)).data;
|
|
185
|
-
},
|
|
196
|
+
}, De = (t) => String(typeof t == "string" ? t : t["en-US"] || t), Me = (t) => t != null && t.image ? [t.image] : "variants" in t ? t.variants[0].images : t.masterVariant.images.map((e) => e.url), hn = (t, e) => t.toLocaleString("en-US", {
|
|
186
197
|
style: "currency",
|
|
187
|
-
currency:
|
|
188
|
-
}),
|
|
189
|
-
var
|
|
190
|
-
return "variants" in
|
|
191
|
-
centAmount: (
|
|
198
|
+
currency: e || "USD"
|
|
199
|
+
}), Ue = (t) => {
|
|
200
|
+
var e, r, n;
|
|
201
|
+
return "variants" in t ? {
|
|
202
|
+
centAmount: (e = t.variants[0]) == null ? void 0 : e.prices.EUR.max,
|
|
192
203
|
currencyCode: "DOL"
|
|
193
204
|
} : {
|
|
194
|
-
centAmount: (
|
|
195
|
-
currencyCode: (
|
|
205
|
+
centAmount: (r = t.masterVariant) == null ? void 0 : r.prices[0].value.centAmount,
|
|
206
|
+
currencyCode: (n = t.masterVariant) == null ? void 0 : n.prices[0].value.currencyCode
|
|
196
207
|
};
|
|
197
|
-
},
|
|
198
|
-
const
|
|
199
|
-
return
|
|
208
|
+
}, mn = (t) => t.charAt(0).toUpperCase() + t.slice(1), Be = (t, e) => t.length < e ? t : t.slice(0, e) + "...", ae = (t) => t.split("\\n").map((e, r) => {
|
|
209
|
+
const n = e.match(/^(\d+)\.\s(.+)/);
|
|
210
|
+
return n ? `<p key=${r} class="mb-2"><strong>${n[1]}.</strong> ${n[2]}</p>` : e.trim() ? `<p key=${r} class="mb-2">${e}</p>` : "<br/>";
|
|
200
211
|
}).join("");
|
|
201
|
-
function
|
|
202
|
-
const
|
|
203
|
-
function
|
|
204
|
-
if (
|
|
212
|
+
function gn(t, e) {
|
|
213
|
+
const r = t.icons, n = t.aliases || /* @__PURE__ */ Object.create(null), o = /* @__PURE__ */ Object.create(null);
|
|
214
|
+
function a(i) {
|
|
215
|
+
if (r[i]) return o[i] = [];
|
|
205
216
|
if (!(i in o)) {
|
|
206
217
|
o[i] = null;
|
|
207
|
-
const c =
|
|
208
|
-
|
|
218
|
+
const c = n[i] && n[i].parent, s = c && a(c);
|
|
219
|
+
s && (o[i] = [c].concat(s));
|
|
209
220
|
}
|
|
210
221
|
return o[i];
|
|
211
222
|
}
|
|
212
|
-
return Object.keys(
|
|
223
|
+
return Object.keys(r).concat(Object.keys(n)).forEach(a), o;
|
|
213
224
|
}
|
|
214
|
-
const
|
|
225
|
+
const Sr = Object.freeze({
|
|
215
226
|
left: 0,
|
|
216
227
|
top: 0,
|
|
217
228
|
width: 16,
|
|
218
229
|
height: 16
|
|
219
|
-
}),
|
|
230
|
+
}), Gt = Object.freeze({
|
|
220
231
|
rotate: 0,
|
|
221
232
|
vFlip: !1,
|
|
222
233
|
hFlip: !1
|
|
223
|
-
}),
|
|
224
|
-
...
|
|
225
|
-
...
|
|
226
|
-
}),
|
|
227
|
-
...
|
|
234
|
+
}), Se = Object.freeze({
|
|
235
|
+
...Sr,
|
|
236
|
+
...Gt
|
|
237
|
+
}), me = Object.freeze({
|
|
238
|
+
...Se,
|
|
228
239
|
body: "",
|
|
229
240
|
hidden: !1
|
|
230
241
|
});
|
|
231
|
-
function
|
|
232
|
-
const
|
|
233
|
-
!
|
|
234
|
-
const
|
|
235
|
-
return
|
|
236
|
-
}
|
|
237
|
-
function
|
|
238
|
-
const
|
|
239
|
-
for (const
|
|
240
|
-
return
|
|
242
|
+
function wn(t, e) {
|
|
243
|
+
const r = {};
|
|
244
|
+
!t.hFlip != !e.hFlip && (r.hFlip = !0), !t.vFlip != !e.vFlip && (r.vFlip = !0);
|
|
245
|
+
const n = ((t.rotate || 0) + (e.rotate || 0)) % 4;
|
|
246
|
+
return n && (r.rotate = n), r;
|
|
247
|
+
}
|
|
248
|
+
function qe(t, e) {
|
|
249
|
+
const r = wn(t, e);
|
|
250
|
+
for (const n in me) n in Gt ? n in t && !(n in r) && (r[n] = Gt[n]) : n in e ? r[n] = e[n] : n in t && (r[n] = t[n]);
|
|
251
|
+
return r;
|
|
241
252
|
}
|
|
242
|
-
function
|
|
243
|
-
const
|
|
244
|
-
let
|
|
253
|
+
function yn(t, e, r) {
|
|
254
|
+
const n = t.icons, o = t.aliases || /* @__PURE__ */ Object.create(null);
|
|
255
|
+
let a = {};
|
|
245
256
|
function i(c) {
|
|
246
|
-
|
|
257
|
+
a = qe(n[c] || o[c], a);
|
|
247
258
|
}
|
|
248
|
-
return i(
|
|
259
|
+
return i(e), r.forEach(i), qe(t, a);
|
|
249
260
|
}
|
|
250
|
-
function
|
|
251
|
-
const
|
|
252
|
-
if (typeof
|
|
253
|
-
|
|
254
|
-
|
|
261
|
+
function Cr(t, e) {
|
|
262
|
+
const r = [];
|
|
263
|
+
if (typeof t != "object" || typeof t.icons != "object") return r;
|
|
264
|
+
t.not_found instanceof Array && t.not_found.forEach((o) => {
|
|
265
|
+
e(o, null), r.push(o);
|
|
255
266
|
});
|
|
256
|
-
const
|
|
257
|
-
for (const o in
|
|
258
|
-
const
|
|
259
|
-
|
|
267
|
+
const n = gn(t);
|
|
268
|
+
for (const o in n) {
|
|
269
|
+
const a = n[o];
|
|
270
|
+
a && (e(o, yn(t, o, a)), r.push(o));
|
|
260
271
|
}
|
|
261
|
-
return
|
|
272
|
+
return r;
|
|
262
273
|
}
|
|
263
|
-
const
|
|
274
|
+
const bn = {
|
|
264
275
|
provider: "",
|
|
265
276
|
aliases: {},
|
|
266
277
|
not_found: {},
|
|
267
|
-
...
|
|
278
|
+
...Sr
|
|
268
279
|
};
|
|
269
|
-
function
|
|
270
|
-
for (const
|
|
280
|
+
function ie(t, e) {
|
|
281
|
+
for (const r in e) if (r in t && typeof t[r] != typeof e[r]) return !1;
|
|
271
282
|
return !0;
|
|
272
283
|
}
|
|
273
|
-
function
|
|
274
|
-
if (typeof
|
|
275
|
-
const
|
|
276
|
-
if (typeof
|
|
277
|
-
const
|
|
278
|
-
for (const o in n) {
|
|
279
|
-
const s = n[o];
|
|
280
|
-
if (!o || typeof s.body != "string" || !it(s, mt)) return null;
|
|
281
|
-
}
|
|
282
|
-
const r = t.aliases || /* @__PURE__ */ Object.create(null);
|
|
284
|
+
function Ir(t) {
|
|
285
|
+
if (typeof t != "object" || t === null) return null;
|
|
286
|
+
const e = t;
|
|
287
|
+
if (typeof e.prefix != "string" || !t.icons || typeof t.icons != "object" || !ie(t, bn)) return null;
|
|
288
|
+
const r = e.icons;
|
|
283
289
|
for (const o in r) {
|
|
284
|
-
const
|
|
285
|
-
if (!o || typeof
|
|
290
|
+
const a = r[o];
|
|
291
|
+
if (!o || typeof a.body != "string" || !ie(a, me)) return null;
|
|
286
292
|
}
|
|
287
|
-
|
|
293
|
+
const n = e.aliases || /* @__PURE__ */ Object.create(null);
|
|
294
|
+
for (const o in n) {
|
|
295
|
+
const a = n[o], i = a.parent;
|
|
296
|
+
if (!o || typeof i != "string" || !r[i] && !n[i] || !ie(a, me)) return null;
|
|
297
|
+
}
|
|
298
|
+
return e;
|
|
288
299
|
}
|
|
289
|
-
const
|
|
290
|
-
function
|
|
300
|
+
const Re = /* @__PURE__ */ Object.create(null);
|
|
301
|
+
function xn(t, e) {
|
|
291
302
|
return {
|
|
292
|
-
provider:
|
|
293
|
-
prefix:
|
|
303
|
+
provider: t,
|
|
304
|
+
prefix: e,
|
|
294
305
|
icons: /* @__PURE__ */ Object.create(null),
|
|
295
306
|
missing: /* @__PURE__ */ new Set()
|
|
296
307
|
};
|
|
297
308
|
}
|
|
298
|
-
function
|
|
299
|
-
const
|
|
300
|
-
return
|
|
309
|
+
function Et(t, e) {
|
|
310
|
+
const r = Re[t] || (Re[t] = /* @__PURE__ */ Object.create(null));
|
|
311
|
+
return r[e] || (r[e] = xn(t, e));
|
|
301
312
|
}
|
|
302
|
-
function
|
|
303
|
-
return
|
|
304
|
-
|
|
313
|
+
function _r(t, e) {
|
|
314
|
+
return Ir(e) ? Cr(e, (r, n) => {
|
|
315
|
+
n ? t.icons[r] = n : t.missing.add(r);
|
|
305
316
|
}) : [];
|
|
306
317
|
}
|
|
307
|
-
function
|
|
318
|
+
function vn(t, e, r) {
|
|
308
319
|
try {
|
|
309
|
-
if (typeof
|
|
310
|
-
return
|
|
320
|
+
if (typeof r.body == "string")
|
|
321
|
+
return t.icons[e] = { ...r }, !0;
|
|
311
322
|
} catch {
|
|
312
323
|
}
|
|
313
324
|
return !1;
|
|
314
325
|
}
|
|
315
|
-
const
|
|
316
|
-
const o =
|
|
317
|
-
if (
|
|
326
|
+
const Fr = /^[a-z0-9]+(-[a-z0-9]+)*$/, te = (t, e, r, n = "") => {
|
|
327
|
+
const o = t.split(":");
|
|
328
|
+
if (t.slice(0, 1) === "@") {
|
|
318
329
|
if (o.length < 2 || o.length > 3) return null;
|
|
319
|
-
|
|
330
|
+
n = o.shift().slice(1);
|
|
320
331
|
}
|
|
321
332
|
if (o.length > 3 || !o.length) return null;
|
|
322
333
|
if (o.length > 1) {
|
|
323
|
-
const c = o.pop(),
|
|
324
|
-
provider: o.length > 0 ? o[0] :
|
|
325
|
-
prefix:
|
|
334
|
+
const c = o.pop(), s = o.pop(), u = {
|
|
335
|
+
provider: o.length > 0 ? o[0] : n,
|
|
336
|
+
prefix: s,
|
|
326
337
|
name: c
|
|
327
338
|
};
|
|
328
|
-
return
|
|
339
|
+
return e && !Vt(u) ? null : u;
|
|
329
340
|
}
|
|
330
|
-
const
|
|
341
|
+
const a = o[0], i = a.split("-");
|
|
331
342
|
if (i.length > 1) {
|
|
332
343
|
const c = {
|
|
333
|
-
provider:
|
|
344
|
+
provider: n,
|
|
334
345
|
prefix: i.shift(),
|
|
335
346
|
name: i.join("-")
|
|
336
347
|
};
|
|
337
|
-
return
|
|
348
|
+
return e && !Vt(c) ? null : c;
|
|
338
349
|
}
|
|
339
|
-
if (
|
|
350
|
+
if (r && n === "") {
|
|
340
351
|
const c = {
|
|
341
|
-
provider:
|
|
352
|
+
provider: n,
|
|
342
353
|
prefix: "",
|
|
343
|
-
name:
|
|
354
|
+
name: a
|
|
344
355
|
};
|
|
345
|
-
return
|
|
356
|
+
return e && !Vt(c, r) ? null : c;
|
|
346
357
|
}
|
|
347
358
|
return null;
|
|
348
|
-
},
|
|
349
|
-
let
|
|
350
|
-
function
|
|
351
|
-
return typeof
|
|
359
|
+
}, Vt = (t, e) => t ? !!((e && t.prefix === "" || t.prefix) && t.name) : !1;
|
|
360
|
+
let Mt = !1;
|
|
361
|
+
function Nr(t) {
|
|
362
|
+
return typeof t == "boolean" && (Mt = t), Mt;
|
|
352
363
|
}
|
|
353
|
-
function
|
|
354
|
-
const
|
|
355
|
-
if (
|
|
356
|
-
const
|
|
357
|
-
return
|
|
364
|
+
function He(t) {
|
|
365
|
+
const e = typeof t == "string" ? te(t, !0, Mt) : t;
|
|
366
|
+
if (e) {
|
|
367
|
+
const r = Et(e.provider, e.prefix), n = e.name;
|
|
368
|
+
return r.icons[n] || (r.missing.has(n) ? null : void 0);
|
|
358
369
|
}
|
|
359
370
|
}
|
|
360
|
-
function
|
|
361
|
-
const
|
|
362
|
-
if (!
|
|
363
|
-
const
|
|
364
|
-
return
|
|
371
|
+
function kn(t, e) {
|
|
372
|
+
const r = te(t, !0, Mt);
|
|
373
|
+
if (!r) return !1;
|
|
374
|
+
const n = Et(r.provider, r.prefix);
|
|
375
|
+
return e ? vn(n, r.name, e) : (n.missing.add(r.name), !0);
|
|
365
376
|
}
|
|
366
|
-
function
|
|
367
|
-
if (typeof
|
|
368
|
-
if (typeof
|
|
377
|
+
function Sn(t, e) {
|
|
378
|
+
if (typeof t != "object") return !1;
|
|
379
|
+
if (typeof e != "string" && (e = t.provider || ""), Mt && !e && !t.prefix) {
|
|
369
380
|
let o = !1;
|
|
370
|
-
return
|
|
371
|
-
|
|
381
|
+
return Ir(t) && (t.prefix = "", Cr(t, (a, i) => {
|
|
382
|
+
kn(a, i) && (o = !0);
|
|
372
383
|
})), o;
|
|
373
384
|
}
|
|
374
|
-
const
|
|
375
|
-
if (!
|
|
376
|
-
prefix:
|
|
385
|
+
const r = t.prefix;
|
|
386
|
+
if (!Vt({
|
|
387
|
+
prefix: r,
|
|
377
388
|
name: "a"
|
|
378
389
|
})) return !1;
|
|
379
|
-
const
|
|
380
|
-
return !!
|
|
390
|
+
const n = Et(e, r);
|
|
391
|
+
return !!_r(n, t);
|
|
381
392
|
}
|
|
382
|
-
const
|
|
393
|
+
const Er = Object.freeze({
|
|
383
394
|
width: null,
|
|
384
395
|
height: null
|
|
385
|
-
}),
|
|
386
|
-
...
|
|
387
|
-
...
|
|
388
|
-
}),
|
|
389
|
-
function
|
|
390
|
-
if (
|
|
391
|
-
if (
|
|
392
|
-
if (typeof
|
|
393
|
-
const
|
|
394
|
-
if (
|
|
396
|
+
}), Tr = Object.freeze({
|
|
397
|
+
...Er,
|
|
398
|
+
...Gt
|
|
399
|
+
}), Cn = /(-?[0-9.]*[0-9]+[0-9.]*)/g, In = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
400
|
+
function Ve(t, e, r) {
|
|
401
|
+
if (e === 1) return t;
|
|
402
|
+
if (r = r || 100, typeof t == "number") return Math.ceil(t * e * r) / r;
|
|
403
|
+
if (typeof t != "string") return t;
|
|
404
|
+
const n = t.split(Cn);
|
|
405
|
+
if (n === null || !n.length) return t;
|
|
395
406
|
const o = [];
|
|
396
|
-
let
|
|
407
|
+
let a = n.shift(), i = In.test(a);
|
|
397
408
|
for (; ; ) {
|
|
398
409
|
if (i) {
|
|
399
|
-
const c = parseFloat(
|
|
400
|
-
isNaN(c) ? o.push(
|
|
401
|
-
} else o.push(
|
|
402
|
-
if (
|
|
410
|
+
const c = parseFloat(a);
|
|
411
|
+
isNaN(c) ? o.push(a) : o.push(Math.ceil(c * e * r) / r);
|
|
412
|
+
} else o.push(a);
|
|
413
|
+
if (a = n.shift(), a === void 0) return o.join("");
|
|
403
414
|
i = !i;
|
|
404
415
|
}
|
|
405
416
|
}
|
|
406
|
-
function
|
|
407
|
-
let
|
|
408
|
-
const
|
|
409
|
-
for (;
|
|
410
|
-
const o =
|
|
411
|
-
if (o === -1 ||
|
|
412
|
-
const i =
|
|
417
|
+
function _n(t, e = "defs") {
|
|
418
|
+
let r = "";
|
|
419
|
+
const n = t.indexOf("<" + e);
|
|
420
|
+
for (; n >= 0; ) {
|
|
421
|
+
const o = t.indexOf(">", n), a = t.indexOf("</" + e);
|
|
422
|
+
if (o === -1 || a === -1) break;
|
|
423
|
+
const i = t.indexOf(">", a);
|
|
413
424
|
if (i === -1) break;
|
|
414
|
-
|
|
425
|
+
r += t.slice(o + 1, a).trim(), t = t.slice(0, n).trim() + t.slice(i + 1);
|
|
415
426
|
}
|
|
416
427
|
return {
|
|
417
|
-
defs:
|
|
418
|
-
content:
|
|
428
|
+
defs: r,
|
|
429
|
+
content: t
|
|
419
430
|
};
|
|
420
431
|
}
|
|
421
|
-
function
|
|
422
|
-
return
|
|
432
|
+
function Fn(t, e) {
|
|
433
|
+
return t ? "<defs>" + t + "</defs>" + e : e;
|
|
423
434
|
}
|
|
424
|
-
function
|
|
425
|
-
const
|
|
426
|
-
return
|
|
435
|
+
function Nn(t, e, r) {
|
|
436
|
+
const n = _n(t);
|
|
437
|
+
return Fn(n.defs, e + n.content + r);
|
|
427
438
|
}
|
|
428
|
-
const
|
|
429
|
-
function
|
|
430
|
-
const
|
|
431
|
-
...
|
|
432
|
-
...e
|
|
433
|
-
}, r = {
|
|
434
|
-
...Pn,
|
|
439
|
+
const En = (t) => t === "unset" || t === "undefined" || t === "none";
|
|
440
|
+
function Tn(t, e) {
|
|
441
|
+
const r = {
|
|
442
|
+
...Se,
|
|
435
443
|
...t
|
|
444
|
+
}, n = {
|
|
445
|
+
...Tr,
|
|
446
|
+
...e
|
|
436
447
|
}, o = {
|
|
437
|
-
left:
|
|
438
|
-
top:
|
|
439
|
-
width:
|
|
440
|
-
height:
|
|
448
|
+
left: r.left,
|
|
449
|
+
top: r.top,
|
|
450
|
+
width: r.width,
|
|
451
|
+
height: r.height
|
|
441
452
|
};
|
|
442
|
-
let
|
|
443
|
-
[
|
|
444
|
-
const
|
|
453
|
+
let a = r.body;
|
|
454
|
+
[r, n].forEach((_) => {
|
|
455
|
+
const w = [], v = _.hFlip, B = _.vFlip;
|
|
445
456
|
let P = _.rotate;
|
|
446
|
-
v ? B ? P += 2 : (
|
|
447
|
-
let
|
|
457
|
+
v ? B ? P += 2 : (w.push("translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"), w.push("scale(-1 1)"), o.top = o.left = 0) : B && (w.push("translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"), w.push("scale(1 -1)"), o.top = o.left = 0);
|
|
458
|
+
let $;
|
|
448
459
|
switch (P < 0 && (P -= Math.floor(P / 4) * 4), P = P % 4, P) {
|
|
449
460
|
case 1:
|
|
450
|
-
|
|
461
|
+
$ = o.height / 2 + o.top, w.unshift("rotate(90 " + $.toString() + " " + $.toString() + ")");
|
|
451
462
|
break;
|
|
452
463
|
case 2:
|
|
453
|
-
|
|
464
|
+
w.unshift("rotate(180 " + (o.width / 2 + o.left).toString() + " " + (o.height / 2 + o.top).toString() + ")");
|
|
454
465
|
break;
|
|
455
466
|
case 3:
|
|
456
|
-
|
|
467
|
+
$ = o.width / 2 + o.left, w.unshift("rotate(-90 " + $.toString() + " " + $.toString() + ")");
|
|
457
468
|
break;
|
|
458
469
|
}
|
|
459
|
-
P % 2 === 1 && (o.left !== o.top && (
|
|
470
|
+
P % 2 === 1 && (o.left !== o.top && ($ = o.left, o.left = o.top, o.top = $), o.width !== o.height && ($ = o.width, o.width = o.height, o.height = $)), w.length && (a = Nn(a, '<g transform="' + w.join(" ") + '">', "</g>"));
|
|
460
471
|
});
|
|
461
|
-
const i =
|
|
462
|
-
let
|
|
463
|
-
i === null ? (h = c === null ? "1em" : c === "auto" ? u : c,
|
|
464
|
-
const m = {}, g = (_,
|
|
465
|
-
|
|
472
|
+
const i = n.width, c = n.height, s = o.width, u = o.height;
|
|
473
|
+
let f, h;
|
|
474
|
+
i === null ? (h = c === null ? "1em" : c === "auto" ? u : c, f = Ve(h, s / u)) : (f = i === "auto" ? s : i, h = c === null ? Ve(f, u / s) : c === "auto" ? u : c);
|
|
475
|
+
const m = {}, g = (_, w) => {
|
|
476
|
+
En(w) || (m[_] = w.toString());
|
|
466
477
|
};
|
|
467
|
-
g("width",
|
|
468
|
-
const
|
|
478
|
+
g("width", f), g("height", h);
|
|
479
|
+
const k = [
|
|
469
480
|
o.left,
|
|
470
481
|
o.top,
|
|
471
|
-
|
|
482
|
+
s,
|
|
472
483
|
u
|
|
473
484
|
];
|
|
474
|
-
return m.viewBox =
|
|
485
|
+
return m.viewBox = k.join(" "), {
|
|
475
486
|
attributes: m,
|
|
476
|
-
viewBox:
|
|
477
|
-
body:
|
|
487
|
+
viewBox: k,
|
|
488
|
+
body: a
|
|
478
489
|
};
|
|
479
490
|
}
|
|
480
|
-
const
|
|
481
|
-
let
|
|
482
|
-
function $
|
|
483
|
-
const
|
|
484
|
-
let
|
|
485
|
-
for (;
|
|
486
|
-
if (!
|
|
491
|
+
const Pn = /\sid="(\S+)"/g, On = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
|
|
492
|
+
let jn = 0;
|
|
493
|
+
function $n(t, e = On) {
|
|
494
|
+
const r = [];
|
|
495
|
+
let n;
|
|
496
|
+
for (; n = Pn.exec(t); ) r.push(n[1]);
|
|
497
|
+
if (!r.length) return t;
|
|
487
498
|
const o = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
|
488
|
-
return
|
|
489
|
-
const i = typeof
|
|
490
|
-
|
|
491
|
-
}),
|
|
499
|
+
return r.forEach((a) => {
|
|
500
|
+
const i = typeof e == "function" ? e(a) : e + (jn++).toString(), c = a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
501
|
+
t = t.replace(new RegExp('([#;"])(' + c + ')([")]|\\.[a-z])', "g"), "$1" + i + o + "$3");
|
|
502
|
+
}), t = t.replace(new RegExp(o, "g"), ""), t;
|
|
492
503
|
}
|
|
493
|
-
const
|
|
494
|
-
function
|
|
495
|
-
|
|
504
|
+
const ge = /* @__PURE__ */ Object.create(null);
|
|
505
|
+
function An(t, e) {
|
|
506
|
+
ge[t] = e;
|
|
496
507
|
}
|
|
497
|
-
function
|
|
498
|
-
return
|
|
508
|
+
function we(t) {
|
|
509
|
+
return ge[t] || ge[""];
|
|
499
510
|
}
|
|
500
|
-
function
|
|
501
|
-
let
|
|
502
|
-
if (typeof
|
|
503
|
-
else if (
|
|
511
|
+
function Ce(t) {
|
|
512
|
+
let e;
|
|
513
|
+
if (typeof t.resources == "string") e = [t.resources];
|
|
514
|
+
else if (e = t.resources, !(e instanceof Array) || !e.length) return null;
|
|
504
515
|
return {
|
|
505
|
-
resources:
|
|
506
|
-
path:
|
|
507
|
-
maxURL:
|
|
508
|
-
rotate:
|
|
509
|
-
timeout:
|
|
510
|
-
random:
|
|
511
|
-
index:
|
|
512
|
-
dataAfterTimeout:
|
|
516
|
+
resources: e,
|
|
517
|
+
path: t.path || "/",
|
|
518
|
+
maxURL: t.maxURL || 500,
|
|
519
|
+
rotate: t.rotate || 750,
|
|
520
|
+
timeout: t.timeout || 5e3,
|
|
521
|
+
random: t.random === !0,
|
|
522
|
+
index: t.index || 0,
|
|
523
|
+
dataAfterTimeout: t.dataAfterTimeout !== !1
|
|
513
524
|
};
|
|
514
525
|
}
|
|
515
|
-
const
|
|
516
|
-
for (;
|
|
517
|
-
|
|
518
|
-
function
|
|
519
|
-
const
|
|
520
|
-
return
|
|
526
|
+
const Ie = /* @__PURE__ */ Object.create(null), jt = ["https://api.simplesvg.com", "https://api.unisvg.com"], Yt = [];
|
|
527
|
+
for (; jt.length > 0; ) jt.length === 1 || Math.random() > 0.5 ? Yt.push(jt.shift()) : Yt.push(jt.pop());
|
|
528
|
+
Ie[""] = Ce({ resources: ["https://api.iconify.design"].concat(Yt) });
|
|
529
|
+
function Ln(t, e) {
|
|
530
|
+
const r = Ce(e);
|
|
531
|
+
return r === null ? !1 : (Ie[t] = r, !0);
|
|
521
532
|
}
|
|
522
|
-
function
|
|
523
|
-
return
|
|
533
|
+
function _e(t) {
|
|
534
|
+
return Ie[t];
|
|
524
535
|
}
|
|
525
|
-
const
|
|
526
|
-
let
|
|
536
|
+
const zn = () => {
|
|
537
|
+
let t;
|
|
527
538
|
try {
|
|
528
|
-
if (
|
|
539
|
+
if (t = fetch, typeof t == "function") return t;
|
|
529
540
|
} catch {
|
|
530
541
|
}
|
|
531
542
|
};
|
|
532
|
-
let
|
|
533
|
-
function
|
|
534
|
-
const
|
|
535
|
-
if (!
|
|
536
|
-
let
|
|
537
|
-
if (!
|
|
543
|
+
let Ye = zn();
|
|
544
|
+
function Dn(t, e) {
|
|
545
|
+
const r = _e(t);
|
|
546
|
+
if (!r) return 0;
|
|
547
|
+
let n;
|
|
548
|
+
if (!r.maxURL) n = 0;
|
|
538
549
|
else {
|
|
539
550
|
let o = 0;
|
|
540
|
-
|
|
551
|
+
r.resources.forEach((i) => {
|
|
541
552
|
o = Math.max(o, i.length);
|
|
542
553
|
});
|
|
543
|
-
const
|
|
544
|
-
|
|
554
|
+
const a = e + ".json?icons=";
|
|
555
|
+
n = r.maxURL - o - r.path.length - a.length;
|
|
545
556
|
}
|
|
546
|
-
return
|
|
557
|
+
return n;
|
|
547
558
|
}
|
|
548
|
-
function
|
|
549
|
-
return
|
|
559
|
+
function Mn(t) {
|
|
560
|
+
return t === 404;
|
|
550
561
|
}
|
|
551
|
-
const
|
|
552
|
-
const
|
|
562
|
+
const Un = (t, e, r) => {
|
|
563
|
+
const n = [], o = Dn(t, e), a = "icons";
|
|
553
564
|
let i = {
|
|
554
|
-
type:
|
|
555
|
-
provider:
|
|
556
|
-
prefix:
|
|
565
|
+
type: a,
|
|
566
|
+
provider: t,
|
|
567
|
+
prefix: e,
|
|
557
568
|
icons: []
|
|
558
569
|
}, c = 0;
|
|
559
|
-
return
|
|
560
|
-
c +=
|
|
561
|
-
type:
|
|
562
|
-
provider:
|
|
563
|
-
prefix:
|
|
570
|
+
return r.forEach((s, u) => {
|
|
571
|
+
c += s.length + 1, c >= o && u > 0 && (n.push(i), i = {
|
|
572
|
+
type: a,
|
|
573
|
+
provider: t,
|
|
574
|
+
prefix: e,
|
|
564
575
|
icons: []
|
|
565
|
-
}, c =
|
|
566
|
-
}),
|
|
576
|
+
}, c = s.length), i.icons.push(s);
|
|
577
|
+
}), n.push(i), n;
|
|
567
578
|
};
|
|
568
|
-
function
|
|
569
|
-
if (typeof
|
|
570
|
-
const
|
|
571
|
-
if (
|
|
579
|
+
function Bn(t) {
|
|
580
|
+
if (typeof t == "string") {
|
|
581
|
+
const e = _e(t);
|
|
582
|
+
if (e) return e.path;
|
|
572
583
|
}
|
|
573
584
|
return "/";
|
|
574
585
|
}
|
|
575
|
-
const
|
|
576
|
-
if (!
|
|
577
|
-
|
|
586
|
+
const qn = (t, e, r) => {
|
|
587
|
+
if (!Ye) {
|
|
588
|
+
r("abort", 424);
|
|
578
589
|
return;
|
|
579
590
|
}
|
|
580
|
-
let
|
|
581
|
-
switch (
|
|
591
|
+
let n = Bn(e.provider);
|
|
592
|
+
switch (e.type) {
|
|
582
593
|
case "icons": {
|
|
583
|
-
const
|
|
584
|
-
|
|
594
|
+
const a = e.prefix, c = e.icons.join(","), s = new URLSearchParams({ icons: c });
|
|
595
|
+
n += a + ".json?" + s.toString();
|
|
585
596
|
break;
|
|
586
597
|
}
|
|
587
598
|
case "custom": {
|
|
588
|
-
const
|
|
589
|
-
|
|
599
|
+
const a = e.uri;
|
|
600
|
+
n += a.slice(0, 1) === "/" ? a.slice(1) : a;
|
|
590
601
|
break;
|
|
591
602
|
}
|
|
592
603
|
default:
|
|
593
|
-
|
|
604
|
+
r("abort", 400);
|
|
594
605
|
return;
|
|
595
606
|
}
|
|
596
607
|
let o = 503;
|
|
597
|
-
|
|
598
|
-
const i =
|
|
608
|
+
Ye(t + n).then((a) => {
|
|
609
|
+
const i = a.status;
|
|
599
610
|
if (i !== 200) {
|
|
600
611
|
setTimeout(() => {
|
|
601
|
-
|
|
612
|
+
r(Mn(i) ? "abort" : "next", i);
|
|
602
613
|
});
|
|
603
614
|
return;
|
|
604
615
|
}
|
|
605
|
-
return o = 501,
|
|
606
|
-
}).then((
|
|
607
|
-
if (typeof
|
|
616
|
+
return o = 501, a.json();
|
|
617
|
+
}).then((a) => {
|
|
618
|
+
if (typeof a != "object" || a === null) {
|
|
608
619
|
setTimeout(() => {
|
|
609
|
-
|
|
620
|
+
a === 404 ? r("abort", a) : r("next", o);
|
|
610
621
|
});
|
|
611
622
|
return;
|
|
612
623
|
}
|
|
613
624
|
setTimeout(() => {
|
|
614
|
-
|
|
625
|
+
r("success", a);
|
|
615
626
|
});
|
|
616
627
|
}).catch(() => {
|
|
617
|
-
|
|
628
|
+
r("next", o);
|
|
618
629
|
});
|
|
619
|
-
},
|
|
620
|
-
prepare:
|
|
621
|
-
send:
|
|
630
|
+
}, Rn = {
|
|
631
|
+
prepare: Un,
|
|
632
|
+
send: qn
|
|
622
633
|
};
|
|
623
|
-
function
|
|
624
|
-
|
|
625
|
-
const
|
|
626
|
-
|
|
634
|
+
function Pr(t, e) {
|
|
635
|
+
t.forEach((r) => {
|
|
636
|
+
const n = r.loaderCallbacks;
|
|
637
|
+
n && (r.loaderCallbacks = n.filter((o) => o.id !== e));
|
|
627
638
|
});
|
|
628
639
|
}
|
|
629
|
-
function
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
const
|
|
633
|
-
if (!
|
|
634
|
-
let
|
|
635
|
-
const
|
|
636
|
-
|
|
637
|
-
const i =
|
|
638
|
-
i.pending = i.pending.filter((
|
|
639
|
-
if (
|
|
640
|
-
const u =
|
|
641
|
-
if (
|
|
642
|
-
provider:
|
|
640
|
+
function Hn(t) {
|
|
641
|
+
t.pendingCallbacksFlag || (t.pendingCallbacksFlag = !0, setTimeout(() => {
|
|
642
|
+
t.pendingCallbacksFlag = !1;
|
|
643
|
+
const e = t.loaderCallbacks ? t.loaderCallbacks.slice(0) : [];
|
|
644
|
+
if (!e.length) return;
|
|
645
|
+
let r = !1;
|
|
646
|
+
const n = t.provider, o = t.prefix;
|
|
647
|
+
e.forEach((a) => {
|
|
648
|
+
const i = a.icons, c = i.pending.length;
|
|
649
|
+
i.pending = i.pending.filter((s) => {
|
|
650
|
+
if (s.prefix !== o) return !0;
|
|
651
|
+
const u = s.name;
|
|
652
|
+
if (t.icons[u]) i.loaded.push({
|
|
653
|
+
provider: n,
|
|
643
654
|
prefix: o,
|
|
644
655
|
name: u
|
|
645
656
|
});
|
|
646
|
-
else if (
|
|
647
|
-
provider:
|
|
657
|
+
else if (t.missing.has(u)) i.missing.push({
|
|
658
|
+
provider: n,
|
|
648
659
|
prefix: o,
|
|
649
660
|
name: u
|
|
650
661
|
});
|
|
651
662
|
else
|
|
652
|
-
return
|
|
663
|
+
return r = !0, !0;
|
|
653
664
|
return !1;
|
|
654
|
-
}), i.pending.length !== c && (
|
|
665
|
+
}), i.pending.length !== c && (r || Pr([t], a.id), a.callback(i.loaded.slice(0), i.missing.slice(0), i.pending.slice(0), a.abort));
|
|
655
666
|
});
|
|
656
667
|
}));
|
|
657
668
|
}
|
|
658
|
-
let
|
|
659
|
-
function
|
|
660
|
-
const
|
|
661
|
-
if (!
|
|
662
|
-
const
|
|
663
|
-
id:
|
|
664
|
-
icons:
|
|
665
|
-
callback:
|
|
669
|
+
let Vn = 0;
|
|
670
|
+
function Yn(t, e, r) {
|
|
671
|
+
const n = Vn++, o = Pr.bind(null, r, n);
|
|
672
|
+
if (!e.pending.length) return o;
|
|
673
|
+
const a = {
|
|
674
|
+
id: n,
|
|
675
|
+
icons: e,
|
|
676
|
+
callback: t,
|
|
666
677
|
abort: o
|
|
667
678
|
};
|
|
668
|
-
return
|
|
669
|
-
(i.loaderCallbacks || (i.loaderCallbacks = [])).push(
|
|
679
|
+
return r.forEach((i) => {
|
|
680
|
+
(i.loaderCallbacks || (i.loaderCallbacks = [])).push(a);
|
|
670
681
|
}), o;
|
|
671
682
|
}
|
|
672
|
-
function
|
|
673
|
-
const
|
|
683
|
+
function Jn(t) {
|
|
684
|
+
const e = {
|
|
674
685
|
loaded: [],
|
|
675
686
|
missing: [],
|
|
676
687
|
pending: []
|
|
677
|
-
},
|
|
678
|
-
|
|
679
|
-
let
|
|
688
|
+
}, r = /* @__PURE__ */ Object.create(null);
|
|
689
|
+
t.sort((o, a) => o.provider !== a.provider ? o.provider.localeCompare(a.provider) : o.prefix !== a.prefix ? o.prefix.localeCompare(a.prefix) : o.name.localeCompare(a.name));
|
|
690
|
+
let n = {
|
|
680
691
|
provider: "",
|
|
681
692
|
prefix: "",
|
|
682
693
|
name: ""
|
|
683
694
|
};
|
|
684
|
-
return
|
|
685
|
-
if (
|
|
686
|
-
|
|
687
|
-
const
|
|
688
|
-
let
|
|
689
|
-
c in u.icons ?
|
|
695
|
+
return t.forEach((o) => {
|
|
696
|
+
if (n.name === o.name && n.prefix === o.prefix && n.provider === o.provider) return;
|
|
697
|
+
n = o;
|
|
698
|
+
const a = o.provider, i = o.prefix, c = o.name, s = r[a] || (r[a] = /* @__PURE__ */ Object.create(null)), u = s[i] || (s[i] = Et(a, i));
|
|
699
|
+
let f;
|
|
700
|
+
c in u.icons ? f = e.loaded : i === "" || u.missing.has(c) ? f = e.missing : f = e.pending;
|
|
690
701
|
const h = {
|
|
691
|
-
provider:
|
|
702
|
+
provider: a,
|
|
692
703
|
prefix: i,
|
|
693
704
|
name: c
|
|
694
705
|
};
|
|
695
|
-
|
|
696
|
-
}),
|
|
706
|
+
f.push(h);
|
|
707
|
+
}), e;
|
|
697
708
|
}
|
|
698
|
-
function
|
|
699
|
-
const
|
|
700
|
-
return
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
}),
|
|
709
|
+
function Kn(t, e = !0, r = !1) {
|
|
710
|
+
const n = [];
|
|
711
|
+
return t.forEach((o) => {
|
|
712
|
+
const a = typeof o == "string" ? te(o, e, r) : o;
|
|
713
|
+
a && n.push(a);
|
|
714
|
+
}), n;
|
|
704
715
|
}
|
|
705
|
-
const
|
|
716
|
+
const Gn = {
|
|
706
717
|
resources: [],
|
|
707
718
|
index: 0,
|
|
708
719
|
timeout: 2e3,
|
|
@@ -710,88 +721,88 @@ const Gr = {
|
|
|
710
721
|
random: !1,
|
|
711
722
|
dataAfterTimeout: !1
|
|
712
723
|
};
|
|
713
|
-
function
|
|
714
|
-
const o =
|
|
724
|
+
function Wn(t, e, r, n) {
|
|
725
|
+
const o = t.resources.length, a = t.random ? Math.floor(Math.random() * o) : t.index;
|
|
715
726
|
let i;
|
|
716
|
-
if (
|
|
717
|
-
let
|
|
718
|
-
for (i = [];
|
|
719
|
-
const L = Math.floor(Math.random() *
|
|
720
|
-
i.push(
|
|
727
|
+
if (t.random) {
|
|
728
|
+
let S = t.resources.slice(0);
|
|
729
|
+
for (i = []; S.length > 1; ) {
|
|
730
|
+
const L = Math.floor(Math.random() * S.length);
|
|
731
|
+
i.push(S[L]), S = S.slice(0, L).concat(S.slice(L + 1));
|
|
721
732
|
}
|
|
722
|
-
i = i.concat(
|
|
723
|
-
} else i =
|
|
733
|
+
i = i.concat(S);
|
|
734
|
+
} else i = t.resources.slice(a).concat(t.resources.slice(0, a));
|
|
724
735
|
const c = Date.now();
|
|
725
|
-
let
|
|
726
|
-
typeof
|
|
727
|
-
function
|
|
736
|
+
let s = "pending", u = 0, f, h = null, m = [], g = [];
|
|
737
|
+
typeof n == "function" && g.push(n);
|
|
738
|
+
function k() {
|
|
728
739
|
h && (clearTimeout(h), h = null);
|
|
729
740
|
}
|
|
730
741
|
function _() {
|
|
731
|
-
|
|
732
|
-
|
|
742
|
+
s === "pending" && (s = "aborted"), k(), m.forEach((S) => {
|
|
743
|
+
S.status === "pending" && (S.status = "aborted");
|
|
733
744
|
}), m = [];
|
|
734
745
|
}
|
|
735
|
-
function
|
|
736
|
-
L && (g = []), typeof
|
|
746
|
+
function w(S, L) {
|
|
747
|
+
L && (g = []), typeof S == "function" && g.push(S);
|
|
737
748
|
}
|
|
738
749
|
function v() {
|
|
739
750
|
return {
|
|
740
751
|
startTime: c,
|
|
741
|
-
payload:
|
|
742
|
-
status:
|
|
752
|
+
payload: e,
|
|
753
|
+
status: s,
|
|
743
754
|
queriesSent: u,
|
|
744
755
|
queriesPending: m.length,
|
|
745
|
-
subscribe:
|
|
756
|
+
subscribe: w,
|
|
746
757
|
abort: _
|
|
747
758
|
};
|
|
748
759
|
}
|
|
749
760
|
function B() {
|
|
750
|
-
|
|
751
|
-
|
|
761
|
+
s = "failed", g.forEach((S) => {
|
|
762
|
+
S(void 0, f);
|
|
752
763
|
});
|
|
753
764
|
}
|
|
754
765
|
function P() {
|
|
755
|
-
m.forEach((
|
|
756
|
-
|
|
766
|
+
m.forEach((S) => {
|
|
767
|
+
S.status === "pending" && (S.status = "aborted");
|
|
757
768
|
}), m = [];
|
|
758
769
|
}
|
|
759
|
-
function
|
|
770
|
+
function $(S, L, H) {
|
|
760
771
|
const V = L !== "success";
|
|
761
|
-
switch (m = m.filter((O) => O !==
|
|
772
|
+
switch (m = m.filter((O) => O !== S), s) {
|
|
762
773
|
case "pending":
|
|
763
774
|
break;
|
|
764
775
|
case "failed":
|
|
765
|
-
if (V || !
|
|
776
|
+
if (V || !t.dataAfterTimeout) return;
|
|
766
777
|
break;
|
|
767
778
|
default:
|
|
768
779
|
return;
|
|
769
780
|
}
|
|
770
781
|
if (L === "abort") {
|
|
771
|
-
|
|
782
|
+
f = H, B();
|
|
772
783
|
return;
|
|
773
784
|
}
|
|
774
785
|
if (V) {
|
|
775
|
-
|
|
786
|
+
f = H, m.length || (i.length ? Z() : B());
|
|
776
787
|
return;
|
|
777
788
|
}
|
|
778
|
-
if (
|
|
779
|
-
const O =
|
|
780
|
-
O !== -1 && O !==
|
|
789
|
+
if (k(), P(), !t.random) {
|
|
790
|
+
const O = t.resources.indexOf(S.resource);
|
|
791
|
+
O !== -1 && O !== t.index && (t.index = O);
|
|
781
792
|
}
|
|
782
|
-
|
|
783
|
-
O(
|
|
793
|
+
s = "completed", g.forEach((O) => {
|
|
794
|
+
O(H);
|
|
784
795
|
});
|
|
785
796
|
}
|
|
786
|
-
function
|
|
787
|
-
if (
|
|
788
|
-
|
|
789
|
-
const
|
|
790
|
-
if (
|
|
797
|
+
function Z() {
|
|
798
|
+
if (s !== "pending") return;
|
|
799
|
+
k();
|
|
800
|
+
const S = i.shift();
|
|
801
|
+
if (S === void 0) {
|
|
791
802
|
if (m.length) {
|
|
792
803
|
h = setTimeout(() => {
|
|
793
|
-
|
|
794
|
-
},
|
|
804
|
+
k(), s === "pending" && (P(), B());
|
|
805
|
+
}, t.timeout);
|
|
795
806
|
return;
|
|
796
807
|
}
|
|
797
808
|
B();
|
|
@@ -799,215 +810,215 @@ function Wr(e, t, n, r) {
|
|
|
799
810
|
}
|
|
800
811
|
const L = {
|
|
801
812
|
status: "pending",
|
|
802
|
-
resource:
|
|
803
|
-
callback: (
|
|
804
|
-
|
|
813
|
+
resource: S,
|
|
814
|
+
callback: (H, V) => {
|
|
815
|
+
$(L, H, V);
|
|
805
816
|
}
|
|
806
817
|
};
|
|
807
|
-
m.push(L), u++, h = setTimeout(
|
|
818
|
+
m.push(L), u++, h = setTimeout(Z, t.rotate), r(S, e, L.callback);
|
|
808
819
|
}
|
|
809
|
-
return setTimeout(
|
|
820
|
+
return setTimeout(Z), v;
|
|
810
821
|
}
|
|
811
|
-
function
|
|
812
|
-
const
|
|
813
|
-
...
|
|
814
|
-
...
|
|
822
|
+
function Or(t) {
|
|
823
|
+
const e = {
|
|
824
|
+
...Gn,
|
|
825
|
+
...t
|
|
815
826
|
};
|
|
816
|
-
let
|
|
817
|
-
function
|
|
818
|
-
|
|
827
|
+
let r = [];
|
|
828
|
+
function n() {
|
|
829
|
+
r = r.filter((c) => c().status === "pending");
|
|
819
830
|
}
|
|
820
|
-
function o(c,
|
|
821
|
-
const
|
|
822
|
-
|
|
831
|
+
function o(c, s, u) {
|
|
832
|
+
const f = Wn(e, c, s, (h, m) => {
|
|
833
|
+
n(), u && u(h, m);
|
|
823
834
|
});
|
|
824
|
-
return
|
|
835
|
+
return r.push(f), f;
|
|
825
836
|
}
|
|
826
|
-
function
|
|
827
|
-
return
|
|
837
|
+
function a(c) {
|
|
838
|
+
return r.find((s) => c(s)) || null;
|
|
828
839
|
}
|
|
829
840
|
return {
|
|
830
841
|
query: o,
|
|
831
|
-
find:
|
|
842
|
+
find: a,
|
|
832
843
|
setIndex: (c) => {
|
|
833
|
-
|
|
844
|
+
e.index = c;
|
|
834
845
|
},
|
|
835
|
-
getIndex: () =>
|
|
836
|
-
cleanup:
|
|
846
|
+
getIndex: () => e.index,
|
|
847
|
+
cleanup: n
|
|
837
848
|
};
|
|
838
849
|
}
|
|
839
|
-
function
|
|
850
|
+
function Je() {
|
|
840
851
|
}
|
|
841
|
-
const
|
|
842
|
-
function
|
|
843
|
-
if (!
|
|
844
|
-
const
|
|
845
|
-
if (!
|
|
846
|
-
const
|
|
847
|
-
config:
|
|
848
|
-
redundancy:
|
|
852
|
+
const se = /* @__PURE__ */ Object.create(null);
|
|
853
|
+
function Qn(t) {
|
|
854
|
+
if (!se[t]) {
|
|
855
|
+
const e = _e(t);
|
|
856
|
+
if (!e) return;
|
|
857
|
+
const r = Or(e), n = {
|
|
858
|
+
config: e,
|
|
859
|
+
redundancy: r
|
|
849
860
|
};
|
|
850
|
-
|
|
851
|
-
}
|
|
852
|
-
return
|
|
853
|
-
}
|
|
854
|
-
function
|
|
855
|
-
let
|
|
856
|
-
if (typeof
|
|
857
|
-
const
|
|
858
|
-
if (!
|
|
859
|
-
return
|
|
860
|
-
o =
|
|
861
|
-
const i =
|
|
862
|
-
i && (
|
|
861
|
+
se[t] = n;
|
|
862
|
+
}
|
|
863
|
+
return se[t];
|
|
864
|
+
}
|
|
865
|
+
function Xn(t, e, r) {
|
|
866
|
+
let n, o;
|
|
867
|
+
if (typeof t == "string") {
|
|
868
|
+
const a = we(t);
|
|
869
|
+
if (!a)
|
|
870
|
+
return r(void 0, 424), Je;
|
|
871
|
+
o = a.send;
|
|
872
|
+
const i = Qn(t);
|
|
873
|
+
i && (n = i.redundancy);
|
|
863
874
|
} else {
|
|
864
|
-
const
|
|
865
|
-
if (
|
|
866
|
-
|
|
867
|
-
const i =
|
|
875
|
+
const a = Ce(t);
|
|
876
|
+
if (a) {
|
|
877
|
+
n = Or(a);
|
|
878
|
+
const i = t.resources ? t.resources[0] : "", c = we(i);
|
|
868
879
|
c && (o = c.send);
|
|
869
880
|
}
|
|
870
881
|
}
|
|
871
|
-
return !
|
|
882
|
+
return !n || !o ? (r(void 0, 424), Je) : n.query(e, o, r)().abort;
|
|
872
883
|
}
|
|
873
|
-
function
|
|
884
|
+
function Ke() {
|
|
874
885
|
}
|
|
875
|
-
function
|
|
876
|
-
|
|
877
|
-
|
|
886
|
+
function Zn(t) {
|
|
887
|
+
t.iconsLoaderFlag || (t.iconsLoaderFlag = !0, setTimeout(() => {
|
|
888
|
+
t.iconsLoaderFlag = !1, Hn(t);
|
|
878
889
|
}));
|
|
879
890
|
}
|
|
880
|
-
function
|
|
881
|
-
const
|
|
882
|
-
return
|
|
883
|
-
(
|
|
891
|
+
function to(t) {
|
|
892
|
+
const e = [], r = [];
|
|
893
|
+
return t.forEach((n) => {
|
|
894
|
+
(n.match(Fr) ? e : r).push(n);
|
|
884
895
|
}), {
|
|
885
|
-
valid:
|
|
886
|
-
invalid:
|
|
896
|
+
valid: e,
|
|
897
|
+
invalid: r
|
|
887
898
|
};
|
|
888
899
|
}
|
|
889
|
-
function
|
|
890
|
-
function
|
|
891
|
-
const o =
|
|
892
|
-
|
|
893
|
-
o && o.delete(
|
|
900
|
+
function $t(t, e, r) {
|
|
901
|
+
function n() {
|
|
902
|
+
const o = t.pendingIcons;
|
|
903
|
+
e.forEach((a) => {
|
|
904
|
+
o && o.delete(a), t.icons[a] || t.missing.add(a);
|
|
894
905
|
});
|
|
895
906
|
}
|
|
896
|
-
if (
|
|
897
|
-
if (!
|
|
898
|
-
|
|
907
|
+
if (r && typeof r == "object") try {
|
|
908
|
+
if (!_r(t, r).length) {
|
|
909
|
+
n();
|
|
899
910
|
return;
|
|
900
911
|
}
|
|
901
912
|
} catch (o) {
|
|
902
913
|
console.error(o);
|
|
903
914
|
}
|
|
904
|
-
|
|
915
|
+
n(), Zn(t);
|
|
905
916
|
}
|
|
906
|
-
function
|
|
907
|
-
|
|
908
|
-
|
|
917
|
+
function Ge(t, e) {
|
|
918
|
+
t instanceof Promise ? t.then((r) => {
|
|
919
|
+
e(r);
|
|
909
920
|
}).catch(() => {
|
|
910
|
-
|
|
911
|
-
}) : t
|
|
912
|
-
}
|
|
913
|
-
function eo(
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
const { provider:
|
|
917
|
-
if (delete
|
|
918
|
-
const
|
|
919
|
-
if (
|
|
920
|
-
|
|
921
|
-
|
|
921
|
+
e(null);
|
|
922
|
+
}) : e(t);
|
|
923
|
+
}
|
|
924
|
+
function eo(t, e) {
|
|
925
|
+
t.iconsToLoad ? t.iconsToLoad = t.iconsToLoad.concat(e).sort() : t.iconsToLoad = e, t.iconsQueueFlag || (t.iconsQueueFlag = !0, setTimeout(() => {
|
|
926
|
+
t.iconsQueueFlag = !1;
|
|
927
|
+
const { provider: r, prefix: n } = t, o = t.iconsToLoad;
|
|
928
|
+
if (delete t.iconsToLoad, !o || !o.length) return;
|
|
929
|
+
const a = t.loadIcon;
|
|
930
|
+
if (t.loadIcons && (o.length > 1 || !a)) {
|
|
931
|
+
Ge(t.loadIcons(o, n, r), (f) => {
|
|
932
|
+
$t(t, o, f);
|
|
922
933
|
});
|
|
923
934
|
return;
|
|
924
935
|
}
|
|
925
|
-
if (
|
|
926
|
-
o.forEach((
|
|
927
|
-
const h =
|
|
928
|
-
|
|
936
|
+
if (a) {
|
|
937
|
+
o.forEach((f) => {
|
|
938
|
+
const h = a(f, n, r);
|
|
939
|
+
Ge(h, (m) => {
|
|
929
940
|
const g = m ? {
|
|
930
|
-
prefix:
|
|
931
|
-
icons: { [
|
|
941
|
+
prefix: n,
|
|
942
|
+
icons: { [f]: m }
|
|
932
943
|
} : null;
|
|
933
|
-
|
|
944
|
+
$t(t, [f], g);
|
|
934
945
|
});
|
|
935
946
|
});
|
|
936
947
|
return;
|
|
937
948
|
}
|
|
938
|
-
const { valid: i, invalid: c } =
|
|
939
|
-
if (c.length &&
|
|
940
|
-
const
|
|
941
|
-
if (!
|
|
942
|
-
|
|
949
|
+
const { valid: i, invalid: c } = to(o);
|
|
950
|
+
if (c.length && $t(t, c, null), !i.length) return;
|
|
951
|
+
const s = n.match(Fr) ? we(r) : null;
|
|
952
|
+
if (!s) {
|
|
953
|
+
$t(t, i, null);
|
|
943
954
|
return;
|
|
944
955
|
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
956
|
+
s.prepare(r, n, i).forEach((f) => {
|
|
957
|
+
Xn(r, f, (h) => {
|
|
958
|
+
$t(t, f.icons, h);
|
|
948
959
|
});
|
|
949
960
|
});
|
|
950
961
|
}));
|
|
951
962
|
}
|
|
952
|
-
const
|
|
953
|
-
const
|
|
954
|
-
if (!
|
|
955
|
-
let
|
|
956
|
-
return
|
|
957
|
-
|
|
963
|
+
const ro = (t, e) => {
|
|
964
|
+
const r = Kn(t, !0, Nr()), n = Jn(r);
|
|
965
|
+
if (!n.pending.length) {
|
|
966
|
+
let s = !0;
|
|
967
|
+
return e && setTimeout(() => {
|
|
968
|
+
s && e(n.loaded, n.missing, n.pending, Ke);
|
|
958
969
|
}), () => {
|
|
959
|
-
|
|
970
|
+
s = !1;
|
|
960
971
|
};
|
|
961
972
|
}
|
|
962
|
-
const o = /* @__PURE__ */ Object.create(null),
|
|
973
|
+
const o = /* @__PURE__ */ Object.create(null), a = [];
|
|
963
974
|
let i, c;
|
|
964
|
-
return
|
|
965
|
-
const { provider: u, prefix:
|
|
966
|
-
if (
|
|
967
|
-
i = u, c =
|
|
975
|
+
return n.pending.forEach((s) => {
|
|
976
|
+
const { provider: u, prefix: f } = s;
|
|
977
|
+
if (f === c && u === i) return;
|
|
978
|
+
i = u, c = f, a.push(Et(u, f));
|
|
968
979
|
const h = o[u] || (o[u] = /* @__PURE__ */ Object.create(null));
|
|
969
|
-
h[
|
|
970
|
-
}),
|
|
971
|
-
const { provider: u, prefix:
|
|
972
|
-
g.has(h) || (g.add(h), o[u][
|
|
973
|
-
}),
|
|
974
|
-
const u = o[
|
|
975
|
-
u.length && eo(
|
|
976
|
-
}),
|
|
980
|
+
h[f] || (h[f] = []);
|
|
981
|
+
}), n.pending.forEach((s) => {
|
|
982
|
+
const { provider: u, prefix: f, name: h } = s, m = Et(u, f), g = m.pendingIcons || (m.pendingIcons = /* @__PURE__ */ new Set());
|
|
983
|
+
g.has(h) || (g.add(h), o[u][f].push(h));
|
|
984
|
+
}), a.forEach((s) => {
|
|
985
|
+
const u = o[s.provider][s.prefix];
|
|
986
|
+
u.length && eo(s, u);
|
|
987
|
+
}), e ? Yn(e, n, a) : Ke;
|
|
977
988
|
};
|
|
978
|
-
function no(
|
|
979
|
-
const
|
|
980
|
-
for (const
|
|
981
|
-
const o =
|
|
982
|
-
|
|
989
|
+
function no(t, e) {
|
|
990
|
+
const r = { ...t };
|
|
991
|
+
for (const n in e) {
|
|
992
|
+
const o = e[n], a = typeof o;
|
|
993
|
+
n in Er ? (o === null || o && (a === "string" || a === "number")) && (r[n] = o) : a === typeof r[n] && (r[n] = n === "rotate" ? o % 4 : o);
|
|
983
994
|
}
|
|
984
|
-
return
|
|
995
|
+
return r;
|
|
985
996
|
}
|
|
986
|
-
const
|
|
987
|
-
function
|
|
988
|
-
|
|
989
|
-
switch (
|
|
997
|
+
const oo = /[\s,]+/;
|
|
998
|
+
function ao(t, e) {
|
|
999
|
+
e.split(oo).forEach((r) => {
|
|
1000
|
+
switch (r.trim()) {
|
|
990
1001
|
case "horizontal":
|
|
991
|
-
|
|
1002
|
+
t.hFlip = !0;
|
|
992
1003
|
break;
|
|
993
1004
|
case "vertical":
|
|
994
|
-
|
|
1005
|
+
t.vFlip = !0;
|
|
995
1006
|
break;
|
|
996
1007
|
}
|
|
997
1008
|
});
|
|
998
1009
|
}
|
|
999
|
-
function
|
|
1000
|
-
const
|
|
1001
|
-
function
|
|
1010
|
+
function io(t, e = 0) {
|
|
1011
|
+
const r = t.replace(/^-?[0-9.]*/, "");
|
|
1012
|
+
function n(o) {
|
|
1002
1013
|
for (; o < 0; ) o += 4;
|
|
1003
1014
|
return o % 4;
|
|
1004
1015
|
}
|
|
1005
|
-
if (
|
|
1006
|
-
const o = parseInt(
|
|
1007
|
-
return isNaN(o) ? 0 :
|
|
1008
|
-
} else if (
|
|
1016
|
+
if (r === "") {
|
|
1017
|
+
const o = parseInt(t);
|
|
1018
|
+
return isNaN(o) ? 0 : n(o);
|
|
1019
|
+
} else if (r !== t) {
|
|
1009
1020
|
let o = 0;
|
|
1010
|
-
switch (
|
|
1021
|
+
switch (r) {
|
|
1011
1022
|
case "%":
|
|
1012
1023
|
o = 25;
|
|
1013
1024
|
break;
|
|
@@ -1015,92 +1026,92 @@ function so(e, t = 0) {
|
|
|
1015
1026
|
o = 90;
|
|
1016
1027
|
}
|
|
1017
1028
|
if (o) {
|
|
1018
|
-
let
|
|
1019
|
-
return isNaN(
|
|
1029
|
+
let a = parseFloat(t.slice(0, t.length - r.length));
|
|
1030
|
+
return isNaN(a) ? 0 : (a = a / o, a % 1 === 0 ? n(a) : 0);
|
|
1020
1031
|
}
|
|
1021
1032
|
}
|
|
1022
|
-
return
|
|
1033
|
+
return e;
|
|
1023
1034
|
}
|
|
1024
|
-
function
|
|
1025
|
-
let
|
|
1026
|
-
for (const
|
|
1027
|
-
return '<svg xmlns="http://www.w3.org/2000/svg"' +
|
|
1035
|
+
function so(t, e) {
|
|
1036
|
+
let r = t.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
|
1037
|
+
for (const n in e) r += " " + n + '="' + e[n] + '"';
|
|
1038
|
+
return '<svg xmlns="http://www.w3.org/2000/svg"' + r + ">" + t + "</svg>";
|
|
1028
1039
|
}
|
|
1029
|
-
function
|
|
1030
|
-
return
|
|
1040
|
+
function co(t) {
|
|
1041
|
+
return t.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
1031
1042
|
}
|
|
1032
|
-
function
|
|
1033
|
-
return "data:image/svg+xml," +
|
|
1043
|
+
function lo(t) {
|
|
1044
|
+
return "data:image/svg+xml," + co(t);
|
|
1034
1045
|
}
|
|
1035
|
-
function
|
|
1036
|
-
return 'url("' +
|
|
1046
|
+
function uo(t) {
|
|
1047
|
+
return 'url("' + lo(t) + '")';
|
|
1037
1048
|
}
|
|
1038
|
-
let
|
|
1039
|
-
function
|
|
1049
|
+
let Dt;
|
|
1050
|
+
function fo() {
|
|
1040
1051
|
try {
|
|
1041
|
-
|
|
1052
|
+
Dt = window.trustedTypes.createPolicy("iconify", { createHTML: (t) => t });
|
|
1042
1053
|
} catch {
|
|
1043
|
-
|
|
1054
|
+
Dt = null;
|
|
1044
1055
|
}
|
|
1045
1056
|
}
|
|
1046
|
-
function
|
|
1047
|
-
return
|
|
1057
|
+
function po(t) {
|
|
1058
|
+
return Dt === void 0 && fo(), Dt ? Dt.createHTML(t) : t;
|
|
1048
1059
|
}
|
|
1049
|
-
const
|
|
1050
|
-
...
|
|
1060
|
+
const jr = {
|
|
1061
|
+
...Tr,
|
|
1051
1062
|
inline: !1
|
|
1052
|
-
},
|
|
1063
|
+
}, ho = {
|
|
1053
1064
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1054
1065
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
1055
1066
|
"aria-hidden": !0,
|
|
1056
1067
|
role: "img"
|
|
1057
|
-
},
|
|
1068
|
+
}, mo = {
|
|
1058
1069
|
display: "inline-block"
|
|
1059
|
-
},
|
|
1070
|
+
}, ye = {
|
|
1060
1071
|
backgroundColor: "currentColor"
|
|
1061
|
-
},
|
|
1072
|
+
}, $r = {
|
|
1062
1073
|
backgroundColor: "transparent"
|
|
1063
|
-
},
|
|
1074
|
+
}, We = {
|
|
1064
1075
|
Image: "var(--svg)",
|
|
1065
1076
|
Repeat: "no-repeat",
|
|
1066
1077
|
Size: "100% 100%"
|
|
1067
|
-
},
|
|
1068
|
-
WebkitMask:
|
|
1069
|
-
mask:
|
|
1070
|
-
background:
|
|
1078
|
+
}, Qe = {
|
|
1079
|
+
WebkitMask: ye,
|
|
1080
|
+
mask: ye,
|
|
1081
|
+
background: $r
|
|
1071
1082
|
};
|
|
1072
|
-
for (const
|
|
1073
|
-
const
|
|
1074
|
-
for (const
|
|
1075
|
-
t
|
|
1083
|
+
for (const t in Qe) {
|
|
1084
|
+
const e = Qe[t];
|
|
1085
|
+
for (const r in We)
|
|
1086
|
+
e[t + r] = We[r];
|
|
1076
1087
|
}
|
|
1077
|
-
const
|
|
1078
|
-
...
|
|
1088
|
+
const go = {
|
|
1089
|
+
...jr,
|
|
1079
1090
|
inline: !0
|
|
1080
1091
|
};
|
|
1081
|
-
function
|
|
1082
|
-
return
|
|
1092
|
+
function Xe(t) {
|
|
1093
|
+
return t + (t.match(/^[-0-9.]+$/) ? "px" : "");
|
|
1083
1094
|
}
|
|
1084
|
-
const
|
|
1085
|
-
const
|
|
1086
|
-
...
|
|
1095
|
+
const wo = (t, e, r) => {
|
|
1096
|
+
const n = e.inline ? go : jr, o = no(n, e), a = e.mode || "svg", i = {}, c = e.style || {}, s = {
|
|
1097
|
+
...a === "svg" ? ho : {}
|
|
1087
1098
|
};
|
|
1088
|
-
if (
|
|
1089
|
-
const
|
|
1090
|
-
if (
|
|
1099
|
+
if (r) {
|
|
1100
|
+
const w = te(r, !1, !0);
|
|
1101
|
+
if (w) {
|
|
1091
1102
|
const v = ["iconify"], B = [
|
|
1092
1103
|
"provider",
|
|
1093
1104
|
"prefix"
|
|
1094
1105
|
];
|
|
1095
1106
|
for (const P of B)
|
|
1096
|
-
|
|
1097
|
-
|
|
1107
|
+
w[P] && v.push("iconify--" + w[P]);
|
|
1108
|
+
s.className = v.join(" ");
|
|
1098
1109
|
}
|
|
1099
1110
|
}
|
|
1100
|
-
for (let
|
|
1101
|
-
const v =
|
|
1111
|
+
for (let w in e) {
|
|
1112
|
+
const v = e[w];
|
|
1102
1113
|
if (v !== void 0)
|
|
1103
|
-
switch (
|
|
1114
|
+
switch (w) {
|
|
1104
1115
|
// Properties to ignore
|
|
1105
1116
|
case "icon":
|
|
1106
1117
|
case "style":
|
|
@@ -1112,21 +1123,21 @@ const go = (e, t, n) => {
|
|
|
1112
1123
|
break;
|
|
1113
1124
|
// Forward ref
|
|
1114
1125
|
case "_ref":
|
|
1115
|
-
|
|
1126
|
+
s.ref = v;
|
|
1116
1127
|
break;
|
|
1117
1128
|
// Merge class names
|
|
1118
1129
|
case "className":
|
|
1119
|
-
|
|
1130
|
+
s[w] = (s[w] ? s[w] + " " : "") + v;
|
|
1120
1131
|
break;
|
|
1121
1132
|
// Boolean attributes
|
|
1122
1133
|
case "inline":
|
|
1123
1134
|
case "hFlip":
|
|
1124
1135
|
case "vFlip":
|
|
1125
|
-
o[
|
|
1136
|
+
o[w] = v === !0 || v === "true" || v === 1;
|
|
1126
1137
|
break;
|
|
1127
1138
|
// Flip as string: 'horizontal,vertical'
|
|
1128
1139
|
case "flip":
|
|
1129
|
-
typeof v == "string" &&
|
|
1140
|
+
typeof v == "string" && ao(o, v);
|
|
1130
1141
|
break;
|
|
1131
1142
|
// Color: copy to style
|
|
1132
1143
|
case "color":
|
|
@@ -1134,91 +1145,91 @@ const go = (e, t, n) => {
|
|
|
1134
1145
|
break;
|
|
1135
1146
|
// Rotation as string
|
|
1136
1147
|
case "rotate":
|
|
1137
|
-
typeof v == "string" ? o[
|
|
1148
|
+
typeof v == "string" ? o[w] = io(v) : typeof v == "number" && (o[w] = v);
|
|
1138
1149
|
break;
|
|
1139
1150
|
// Remove aria-hidden
|
|
1140
1151
|
case "ariaHidden":
|
|
1141
1152
|
case "aria-hidden":
|
|
1142
|
-
v !== !0 && v !== "true" && delete
|
|
1153
|
+
v !== !0 && v !== "true" && delete s["aria-hidden"];
|
|
1143
1154
|
break;
|
|
1144
1155
|
// Copy missing property if it does not exist in customisations
|
|
1145
1156
|
default:
|
|
1146
|
-
|
|
1157
|
+
n[w] === void 0 && (s[w] = v);
|
|
1147
1158
|
}
|
|
1148
1159
|
}
|
|
1149
|
-
const u =
|
|
1150
|
-
if (o.inline && (i.verticalAlign = "-0.125em"),
|
|
1151
|
-
|
|
1160
|
+
const u = Tn(t, o), f = u.attributes;
|
|
1161
|
+
if (o.inline && (i.verticalAlign = "-0.125em"), a === "svg") {
|
|
1162
|
+
s.style = {
|
|
1152
1163
|
...i,
|
|
1153
1164
|
...c
|
|
1154
|
-
}, Object.assign(
|
|
1155
|
-
let
|
|
1156
|
-
return typeof v == "string" && (v = v.replace(/-/g, "_")),
|
|
1157
|
-
__html:
|
|
1158
|
-
},
|
|
1159
|
-
}
|
|
1160
|
-
const { body: h, width: m, height: g } =
|
|
1161
|
-
...
|
|
1165
|
+
}, Object.assign(s, f);
|
|
1166
|
+
let w = 0, v = e.id;
|
|
1167
|
+
return typeof v == "string" && (v = v.replace(/-/g, "_")), s.dangerouslySetInnerHTML = {
|
|
1168
|
+
__html: po($n(u.body, v ? () => v + "ID" + w++ : "iconifyReact"))
|
|
1169
|
+
}, fe("svg", s);
|
|
1170
|
+
}
|
|
1171
|
+
const { body: h, width: m, height: g } = t, k = a === "mask" || (a === "bg" ? !1 : h.indexOf("currentColor") !== -1), _ = so(h, {
|
|
1172
|
+
...f,
|
|
1162
1173
|
width: m + "",
|
|
1163
1174
|
height: g + ""
|
|
1164
1175
|
});
|
|
1165
|
-
return
|
|
1176
|
+
return s.style = {
|
|
1166
1177
|
...i,
|
|
1167
|
-
"--svg":
|
|
1168
|
-
width:
|
|
1169
|
-
height:
|
|
1170
|
-
...
|
|
1171
|
-
...
|
|
1178
|
+
"--svg": uo(_),
|
|
1179
|
+
width: Xe(f.width),
|
|
1180
|
+
height: Xe(f.height),
|
|
1181
|
+
...mo,
|
|
1182
|
+
...k ? ye : $r,
|
|
1172
1183
|
...c
|
|
1173
|
-
},
|
|
1184
|
+
}, fe("span", s);
|
|
1174
1185
|
};
|
|
1175
|
-
|
|
1176
|
-
|
|
1186
|
+
Nr(!0);
|
|
1187
|
+
An("", Rn);
|
|
1177
1188
|
if (typeof document < "u" && typeof window < "u") {
|
|
1178
|
-
const
|
|
1179
|
-
if (
|
|
1180
|
-
const
|
|
1181
|
-
typeof
|
|
1189
|
+
const t = window;
|
|
1190
|
+
if (t.IconifyPreload !== void 0) {
|
|
1191
|
+
const e = t.IconifyPreload, r = "Invalid IconifyPreload syntax.";
|
|
1192
|
+
typeof e == "object" && e !== null && (e instanceof Array ? e : [e]).forEach((n) => {
|
|
1182
1193
|
try {
|
|
1183
1194
|
// Check if item is an object and not null/array
|
|
1184
|
-
(typeof
|
|
1185
|
-
typeof
|
|
1186
|
-
!
|
|
1195
|
+
(typeof n != "object" || n === null || n instanceof Array || // Check for 'icons' and 'prefix'
|
|
1196
|
+
typeof n.icons != "object" || typeof n.prefix != "string" || // Add icon set
|
|
1197
|
+
!Sn(n)) && console.error(r);
|
|
1187
1198
|
} catch {
|
|
1188
|
-
console.error(
|
|
1199
|
+
console.error(r);
|
|
1189
1200
|
}
|
|
1190
1201
|
});
|
|
1191
1202
|
}
|
|
1192
|
-
if (
|
|
1193
|
-
const
|
|
1194
|
-
if (typeof
|
|
1195
|
-
for (let
|
|
1196
|
-
const
|
|
1203
|
+
if (t.IconifyProviders !== void 0) {
|
|
1204
|
+
const e = t.IconifyProviders;
|
|
1205
|
+
if (typeof e == "object" && e !== null)
|
|
1206
|
+
for (let r in e) {
|
|
1207
|
+
const n = "IconifyProviders[" + r + "] is invalid.";
|
|
1197
1208
|
try {
|
|
1198
|
-
const o =
|
|
1209
|
+
const o = e[r];
|
|
1199
1210
|
if (typeof o != "object" || !o || o.resources === void 0)
|
|
1200
1211
|
continue;
|
|
1201
|
-
|
|
1212
|
+
Ln(r, o) || console.error(n);
|
|
1202
1213
|
} catch {
|
|
1203
|
-
console.error(
|
|
1214
|
+
console.error(n);
|
|
1204
1215
|
}
|
|
1205
1216
|
}
|
|
1206
1217
|
}
|
|
1207
1218
|
}
|
|
1208
|
-
function
|
|
1209
|
-
const [
|
|
1210
|
-
function
|
|
1219
|
+
function Ar(t) {
|
|
1220
|
+
const [e, r] = D(!!t.ssr), [n, o] = D({});
|
|
1221
|
+
function a(g) {
|
|
1211
1222
|
if (g) {
|
|
1212
|
-
const
|
|
1213
|
-
if (typeof
|
|
1223
|
+
const k = t.icon;
|
|
1224
|
+
if (typeof k == "object")
|
|
1214
1225
|
return {
|
|
1215
1226
|
name: "",
|
|
1216
|
-
data:
|
|
1227
|
+
data: k
|
|
1217
1228
|
};
|
|
1218
|
-
const _ =
|
|
1229
|
+
const _ = He(k);
|
|
1219
1230
|
if (_)
|
|
1220
1231
|
return {
|
|
1221
|
-
name:
|
|
1232
|
+
name: k,
|
|
1222
1233
|
data: _
|
|
1223
1234
|
};
|
|
1224
1235
|
}
|
|
@@ -1226,102 +1237,102 @@ function Ln(e) {
|
|
|
1226
1237
|
name: ""
|
|
1227
1238
|
};
|
|
1228
1239
|
}
|
|
1229
|
-
const [i, c] =
|
|
1230
|
-
function
|
|
1231
|
-
const g =
|
|
1240
|
+
const [i, c] = D(a(!!t.ssr));
|
|
1241
|
+
function s() {
|
|
1242
|
+
const g = n.callback;
|
|
1232
1243
|
g && (g(), o({}));
|
|
1233
1244
|
}
|
|
1234
1245
|
function u(g) {
|
|
1235
1246
|
if (JSON.stringify(i) !== JSON.stringify(g))
|
|
1236
|
-
return
|
|
1247
|
+
return s(), c(g), !0;
|
|
1237
1248
|
}
|
|
1238
|
-
function
|
|
1249
|
+
function f() {
|
|
1239
1250
|
var g;
|
|
1240
|
-
const
|
|
1241
|
-
if (typeof
|
|
1251
|
+
const k = t.icon;
|
|
1252
|
+
if (typeof k == "object") {
|
|
1242
1253
|
u({
|
|
1243
1254
|
name: "",
|
|
1244
|
-
data:
|
|
1255
|
+
data: k
|
|
1245
1256
|
});
|
|
1246
1257
|
return;
|
|
1247
1258
|
}
|
|
1248
|
-
const _ =
|
|
1259
|
+
const _ = He(k);
|
|
1249
1260
|
if (u({
|
|
1250
|
-
name:
|
|
1261
|
+
name: k,
|
|
1251
1262
|
data: _
|
|
1252
1263
|
}))
|
|
1253
1264
|
if (_ === void 0) {
|
|
1254
|
-
const
|
|
1265
|
+
const w = ro([k], f);
|
|
1255
1266
|
o({
|
|
1256
|
-
callback:
|
|
1267
|
+
callback: w
|
|
1257
1268
|
});
|
|
1258
|
-
} else _ && ((g =
|
|
1269
|
+
} else _ && ((g = t.onLoad) === null || g === void 0 || g.call(t, k));
|
|
1259
1270
|
}
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
}, [
|
|
1271
|
+
ct(() => (r(!0), s), []), ct(() => {
|
|
1272
|
+
e && f();
|
|
1273
|
+
}, [t.icon, e]);
|
|
1263
1274
|
const { name: h, data: m } = i;
|
|
1264
|
-
return m ?
|
|
1265
|
-
...
|
|
1275
|
+
return m ? wo({
|
|
1276
|
+
...Se,
|
|
1266
1277
|
...m
|
|
1267
|
-
},
|
|
1278
|
+
}, t, h) : t.children ? t.children : t.fallback ? t.fallback : fe("span", {});
|
|
1268
1279
|
}
|
|
1269
|
-
const
|
|
1270
|
-
...
|
|
1271
|
-
_ref:
|
|
1280
|
+
const Ze = hr((t, e) => Ar({
|
|
1281
|
+
...t,
|
|
1282
|
+
_ref: e
|
|
1272
1283
|
}));
|
|
1273
|
-
|
|
1284
|
+
hr((t, e) => Ar({
|
|
1274
1285
|
inline: !0,
|
|
1275
|
-
...
|
|
1276
|
-
_ref:
|
|
1286
|
+
...t,
|
|
1287
|
+
_ref: e
|
|
1277
1288
|
}));
|
|
1278
1289
|
function yo() {
|
|
1279
|
-
const
|
|
1280
|
-
return
|
|
1281
|
-
const
|
|
1282
|
-
return window.addEventListener("resize",
|
|
1283
|
-
}, []),
|
|
1290
|
+
const t = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [e, r] = D(t);
|
|
1291
|
+
return ct(() => {
|
|
1292
|
+
const n = () => r(t());
|
|
1293
|
+
return window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
|
|
1294
|
+
}, []), e;
|
|
1284
1295
|
}
|
|
1285
1296
|
const bo = ({
|
|
1286
|
-
product:
|
|
1297
|
+
product: t
|
|
1287
1298
|
}) => {
|
|
1288
|
-
const
|
|
1299
|
+
const e = mr(), r = yo(), [n, o] = D(0), a = () => {
|
|
1289
1300
|
o(
|
|
1290
|
-
(
|
|
1301
|
+
(s) => s + r >= t.length ? 0 : s + r
|
|
1291
1302
|
);
|
|
1292
1303
|
}, i = () => {
|
|
1293
1304
|
o(
|
|
1294
|
-
(
|
|
1305
|
+
(s) => s - r < 0 ? t.length - (t.length % r || r) : s - r
|
|
1295
1306
|
);
|
|
1296
|
-
}, c = async (
|
|
1297
|
-
const u = await
|
|
1298
|
-
|
|
1307
|
+
}, c = async (s) => {
|
|
1308
|
+
const u = await kr(s);
|
|
1309
|
+
e(he(u));
|
|
1299
1310
|
};
|
|
1300
1311
|
return /* @__PURE__ */ l("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */ p("div", { className: "flex items-center justify-center gap-4 relative", children: [
|
|
1301
|
-
(
|
|
1312
|
+
(t == null ? void 0 : t.length) > r && /* @__PURE__ */ l(
|
|
1302
1313
|
"button",
|
|
1303
1314
|
{
|
|
1304
1315
|
onClick: i,
|
|
1305
1316
|
className: "absolute z-50 left-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",
|
|
1306
|
-
children: /* @__PURE__ */ l(
|
|
1317
|
+
children: /* @__PURE__ */ l(Ze, { icon: "mdi:chevron-left", width: "25" })
|
|
1307
1318
|
}
|
|
1308
1319
|
),
|
|
1309
|
-
/* @__PURE__ */ l("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children:
|
|
1310
|
-
var u,
|
|
1320
|
+
/* @__PURE__ */ l("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: t.slice(n, n + r).map((s) => {
|
|
1321
|
+
var u, f, h, m;
|
|
1311
1322
|
return /* @__PURE__ */ p(
|
|
1312
1323
|
"div",
|
|
1313
1324
|
{
|
|
1314
1325
|
className: "flex-shrink-0 flex flex-col w-[150px] h-[200px] p-2 items-center justify-between cursor-pointer bg-[#FFFFFF] rounded-[10px] shadow-[0px_2px_2px_0px_#9292BC40]",
|
|
1315
1326
|
onClick: () => {
|
|
1316
|
-
c(
|
|
1327
|
+
c(s.product_id ?? s.productId);
|
|
1317
1328
|
},
|
|
1318
1329
|
children: [
|
|
1319
1330
|
/* @__PURE__ */ l("div", { className: "w-full p-2 flex items-center justify-center bg-white", children: /* @__PURE__ */ l(
|
|
1320
1331
|
"img",
|
|
1321
1332
|
{
|
|
1322
|
-
src: ((u =
|
|
1333
|
+
src: ((u = Me(s)[0]) == null ? void 0 : u.link) || Me(s)[0] || // fallback if it's a string
|
|
1323
1334
|
"https://via.placeholder.com/120",
|
|
1324
|
-
alt:
|
|
1335
|
+
alt: s != null && s.productName ? s.productName : "Product",
|
|
1325
1336
|
className: "w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"
|
|
1326
1337
|
}
|
|
1327
1338
|
) }),
|
|
@@ -1331,8 +1342,8 @@ const bo = ({
|
|
|
1331
1342
|
className: "text-white w-full p-2 text-[12px] text-center h-[60px]",
|
|
1332
1343
|
children: [
|
|
1333
1344
|
/* @__PURE__ */ p("div", { className: "relative inline-block group", children: [
|
|
1334
|
-
/* @__PURE__ */ l("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children:
|
|
1335
|
-
|
|
1345
|
+
/* @__PURE__ */ l("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 : Be(
|
|
1346
|
+
De((f = s == null ? void 0 : s.name) == null ? void 0 : f["en-US"]),
|
|
1336
1347
|
60
|
|
1337
1348
|
) || "Product" }),
|
|
1338
1349
|
/* @__PURE__ */ l(
|
|
@@ -1346,21 +1357,21 @@ const bo = ({
|
|
|
1346
1357
|
marginBottom: "5px",
|
|
1347
1358
|
zIndex: 50
|
|
1348
1359
|
},
|
|
1349
|
-
children:
|
|
1350
|
-
|
|
1360
|
+
children: s != null && s.productName ? s.productName : s != null && s.product_name ? s.product_name : Be(
|
|
1361
|
+
De((h = s == null ? void 0 : s.name) == null ? void 0 : h["en-US"]),
|
|
1351
1362
|
60
|
|
1352
1363
|
) || "Product"
|
|
1353
1364
|
}
|
|
1354
1365
|
)
|
|
1355
1366
|
] }),
|
|
1356
1367
|
/* @__PURE__ */ p("div", { className: " flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1", children: [
|
|
1357
|
-
/* @__PURE__ */ l("p", { children:
|
|
1358
|
-
|
|
1359
|
-
(m =
|
|
1368
|
+
/* @__PURE__ */ l("p", { children: hn(
|
|
1369
|
+
s != null && s.price ? Number(s == null ? void 0 : s.price) : Ue(s).centAmount || 0,
|
|
1370
|
+
(m = Ue(s)) == null ? void 0 : m.currencyCode
|
|
1360
1371
|
) }),
|
|
1361
1372
|
/* @__PURE__ */ p("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
|
|
1362
1373
|
"$",
|
|
1363
|
-
Number(
|
|
1374
|
+
Number(s == null ? void 0 : s.price).toFixed(2) ?? 5
|
|
1364
1375
|
] })
|
|
1365
1376
|
] })
|
|
1366
1377
|
]
|
|
@@ -1368,19 +1379,19 @@ const bo = ({
|
|
|
1368
1379
|
)
|
|
1369
1380
|
]
|
|
1370
1381
|
},
|
|
1371
|
-
|
|
1382
|
+
s.productId
|
|
1372
1383
|
);
|
|
1373
1384
|
}) }),
|
|
1374
|
-
(
|
|
1385
|
+
(t == null ? void 0 : t.length) > r && /* @__PURE__ */ l(
|
|
1375
1386
|
"button",
|
|
1376
1387
|
{
|
|
1377
|
-
onClick:
|
|
1388
|
+
onClick: a,
|
|
1378
1389
|
className: "absolute z-50 right-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",
|
|
1379
|
-
children: /* @__PURE__ */ l(
|
|
1390
|
+
children: /* @__PURE__ */ l(Ze, { icon: "mdi:chevron-right", width: "25" })
|
|
1380
1391
|
}
|
|
1381
1392
|
)
|
|
1382
1393
|
] }) });
|
|
1383
|
-
},
|
|
1394
|
+
}, xo = ({ chat: t, storeDetails: e }) => /* @__PURE__ */ l("div", { className: "bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full", children: t.map((r, n) => /* @__PURE__ */ p(
|
|
1384
1395
|
"div",
|
|
1385
1396
|
{
|
|
1386
1397
|
className: "mb-4 p-3 rounded-xl",
|
|
@@ -1393,216 +1404,216 @@ const bo = ({
|
|
|
1393
1404
|
"div",
|
|
1394
1405
|
{
|
|
1395
1406
|
className: "font-nunitoSans font-bold text-sm text-[#494949] p-2 w-fit rounded-[20px]",
|
|
1396
|
-
children:
|
|
1407
|
+
children: mn(r.keyword) || "No keyword"
|
|
1397
1408
|
}
|
|
1398
1409
|
),
|
|
1399
1410
|
/* @__PURE__ */ l(
|
|
1400
1411
|
bo,
|
|
1401
1412
|
{
|
|
1402
|
-
product:
|
|
1403
|
-
storeDetails:
|
|
1413
|
+
product: r.items,
|
|
1414
|
+
storeDetails: e
|
|
1404
1415
|
}
|
|
1405
1416
|
)
|
|
1406
1417
|
]
|
|
1407
1418
|
},
|
|
1408
|
-
|
|
1409
|
-
)) }),
|
|
1410
|
-
const { serverUrl:
|
|
1419
|
+
n
|
|
1420
|
+
)) }), Lr = async (t, e) => {
|
|
1421
|
+
const { serverUrl: r, basePath: n } = wt(), o = `${r}`;
|
|
1411
1422
|
console.log(`customer_token
|
|
1412
|
-
`,
|
|
1423
|
+
`, t);
|
|
1413
1424
|
try {
|
|
1414
|
-
return (await
|
|
1415
|
-
`${o}${
|
|
1416
|
-
|
|
1425
|
+
return (await U.post(
|
|
1426
|
+
`${o}${n}/basket/create?baseUrl=${lt()}&siteId=${rt()}&pubCfg=${ut()}&envRef=${dt()}&orgRef=${ft()}`,
|
|
1427
|
+
e,
|
|
1417
1428
|
{
|
|
1418
1429
|
headers: {
|
|
1419
1430
|
"Content-Type": "application/json",
|
|
1420
|
-
Authorization:
|
|
1431
|
+
Authorization: t
|
|
1421
1432
|
}
|
|
1422
1433
|
}
|
|
1423
1434
|
)).data;
|
|
1424
|
-
} catch (
|
|
1425
|
-
return
|
|
1435
|
+
} catch (a) {
|
|
1436
|
+
return U.isAxiosError(a) ? console.error("Error creating basket:", a.response || a.message) : console.error("Unexpected error:", a), null;
|
|
1426
1437
|
}
|
|
1427
|
-
},
|
|
1428
|
-
const { serverUrl:
|
|
1438
|
+
}, Wt = async (t, e, r) => {
|
|
1439
|
+
const { serverUrl: n, basePath: o } = wt(), a = `${n}`;
|
|
1429
1440
|
try {
|
|
1430
|
-
const i = await
|
|
1431
|
-
`${
|
|
1432
|
-
|
|
1441
|
+
const i = await U.post(
|
|
1442
|
+
`${a}${o}/basket/add-product/${t}?baseUrl=${lt()}&siteId=${rt()}&pubCfg=${ut()}&envRef=${dt()}&orgRef=${ft()}`,
|
|
1443
|
+
e,
|
|
1433
1444
|
{
|
|
1434
1445
|
headers: {
|
|
1435
1446
|
"Content-Type": "application/json",
|
|
1436
|
-
Authorization:
|
|
1447
|
+
Authorization: r
|
|
1437
1448
|
}
|
|
1438
1449
|
}
|
|
1439
1450
|
);
|
|
1440
1451
|
return i.status === 200 && i.data ? i.data : null;
|
|
1441
1452
|
} catch (i) {
|
|
1442
|
-
return
|
|
1453
|
+
return U.isAxiosError(i) ? console.error(
|
|
1443
1454
|
"Error adding products to basket:",
|
|
1444
1455
|
i.response || i.message
|
|
1445
1456
|
) : console.error("Unexpected error:", i), null;
|
|
1446
1457
|
}
|
|
1447
|
-
},
|
|
1448
|
-
basketId:
|
|
1449
|
-
customer_token:
|
|
1458
|
+
}, zr = async ({
|
|
1459
|
+
basketId: t,
|
|
1460
|
+
customer_token: e
|
|
1450
1461
|
}) => {
|
|
1451
|
-
var
|
|
1452
|
-
const { serverUrl:
|
|
1462
|
+
var a;
|
|
1463
|
+
const { serverUrl: r, basePath: n } = wt(), o = `${r}`;
|
|
1453
1464
|
try {
|
|
1454
|
-
const i = await
|
|
1455
|
-
`${o}${
|
|
1465
|
+
const i = await U.get(
|
|
1466
|
+
`${o}${n}/basket/${t}?baseUrl=${lt()}&siteId=${rt()}&pubCfg=${ut()}&envRef=${dt()}&orgRef=${ft()}`,
|
|
1456
1467
|
{
|
|
1457
1468
|
headers: {
|
|
1458
1469
|
"Content-Type": "application/json",
|
|
1459
|
-
Authorization:
|
|
1470
|
+
Authorization: e
|
|
1460
1471
|
}
|
|
1461
1472
|
}
|
|
1462
1473
|
);
|
|
1463
1474
|
return { status: i.status, data: i.data };
|
|
1464
1475
|
} catch (i) {
|
|
1465
|
-
return
|
|
1476
|
+
return U.isAxiosError(i) ? { status: (a = i.response) == null ? void 0 : a.status, data: null } : { status: null, data: null };
|
|
1466
1477
|
}
|
|
1467
|
-
},
|
|
1468
|
-
const
|
|
1478
|
+
}, tr = "sfcc_basket_id", er = "sfcc_customer_token", Ut = "sfcc_token_expiry", vo = 300 * 1e3, At = "1.0.0";
|
|
1479
|
+
const Nt = (t) => {
|
|
1469
1480
|
try {
|
|
1470
|
-
|
|
1471
|
-
} catch (
|
|
1472
|
-
console.error("Error saving basket ID to storage:",
|
|
1481
|
+
t ? localStorage.setItem(tr, t) : localStorage.removeItem(tr);
|
|
1482
|
+
} catch (e) {
|
|
1483
|
+
console.error("Error saving basket ID to storage:", e);
|
|
1473
1484
|
}
|
|
1474
|
-
},
|
|
1485
|
+
}, Qt = (t) => {
|
|
1475
1486
|
try {
|
|
1476
|
-
if (
|
|
1477
|
-
localStorage.setItem(
|
|
1478
|
-
const
|
|
1479
|
-
localStorage.setItem(
|
|
1487
|
+
if (t) {
|
|
1488
|
+
localStorage.setItem(er, t);
|
|
1489
|
+
const e = Date.now() + vo;
|
|
1490
|
+
localStorage.setItem(Ut, e.toString());
|
|
1480
1491
|
} else
|
|
1481
|
-
localStorage.removeItem(
|
|
1482
|
-
} catch (
|
|
1483
|
-
console.error("Error storing token:",
|
|
1484
|
-
}
|
|
1485
|
-
},
|
|
1486
|
-
var c,
|
|
1487
|
-
const
|
|
1488
|
-
if (
|
|
1489
|
-
o(!!
|
|
1490
|
-
}, [
|
|
1491
|
-
const
|
|
1492
|
-
var g,
|
|
1493
|
-
console.log(
|
|
1492
|
+
localStorage.removeItem(er);
|
|
1493
|
+
} catch (e) {
|
|
1494
|
+
console.error("Error storing token:", e);
|
|
1495
|
+
}
|
|
1496
|
+
}, rr = 300, ko = () => {
|
|
1497
|
+
var c, s, u, f, h, m;
|
|
1498
|
+
const t = mr(), e = Kt((g) => g.product.product), r = Kt((g) => g.store.store), [n, o] = D(!!e);
|
|
1499
|
+
if (ct(() => {
|
|
1500
|
+
o(!!e);
|
|
1501
|
+
}, [e]), !e) return null;
|
|
1502
|
+
const a = async () => {
|
|
1503
|
+
var g, k, _, w, v, B, P, $, Z, S, L, H, V, O, yt, T;
|
|
1504
|
+
console.log(e, "the prod");
|
|
1494
1505
|
try {
|
|
1495
|
-
if (!((
|
|
1496
|
-
|
|
1506
|
+
if (!((k = (g = e == null ? void 0 : e.variants) == null ? void 0 : g[0]) != null && k.product_id) && !(e.type.item || e.type.bundle) && !((w = (_ = e == null ? void 0 : e.variants) == null ? void 0 : _[0]) != null && w.productId)) {
|
|
1507
|
+
X.error("Variants not available", {
|
|
1497
1508
|
position: "bottom-right",
|
|
1498
1509
|
autoClose: 1e3
|
|
1499
1510
|
}), console.error("No product variant found");
|
|
1500
1511
|
return;
|
|
1501
1512
|
}
|
|
1502
|
-
const
|
|
1513
|
+
const j = [
|
|
1503
1514
|
{
|
|
1504
|
-
product_id: ((v =
|
|
1515
|
+
product_id: ((v = e.variants) == null ? void 0 : v[0].product_id) || ((B = e.variants) == null ? void 0 : B[0].productId) || (e == null ? void 0 : e.id),
|
|
1505
1516
|
quantity: 1
|
|
1506
1517
|
}
|
|
1507
1518
|
];
|
|
1508
|
-
console.log(
|
|
1509
|
-
const
|
|
1519
|
+
console.log(j, "the product data");
|
|
1520
|
+
const Pt = JSON.parse(
|
|
1510
1521
|
sessionStorage.getItem("customerData") || "{}"
|
|
1511
|
-
),
|
|
1512
|
-
if (!
|
|
1513
|
-
let
|
|
1522
|
+
), pt = Pt == null ? void 0 : Pt.basketId, ee = !1, nt = localStorage.getItem(Ut), ht = Date.now();
|
|
1523
|
+
if (!ee || !nt || ht >= parseInt(nt)) {
|
|
1524
|
+
let Y = "";
|
|
1514
1525
|
{
|
|
1515
|
-
const
|
|
1516
|
-
console.log("token from auth data"),
|
|
1526
|
+
const bt = await Zt();
|
|
1527
|
+
console.log("token from auth data"), Y = "Bearer " + bt.access_token;
|
|
1517
1528
|
}
|
|
1518
|
-
if (!
|
|
1529
|
+
if (!Y) {
|
|
1519
1530
|
console.error("Failed to get customer_token");
|
|
1520
1531
|
return;
|
|
1521
1532
|
}
|
|
1522
|
-
const
|
|
1523
|
-
if (
|
|
1524
|
-
const
|
|
1525
|
-
basketId:
|
|
1526
|
-
customer_token:
|
|
1533
|
+
const re = ht + 300 * 1e3;
|
|
1534
|
+
if (Qt(Y), localStorage.setItem(Ut, re.toString()), pt) {
|
|
1535
|
+
const bt = await zr({
|
|
1536
|
+
basketId: pt,
|
|
1537
|
+
customer_token: Y
|
|
1527
1538
|
});
|
|
1528
|
-
if (console.log(
|
|
1529
|
-
const
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1539
|
+
if (console.log(pt, "basket id from customer"), bt.status === 200 && bt) {
|
|
1540
|
+
const ot = await Wt(
|
|
1541
|
+
pt,
|
|
1542
|
+
j,
|
|
1543
|
+
Y
|
|
1533
1544
|
);
|
|
1534
|
-
(((P =
|
|
1545
|
+
(((P = ot == null ? void 0 : ot.product_items) == null ? void 0 : P.length) > 0 || (($ = ot == null ? void 0 : ot.productItems) == null ? void 0 : $.length) > 0) && (X.success("Added to cart", {
|
|
1535
1546
|
position: "bottom-right",
|
|
1536
1547
|
autoClose: 3e3,
|
|
1537
1548
|
hideProgressBar: !1,
|
|
1538
1549
|
closeOnClick: !0,
|
|
1539
1550
|
pauseOnHover: !0,
|
|
1540
1551
|
draggable: !0
|
|
1541
|
-
}),
|
|
1552
|
+
}), Ft(pt));
|
|
1542
1553
|
return;
|
|
1543
1554
|
}
|
|
1544
1555
|
}
|
|
1545
|
-
const
|
|
1556
|
+
const ne = {
|
|
1546
1557
|
productItems: [
|
|
1547
1558
|
{
|
|
1548
|
-
productId: ((
|
|
1559
|
+
productId: ((Z = e.variants) == null ? void 0 : Z[0].product_id) || ((S = e.variants) == null ? void 0 : S[0].productId) || (e == null ? void 0 : e.id),
|
|
1549
1560
|
quantity: 1
|
|
1550
1561
|
}
|
|
1551
1562
|
]
|
|
1552
1563
|
};
|
|
1553
1564
|
console.log("before create basket");
|
|
1554
|
-
const
|
|
1565
|
+
const b = await Lr(Y, ne);
|
|
1555
1566
|
if (console.log(
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1567
|
+
b,
|
|
1568
|
+
b == null ? void 0 : b.basket_id,
|
|
1569
|
+
b == null ? void 0 : b.basketId,
|
|
1559
1570
|
"the basket response"
|
|
1560
|
-
), !(
|
|
1571
|
+
), !(b != null && b.basket_id) && !(b != null && b.basketId)) {
|
|
1561
1572
|
console.error("Failed to create basket");
|
|
1562
1573
|
return;
|
|
1563
1574
|
}
|
|
1564
1575
|
console.log(
|
|
1565
1576
|
"setting stored id",
|
|
1566
|
-
(
|
|
1567
|
-
),
|
|
1568
|
-
(
|
|
1577
|
+
(b == null ? void 0 : b.basket_id) || (b == null ? void 0 : b.basketId)
|
|
1578
|
+
), Nt(
|
|
1579
|
+
(b == null ? void 0 : b.basket_id) || (b == null ? void 0 : b.basketId)
|
|
1569
1580
|
), console.log("adding product to basket");
|
|
1570
|
-
const
|
|
1571
|
-
(
|
|
1572
|
-
|
|
1573
|
-
|
|
1581
|
+
const J = await Wt(
|
|
1582
|
+
(b == null ? void 0 : b.basket_id) || (b == null ? void 0 : b.basketId),
|
|
1583
|
+
j,
|
|
1584
|
+
Y
|
|
1574
1585
|
);
|
|
1575
|
-
console.log("object added to basket"), (((L =
|
|
1586
|
+
console.log("object added to basket"), (((L = J == null ? void 0 : J.product_items) == null ? void 0 : L.length) > 0 || ((H = J == null ? void 0 : J.productItems) == null ? void 0 : H.length) > 0) && X.success("Added to cart", {
|
|
1576
1587
|
position: "bottom-right",
|
|
1577
1588
|
autoClose: 3e3,
|
|
1578
1589
|
hideProgressBar: !1,
|
|
1579
1590
|
closeOnClick: !0,
|
|
1580
1591
|
pauseOnHover: !0,
|
|
1581
1592
|
draggable: !0
|
|
1582
|
-
}),
|
|
1593
|
+
}), Ft(b.basket_id || (b == null ? void 0 : b.basketId));
|
|
1583
1594
|
}
|
|
1584
|
-
} catch (
|
|
1585
|
-
console.error("Error adding to cart:",
|
|
1595
|
+
} catch (j) {
|
|
1596
|
+
console.error("Error adding to cart:", j), X.error("Failed to add product to cart", {
|
|
1586
1597
|
position: "bottom-right",
|
|
1587
1598
|
autoClose: 3e3
|
|
1588
|
-
}), ((V =
|
|
1589
|
-
((O =
|
|
1599
|
+
}), ((V = j == null ? void 0 : j.response) == null ? void 0 : V.status) === 404 || // Basket not found
|
|
1600
|
+
((O = j == null ? void 0 : j.response) == null ? void 0 : O.status) === 401 ? (((yt = j == null ? void 0 : j.response) == null ? void 0 : yt.status) === 404 && Nt(null), ((T = j == null ? void 0 : j.response) == null ? void 0 : T.status) === 401 && (Nt(null), Qt(null))) : (console.error("Failed to add product to basket:", j.message), X.error("Failed to add product to cart", {
|
|
1590
1601
|
position: "bottom-right",
|
|
1591
1602
|
autoClose: 3e3
|
|
1592
1603
|
}));
|
|
1593
1604
|
} finally {
|
|
1594
|
-
|
|
1605
|
+
Ft();
|
|
1595
1606
|
}
|
|
1596
1607
|
}, i = () => {
|
|
1597
|
-
|
|
1608
|
+
e && (window.location.href = e.c_pdpUrl);
|
|
1598
1609
|
};
|
|
1599
|
-
return console.log(
|
|
1610
|
+
return console.log(e, "the prod"), /* @__PURE__ */ p(pe, { children: [
|
|
1600
1611
|
/* @__PURE__ */ l(
|
|
1601
1612
|
"div",
|
|
1602
1613
|
{
|
|
1603
1614
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
1604
1615
|
onClick: () => {
|
|
1605
|
-
o(!1), setTimeout(() =>
|
|
1616
|
+
o(!1), setTimeout(() => t(he(null)), rr);
|
|
1606
1617
|
}
|
|
1607
1618
|
}
|
|
1608
1619
|
),
|
|
@@ -1612,22 +1623,22 @@ const Fe = (e) => {
|
|
|
1612
1623
|
className: `
|
|
1613
1624
|
flex flex-col gap-2 items-center h-[90vh] absolute right-0 bottom-0 z-50 w-full md:w-1/2 md:h-[100vh] lg:w-1/2 lg:h-[100vh] shadow-xl p-2 border-l-2 bg-white border-gray-200 overflow-y-scroll
|
|
1614
1625
|
transition-all duration-300
|
|
1615
|
-
${
|
|
1626
|
+
${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"}
|
|
1616
1627
|
`,
|
|
1617
1628
|
style: { willChange: "transform, opacity" },
|
|
1618
1629
|
onClick: (g) => g.stopPropagation(),
|
|
1619
1630
|
children: [
|
|
1620
1631
|
/* @__PURE__ */ p("div", { className: "mt-3 flex flex-row justify-between w-full ", children: [
|
|
1621
|
-
/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("p", { className: "text-[#000000] font-bold font-nunitoSans", children:
|
|
1632
|
+
/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("p", { className: "text-[#000000] font-bold font-nunitoSans", children: e.name }) }),
|
|
1622
1633
|
/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
|
|
1623
|
-
|
|
1634
|
+
Le,
|
|
1624
1635
|
{
|
|
1625
1636
|
icon: "mdi:close",
|
|
1626
1637
|
className: "text-[#555555] w-6 h-6 cursor-pointer",
|
|
1627
1638
|
onClick: () => {
|
|
1628
1639
|
o(!1), setTimeout(
|
|
1629
|
-
() =>
|
|
1630
|
-
|
|
1640
|
+
() => t(he(null)),
|
|
1641
|
+
rr
|
|
1631
1642
|
);
|
|
1632
1643
|
}
|
|
1633
1644
|
}
|
|
@@ -1637,20 +1648,20 @@ const Fe = (e) => {
|
|
|
1637
1648
|
/* @__PURE__ */ l("div", { className: "flex flex-row items-center justify-center w-[120px] h-[120px] my-5", children: /* @__PURE__ */ l(
|
|
1638
1649
|
"img",
|
|
1639
1650
|
{
|
|
1640
|
-
src: (
|
|
1641
|
-
alt:
|
|
1651
|
+
src: (f = (u = (s = (c = e.imageGroups) == null ? void 0 : c[0]) == null ? void 0 : s.images) == null ? void 0 : u[0]) == null ? void 0 : f.link,
|
|
1652
|
+
alt: e.name,
|
|
1642
1653
|
className: "rounded-[10px]"
|
|
1643
1654
|
}
|
|
1644
1655
|
) }),
|
|
1645
|
-
/* @__PURE__ */ l("div", { className: "flex flex-col items-center gap-2", children:
|
|
1646
|
-
(g) => g.images.slice(1, 2).map((
|
|
1656
|
+
/* @__PURE__ */ l("div", { className: "flex flex-col items-center gap-2", children: e.imageGroups.slice(1, 2).map(
|
|
1657
|
+
(g) => g.images.slice(1, 2).map((k) => /* @__PURE__ */ l(
|
|
1647
1658
|
"img",
|
|
1648
1659
|
{
|
|
1649
|
-
src:
|
|
1650
|
-
alt:
|
|
1660
|
+
src: k.link,
|
|
1661
|
+
alt: e.name,
|
|
1651
1662
|
className: "rounded-[10px] w-[60px] h-[60px]"
|
|
1652
1663
|
},
|
|
1653
|
-
|
|
1664
|
+
k.link
|
|
1654
1665
|
))
|
|
1655
1666
|
) })
|
|
1656
1667
|
] }),
|
|
@@ -1659,16 +1670,16 @@ const Fe = (e) => {
|
|
|
1659
1670
|
/* @__PURE__ */ p("p", { className: "text-[#14121F] font-bold font-nunitoSans", children: [
|
|
1660
1671
|
" ",
|
|
1661
1672
|
"$",
|
|
1662
|
-
|
|
1673
|
+
e.price.toFixed(2)
|
|
1663
1674
|
] }),
|
|
1664
1675
|
" ",
|
|
1665
1676
|
/* @__PURE__ */ p("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans", children: [
|
|
1666
1677
|
" ",
|
|
1667
1678
|
"$",
|
|
1668
|
-
(
|
|
1679
|
+
(e.price + 5).toFixed(2)
|
|
1669
1680
|
] })
|
|
1670
1681
|
] }),
|
|
1671
|
-
/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("p", { className: "text-[#EC5050] font-bold font-nunitoSans", children:
|
|
1682
|
+
/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("p", { className: "text-[#EC5050] font-bold font-nunitoSans", children: e.discount }) })
|
|
1672
1683
|
] }),
|
|
1673
1684
|
/* @__PURE__ */ l("div", { className: "mt-2 w-full border-t-2 border-gray-200" }),
|
|
1674
1685
|
/* @__PURE__ */ p("div", { className: "w-full text-left", children: [
|
|
@@ -1677,37 +1688,37 @@ const Fe = (e) => {
|
|
|
1677
1688
|
"div",
|
|
1678
1689
|
{
|
|
1679
1690
|
className: "text-[#68656E] font-normal font-nunitoSans text-xs pl-2 mt-3",
|
|
1680
|
-
dangerouslySetInnerHTML: { __html:
|
|
1691
|
+
dangerouslySetInnerHTML: { __html: e.short_description || e.longDescription }
|
|
1681
1692
|
}
|
|
1682
1693
|
)
|
|
1683
1694
|
] }),
|
|
1684
1695
|
/* @__PURE__ */ p("div", { className: "mt-4 flex flex-col gap-2 w-full p-2", children: [
|
|
1685
1696
|
/* @__PURE__ */ l("div", { className: "flex flex-row items-center gap-2", children: /* @__PURE__ */ p("div", { className: "flex items-center gap-2 text-left font-nunitoSans", children: [
|
|
1686
1697
|
/* @__PURE__ */ p("div", { className: "text-[#323135] font-bold", children: [
|
|
1687
|
-
((h =
|
|
1698
|
+
((h = e == null ? void 0 : e.rating) == null ? void 0 : h.rate) || 0,
|
|
1688
1699
|
" /",
|
|
1689
1700
|
" ",
|
|
1690
1701
|
/* @__PURE__ */ l("span", { className: "text-[#68656E]", children: "5" })
|
|
1691
1702
|
] }),
|
|
1692
1703
|
/* @__PURE__ */ l("div", { className: "text-[#323135] font-semibold text-sm", children: "Overall Rating" }),
|
|
1693
1704
|
/* @__PURE__ */ p("div", { className: "text-[#68656E] font-semibold text-sm", children: [
|
|
1694
|
-
((m =
|
|
1705
|
+
((m = e == null ? void 0 : e.rating) == null ? void 0 : m.count) || 0,
|
|
1695
1706
|
" ratings"
|
|
1696
1707
|
] })
|
|
1697
1708
|
] }) }),
|
|
1698
|
-
/* @__PURE__ */ l("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((g,
|
|
1709
|
+
/* @__PURE__ */ l("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((g, k) => {
|
|
1699
1710
|
var _;
|
|
1700
1711
|
return /* @__PURE__ */ l(
|
|
1701
|
-
|
|
1712
|
+
Le,
|
|
1702
1713
|
{
|
|
1703
1714
|
icon: "mdi:star",
|
|
1704
1715
|
width: "20",
|
|
1705
1716
|
height: "20",
|
|
1706
1717
|
className: `text-yellow-500
|
|
1707
|
-
${((_ =
|
|
1718
|
+
${((_ = e == null ? void 0 : e.rating) == null ? void 0 : _.rate) > k ? "text-yellow-500" : "text-gray-300"}
|
|
1708
1719
|
`
|
|
1709
1720
|
},
|
|
1710
|
-
|
|
1721
|
+
k
|
|
1711
1722
|
);
|
|
1712
1723
|
}) })
|
|
1713
1724
|
] }),
|
|
@@ -1721,8 +1732,8 @@ const Fe = (e) => {
|
|
|
1721
1732
|
"button",
|
|
1722
1733
|
{
|
|
1723
1734
|
className: "rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer",
|
|
1724
|
-
style: { backgroundColor:
|
|
1725
|
-
onClick:
|
|
1735
|
+
style: { backgroundColor: r.tanyaThemeColor },
|
|
1736
|
+
onClick: a,
|
|
1726
1737
|
children: "Add to Cart"
|
|
1727
1738
|
}
|
|
1728
1739
|
),
|
|
@@ -1730,7 +1741,7 @@ const Fe = (e) => {
|
|
|
1730
1741
|
"button",
|
|
1731
1742
|
{
|
|
1732
1743
|
className: "rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer mb-16",
|
|
1733
|
-
style: { backgroundColor:
|
|
1744
|
+
style: { backgroundColor: r.tanyaThemeColor },
|
|
1734
1745
|
onClick: i,
|
|
1735
1746
|
children: "View more"
|
|
1736
1747
|
}
|
|
@@ -1743,157 +1754,157 @@ const Fe = (e) => {
|
|
|
1743
1754
|
)
|
|
1744
1755
|
] });
|
|
1745
1756
|
}, So = () => {
|
|
1746
|
-
const
|
|
1757
|
+
const t = [
|
|
1747
1758
|
"Myself",
|
|
1748
1759
|
"My Child",
|
|
1749
1760
|
"My Grandchild",
|
|
1750
1761
|
"Niece/Nephew",
|
|
1751
1762
|
"My Friends",
|
|
1752
1763
|
"Others"
|
|
1753
|
-
],
|
|
1764
|
+
], e = {
|
|
1754
1765
|
Myself: "himself/herself",
|
|
1755
1766
|
"My Child": "his/her child",
|
|
1756
1767
|
"My Grandchild": "his/her grandchild",
|
|
1757
1768
|
"Niece/Nephew": "his/her niece/nephew",
|
|
1758
1769
|
"My Friends": "his/her friends",
|
|
1759
1770
|
Others: "others"
|
|
1760
|
-
},
|
|
1771
|
+
}, r = Ot(null), n = Ot(null), o = Ot(null), a = Ot(null), [i, c] = D(null), [s, u] = D(
|
|
1761
1772
|
!1
|
|
1762
|
-
), [
|
|
1763
|
-
id:
|
|
1764
|
-
title:
|
|
1765
|
-
image:
|
|
1766
|
-
price:
|
|
1767
|
-
}), [V, O] =
|
|
1773
|
+
), [f, h] = D(!1), [m, g] = D(!1), [k, _] = D(!1), [w, v] = D(!1), [B, P] = D(!1), [$, Z] = D(""), [S, L] = D(""), H = (d) => ({
|
|
1774
|
+
id: d.id,
|
|
1775
|
+
title: d.name,
|
|
1776
|
+
image: d.image ?? "",
|
|
1777
|
+
price: d.price ?? 0
|
|
1778
|
+
}), [V, O] = D([]), yt = Ot(null), T = Kt((d) => d.store.store), j = Kt((d) => d.product.product), Pt = () => {
|
|
1768
1779
|
g(!0), setTimeout(() => h(!0), 10);
|
|
1769
|
-
},
|
|
1780
|
+
}, pt = () => {
|
|
1770
1781
|
h(!1), setTimeout(() => g(!1), 300);
|
|
1771
1782
|
};
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
}, [
|
|
1775
|
-
const
|
|
1776
|
-
L(
|
|
1783
|
+
ct(() => {
|
|
1784
|
+
s ? Pt() : pt();
|
|
1785
|
+
}, [s]);
|
|
1786
|
+
const ee = (d) => {
|
|
1787
|
+
L(e[d]);
|
|
1777
1788
|
};
|
|
1778
|
-
|
|
1779
|
-
|
|
1789
|
+
ct(() => {
|
|
1790
|
+
yt.current && (yt.current.scrollTop += 150);
|
|
1780
1791
|
}, [V]);
|
|
1781
|
-
let
|
|
1782
|
-
const
|
|
1783
|
-
if (
|
|
1784
|
-
return
|
|
1792
|
+
let nt = null, ht = null;
|
|
1793
|
+
const Y = async () => {
|
|
1794
|
+
if (nt && ht && Date.now() < ht)
|
|
1795
|
+
return nt;
|
|
1785
1796
|
try {
|
|
1786
|
-
const
|
|
1797
|
+
const d = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token", E = new URLSearchParams({
|
|
1787
1798
|
grant_type: "client_credentials",
|
|
1788
1799
|
client_id: "4i8rd70sgt961tc4dhskgf08c",
|
|
1789
1800
|
client_secret: "bnsfq1220loh2cn2cm2ttn8fdhdpt0u8m1fgj8vfk2rn61aurjg",
|
|
1790
1801
|
scope: "default-m2m-resource-server-8xzfzo/read"
|
|
1791
|
-
}),
|
|
1802
|
+
}), I = await fetch(d, {
|
|
1792
1803
|
method: "POST",
|
|
1793
1804
|
headers: {
|
|
1794
1805
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
1795
1806
|
},
|
|
1796
|
-
body:
|
|
1807
|
+
body: E
|
|
1797
1808
|
});
|
|
1798
|
-
if (!
|
|
1809
|
+
if (!I.ok)
|
|
1799
1810
|
throw new Error(
|
|
1800
|
-
`Token request failed! status: ${
|
|
1811
|
+
`Token request failed! status: ${I.status}`
|
|
1801
1812
|
);
|
|
1802
|
-
const
|
|
1803
|
-
|
|
1804
|
-
const x =
|
|
1805
|
-
return
|
|
1806
|
-
} catch (
|
|
1807
|
-
return console.error("Error obtaining JWT token:",
|
|
1813
|
+
const N = await I.json();
|
|
1814
|
+
nt = N.access_token;
|
|
1815
|
+
const x = N.expires_in || 3600;
|
|
1816
|
+
return ht = Date.now() + (x - 60) * 1e3, nt;
|
|
1817
|
+
} catch (d) {
|
|
1818
|
+
return console.error("Error obtaining JWT token:", d), nt = null, ht = null, null;
|
|
1808
1819
|
}
|
|
1809
|
-
},
|
|
1810
|
-
const
|
|
1811
|
-
|
|
1820
|
+
}, re = async () => {
|
|
1821
|
+
const d = await Zt();
|
|
1822
|
+
d != null && c(d);
|
|
1812
1823
|
};
|
|
1813
|
-
|
|
1814
|
-
|
|
1824
|
+
ct(() => {
|
|
1825
|
+
re(), console.log("scapi environment v1");
|
|
1815
1826
|
}, []);
|
|
1816
|
-
const
|
|
1817
|
-
const
|
|
1827
|
+
const ne = async () => {
|
|
1828
|
+
const d = JSON.parse(
|
|
1818
1829
|
sessionStorage.getItem("customerData") || "{}"
|
|
1819
1830
|
).customerId;
|
|
1820
|
-
return (await
|
|
1821
|
-
},
|
|
1822
|
-
console.log("in secondary flow",
|
|
1823
|
-
const
|
|
1824
|
-
if (console.log(
|
|
1831
|
+
return (await pn(d || "")).c_interests;
|
|
1832
|
+
}, b = async (d, E) => {
|
|
1833
|
+
console.log("in secondary flow", At);
|
|
1834
|
+
const I = await ne();
|
|
1835
|
+
if (console.log(I, "interests of customer", At), !!I)
|
|
1825
1836
|
try {
|
|
1826
1837
|
O(
|
|
1827
|
-
(
|
|
1828
|
-
(
|
|
1838
|
+
(W) => W.map(
|
|
1839
|
+
(tt, et) => et === W.length - 1 ? { ...tt, secondaryLoading: !0 } : tt
|
|
1829
1840
|
)
|
|
1830
1841
|
);
|
|
1831
|
-
const
|
|
1832
|
-
if (!
|
|
1833
|
-
const x = localStorage.getItem("customerNumber"),
|
|
1834
|
-
registered: String(
|
|
1842
|
+
const N = await Y();
|
|
1843
|
+
if (!N) throw new Error("Failed to fetch token");
|
|
1844
|
+
const x = localStorage.getItem("customerNumber"), C = localStorage.getItem("isLoggedIn"), xt = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
1845
|
+
registered: String(C || !1),
|
|
1835
1846
|
userId: String(x || (/* @__PURE__ */ new Date()).getTime())
|
|
1836
|
-
}).toString()}`,
|
|
1847
|
+
}).toString()}`, vt = JSON.stringify({
|
|
1837
1848
|
flowId: "Q166PR519W",
|
|
1838
1849
|
flowAliasId: "HKFUVLWVH2",
|
|
1839
1850
|
input: {
|
|
1840
1851
|
loyaltyPoints: "",
|
|
1841
|
-
productName:
|
|
1842
|
-
productPoints: String(
|
|
1843
|
-
interests:
|
|
1852
|
+
productName: d,
|
|
1853
|
+
productPoints: String(E || 0),
|
|
1854
|
+
interests: I
|
|
1844
1855
|
}
|
|
1845
|
-
}),
|
|
1856
|
+
}), K = await fetch(xt, {
|
|
1846
1857
|
signal: AbortSignal.timeout(3e4),
|
|
1847
1858
|
method: "POST",
|
|
1848
1859
|
headers: {
|
|
1849
1860
|
"Content-Type": "application/json",
|
|
1850
|
-
Authorization: `Bearer ${
|
|
1861
|
+
Authorization: `Bearer ${N}`
|
|
1851
1862
|
},
|
|
1852
|
-
body:
|
|
1863
|
+
body: vt
|
|
1853
1864
|
});
|
|
1854
|
-
if (!
|
|
1855
|
-
const
|
|
1856
|
-
let
|
|
1865
|
+
if (!K.body) throw new Error("Readable stream not supported");
|
|
1866
|
+
const kt = K.body.getReader(), St = new TextDecoder();
|
|
1867
|
+
let G = "";
|
|
1857
1868
|
for (; ; ) {
|
|
1858
|
-
const { done:
|
|
1859
|
-
if (
|
|
1860
|
-
|
|
1861
|
-
const
|
|
1869
|
+
const { done: W, value: tt } = await kt.read();
|
|
1870
|
+
if (W) break;
|
|
1871
|
+
G += St.decode(tt, { stream: !0 });
|
|
1872
|
+
const et = G.split(`
|
|
1862
1873
|
`);
|
|
1863
|
-
|
|
1864
|
-
for (const
|
|
1865
|
-
if (
|
|
1866
|
-
const
|
|
1874
|
+
G = et.pop() || "";
|
|
1875
|
+
for (const at of et)
|
|
1876
|
+
if (at.startsWith("data:")) {
|
|
1877
|
+
const y = at.slice(5).trim();
|
|
1867
1878
|
try {
|
|
1868
|
-
const
|
|
1869
|
-
|
|
1879
|
+
const Q = JSON.parse(y);
|
|
1880
|
+
Q.index === 0 && O(
|
|
1870
1881
|
(A) => A.map(
|
|
1871
|
-
(
|
|
1872
|
-
...
|
|
1873
|
-
secondaryResponse:
|
|
1882
|
+
(q, it) => it === A.length - 1 ? {
|
|
1883
|
+
...q,
|
|
1884
|
+
secondaryResponse: Q.data,
|
|
1874
1885
|
secondaryLoading: !1
|
|
1875
|
-
} :
|
|
1886
|
+
} : q
|
|
1876
1887
|
)
|
|
1877
1888
|
);
|
|
1878
|
-
} catch (
|
|
1889
|
+
} catch (Q) {
|
|
1879
1890
|
O(
|
|
1880
1891
|
(A) => A.map(
|
|
1881
|
-
(
|
|
1892
|
+
(q, it) => it === A.length - 1 ? { ...q, secondaryLoading: !1 } : q
|
|
1882
1893
|
)
|
|
1883
|
-
), console.error("Secondary flow JSON parse error:",
|
|
1894
|
+
), console.error("Secondary flow JSON parse error:", Q);
|
|
1884
1895
|
}
|
|
1885
1896
|
}
|
|
1886
1897
|
}
|
|
1887
|
-
} catch (
|
|
1888
|
-
console.error("Secondary flow error:",
|
|
1898
|
+
} catch (N) {
|
|
1899
|
+
console.error("Secondary flow error:", N);
|
|
1889
1900
|
}
|
|
1890
|
-
},
|
|
1891
|
-
const
|
|
1892
|
-
if (
|
|
1893
|
-
v(!0),
|
|
1894
|
-
...
|
|
1901
|
+
}, J = async (d) => {
|
|
1902
|
+
const E = d || $.trim();
|
|
1903
|
+
if (E) {
|
|
1904
|
+
v(!0), Z(""), r.current = null, n.current = null, o.current = null, a.current = null, O((I) => [
|
|
1905
|
+
...I,
|
|
1895
1906
|
{
|
|
1896
|
-
query:
|
|
1907
|
+
query: E,
|
|
1897
1908
|
response: "Thinking for what suits you best...",
|
|
1898
1909
|
potentialQuestions: "",
|
|
1899
1910
|
products: [],
|
|
@@ -1901,52 +1912,52 @@ const Fe = (e) => {
|
|
|
1901
1912
|
}
|
|
1902
1913
|
]);
|
|
1903
1914
|
try {
|
|
1904
|
-
const
|
|
1905
|
-
if (!
|
|
1915
|
+
const I = S, N = localStorage.getItem("customerNumber"), x = localStorage.getItem("isLoggedIn"), C = await Y();
|
|
1916
|
+
if (!C)
|
|
1906
1917
|
throw new Error("Failed to obtain access token");
|
|
1907
|
-
const
|
|
1918
|
+
const xt = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
1908
1919
|
registered: String(x || !1),
|
|
1909
|
-
userId: String(
|
|
1910
|
-
}).toString()}`,
|
|
1920
|
+
userId: String(N || (/* @__PURE__ */ new Date()).getTime())
|
|
1921
|
+
}).toString()}`, vt = JSON.stringify({
|
|
1911
1922
|
flowId: "MMHQKYI1NE",
|
|
1912
1923
|
flowAliasId: "SZF9ZK1ATE",
|
|
1913
1924
|
input: {
|
|
1914
|
-
userPrompt:
|
|
1915
|
-
whom:
|
|
1925
|
+
userPrompt: E,
|
|
1926
|
+
whom: I
|
|
1916
1927
|
}
|
|
1917
|
-
}),
|
|
1928
|
+
}), K = await fetch(xt, {
|
|
1918
1929
|
signal: AbortSignal.timeout(3e4),
|
|
1919
1930
|
method: "POST",
|
|
1920
1931
|
headers: {
|
|
1921
1932
|
"Content-Type": "application/json",
|
|
1922
|
-
Authorization: `Bearer ${
|
|
1933
|
+
Authorization: `Bearer ${C}`
|
|
1923
1934
|
},
|
|
1924
|
-
body:
|
|
1935
|
+
body: vt
|
|
1925
1936
|
});
|
|
1926
|
-
if (!
|
|
1927
|
-
throw new Error(`HTTP error! status: ${
|
|
1928
|
-
if (!
|
|
1929
|
-
const
|
|
1930
|
-
let
|
|
1937
|
+
if (!K.ok)
|
|
1938
|
+
throw new Error(`HTTP error! status: ${K.status}`);
|
|
1939
|
+
if (!K.body) throw new Error("Readable stream not supported");
|
|
1940
|
+
const kt = K.body.getReader(), St = new TextDecoder();
|
|
1941
|
+
let G = "", W = "";
|
|
1931
1942
|
for (; ; ) {
|
|
1932
1943
|
P(!0);
|
|
1933
|
-
const { done:
|
|
1934
|
-
if (
|
|
1935
|
-
|
|
1936
|
-
const
|
|
1944
|
+
const { done: tt, value: et } = await kt.read();
|
|
1945
|
+
if (tt) break;
|
|
1946
|
+
G += St.decode(et, { stream: !0 });
|
|
1947
|
+
const at = G.split(`
|
|
1937
1948
|
`);
|
|
1938
|
-
|
|
1939
|
-
for (const
|
|
1940
|
-
if (
|
|
1941
|
-
const
|
|
1949
|
+
G = at.pop() || "";
|
|
1950
|
+
for (const y of at)
|
|
1951
|
+
if (y.startsWith("data:")) {
|
|
1952
|
+
const Q = y.slice(5).trim();
|
|
1942
1953
|
try {
|
|
1943
|
-
const A = JSON.parse(
|
|
1944
|
-
A.index == 1 && (
|
|
1945
|
-
(
|
|
1946
|
-
(
|
|
1947
|
-
...
|
|
1954
|
+
const A = JSON.parse(Q);
|
|
1955
|
+
A.index == 1 && (W = A.data), O(
|
|
1956
|
+
(q) => q.map(
|
|
1957
|
+
(it, Bt) => Bt === q.length - 1 ? {
|
|
1958
|
+
...it,
|
|
1948
1959
|
[A.index == 0 ? "response" : A.index == 1 ? "keywords" : A.index == 2 ? "potentialQuestions" : "end"]: A.data
|
|
1949
|
-
} :
|
|
1960
|
+
} : it
|
|
1950
1961
|
)
|
|
1951
1962
|
);
|
|
1952
1963
|
} catch (A) {
|
|
@@ -1954,189 +1965,189 @@ const Fe = (e) => {
|
|
|
1954
1965
|
}
|
|
1955
1966
|
}
|
|
1956
1967
|
}
|
|
1957
|
-
|
|
1958
|
-
} catch (
|
|
1959
|
-
console.error("Error sending message to Tanya:",
|
|
1968
|
+
ot(bt(W));
|
|
1969
|
+
} catch (I) {
|
|
1970
|
+
console.error("Error sending message to Tanya:", I);
|
|
1960
1971
|
} finally {
|
|
1961
1972
|
v(!1);
|
|
1962
1973
|
}
|
|
1963
1974
|
}
|
|
1964
|
-
},
|
|
1965
|
-
const
|
|
1975
|
+
}, bt = (d) => {
|
|
1976
|
+
const E = d.match(
|
|
1966
1977
|
/top five relevant product or category names are: (.*)/i
|
|
1967
|
-
), x = (
|
|
1978
|
+
), x = (E ? E[1] : d).split(", ").map((R) => R.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
|
|
1968
1979
|
return [...new Set(x)].filter(Boolean).join(",");
|
|
1969
|
-
},
|
|
1970
|
-
if (console.log(i == null ? void 0 : i.access_token, "access_token"), typeof
|
|
1971
|
-
console.log(
|
|
1972
|
-
const
|
|
1973
|
-
for (const
|
|
1974
|
-
const
|
|
1975
|
-
|
|
1980
|
+
}, ot = async (d) => {
|
|
1981
|
+
if (console.log(i == null ? void 0 : i.access_token, "access_token"), typeof d == "string") {
|
|
1982
|
+
console.log(d, "keywords");
|
|
1983
|
+
const E = d.split(",");
|
|
1984
|
+
for (const I of E) {
|
|
1985
|
+
const N = await ze(
|
|
1986
|
+
I,
|
|
1976
1987
|
i == null ? void 0 : i.access_token
|
|
1977
1988
|
);
|
|
1978
|
-
if (P(!1), (
|
|
1989
|
+
if (P(!1), (N == null ? void 0 : N.length) > 0 && (O(
|
|
1979
1990
|
(x) => x.map(
|
|
1980
|
-
(
|
|
1981
|
-
...
|
|
1991
|
+
(C, R) => R === x.length - 1 ? {
|
|
1992
|
+
...C,
|
|
1982
1993
|
products: [
|
|
1983
|
-
...
|
|
1984
|
-
{ keyword:
|
|
1994
|
+
...C.products || [],
|
|
1995
|
+
{ keyword: I, items: N, loading: !1 }
|
|
1985
1996
|
]
|
|
1986
|
-
} :
|
|
1997
|
+
} : C
|
|
1987
1998
|
)
|
|
1988
|
-
), !
|
|
1989
|
-
const x =
|
|
1990
|
-
|
|
1991
|
-
const
|
|
1992
|
-
|
|
1999
|
+
), !r.current || n.current == null)) {
|
|
2000
|
+
const x = N[0];
|
|
2001
|
+
r.current = String((x == null ? void 0 : x.product_name) ?? ""), o.current = x.image.link, n.current = x.product_id;
|
|
2002
|
+
const C = typeof (x == null ? void 0 : x.price) == "number" ? x.price : void 0;
|
|
2003
|
+
a.current = typeof C == "number" && Number.isFinite(C) ? C : null;
|
|
1993
2004
|
}
|
|
1994
2005
|
}
|
|
1995
2006
|
} else
|
|
1996
|
-
for (const
|
|
1997
|
-
const
|
|
1998
|
-
|
|
2007
|
+
for (const E of d) {
|
|
2008
|
+
const I = await ze(
|
|
2009
|
+
E,
|
|
1999
2010
|
i == null ? void 0 : i.access_token
|
|
2000
2011
|
);
|
|
2001
|
-
P(!1), (
|
|
2002
|
-
(
|
|
2003
|
-
(x,
|
|
2012
|
+
P(!1), (I == null ? void 0 : I.length) > 0 && O(
|
|
2013
|
+
(N) => N.map(
|
|
2014
|
+
(x, C) => C === N.length - 1 ? {
|
|
2004
2015
|
...x,
|
|
2005
2016
|
products: [
|
|
2006
2017
|
...x.products || [],
|
|
2007
|
-
{ keyword:
|
|
2018
|
+
{ keyword: E, items: I, loading: !1 }
|
|
2008
2019
|
]
|
|
2009
2020
|
} : x
|
|
2010
2021
|
)
|
|
2011
2022
|
);
|
|
2012
2023
|
}
|
|
2013
|
-
if (
|
|
2024
|
+
if (r.current) {
|
|
2014
2025
|
O(
|
|
2015
|
-
(
|
|
2016
|
-
(
|
|
2017
|
-
...
|
|
2026
|
+
(I) => I.map(
|
|
2027
|
+
(N, x) => x === I.length - 1 ? {
|
|
2028
|
+
...N,
|
|
2018
2029
|
productSnapshot: {
|
|
2019
|
-
id:
|
|
2020
|
-
name:
|
|
2030
|
+
id: n.current,
|
|
2031
|
+
name: r.current,
|
|
2021
2032
|
image: o.current,
|
|
2022
|
-
price:
|
|
2033
|
+
price: a.current ?? null,
|
|
2023
2034
|
points: 0,
|
|
2024
2035
|
quantity: 1
|
|
2025
2036
|
}
|
|
2026
|
-
} :
|
|
2037
|
+
} : N
|
|
2027
2038
|
)
|
|
2028
2039
|
);
|
|
2029
|
-
const
|
|
2040
|
+
const E = JSON.parse(
|
|
2030
2041
|
sessionStorage.getItem("customerData") || "{}"
|
|
2031
2042
|
);
|
|
2032
|
-
(
|
|
2043
|
+
(E == null ? void 0 : E.isGuest) == !1 ? (console.log("running secondary flow", At), b(r.current, 0)) : console.log("not running secondary flow", At);
|
|
2033
2044
|
}
|
|
2034
2045
|
P(!1);
|
|
2035
|
-
},
|
|
2036
|
-
var
|
|
2046
|
+
}, Jr = async (d, E) => {
|
|
2047
|
+
var I, N, x, C, R, xt, vt, K, kt, St, G, W, tt, et, at;
|
|
2037
2048
|
_(!0);
|
|
2038
2049
|
try {
|
|
2039
|
-
const
|
|
2040
|
-
if (!((
|
|
2041
|
-
_(!1),
|
|
2050
|
+
const y = await kr(d.id);
|
|
2051
|
+
if (!((N = (I = y == null ? void 0 : y.variants) == null ? void 0 : I[0]) != null && N.product_id || (C = (x = y == null ? void 0 : y.variants) == null ? void 0 : x[0]) != null && C.productId) && !(y.type.item || y.type.bundle)) {
|
|
2052
|
+
_(!1), X.error("Variants not found", {
|
|
2042
2053
|
position: "bottom-right",
|
|
2043
2054
|
autoClose: 1e3
|
|
2044
2055
|
}), console.error("No product variant found");
|
|
2045
2056
|
return;
|
|
2046
2057
|
}
|
|
2047
|
-
const
|
|
2058
|
+
const Q = [
|
|
2048
2059
|
{
|
|
2049
|
-
product_id: ((R =
|
|
2050
|
-
quantity:
|
|
2060
|
+
product_id: ((R = y.variants) == null ? void 0 : R[0].product_id) || ((xt = y.variants) == null ? void 0 : xt[0].productId) || (y == null ? void 0 : y.id),
|
|
2061
|
+
quantity: E
|
|
2051
2062
|
}
|
|
2052
2063
|
];
|
|
2053
|
-
console.log(
|
|
2064
|
+
console.log(Q, "product data", "app version", At);
|
|
2054
2065
|
const A = JSON.parse(
|
|
2055
2066
|
sessionStorage.getItem("customerData") || "{}"
|
|
2056
|
-
),
|
|
2057
|
-
if (!
|
|
2058
|
-
const
|
|
2059
|
-
let { customer_token:
|
|
2060
|
-
|
|
2067
|
+
), q = A == null ? void 0 : A.basketId, it = !1, Bt = localStorage.getItem(Ut), $e = Date.now();
|
|
2068
|
+
if (!it || !Bt || $e >= parseInt(Bt)) {
|
|
2069
|
+
const Kr = await xr();
|
|
2070
|
+
let { customer_token: mt } = await vr(
|
|
2071
|
+
Kr
|
|
2061
2072
|
);
|
|
2062
|
-
if (
|
|
2073
|
+
if (mt = "Bearer " + i.access_token, !mt) {
|
|
2063
2074
|
console.error("Failed to get customer_token");
|
|
2064
2075
|
return;
|
|
2065
2076
|
}
|
|
2066
|
-
const
|
|
2067
|
-
if (
|
|
2068
|
-
const
|
|
2069
|
-
basketId:
|
|
2070
|
-
customer_token:
|
|
2077
|
+
const Gr = $e + 300 * 1e3;
|
|
2078
|
+
if (Qt(mt), localStorage.setItem(Ut, Gr.toString()), q) {
|
|
2079
|
+
const Ae = await zr({
|
|
2080
|
+
basketId: q,
|
|
2081
|
+
customer_token: mt
|
|
2071
2082
|
});
|
|
2072
|
-
if (
|
|
2073
|
-
const
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2083
|
+
if (Ae.status === 200 && Ae) {
|
|
2084
|
+
const oe = await Wt(
|
|
2085
|
+
q,
|
|
2086
|
+
Q,
|
|
2087
|
+
mt
|
|
2077
2088
|
);
|
|
2078
|
-
((
|
|
2089
|
+
((vt = oe == null ? void 0 : oe.product_items) == null ? void 0 : vt.length) > 0 && (X.success("Added to cart", {
|
|
2079
2090
|
position: "bottom-right",
|
|
2080
2091
|
autoClose: 3e3,
|
|
2081
2092
|
hideProgressBar: !1,
|
|
2082
2093
|
closeOnClick: !0,
|
|
2083
2094
|
pauseOnHover: !0,
|
|
2084
2095
|
draggable: !0
|
|
2085
|
-
}),
|
|
2096
|
+
}), Ft(q), _(!1));
|
|
2086
2097
|
return;
|
|
2087
2098
|
}
|
|
2088
2099
|
}
|
|
2089
|
-
const
|
|
2100
|
+
const Wr = {
|
|
2090
2101
|
productItems: [
|
|
2091
2102
|
{
|
|
2092
|
-
productId: ((
|
|
2103
|
+
productId: ((K = y.variants) == null ? void 0 : K[0].product_id) || ((kt = y.variants) == null ? void 0 : kt[0].productId) || (y == null ? void 0 : y.id),
|
|
2093
2104
|
quantity: 1
|
|
2094
2105
|
}
|
|
2095
2106
|
]
|
|
2096
|
-
},
|
|
2107
|
+
}, F = await Lr(mt, Wr);
|
|
2097
2108
|
if (console.log(
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2109
|
+
F,
|
|
2110
|
+
F == null ? void 0 : F.basket_id,
|
|
2111
|
+
F == null ? void 0 : F.basketId,
|
|
2101
2112
|
"the basket response"
|
|
2102
|
-
), !(
|
|
2113
|
+
), !(F != null && F.basket_id || !(F != null && F.basketId))) {
|
|
2103
2114
|
_(!1), console.error("Failed to create basket");
|
|
2104
2115
|
return;
|
|
2105
2116
|
}
|
|
2106
|
-
|
|
2107
|
-
(
|
|
2117
|
+
Nt(
|
|
2118
|
+
(F == null ? void 0 : F.basket_id) || (F == null ? void 0 : F.basketId)
|
|
2108
2119
|
);
|
|
2109
|
-
const
|
|
2110
|
-
(
|
|
2111
|
-
|
|
2112
|
-
|
|
2120
|
+
const Ct = await Wt(
|
|
2121
|
+
(F == null ? void 0 : F.basket_id) || (F == null ? void 0 : F.basketId),
|
|
2122
|
+
Q,
|
|
2123
|
+
mt
|
|
2113
2124
|
);
|
|
2114
|
-
(((
|
|
2125
|
+
(((St = Ct == null ? void 0 : Ct.product_items) == null ? void 0 : St.length) > 0 || ((G = Ct == null ? void 0 : Ct.productItems) == null ? void 0 : G.length) > 0) && X.success("Added to cart", {
|
|
2115
2126
|
position: "bottom-right",
|
|
2116
2127
|
autoClose: 3e3,
|
|
2117
2128
|
hideProgressBar: !1,
|
|
2118
2129
|
closeOnClick: !0,
|
|
2119
2130
|
pauseOnHover: !0,
|
|
2120
2131
|
draggable: !0
|
|
2121
|
-
}),
|
|
2132
|
+
}), Ft(F.basket_id || (F == null ? void 0 : F.basketId));
|
|
2122
2133
|
}
|
|
2123
|
-
} catch (
|
|
2124
|
-
_(!1), console.error("Error adding to cart:",
|
|
2134
|
+
} catch (y) {
|
|
2135
|
+
_(!1), console.error("Error adding to cart:", y), X.error("Failed to add product to cart", {
|
|
2125
2136
|
position: "bottom-right",
|
|
2126
2137
|
autoClose: 3e3
|
|
2127
|
-
}), ((
|
|
2128
|
-
((
|
|
2138
|
+
}), ((W = y == null ? void 0 : y.response) == null ? void 0 : W.status) === 404 || // Basket not found
|
|
2139
|
+
((tt = y == null ? void 0 : y.response) == null ? void 0 : tt.status) === 401 ? (((et = y == null ? void 0 : y.response) == null ? void 0 : et.status) === 404 && Nt(null), ((at = y == null ? void 0 : y.response) == null ? void 0 : at.status) === 401 && (Nt(null), Qt(null))) : (console.error("Failed to add product to basket:", y.message), X.error("Failed to add product to cart", {
|
|
2129
2140
|
position: "bottom-right",
|
|
2130
2141
|
autoClose: 3e3
|
|
2131
2142
|
}));
|
|
2132
2143
|
} finally {
|
|
2133
|
-
|
|
2144
|
+
Ft();
|
|
2134
2145
|
}
|
|
2135
2146
|
_(!1);
|
|
2136
2147
|
};
|
|
2137
|
-
return /* @__PURE__ */ l("div", { className: "relative flex justify-center", children: /* @__PURE__ */ p(
|
|
2148
|
+
return /* @__PURE__ */ l("div", { className: "relative flex justify-center", children: /* @__PURE__ */ p(dn, { open: s, onOpenChange: u, children: [
|
|
2138
2149
|
/* @__PURE__ */ l(
|
|
2139
|
-
|
|
2150
|
+
fn,
|
|
2140
2151
|
{
|
|
2141
2152
|
onClick: () => u(!0),
|
|
2142
2153
|
style: {
|
|
@@ -2198,7 +2209,7 @@ const Fe = (e) => {
|
|
|
2198
2209
|
) })
|
|
2199
2210
|
}
|
|
2200
2211
|
),
|
|
2201
|
-
m && /* @__PURE__ */ p(
|
|
2212
|
+
m && /* @__PURE__ */ p(pe, { children: [
|
|
2202
2213
|
/* @__PURE__ */ l(
|
|
2203
2214
|
"div",
|
|
2204
2215
|
{
|
|
@@ -2214,9 +2225,9 @@ const Fe = (e) => {
|
|
|
2214
2225
|
top-0 right-0
|
|
2215
2226
|
transition-transform duration-300 ease-in-out
|
|
2216
2227
|
lg:transform
|
|
2217
|
-
${
|
|
2228
|
+
${f ? "lg:translate-x-0" : "lg:translate-x-full"}
|
|
2218
2229
|
// For mobile: animate from bottom
|
|
2219
|
-
${
|
|
2230
|
+
${f ? "translate-y-0" : "translate-y-full"}
|
|
2220
2231
|
lg:translate-y-0
|
|
2221
2232
|
`,
|
|
2222
2233
|
style: {
|
|
@@ -2233,7 +2244,7 @@ const Fe = (e) => {
|
|
|
2233
2244
|
{
|
|
2234
2245
|
style: {
|
|
2235
2246
|
display: "flex",
|
|
2236
|
-
color:
|
|
2247
|
+
color: T.tanyaThemeContrastColor,
|
|
2237
2248
|
alignItems: "center",
|
|
2238
2249
|
gap: "0.5rem"
|
|
2239
2250
|
},
|
|
@@ -2346,46 +2357,46 @@ const Fe = (e) => {
|
|
|
2346
2357
|
/* @__PURE__ */ p(
|
|
2347
2358
|
"div",
|
|
2348
2359
|
{
|
|
2349
|
-
className: `flex flex-col h-full ${
|
|
2360
|
+
className: `flex flex-col h-full ${j ? "lg:w-2/3 w-full" : "w-full"}`,
|
|
2350
2361
|
children: [
|
|
2351
2362
|
/* @__PURE__ */ p(
|
|
2352
2363
|
"div",
|
|
2353
2364
|
{
|
|
2354
|
-
ref:
|
|
2365
|
+
ref: yt,
|
|
2355
2366
|
className: "overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",
|
|
2356
2367
|
children: [
|
|
2357
|
-
(
|
|
2368
|
+
(T == null ? void 0 : T.whomRequired) && /* @__PURE__ */ p(
|
|
2358
2369
|
"div",
|
|
2359
2370
|
{
|
|
2360
2371
|
className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
|
|
2361
2372
|
children: [
|
|
2362
2373
|
/* @__PURE__ */ l("div", { className: "flex gap-2 bg-[#FFFFFF]", children: /* @__PURE__ */ l("p", { className: "font-bold font-nunitoSans text-[#494949]", children: "Is this for you or someone else?" }) }),
|
|
2363
|
-
/* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2 mt-2", children:
|
|
2374
|
+
/* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2 mt-2", children: t.map((d) => /* @__PURE__ */ l(
|
|
2364
2375
|
"button",
|
|
2365
2376
|
{
|
|
2366
|
-
onClick: () =>
|
|
2377
|
+
onClick: () => ee(d),
|
|
2367
2378
|
className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
|
|
2368
2379
|
style: {
|
|
2369
|
-
backgroundColor:
|
|
2370
|
-
borderColor:
|
|
2380
|
+
backgroundColor: S === e[d] ? "#FFFFFF" : "#F3F3F3",
|
|
2381
|
+
borderColor: S === e[d] ? "#BBB3DD" : ""
|
|
2371
2382
|
},
|
|
2372
|
-
children:
|
|
2383
|
+
children: d
|
|
2373
2384
|
},
|
|
2374
|
-
|
|
2385
|
+
d
|
|
2375
2386
|
)) })
|
|
2376
2387
|
]
|
|
2377
2388
|
}
|
|
2378
2389
|
),
|
|
2379
|
-
V.map((
|
|
2380
|
-
var
|
|
2390
|
+
V.map((d, E) => {
|
|
2391
|
+
var I, N;
|
|
2381
2392
|
return /* @__PURE__ */ p("div", { children: [
|
|
2382
|
-
/* @__PURE__ */ l("div", { className: "flex justify-end", children: /* @__PURE__ */ l("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:
|
|
2383
|
-
|
|
2393
|
+
/* @__PURE__ */ l("div", { className: "flex justify-end", children: /* @__PURE__ */ l("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: d.query }) }),
|
|
2394
|
+
d.response && d.response.includes("Thinking") ? /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
|
|
2384
2395
|
"div",
|
|
2385
2396
|
{
|
|
2386
2397
|
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",
|
|
2387
2398
|
dangerouslySetInnerHTML: {
|
|
2388
|
-
__html:
|
|
2399
|
+
__html: ae(d.response)
|
|
2389
2400
|
}
|
|
2390
2401
|
}
|
|
2391
2402
|
) }) : /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
|
|
@@ -2393,41 +2404,41 @@ const Fe = (e) => {
|
|
|
2393
2404
|
{
|
|
2394
2405
|
className: "font-nunitoSans font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
|
|
2395
2406
|
dangerouslySetInnerHTML: {
|
|
2396
|
-
__html:
|
|
2407
|
+
__html: ae(d.response)
|
|
2397
2408
|
}
|
|
2398
2409
|
}
|
|
2399
2410
|
) }),
|
|
2400
|
-
B && !
|
|
2401
|
-
(
|
|
2402
|
-
|
|
2411
|
+
B && !d.response.includes("Thinking") && ((I = d.products) == null ? void 0 : I.length) == 0 && /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("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" }) }),
|
|
2412
|
+
(d == null ? void 0 : d.products) && ((N = d == null ? void 0 : d.products) == null ? void 0 : N.length) > 0 && /* @__PURE__ */ l(
|
|
2413
|
+
xo,
|
|
2403
2414
|
{
|
|
2404
|
-
chat:
|
|
2405
|
-
storeDetails:
|
|
2415
|
+
chat: d.products,
|
|
2416
|
+
storeDetails: T
|
|
2406
2417
|
}
|
|
2407
2418
|
),
|
|
2408
|
-
|
|
2419
|
+
d.potentialQuestions.length > 0 && /* @__PURE__ */ p("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
|
|
2409
2420
|
/* @__PURE__ */ l(
|
|
2410
2421
|
"p",
|
|
2411
2422
|
{
|
|
2412
2423
|
className: "font-nunitoSans font-bold text-sm text-[#494949]",
|
|
2413
|
-
style: { color:
|
|
2424
|
+
style: { color: T.themeDarkColor },
|
|
2414
2425
|
children: "Why not explore these inquiries..."
|
|
2415
2426
|
}
|
|
2416
2427
|
),
|
|
2417
|
-
|
|
2428
|
+
d.potentialQuestions.split(",").map((x, C) => /* @__PURE__ */ l(
|
|
2418
2429
|
"button",
|
|
2419
2430
|
{
|
|
2420
|
-
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${
|
|
2421
|
-
onClick: () =>
|
|
2431
|
+
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${T.themeDarkColor} m-1 rounded-xl px-2 py-1`,
|
|
2432
|
+
onClick: () => J(x),
|
|
2422
2433
|
style: {
|
|
2423
|
-
backgroundColor:
|
|
2434
|
+
backgroundColor: T.tanyaThemeColorLight
|
|
2424
2435
|
},
|
|
2425
2436
|
children: x
|
|
2426
2437
|
},
|
|
2427
|
-
|
|
2438
|
+
C
|
|
2428
2439
|
))
|
|
2429
2440
|
] }),
|
|
2430
|
-
|
|
2441
|
+
d.secondaryLoading && /* @__PURE__ */ l("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ p(
|
|
2431
2442
|
"div",
|
|
2432
2443
|
{
|
|
2433
2444
|
className: "tanya-surprise-wrapper bg-indigo-300 text-sm px-7 py-4 rounded-r-xl rounded-bl-2xl w-full relative overflow-hidden",
|
|
@@ -2445,7 +2456,7 @@ const Fe = (e) => {
|
|
|
2445
2456
|
"p",
|
|
2446
2457
|
{
|
|
2447
2458
|
className: "font-semibold tanya-pulse",
|
|
2448
|
-
style: { color:
|
|
2459
|
+
style: { color: T.themeDarkColor },
|
|
2449
2460
|
children: "I’ve found a special surprise crafted just for you… hang on a sec!"
|
|
2450
2461
|
}
|
|
2451
2462
|
),
|
|
@@ -2453,35 +2464,35 @@ const Fe = (e) => {
|
|
|
2453
2464
|
"p",
|
|
2454
2465
|
{
|
|
2455
2466
|
className: "tanya-dots mt-1",
|
|
2456
|
-
style: { color:
|
|
2467
|
+
style: { color: T.themeDarkColor },
|
|
2457
2468
|
children: "• • •"
|
|
2458
2469
|
}
|
|
2459
2470
|
)
|
|
2460
2471
|
]
|
|
2461
2472
|
}
|
|
2462
2473
|
) }),
|
|
2463
|
-
|
|
2474
|
+
d.secondaryResponse && /* @__PURE__ */ l(pe, { children: /* @__PURE__ */ p("div", { className: "mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]", children: [
|
|
2464
2475
|
/* @__PURE__ */ l(
|
|
2465
2476
|
"div",
|
|
2466
2477
|
{
|
|
2467
2478
|
className: "text-sm text-[#232323] bg-[#FFFFFF] px-7 py-4 rounded-br-xl rounded-bl-2xl w-full",
|
|
2468
2479
|
style: {
|
|
2469
|
-
backgroundColor:
|
|
2480
|
+
backgroundColor: T.tanyaThemeColorLight
|
|
2470
2481
|
},
|
|
2471
2482
|
dangerouslySetInnerHTML: {
|
|
2472
|
-
__html:
|
|
2473
|
-
|
|
2483
|
+
__html: ae(
|
|
2484
|
+
d.secondaryResponse
|
|
2474
2485
|
)
|
|
2475
2486
|
}
|
|
2476
2487
|
}
|
|
2477
2488
|
),
|
|
2478
|
-
|
|
2489
|
+
d.productSnapshot && // chat.productSnapshot.points > 0 &&
|
|
2479
2490
|
/* @__PURE__ */ l("div", { className: "mt-4 w-full", children: /* @__PURE__ */ p(
|
|
2480
2491
|
"div",
|
|
2481
2492
|
{
|
|
2482
2493
|
className: "flex gap-4 items-stretch rounded-2xl p-4",
|
|
2483
2494
|
style: {
|
|
2484
|
-
backgroundColor:
|
|
2495
|
+
backgroundColor: T.tanyaThemeColorLight
|
|
2485
2496
|
},
|
|
2486
2497
|
children: [
|
|
2487
2498
|
/* @__PURE__ */ l(
|
|
@@ -2493,11 +2504,11 @@ const Fe = (e) => {
|
|
|
2493
2504
|
height: 112,
|
|
2494
2505
|
borderColor: "#eee"
|
|
2495
2506
|
},
|
|
2496
|
-
children:
|
|
2507
|
+
children: d.productSnapshot.image ? /* @__PURE__ */ l(
|
|
2497
2508
|
"img",
|
|
2498
2509
|
{
|
|
2499
|
-
src:
|
|
2500
|
-
alt:
|
|
2510
|
+
src: d.productSnapshot.image,
|
|
2511
|
+
alt: d.productSnapshot.name,
|
|
2501
2512
|
className: "w-full h-full object-cover"
|
|
2502
2513
|
}
|
|
2503
2514
|
) : /* @__PURE__ */ l("div", { className: "w-full h-full flex items-center justify-center text-xs text-gray-500", children: "No Image" })
|
|
@@ -2505,18 +2516,18 @@ const Fe = (e) => {
|
|
|
2505
2516
|
),
|
|
2506
2517
|
/* @__PURE__ */ p("div", { className: "flex flex-col flex-1 justify-between", children: [
|
|
2507
2518
|
/* @__PURE__ */ p("div", { children: [
|
|
2508
|
-
/* @__PURE__ */ l("p", { className: "font-semibold text-[15px] leading-snug", children:
|
|
2509
|
-
/* @__PURE__ */ l("p", { className: "mt-1 text-[14px] font-medium", children:
|
|
2519
|
+
/* @__PURE__ */ l("p", { className: "font-semibold text-[15px] leading-snug", children: d.productSnapshot.name }),
|
|
2520
|
+
/* @__PURE__ */ l("p", { className: "mt-1 text-[14px] font-medium", children: d.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
|
|
2510
2521
|
style: "currency",
|
|
2511
|
-
currency: (
|
|
2522
|
+
currency: (T == null ? void 0 : T.currency) || "USD"
|
|
2512
2523
|
}).format(
|
|
2513
|
-
|
|
2524
|
+
d.productSnapshot.price
|
|
2514
2525
|
) : "" }),
|
|
2515
|
-
|
|
2526
|
+
d.productSnapshot.points > 0 && /* @__PURE__ */ p("p", { className: "mt-1 text-xs opacity-80", children: [
|
|
2516
2527
|
"You will earn",
|
|
2517
2528
|
" ",
|
|
2518
2529
|
/* @__PURE__ */ p("strong", { children: [
|
|
2519
|
-
|
|
2530
|
+
d.productSnapshot.points,
|
|
2520
2531
|
" ",
|
|
2521
2532
|
"points"
|
|
2522
2533
|
] })
|
|
@@ -2530,44 +2541,44 @@ const Fe = (e) => {
|
|
|
2530
2541
|
className: "px-3 py-1 text-sm",
|
|
2531
2542
|
onClick: () => O(
|
|
2532
2543
|
(x) => x.map(
|
|
2533
|
-
(
|
|
2534
|
-
...
|
|
2544
|
+
(C, R) => R === E && C.productSnapshot ? {
|
|
2545
|
+
...C,
|
|
2535
2546
|
productSnapshot: {
|
|
2536
|
-
...
|
|
2547
|
+
...C.productSnapshot,
|
|
2537
2548
|
quantity: Math.max(
|
|
2538
2549
|
1,
|
|
2539
|
-
|
|
2550
|
+
C.productSnapshot.quantity - 1
|
|
2540
2551
|
)
|
|
2541
2552
|
}
|
|
2542
|
-
} :
|
|
2553
|
+
} : C
|
|
2543
2554
|
)
|
|
2544
2555
|
),
|
|
2545
2556
|
style: {
|
|
2546
2557
|
background: "transparent",
|
|
2547
|
-
color:
|
|
2558
|
+
color: T.themeDarkColor
|
|
2548
2559
|
},
|
|
2549
2560
|
children: "−"
|
|
2550
2561
|
}
|
|
2551
2562
|
),
|
|
2552
|
-
/* @__PURE__ */ l("div", { className: "px-3 py-1 text-sm select-none", children:
|
|
2563
|
+
/* @__PURE__ */ l("div", { className: "px-3 py-1 text-sm select-none", children: d.productSnapshot.quantity }),
|
|
2553
2564
|
/* @__PURE__ */ l(
|
|
2554
2565
|
"button",
|
|
2555
2566
|
{
|
|
2556
2567
|
className: "px-3 py-1 text-sm",
|
|
2557
2568
|
onClick: () => O(
|
|
2558
2569
|
(x) => x.map(
|
|
2559
|
-
(
|
|
2560
|
-
...
|
|
2570
|
+
(C, R) => R === E && C.productSnapshot ? {
|
|
2571
|
+
...C,
|
|
2561
2572
|
productSnapshot: {
|
|
2562
|
-
...
|
|
2563
|
-
quantity:
|
|
2573
|
+
...C.productSnapshot,
|
|
2574
|
+
quantity: C.productSnapshot.quantity + 1
|
|
2564
2575
|
}
|
|
2565
|
-
} :
|
|
2576
|
+
} : C
|
|
2566
2577
|
)
|
|
2567
2578
|
),
|
|
2568
2579
|
style: {
|
|
2569
2580
|
background: "transparent",
|
|
2570
|
-
color:
|
|
2581
|
+
color: T.themeDarkColor
|
|
2571
2582
|
},
|
|
2572
2583
|
children: "+"
|
|
2573
2584
|
}
|
|
@@ -2577,21 +2588,21 @@ const Fe = (e) => {
|
|
|
2577
2588
|
"button",
|
|
2578
2589
|
{
|
|
2579
2590
|
onClick: () => {
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2591
|
+
Jr(
|
|
2592
|
+
H(
|
|
2593
|
+
d.productSnapshot
|
|
2583
2594
|
),
|
|
2584
|
-
|
|
2595
|
+
d.productSnapshot.quantity
|
|
2585
2596
|
);
|
|
2586
2597
|
},
|
|
2587
|
-
disabled:
|
|
2598
|
+
disabled: k,
|
|
2588
2599
|
className: "px-4 py-2 rounded-full font-medium",
|
|
2589
2600
|
style: {
|
|
2590
|
-
background:
|
|
2591
|
-
color: (
|
|
2592
|
-
opacity:
|
|
2601
|
+
background: T.tanyaThemeColor,
|
|
2602
|
+
color: (T == null ? void 0 : T.tanyaThemeContrastColor) || "#fff",
|
|
2603
|
+
opacity: k ? 0.8 : 1
|
|
2593
2604
|
},
|
|
2594
|
-
children:
|
|
2605
|
+
children: k ? "Adding..." : "Add to cart"
|
|
2595
2606
|
}
|
|
2596
2607
|
)
|
|
2597
2608
|
] })
|
|
@@ -2601,7 +2612,7 @@ const Fe = (e) => {
|
|
|
2601
2612
|
) })
|
|
2602
2613
|
] }) }),
|
|
2603
2614
|
/* @__PURE__ */ l("div", { className: "mb-20" })
|
|
2604
|
-
] },
|
|
2615
|
+
] }, E);
|
|
2605
2616
|
})
|
|
2606
2617
|
]
|
|
2607
2618
|
}
|
|
@@ -2619,11 +2630,11 @@ const Fe = (e) => {
|
|
|
2619
2630
|
{
|
|
2620
2631
|
className: "flex-1 bg-[#FFFFFF] text-[#232323] outline-none border-none px-2 py-2 text-sm",
|
|
2621
2632
|
placeholder: "How can I help you...",
|
|
2622
|
-
value:
|
|
2633
|
+
value: $,
|
|
2623
2634
|
autoFocus: !0,
|
|
2624
|
-
onChange: (
|
|
2625
|
-
onKeyDown: (
|
|
2626
|
-
|
|
2635
|
+
onChange: (d) => Z(d.target.value),
|
|
2636
|
+
onKeyDown: (d) => {
|
|
2637
|
+
d.key === "Enter" && !w && J();
|
|
2627
2638
|
}
|
|
2628
2639
|
}
|
|
2629
2640
|
),
|
|
@@ -2631,16 +2642,16 @@ const Fe = (e) => {
|
|
|
2631
2642
|
"button",
|
|
2632
2643
|
{
|
|
2633
2644
|
type: "submit",
|
|
2634
|
-
disabled:
|
|
2645
|
+
disabled: w,
|
|
2635
2646
|
className: "p-3",
|
|
2636
|
-
onClick: () =>
|
|
2637
|
-
children:
|
|
2647
|
+
onClick: () => J(),
|
|
2648
|
+
children: w ? /* @__PURE__ */ l(
|
|
2638
2649
|
"div",
|
|
2639
2650
|
{
|
|
2640
2651
|
className: "p-3 animate-spin rounded-full h-3 w-3 border-b-2",
|
|
2641
2652
|
style: {
|
|
2642
2653
|
borderBottom: "2px solid",
|
|
2643
|
-
color:
|
|
2654
|
+
color: T.tanyaThemeColor
|
|
2644
2655
|
}
|
|
2645
2656
|
}
|
|
2646
2657
|
) : /* @__PURE__ */ l(
|
|
@@ -2668,7 +2679,7 @@ const Fe = (e) => {
|
|
|
2668
2679
|
]
|
|
2669
2680
|
}
|
|
2670
2681
|
),
|
|
2671
|
-
/* @__PURE__ */ l(
|
|
2682
|
+
/* @__PURE__ */ l(ko, {})
|
|
2672
2683
|
] })
|
|
2673
2684
|
]
|
|
2674
2685
|
}
|
|
@@ -2676,83 +2687,83 @@ const Fe = (e) => {
|
|
|
2676
2687
|
] })
|
|
2677
2688
|
] }) });
|
|
2678
2689
|
};
|
|
2679
|
-
var
|
|
2680
|
-
return
|
|
2681
|
-
|
|
2682
|
-
} || function(
|
|
2683
|
-
for (var o in
|
|
2684
|
-
},
|
|
2690
|
+
var be = function(t, e) {
|
|
2691
|
+
return be = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
|
|
2692
|
+
r.__proto__ = n;
|
|
2693
|
+
} || function(r, n) {
|
|
2694
|
+
for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (r[o] = n[o]);
|
|
2695
|
+
}, be(t, e);
|
|
2685
2696
|
};
|
|
2686
|
-
function
|
|
2687
|
-
if (typeof
|
|
2688
|
-
throw new TypeError("Class extends value " + String(
|
|
2689
|
-
|
|
2690
|
-
function
|
|
2691
|
-
this.constructor =
|
|
2697
|
+
function Co(t, e) {
|
|
2698
|
+
if (typeof e != "function" && e !== null)
|
|
2699
|
+
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
2700
|
+
be(t, e);
|
|
2701
|
+
function r() {
|
|
2702
|
+
this.constructor = t;
|
|
2692
2703
|
}
|
|
2693
|
-
|
|
2704
|
+
t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
|
|
2694
2705
|
}
|
|
2695
|
-
var
|
|
2696
|
-
return
|
|
2697
|
-
for (var
|
|
2698
|
-
|
|
2699
|
-
for (var
|
|
2706
|
+
var st = function() {
|
|
2707
|
+
return st = Object.assign || function(e) {
|
|
2708
|
+
for (var r, n = 1, o = arguments.length; n < o; n++) {
|
|
2709
|
+
r = arguments[n];
|
|
2710
|
+
for (var a in r) Object.prototype.hasOwnProperty.call(r, a) && (e[a] = r[a]);
|
|
2700
2711
|
}
|
|
2701
|
-
return
|
|
2702
|
-
},
|
|
2712
|
+
return e;
|
|
2713
|
+
}, st.apply(this, arguments);
|
|
2703
2714
|
};
|
|
2704
|
-
function Io(
|
|
2705
|
-
var
|
|
2706
|
-
for (var
|
|
2707
|
-
if (
|
|
2708
|
-
for (var o = 0,
|
|
2709
|
-
|
|
2710
|
-
return
|
|
2715
|
+
function Io(t, e) {
|
|
2716
|
+
var r = {};
|
|
2717
|
+
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
|
|
2718
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
2719
|
+
for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
|
|
2720
|
+
e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (r[n[o]] = t[n[o]]);
|
|
2721
|
+
return r;
|
|
2711
2722
|
}
|
|
2712
|
-
var
|
|
2713
|
-
return
|
|
2714
|
-
} :
|
|
2723
|
+
var ce = "Invariant Violation", nr = Object.setPrototypeOf, _o = nr === void 0 ? function(t, e) {
|
|
2724
|
+
return t.__proto__ = e, t;
|
|
2725
|
+
} : nr, Dr = (
|
|
2715
2726
|
/** @class */
|
|
2716
|
-
(function(
|
|
2717
|
-
|
|
2718
|
-
function
|
|
2719
|
-
|
|
2720
|
-
var
|
|
2721
|
-
return
|
|
2727
|
+
(function(t) {
|
|
2728
|
+
Co(e, t);
|
|
2729
|
+
function e(r) {
|
|
2730
|
+
r === void 0 && (r = ce);
|
|
2731
|
+
var n = t.call(this, typeof r == "number" ? ce + ": " + r + " (see https://github.com/apollographql/invariant-packages)" : r) || this;
|
|
2732
|
+
return n.framesToPop = 1, n.name = ce, _o(n, e.prototype), n;
|
|
2722
2733
|
}
|
|
2723
|
-
return
|
|
2734
|
+
return e;
|
|
2724
2735
|
})(Error)
|
|
2725
2736
|
);
|
|
2726
|
-
function
|
|
2727
|
-
if (!
|
|
2728
|
-
throw new
|
|
2737
|
+
function gt(t, e) {
|
|
2738
|
+
if (!t)
|
|
2739
|
+
throw new Dr(e);
|
|
2729
2740
|
}
|
|
2730
|
-
var
|
|
2731
|
-
function
|
|
2741
|
+
var Mr = ["debug", "log", "warn", "error", "silent"], Fo = Mr.indexOf("log");
|
|
2742
|
+
function qt(t) {
|
|
2732
2743
|
return function() {
|
|
2733
|
-
if (
|
|
2734
|
-
var
|
|
2735
|
-
return
|
|
2744
|
+
if (Mr.indexOf(t) >= Fo) {
|
|
2745
|
+
var e = console[t] || console.log;
|
|
2746
|
+
return e.apply(console, arguments);
|
|
2736
2747
|
}
|
|
2737
2748
|
};
|
|
2738
2749
|
}
|
|
2739
|
-
(function(
|
|
2740
|
-
|
|
2741
|
-
})(
|
|
2742
|
-
var
|
|
2743
|
-
function
|
|
2750
|
+
(function(t) {
|
|
2751
|
+
t.debug = qt("debug"), t.log = qt("log"), t.warn = qt("warn"), t.error = qt("error");
|
|
2752
|
+
})(gt || (gt = {}));
|
|
2753
|
+
var Ur = "3.14.0";
|
|
2754
|
+
function It(t) {
|
|
2744
2755
|
try {
|
|
2745
|
-
return
|
|
2756
|
+
return t();
|
|
2746
2757
|
} catch {
|
|
2747
2758
|
}
|
|
2748
2759
|
}
|
|
2749
|
-
const
|
|
2760
|
+
const xe = It(function() {
|
|
2750
2761
|
return globalThis;
|
|
2751
|
-
}) ||
|
|
2762
|
+
}) || It(function() {
|
|
2752
2763
|
return window;
|
|
2753
|
-
}) ||
|
|
2764
|
+
}) || It(function() {
|
|
2754
2765
|
return self;
|
|
2755
|
-
}) ||
|
|
2766
|
+
}) || It(function() {
|
|
2756
2767
|
return global;
|
|
2757
2768
|
}) || // We don't expect the Function constructor ever to be invoked at runtime, as
|
|
2758
2769
|
// long as at least one of globalThis, window, self, or global is defined, so
|
|
@@ -2760,161 +2771,161 @@ const xt = Ce(function() {
|
|
|
2760
2771
|
// detect syntactic usage of the Function constructor. If you think you can
|
|
2761
2772
|
// improve your static analysis to detect this obfuscation, think again. This
|
|
2762
2773
|
// is an arms race you cannot win, at least not in JavaScript.
|
|
2763
|
-
|
|
2764
|
-
return
|
|
2774
|
+
It(function() {
|
|
2775
|
+
return It.constructor("return this")();
|
|
2765
2776
|
});
|
|
2766
|
-
var
|
|
2767
|
-
function No(
|
|
2768
|
-
var
|
|
2769
|
-
return
|
|
2770
|
-
}
|
|
2771
|
-
function
|
|
2772
|
-
var
|
|
2773
|
-
return JSON.stringify(
|
|
2774
|
-
return o === void 0 ?
|
|
2775
|
-
},
|
|
2776
|
-
}
|
|
2777
|
-
function
|
|
2778
|
-
return function(
|
|
2779
|
-
for (var
|
|
2780
|
-
n
|
|
2781
|
-
if (typeof
|
|
2782
|
-
var o =
|
|
2783
|
-
|
|
2777
|
+
var or = /* @__PURE__ */ new Map();
|
|
2778
|
+
function No(t) {
|
|
2779
|
+
var e = or.get(t) || 1;
|
|
2780
|
+
return or.set(t, e + 1), "".concat(t, ":").concat(e, ":").concat(Math.random().toString(36).slice(2));
|
|
2781
|
+
}
|
|
2782
|
+
function Eo(t, e) {
|
|
2783
|
+
var r = No("stringifyForDisplay");
|
|
2784
|
+
return JSON.stringify(t, function(n, o) {
|
|
2785
|
+
return o === void 0 ? r : o;
|
|
2786
|
+
}, e).split(JSON.stringify(r)).join("<undefined>");
|
|
2787
|
+
}
|
|
2788
|
+
function Rt(t) {
|
|
2789
|
+
return function(e) {
|
|
2790
|
+
for (var r = [], n = 1; n < arguments.length; n++)
|
|
2791
|
+
r[n - 1] = arguments[n];
|
|
2792
|
+
if (typeof e == "number") {
|
|
2793
|
+
var o = e;
|
|
2794
|
+
e = Fe(o), e || (e = Ne(o, r), r = []);
|
|
2784
2795
|
}
|
|
2785
|
-
|
|
2796
|
+
t.apply(void 0, [e].concat(r));
|
|
2786
2797
|
};
|
|
2787
2798
|
}
|
|
2788
|
-
var
|
|
2789
|
-
for (var
|
|
2790
|
-
|
|
2791
|
-
|
|
2799
|
+
var le = Object.assign(function(e, r) {
|
|
2800
|
+
for (var n = [], o = 2; o < arguments.length; o++)
|
|
2801
|
+
n[o - 2] = arguments[o];
|
|
2802
|
+
e || gt(e, Fe(r, n) || Ne(r, n));
|
|
2792
2803
|
}, {
|
|
2793
|
-
debug:
|
|
2794
|
-
log:
|
|
2795
|
-
warn:
|
|
2796
|
-
error:
|
|
2804
|
+
debug: Rt(gt.debug),
|
|
2805
|
+
log: Rt(gt.log),
|
|
2806
|
+
warn: Rt(gt.warn),
|
|
2807
|
+
error: Rt(gt.error)
|
|
2797
2808
|
});
|
|
2798
|
-
function
|
|
2799
|
-
for (var
|
|
2800
|
-
|
|
2801
|
-
return new
|
|
2802
|
-
}
|
|
2803
|
-
var
|
|
2804
|
-
function
|
|
2805
|
-
if (typeof
|
|
2806
|
-
return
|
|
2809
|
+
function Br(t) {
|
|
2810
|
+
for (var e = [], r = 1; r < arguments.length; r++)
|
|
2811
|
+
e[r - 1] = arguments[r];
|
|
2812
|
+
return new Dr(Fe(t, e) || Ne(t, e));
|
|
2813
|
+
}
|
|
2814
|
+
var ar = Symbol.for("ApolloErrorMessageHandler_" + Ur);
|
|
2815
|
+
function qr(t) {
|
|
2816
|
+
if (typeof t == "string")
|
|
2817
|
+
return t;
|
|
2807
2818
|
try {
|
|
2808
|
-
return
|
|
2819
|
+
return Eo(t, 2).slice(0, 1e3);
|
|
2809
2820
|
} catch {
|
|
2810
2821
|
return "<non-serializable>";
|
|
2811
2822
|
}
|
|
2812
2823
|
}
|
|
2813
|
-
function
|
|
2814
|
-
if (
|
|
2815
|
-
return
|
|
2824
|
+
function Fe(t, e) {
|
|
2825
|
+
if (e === void 0 && (e = []), !!t)
|
|
2826
|
+
return xe[ar] && xe[ar](t, e.map(qr));
|
|
2816
2827
|
}
|
|
2817
|
-
function
|
|
2818
|
-
if (
|
|
2828
|
+
function Ne(t, e) {
|
|
2829
|
+
if (e === void 0 && (e = []), !!t)
|
|
2819
2830
|
return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
|
|
2820
|
-
version:
|
|
2821
|
-
message:
|
|
2822
|
-
args:
|
|
2831
|
+
version: Ur,
|
|
2832
|
+
message: t,
|
|
2833
|
+
args: e.map(qr)
|
|
2823
2834
|
})));
|
|
2824
2835
|
}
|
|
2825
|
-
function To(
|
|
2826
|
-
return
|
|
2827
|
-
return
|
|
2828
|
-
}).map(function(
|
|
2829
|
-
return
|
|
2836
|
+
function To(t) {
|
|
2837
|
+
return t.definitions.filter(function(e) {
|
|
2838
|
+
return e.kind === "OperationDefinition" && !!e.name;
|
|
2839
|
+
}).map(function(e) {
|
|
2840
|
+
return e.name.value;
|
|
2830
2841
|
})[0] || null;
|
|
2831
2842
|
}
|
|
2832
|
-
let
|
|
2833
|
-
const
|
|
2834
|
-
let
|
|
2835
|
-
const
|
|
2843
|
+
let z = null;
|
|
2844
|
+
const ir = {};
|
|
2845
|
+
let Po = 1;
|
|
2846
|
+
const Oo = () => class {
|
|
2836
2847
|
constructor() {
|
|
2837
2848
|
this.id = [
|
|
2838
2849
|
"slot",
|
|
2839
|
-
|
|
2850
|
+
Po++,
|
|
2840
2851
|
Date.now(),
|
|
2841
2852
|
Math.random().toString(36).slice(2)
|
|
2842
2853
|
].join(":");
|
|
2843
2854
|
}
|
|
2844
2855
|
hasValue() {
|
|
2845
|
-
for (let
|
|
2846
|
-
if (this.id in
|
|
2847
|
-
const
|
|
2848
|
-
if (
|
|
2856
|
+
for (let e = z; e; e = e.parent)
|
|
2857
|
+
if (this.id in e.slots) {
|
|
2858
|
+
const r = e.slots[this.id];
|
|
2859
|
+
if (r === ir)
|
|
2849
2860
|
break;
|
|
2850
|
-
return
|
|
2861
|
+
return e !== z && (z.slots[this.id] = r), !0;
|
|
2851
2862
|
}
|
|
2852
|
-
return
|
|
2863
|
+
return z && (z.slots[this.id] = ir), !1;
|
|
2853
2864
|
}
|
|
2854
2865
|
getValue() {
|
|
2855
2866
|
if (this.hasValue())
|
|
2856
|
-
return
|
|
2867
|
+
return z.slots[this.id];
|
|
2857
2868
|
}
|
|
2858
|
-
withValue(
|
|
2859
|
-
const
|
|
2869
|
+
withValue(e, r, n, o) {
|
|
2870
|
+
const a = {
|
|
2860
2871
|
__proto__: null,
|
|
2861
|
-
[this.id]:
|
|
2862
|
-
}, i =
|
|
2863
|
-
|
|
2872
|
+
[this.id]: e
|
|
2873
|
+
}, i = z;
|
|
2874
|
+
z = { parent: i, slots: a };
|
|
2864
2875
|
try {
|
|
2865
|
-
return
|
|
2876
|
+
return r.apply(o, n);
|
|
2866
2877
|
} finally {
|
|
2867
|
-
|
|
2878
|
+
z = i;
|
|
2868
2879
|
}
|
|
2869
2880
|
}
|
|
2870
2881
|
// Capture the current context and wrap a callback function so that it
|
|
2871
2882
|
// reestablishes the captured context when called.
|
|
2872
|
-
static bind(
|
|
2873
|
-
const
|
|
2883
|
+
static bind(e) {
|
|
2884
|
+
const r = z;
|
|
2874
2885
|
return function() {
|
|
2875
|
-
const
|
|
2886
|
+
const n = z;
|
|
2876
2887
|
try {
|
|
2877
|
-
return
|
|
2888
|
+
return z = r, e.apply(this, arguments);
|
|
2878
2889
|
} finally {
|
|
2879
|
-
|
|
2890
|
+
z = n;
|
|
2880
2891
|
}
|
|
2881
2892
|
};
|
|
2882
2893
|
}
|
|
2883
2894
|
// Immediately run a callback function without any captured context.
|
|
2884
|
-
static noContext(
|
|
2885
|
-
if (
|
|
2886
|
-
const o =
|
|
2895
|
+
static noContext(e, r, n) {
|
|
2896
|
+
if (z) {
|
|
2897
|
+
const o = z;
|
|
2887
2898
|
try {
|
|
2888
|
-
return
|
|
2899
|
+
return z = null, e.apply(n, r);
|
|
2889
2900
|
} finally {
|
|
2890
|
-
|
|
2901
|
+
z = o;
|
|
2891
2902
|
}
|
|
2892
2903
|
} else
|
|
2893
|
-
return
|
|
2904
|
+
return e.apply(n, r);
|
|
2894
2905
|
}
|
|
2895
2906
|
};
|
|
2896
|
-
function
|
|
2907
|
+
function sr(t) {
|
|
2897
2908
|
try {
|
|
2898
|
-
return
|
|
2909
|
+
return t();
|
|
2899
2910
|
} catch {
|
|
2900
2911
|
}
|
|
2901
2912
|
}
|
|
2902
|
-
const
|
|
2913
|
+
const ue = "@wry/context:Slot", jo = (
|
|
2903
2914
|
// Prefer globalThis when available.
|
|
2904
2915
|
// https://github.com/benjamn/wryware/issues/347
|
|
2905
|
-
|
|
2916
|
+
sr(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
|
|
2906
2917
|
// bundlers to the appropriate identifier (window, self, ...) depending on the
|
|
2907
2918
|
// bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224
|
|
2908
|
-
|
|
2919
|
+
sr(() => global) || // Otherwise, use a dummy host that's local to this module. We used to fall
|
|
2909
2920
|
// back to using the Array constructor as a namespace, but that was flagged in
|
|
2910
2921
|
// https://github.com/benjamn/wryware/issues/347, and can be avoided.
|
|
2911
2922
|
/* @__PURE__ */ Object.create(null)
|
|
2912
|
-
),
|
|
2923
|
+
), cr = jo, Ee = cr[ue] || // Earlier versions of this package stored the globalKey property on the Array
|
|
2913
2924
|
// constructor, so we check there as well, to prevent Slot class duplication.
|
|
2914
|
-
Array[
|
|
2925
|
+
Array[ue] || (function(t) {
|
|
2915
2926
|
try {
|
|
2916
|
-
Object.defineProperty(
|
|
2917
|
-
value:
|
|
2927
|
+
Object.defineProperty(cr, ue, {
|
|
2928
|
+
value: t,
|
|
2918
2929
|
enumerable: !1,
|
|
2919
2930
|
writable: !1,
|
|
2920
2931
|
// When it was possible for globalHost to be the Array constructor (a
|
|
@@ -2926,234 +2937,234 @@ Array[ut] || (function(e) {
|
|
|
2926
2937
|
configurable: !0
|
|
2927
2938
|
});
|
|
2928
2939
|
} finally {
|
|
2929
|
-
return
|
|
2940
|
+
return t;
|
|
2930
2941
|
}
|
|
2931
|
-
})(
|
|
2932
|
-
new
|
|
2933
|
-
function $o(
|
|
2934
|
-
var
|
|
2935
|
-
if (
|
|
2936
|
-
if (Array.isArray(
|
|
2937
|
-
|
|
2938
|
-
var
|
|
2942
|
+
})(Oo()), { bind: ga, noContext: wa } = Ee;
|
|
2943
|
+
new Ee();
|
|
2944
|
+
function $o(t, e) {
|
|
2945
|
+
var r = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
2946
|
+
if (r) return (r = r.call(t)).next.bind(r);
|
|
2947
|
+
if (Array.isArray(t) || (r = Ao(t)) || e) {
|
|
2948
|
+
r && (t = r);
|
|
2949
|
+
var n = 0;
|
|
2939
2950
|
return function() {
|
|
2940
|
-
return
|
|
2951
|
+
return n >= t.length ? { done: !0 } : { done: !1, value: t[n++] };
|
|
2941
2952
|
};
|
|
2942
2953
|
}
|
|
2943
2954
|
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2944
2955
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
2945
2956
|
}
|
|
2946
|
-
function
|
|
2947
|
-
if (
|
|
2948
|
-
if (typeof
|
|
2949
|
-
var
|
|
2950
|
-
if (
|
|
2951
|
-
if (
|
|
2957
|
+
function Ao(t, e) {
|
|
2958
|
+
if (t) {
|
|
2959
|
+
if (typeof t == "string") return lr(t, e);
|
|
2960
|
+
var r = Object.prototype.toString.call(t).slice(8, -1);
|
|
2961
|
+
if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set") return Array.from(t);
|
|
2962
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return lr(t, e);
|
|
2952
2963
|
}
|
|
2953
2964
|
}
|
|
2954
|
-
function
|
|
2955
|
-
(
|
|
2956
|
-
for (var
|
|
2957
|
-
r
|
|
2958
|
-
return
|
|
2965
|
+
function lr(t, e) {
|
|
2966
|
+
(e == null || e > t.length) && (e = t.length);
|
|
2967
|
+
for (var r = 0, n = new Array(e); r < e; r++)
|
|
2968
|
+
n[r] = t[r];
|
|
2969
|
+
return n;
|
|
2959
2970
|
}
|
|
2960
|
-
function
|
|
2961
|
-
for (var
|
|
2962
|
-
var
|
|
2963
|
-
|
|
2971
|
+
function ur(t, e) {
|
|
2972
|
+
for (var r = 0; r < e.length; r++) {
|
|
2973
|
+
var n = e[r];
|
|
2974
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
|
|
2964
2975
|
}
|
|
2965
2976
|
}
|
|
2966
|
-
function
|
|
2967
|
-
return
|
|
2977
|
+
function Te(t, e, r) {
|
|
2978
|
+
return e && ur(t.prototype, e), r && ur(t, r), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
2968
2979
|
}
|
|
2969
|
-
var
|
|
2980
|
+
var Pe = function() {
|
|
2970
2981
|
return typeof Symbol == "function";
|
|
2971
|
-
},
|
|
2972
|
-
return
|
|
2973
|
-
},
|
|
2974
|
-
return
|
|
2982
|
+
}, Oe = function(t) {
|
|
2983
|
+
return Pe() && !!Symbol[t];
|
|
2984
|
+
}, je = function(t) {
|
|
2985
|
+
return Oe(t) ? Symbol[t] : "@@" + t;
|
|
2975
2986
|
};
|
|
2976
|
-
|
|
2977
|
-
var
|
|
2978
|
-
function
|
|
2979
|
-
var
|
|
2980
|
-
if (
|
|
2981
|
-
if (typeof
|
|
2982
|
-
return
|
|
2987
|
+
Pe() && !Oe("observable") && (Symbol.observable = Symbol("observable"));
|
|
2988
|
+
var Lo = je("iterator"), ve = je("observable"), Rr = je("species");
|
|
2989
|
+
function Xt(t, e) {
|
|
2990
|
+
var r = t[e];
|
|
2991
|
+
if (r != null) {
|
|
2992
|
+
if (typeof r != "function") throw new TypeError(r + " is not a function");
|
|
2993
|
+
return r;
|
|
2983
2994
|
}
|
|
2984
2995
|
}
|
|
2985
|
-
function
|
|
2986
|
-
var
|
|
2987
|
-
return
|
|
2996
|
+
function Lt(t) {
|
|
2997
|
+
var e = t.constructor;
|
|
2998
|
+
return e !== void 0 && (e = e[Rr], e === null && (e = void 0)), e !== void 0 ? e : M;
|
|
2988
2999
|
}
|
|
2989
|
-
function
|
|
2990
|
-
return
|
|
3000
|
+
function zo(t) {
|
|
3001
|
+
return t instanceof M;
|
|
2991
3002
|
}
|
|
2992
|
-
function
|
|
2993
|
-
|
|
2994
|
-
throw
|
|
3003
|
+
function Tt(t) {
|
|
3004
|
+
Tt.log ? Tt.log(t) : setTimeout(function() {
|
|
3005
|
+
throw t;
|
|
2995
3006
|
});
|
|
2996
3007
|
}
|
|
2997
|
-
function
|
|
3008
|
+
function Jt(t) {
|
|
2998
3009
|
Promise.resolve().then(function() {
|
|
2999
3010
|
try {
|
|
3000
|
-
|
|
3001
|
-
} catch (
|
|
3002
|
-
|
|
3011
|
+
t();
|
|
3012
|
+
} catch (e) {
|
|
3013
|
+
Tt(e);
|
|
3003
3014
|
}
|
|
3004
3015
|
});
|
|
3005
3016
|
}
|
|
3006
|
-
function
|
|
3007
|
-
var
|
|
3008
|
-
if (
|
|
3017
|
+
function Hr(t) {
|
|
3018
|
+
var e = t._cleanup;
|
|
3019
|
+
if (e !== void 0 && (t._cleanup = void 0, !!e))
|
|
3009
3020
|
try {
|
|
3010
|
-
if (typeof
|
|
3011
|
-
|
|
3021
|
+
if (typeof e == "function")
|
|
3022
|
+
e();
|
|
3012
3023
|
else {
|
|
3013
|
-
var
|
|
3014
|
-
|
|
3024
|
+
var r = Xt(e, "unsubscribe");
|
|
3025
|
+
r && r.call(e);
|
|
3015
3026
|
}
|
|
3016
|
-
} catch (
|
|
3017
|
-
|
|
3027
|
+
} catch (n) {
|
|
3028
|
+
Tt(n);
|
|
3018
3029
|
}
|
|
3019
3030
|
}
|
|
3020
|
-
function
|
|
3021
|
-
|
|
3031
|
+
function ke(t) {
|
|
3032
|
+
t._observer = void 0, t._queue = void 0, t._state = "closed";
|
|
3022
3033
|
}
|
|
3023
|
-
function Do(
|
|
3024
|
-
var
|
|
3025
|
-
if (
|
|
3026
|
-
|
|
3027
|
-
for (var
|
|
3034
|
+
function Do(t) {
|
|
3035
|
+
var e = t._queue;
|
|
3036
|
+
if (e) {
|
|
3037
|
+
t._queue = void 0, t._state = "ready";
|
|
3038
|
+
for (var r = 0; r < e.length && (Vr(t, e[r].type, e[r].value), t._state !== "closed"); ++r)
|
|
3028
3039
|
;
|
|
3029
3040
|
}
|
|
3030
3041
|
}
|
|
3031
|
-
function
|
|
3032
|
-
|
|
3033
|
-
var
|
|
3042
|
+
function Vr(t, e, r) {
|
|
3043
|
+
t._state = "running";
|
|
3044
|
+
var n = t._observer;
|
|
3034
3045
|
try {
|
|
3035
|
-
var o =
|
|
3036
|
-
switch (
|
|
3046
|
+
var o = Xt(n, e);
|
|
3047
|
+
switch (e) {
|
|
3037
3048
|
case "next":
|
|
3038
|
-
o && o.call(
|
|
3049
|
+
o && o.call(n, r);
|
|
3039
3050
|
break;
|
|
3040
3051
|
case "error":
|
|
3041
|
-
if (
|
|
3042
|
-
else throw
|
|
3052
|
+
if (ke(t), o) o.call(n, r);
|
|
3053
|
+
else throw r;
|
|
3043
3054
|
break;
|
|
3044
3055
|
case "complete":
|
|
3045
|
-
|
|
3056
|
+
ke(t), o && o.call(n);
|
|
3046
3057
|
break;
|
|
3047
3058
|
}
|
|
3048
|
-
} catch (
|
|
3049
|
-
|
|
3059
|
+
} catch (a) {
|
|
3060
|
+
Tt(a);
|
|
3050
3061
|
}
|
|
3051
|
-
|
|
3062
|
+
t._state === "closed" ? Hr(t) : t._state === "running" && (t._state = "ready");
|
|
3052
3063
|
}
|
|
3053
|
-
function
|
|
3054
|
-
if (
|
|
3055
|
-
if (
|
|
3056
|
-
|
|
3057
|
-
type:
|
|
3058
|
-
value:
|
|
3064
|
+
function de(t, e, r) {
|
|
3065
|
+
if (t._state !== "closed") {
|
|
3066
|
+
if (t._state === "buffering") {
|
|
3067
|
+
t._queue.push({
|
|
3068
|
+
type: e,
|
|
3069
|
+
value: r
|
|
3059
3070
|
});
|
|
3060
3071
|
return;
|
|
3061
3072
|
}
|
|
3062
|
-
if (
|
|
3063
|
-
|
|
3064
|
-
type:
|
|
3065
|
-
value:
|
|
3066
|
-
}],
|
|
3067
|
-
return Do(
|
|
3073
|
+
if (t._state !== "ready") {
|
|
3074
|
+
t._state = "buffering", t._queue = [{
|
|
3075
|
+
type: e,
|
|
3076
|
+
value: r
|
|
3077
|
+
}], Jt(function() {
|
|
3078
|
+
return Do(t);
|
|
3068
3079
|
});
|
|
3069
3080
|
return;
|
|
3070
3081
|
}
|
|
3071
|
-
|
|
3082
|
+
Vr(t, e, r);
|
|
3072
3083
|
}
|
|
3073
3084
|
}
|
|
3074
3085
|
var Mo = /* @__PURE__ */ (function() {
|
|
3075
|
-
function
|
|
3076
|
-
this._cleanup = void 0, this._observer =
|
|
3086
|
+
function t(r, n) {
|
|
3087
|
+
this._cleanup = void 0, this._observer = r, this._queue = void 0, this._state = "initializing";
|
|
3077
3088
|
var o = new Uo(this);
|
|
3078
3089
|
try {
|
|
3079
|
-
this._cleanup =
|
|
3080
|
-
} catch (
|
|
3081
|
-
o.error(
|
|
3090
|
+
this._cleanup = n.call(void 0, o);
|
|
3091
|
+
} catch (a) {
|
|
3092
|
+
o.error(a);
|
|
3082
3093
|
}
|
|
3083
3094
|
this._state === "initializing" && (this._state = "ready");
|
|
3084
3095
|
}
|
|
3085
|
-
var
|
|
3086
|
-
return
|
|
3087
|
-
this._state !== "closed" && (
|
|
3088
|
-
},
|
|
3096
|
+
var e = t.prototype;
|
|
3097
|
+
return e.unsubscribe = function() {
|
|
3098
|
+
this._state !== "closed" && (ke(this), Hr(this));
|
|
3099
|
+
}, Te(t, [{
|
|
3089
3100
|
key: "closed",
|
|
3090
3101
|
get: function() {
|
|
3091
3102
|
return this._state === "closed";
|
|
3092
3103
|
}
|
|
3093
|
-
}]),
|
|
3104
|
+
}]), t;
|
|
3094
3105
|
})(), Uo = /* @__PURE__ */ (function() {
|
|
3095
|
-
function
|
|
3096
|
-
this._subscription =
|
|
3097
|
-
}
|
|
3098
|
-
var
|
|
3099
|
-
return
|
|
3100
|
-
|
|
3101
|
-
},
|
|
3102
|
-
|
|
3103
|
-
},
|
|
3104
|
-
|
|
3105
|
-
},
|
|
3106
|
+
function t(r) {
|
|
3107
|
+
this._subscription = r;
|
|
3108
|
+
}
|
|
3109
|
+
var e = t.prototype;
|
|
3110
|
+
return e.next = function(n) {
|
|
3111
|
+
de(this._subscription, "next", n);
|
|
3112
|
+
}, e.error = function(n) {
|
|
3113
|
+
de(this._subscription, "error", n);
|
|
3114
|
+
}, e.complete = function() {
|
|
3115
|
+
de(this._subscription, "complete");
|
|
3116
|
+
}, Te(t, [{
|
|
3106
3117
|
key: "closed",
|
|
3107
3118
|
get: function() {
|
|
3108
3119
|
return this._subscription._state === "closed";
|
|
3109
3120
|
}
|
|
3110
|
-
}]),
|
|
3111
|
-
})(),
|
|
3112
|
-
function
|
|
3113
|
-
if (!(this instanceof
|
|
3114
|
-
if (typeof
|
|
3115
|
-
this._subscriber =
|
|
3116
|
-
}
|
|
3117
|
-
var
|
|
3118
|
-
return
|
|
3119
|
-
return (typeof
|
|
3120
|
-
next:
|
|
3121
|
+
}]), t;
|
|
3122
|
+
})(), M = /* @__PURE__ */ (function() {
|
|
3123
|
+
function t(r) {
|
|
3124
|
+
if (!(this instanceof t)) throw new TypeError("Observable cannot be called as a function");
|
|
3125
|
+
if (typeof r != "function") throw new TypeError("Observable initializer must be a function");
|
|
3126
|
+
this._subscriber = r;
|
|
3127
|
+
}
|
|
3128
|
+
var e = t.prototype;
|
|
3129
|
+
return e.subscribe = function(n) {
|
|
3130
|
+
return (typeof n != "object" || n === null) && (n = {
|
|
3131
|
+
next: n,
|
|
3121
3132
|
error: arguments[1],
|
|
3122
3133
|
complete: arguments[2]
|
|
3123
|
-
}), new Mo(
|
|
3124
|
-
},
|
|
3134
|
+
}), new Mo(n, this._subscriber);
|
|
3135
|
+
}, e.forEach = function(n) {
|
|
3125
3136
|
var o = this;
|
|
3126
|
-
return new Promise(function(
|
|
3127
|
-
if (typeof
|
|
3128
|
-
i(new TypeError(
|
|
3137
|
+
return new Promise(function(a, i) {
|
|
3138
|
+
if (typeof n != "function") {
|
|
3139
|
+
i(new TypeError(n + " is not a function"));
|
|
3129
3140
|
return;
|
|
3130
3141
|
}
|
|
3131
3142
|
function c() {
|
|
3132
|
-
|
|
3143
|
+
s.unsubscribe(), a();
|
|
3133
3144
|
}
|
|
3134
|
-
var
|
|
3145
|
+
var s = o.subscribe({
|
|
3135
3146
|
next: function(u) {
|
|
3136
3147
|
try {
|
|
3137
|
-
|
|
3138
|
-
} catch (
|
|
3139
|
-
i(
|
|
3148
|
+
n(u, c);
|
|
3149
|
+
} catch (f) {
|
|
3150
|
+
i(f), s.unsubscribe();
|
|
3140
3151
|
}
|
|
3141
3152
|
},
|
|
3142
3153
|
error: i,
|
|
3143
|
-
complete:
|
|
3154
|
+
complete: a
|
|
3144
3155
|
});
|
|
3145
3156
|
});
|
|
3146
|
-
},
|
|
3157
|
+
}, e.map = function(n) {
|
|
3147
3158
|
var o = this;
|
|
3148
|
-
if (typeof
|
|
3149
|
-
var
|
|
3150
|
-
return new
|
|
3159
|
+
if (typeof n != "function") throw new TypeError(n + " is not a function");
|
|
3160
|
+
var a = Lt(this);
|
|
3161
|
+
return new a(function(i) {
|
|
3151
3162
|
return o.subscribe({
|
|
3152
3163
|
next: function(c) {
|
|
3153
3164
|
try {
|
|
3154
|
-
c =
|
|
3155
|
-
} catch (
|
|
3156
|
-
return i.error(
|
|
3165
|
+
c = n(c);
|
|
3166
|
+
} catch (s) {
|
|
3167
|
+
return i.error(s);
|
|
3157
3168
|
}
|
|
3158
3169
|
i.next(c);
|
|
3159
3170
|
},
|
|
@@ -3165,17 +3176,17 @@ var Mo = /* @__PURE__ */ (function() {
|
|
|
3165
3176
|
}
|
|
3166
3177
|
});
|
|
3167
3178
|
});
|
|
3168
|
-
},
|
|
3179
|
+
}, e.filter = function(n) {
|
|
3169
3180
|
var o = this;
|
|
3170
|
-
if (typeof
|
|
3171
|
-
var
|
|
3172
|
-
return new
|
|
3181
|
+
if (typeof n != "function") throw new TypeError(n + " is not a function");
|
|
3182
|
+
var a = Lt(this);
|
|
3183
|
+
return new a(function(i) {
|
|
3173
3184
|
return o.subscribe({
|
|
3174
3185
|
next: function(c) {
|
|
3175
3186
|
try {
|
|
3176
|
-
if (!
|
|
3177
|
-
} catch (
|
|
3178
|
-
return i.error(
|
|
3187
|
+
if (!n(c)) return;
|
|
3188
|
+
} catch (s) {
|
|
3189
|
+
return i.error(s);
|
|
3179
3190
|
}
|
|
3180
3191
|
i.next(c);
|
|
3181
3192
|
},
|
|
@@ -3187,69 +3198,69 @@ var Mo = /* @__PURE__ */ (function() {
|
|
|
3187
3198
|
}
|
|
3188
3199
|
});
|
|
3189
3200
|
});
|
|
3190
|
-
},
|
|
3201
|
+
}, e.reduce = function(n) {
|
|
3191
3202
|
var o = this;
|
|
3192
|
-
if (typeof
|
|
3193
|
-
var
|
|
3194
|
-
return new
|
|
3203
|
+
if (typeof n != "function") throw new TypeError(n + " is not a function");
|
|
3204
|
+
var a = Lt(this), i = arguments.length > 1, c = !1, s = arguments[1], u = s;
|
|
3205
|
+
return new a(function(f) {
|
|
3195
3206
|
return o.subscribe({
|
|
3196
3207
|
next: function(h) {
|
|
3197
3208
|
var m = !c;
|
|
3198
3209
|
if (c = !0, !m || i)
|
|
3199
3210
|
try {
|
|
3200
|
-
u =
|
|
3211
|
+
u = n(u, h);
|
|
3201
3212
|
} catch (g) {
|
|
3202
|
-
return
|
|
3213
|
+
return f.error(g);
|
|
3203
3214
|
}
|
|
3204
3215
|
else
|
|
3205
3216
|
u = h;
|
|
3206
3217
|
},
|
|
3207
3218
|
error: function(h) {
|
|
3208
|
-
|
|
3219
|
+
f.error(h);
|
|
3209
3220
|
},
|
|
3210
3221
|
complete: function() {
|
|
3211
|
-
if (!c && !i) return
|
|
3212
|
-
|
|
3222
|
+
if (!c && !i) return f.error(new TypeError("Cannot reduce an empty sequence"));
|
|
3223
|
+
f.next(u), f.complete();
|
|
3213
3224
|
}
|
|
3214
3225
|
});
|
|
3215
3226
|
});
|
|
3216
|
-
},
|
|
3217
|
-
for (var
|
|
3218
|
-
|
|
3219
|
-
var c =
|
|
3220
|
-
return new c(function(
|
|
3221
|
-
var u,
|
|
3227
|
+
}, e.concat = function() {
|
|
3228
|
+
for (var n = this, o = arguments.length, a = new Array(o), i = 0; i < o; i++)
|
|
3229
|
+
a[i] = arguments[i];
|
|
3230
|
+
var c = Lt(this);
|
|
3231
|
+
return new c(function(s) {
|
|
3232
|
+
var u, f = 0;
|
|
3222
3233
|
function h(m) {
|
|
3223
3234
|
u = m.subscribe({
|
|
3224
3235
|
next: function(g) {
|
|
3225
|
-
|
|
3236
|
+
s.next(g);
|
|
3226
3237
|
},
|
|
3227
3238
|
error: function(g) {
|
|
3228
|
-
|
|
3239
|
+
s.error(g);
|
|
3229
3240
|
},
|
|
3230
3241
|
complete: function() {
|
|
3231
|
-
|
|
3242
|
+
f === a.length ? (u = void 0, s.complete()) : h(c.from(a[f++]));
|
|
3232
3243
|
}
|
|
3233
3244
|
});
|
|
3234
3245
|
}
|
|
3235
|
-
return h(
|
|
3246
|
+
return h(n), function() {
|
|
3236
3247
|
u && (u.unsubscribe(), u = void 0);
|
|
3237
3248
|
};
|
|
3238
3249
|
});
|
|
3239
|
-
},
|
|
3250
|
+
}, e.flatMap = function(n) {
|
|
3240
3251
|
var o = this;
|
|
3241
|
-
if (typeof
|
|
3242
|
-
var
|
|
3243
|
-
return new
|
|
3244
|
-
var c = [],
|
|
3245
|
-
next: function(
|
|
3246
|
-
if (
|
|
3252
|
+
if (typeof n != "function") throw new TypeError(n + " is not a function");
|
|
3253
|
+
var a = Lt(this);
|
|
3254
|
+
return new a(function(i) {
|
|
3255
|
+
var c = [], s = o.subscribe({
|
|
3256
|
+
next: function(f) {
|
|
3257
|
+
if (n)
|
|
3247
3258
|
try {
|
|
3248
|
-
|
|
3259
|
+
f = n(f);
|
|
3249
3260
|
} catch (m) {
|
|
3250
3261
|
return i.error(m);
|
|
3251
3262
|
}
|
|
3252
|
-
var h =
|
|
3263
|
+
var h = a.from(f).subscribe({
|
|
3253
3264
|
next: function(m) {
|
|
3254
3265
|
i.next(m);
|
|
3255
3266
|
},
|
|
@@ -3263,272 +3274,273 @@ var Mo = /* @__PURE__ */ (function() {
|
|
|
3263
3274
|
});
|
|
3264
3275
|
c.push(h);
|
|
3265
3276
|
},
|
|
3266
|
-
error: function(
|
|
3267
|
-
i.error(
|
|
3277
|
+
error: function(f) {
|
|
3278
|
+
i.error(f);
|
|
3268
3279
|
},
|
|
3269
3280
|
complete: function() {
|
|
3270
3281
|
u();
|
|
3271
3282
|
}
|
|
3272
3283
|
});
|
|
3273
3284
|
function u() {
|
|
3274
|
-
|
|
3285
|
+
s.closed && c.length === 0 && i.complete();
|
|
3275
3286
|
}
|
|
3276
3287
|
return function() {
|
|
3277
|
-
c.forEach(function(
|
|
3278
|
-
return
|
|
3279
|
-
}),
|
|
3288
|
+
c.forEach(function(f) {
|
|
3289
|
+
return f.unsubscribe();
|
|
3290
|
+
}), s.unsubscribe();
|
|
3280
3291
|
};
|
|
3281
3292
|
});
|
|
3282
|
-
},
|
|
3293
|
+
}, e[ve] = function() {
|
|
3283
3294
|
return this;
|
|
3284
|
-
},
|
|
3285
|
-
var o = typeof this == "function" ? this :
|
|
3286
|
-
if (
|
|
3287
|
-
var
|
|
3288
|
-
if (
|
|
3289
|
-
var i =
|
|
3295
|
+
}, t.from = function(n) {
|
|
3296
|
+
var o = typeof this == "function" ? this : t;
|
|
3297
|
+
if (n == null) throw new TypeError(n + " is not an object");
|
|
3298
|
+
var a = Xt(n, ve);
|
|
3299
|
+
if (a) {
|
|
3300
|
+
var i = a.call(n);
|
|
3290
3301
|
if (Object(i) !== i) throw new TypeError(i + " is not an object");
|
|
3291
|
-
return
|
|
3302
|
+
return zo(i) && i.constructor === o ? i : new o(function(c) {
|
|
3292
3303
|
return i.subscribe(c);
|
|
3293
3304
|
});
|
|
3294
3305
|
}
|
|
3295
|
-
if (
|
|
3306
|
+
if (Oe("iterator") && (a = Xt(n, Lo), a))
|
|
3296
3307
|
return new o(function(c) {
|
|
3297
|
-
|
|
3308
|
+
Jt(function() {
|
|
3298
3309
|
if (!c.closed) {
|
|
3299
|
-
for (var
|
|
3300
|
-
var
|
|
3301
|
-
if (c.next(
|
|
3310
|
+
for (var s = $o(a.call(n)), u; !(u = s()).done; ) {
|
|
3311
|
+
var f = u.value;
|
|
3312
|
+
if (c.next(f), c.closed) return;
|
|
3302
3313
|
}
|
|
3303
3314
|
c.complete();
|
|
3304
3315
|
}
|
|
3305
3316
|
});
|
|
3306
3317
|
});
|
|
3307
|
-
if (Array.isArray(
|
|
3318
|
+
if (Array.isArray(n))
|
|
3308
3319
|
return new o(function(c) {
|
|
3309
|
-
|
|
3320
|
+
Jt(function() {
|
|
3310
3321
|
if (!c.closed) {
|
|
3311
|
-
for (var
|
|
3312
|
-
if (c.next(
|
|
3322
|
+
for (var s = 0; s < n.length; ++s)
|
|
3323
|
+
if (c.next(n[s]), c.closed) return;
|
|
3313
3324
|
c.complete();
|
|
3314
3325
|
}
|
|
3315
3326
|
});
|
|
3316
3327
|
});
|
|
3317
|
-
throw new TypeError(
|
|
3318
|
-
},
|
|
3319
|
-
for (var
|
|
3320
|
-
o[
|
|
3321
|
-
var i = typeof this == "function" ? this :
|
|
3328
|
+
throw new TypeError(n + " is not observable");
|
|
3329
|
+
}, t.of = function() {
|
|
3330
|
+
for (var n = arguments.length, o = new Array(n), a = 0; a < n; a++)
|
|
3331
|
+
o[a] = arguments[a];
|
|
3332
|
+
var i = typeof this == "function" ? this : t;
|
|
3322
3333
|
return new i(function(c) {
|
|
3323
|
-
|
|
3334
|
+
Jt(function() {
|
|
3324
3335
|
if (!c.closed) {
|
|
3325
|
-
for (var
|
|
3326
|
-
if (c.next(o[
|
|
3336
|
+
for (var s = 0; s < o.length; ++s)
|
|
3337
|
+
if (c.next(o[s]), c.closed) return;
|
|
3327
3338
|
c.complete();
|
|
3328
3339
|
}
|
|
3329
3340
|
});
|
|
3330
3341
|
});
|
|
3331
|
-
},
|
|
3332
|
-
key:
|
|
3342
|
+
}, Te(t, null, [{
|
|
3343
|
+
key: Rr,
|
|
3333
3344
|
get: function() {
|
|
3334
3345
|
return this;
|
|
3335
3346
|
}
|
|
3336
|
-
}]),
|
|
3347
|
+
}]), t;
|
|
3337
3348
|
})();
|
|
3338
|
-
|
|
3349
|
+
Pe() && Object.defineProperty(M, Symbol("extensions"), {
|
|
3339
3350
|
value: {
|
|
3340
|
-
symbol:
|
|
3341
|
-
hostReportError:
|
|
3351
|
+
symbol: ve,
|
|
3352
|
+
hostReportError: Tt
|
|
3342
3353
|
},
|
|
3343
3354
|
configurable: !0
|
|
3344
3355
|
});
|
|
3345
|
-
function
|
|
3346
|
-
var
|
|
3347
|
-
if (typeof
|
|
3348
|
-
if (
|
|
3349
|
-
|
|
3356
|
+
function Bo(t) {
|
|
3357
|
+
var e, r = t.Symbol;
|
|
3358
|
+
if (typeof r == "function")
|
|
3359
|
+
if (r.observable)
|
|
3360
|
+
e = r.observable;
|
|
3350
3361
|
else {
|
|
3351
|
-
typeof
|
|
3362
|
+
typeof r.for == "function" ? e = r.for("https://github.com/benlesh/symbol-observable") : e = r("https://github.com/benlesh/symbol-observable");
|
|
3352
3363
|
try {
|
|
3353
|
-
|
|
3364
|
+
r.observable = e;
|
|
3354
3365
|
} catch {
|
|
3355
3366
|
}
|
|
3356
3367
|
}
|
|
3357
3368
|
else
|
|
3358
|
-
|
|
3359
|
-
return
|
|
3369
|
+
e = "@@observable";
|
|
3370
|
+
return e;
|
|
3360
3371
|
}
|
|
3361
|
-
var
|
|
3362
|
-
typeof self < "u" ?
|
|
3363
|
-
|
|
3364
|
-
var
|
|
3365
|
-
|
|
3372
|
+
var _t;
|
|
3373
|
+
typeof self < "u" ? _t = self : typeof window < "u" ? _t = window : typeof global < "u" ? _t = global : typeof module < "u" ? _t = module : _t = Function("return this")();
|
|
3374
|
+
Bo(_t);
|
|
3375
|
+
var dr = M.prototype, fr = "@@observable";
|
|
3376
|
+
dr[fr] || (dr[fr] = function() {
|
|
3366
3377
|
return this;
|
|
3367
3378
|
});
|
|
3368
|
-
function
|
|
3369
|
-
for (var
|
|
3379
|
+
function qo(t) {
|
|
3380
|
+
for (var e = [
|
|
3370
3381
|
"query",
|
|
3371
3382
|
"operationName",
|
|
3372
3383
|
"variables",
|
|
3373
3384
|
"extensions",
|
|
3374
3385
|
"context"
|
|
3375
|
-
],
|
|
3376
|
-
var o = r
|
|
3377
|
-
if (
|
|
3378
|
-
throw
|
|
3386
|
+
], r = 0, n = Object.keys(t); r < n.length; r++) {
|
|
3387
|
+
var o = n[r];
|
|
3388
|
+
if (e.indexOf(o) < 0)
|
|
3389
|
+
throw Br(58, o);
|
|
3379
3390
|
}
|
|
3380
|
-
return
|
|
3391
|
+
return t;
|
|
3381
3392
|
}
|
|
3382
|
-
function
|
|
3383
|
-
var
|
|
3384
|
-
typeof
|
|
3393
|
+
function Ro(t, e) {
|
|
3394
|
+
var r = st({}, t), n = function(a) {
|
|
3395
|
+
typeof a == "function" ? r = st(st({}, r), a(r)) : r = st(st({}, r), a);
|
|
3385
3396
|
}, o = function() {
|
|
3386
|
-
return
|
|
3397
|
+
return st({}, r);
|
|
3387
3398
|
};
|
|
3388
|
-
return Object.defineProperty(
|
|
3399
|
+
return Object.defineProperty(e, "setContext", {
|
|
3389
3400
|
enumerable: !1,
|
|
3390
|
-
value:
|
|
3391
|
-
}), Object.defineProperty(
|
|
3401
|
+
value: n
|
|
3402
|
+
}), Object.defineProperty(e, "getContext", {
|
|
3392
3403
|
enumerable: !1,
|
|
3393
3404
|
value: o
|
|
3394
|
-
}),
|
|
3395
|
-
}
|
|
3396
|
-
function
|
|
3397
|
-
var
|
|
3398
|
-
variables:
|
|
3399
|
-
extensions:
|
|
3400
|
-
operationName:
|
|
3401
|
-
query:
|
|
3405
|
+
}), e;
|
|
3406
|
+
}
|
|
3407
|
+
function Ho(t) {
|
|
3408
|
+
var e = {
|
|
3409
|
+
variables: t.variables || {},
|
|
3410
|
+
extensions: t.extensions || {},
|
|
3411
|
+
operationName: t.operationName,
|
|
3412
|
+
query: t.query
|
|
3402
3413
|
};
|
|
3403
|
-
return
|
|
3414
|
+
return e.operationName || (e.operationName = typeof e.query != "string" ? To(e.query) || void 0 : ""), e;
|
|
3404
3415
|
}
|
|
3405
|
-
var
|
|
3406
|
-
function Ko(
|
|
3407
|
-
return Vo
|
|
3416
|
+
var Vo = Symbol.for("apollo.deprecations"), Yo = xe, Jo = new Ee();
|
|
3417
|
+
function Ko(t) {
|
|
3418
|
+
return Yo[Vo] || (Jo.getValue() || []).includes(t);
|
|
3408
3419
|
}
|
|
3409
|
-
function Go(
|
|
3410
|
-
Ko(
|
|
3420
|
+
function Go(t, e) {
|
|
3421
|
+
Ko(t) || e();
|
|
3411
3422
|
}
|
|
3412
|
-
function
|
|
3413
|
-
return
|
|
3423
|
+
function pr(t, e) {
|
|
3424
|
+
return e ? e(t) : M.of();
|
|
3414
3425
|
}
|
|
3415
|
-
function
|
|
3416
|
-
return typeof
|
|
3426
|
+
function zt(t) {
|
|
3427
|
+
return typeof t == "function" ? new Yr(t) : t;
|
|
3417
3428
|
}
|
|
3418
|
-
function
|
|
3419
|
-
return
|
|
3429
|
+
function Ht(t) {
|
|
3430
|
+
return t.request.length <= 1;
|
|
3420
3431
|
}
|
|
3421
|
-
var
|
|
3432
|
+
var Yr = (
|
|
3422
3433
|
/** @class */
|
|
3423
3434
|
(function() {
|
|
3424
|
-
function e
|
|
3425
|
-
|
|
3435
|
+
function t(e) {
|
|
3436
|
+
e && (this.request = e);
|
|
3426
3437
|
}
|
|
3427
|
-
return
|
|
3428
|
-
return new
|
|
3429
|
-
return
|
|
3438
|
+
return t.empty = function() {
|
|
3439
|
+
return new t(function() {
|
|
3440
|
+
return M.of();
|
|
3430
3441
|
});
|
|
3431
|
-
},
|
|
3432
|
-
return
|
|
3433
|
-
return
|
|
3442
|
+
}, t.from = function(e) {
|
|
3443
|
+
return e.length === 0 ? t.empty() : e.map(zt).reduce(function(r, n) {
|
|
3444
|
+
return r.concat(n);
|
|
3434
3445
|
});
|
|
3435
|
-
},
|
|
3436
|
-
var o =
|
|
3437
|
-
return
|
|
3438
|
-
return
|
|
3439
|
-
}) : i = new
|
|
3440
|
-
return
|
|
3441
|
-
}), Object.assign(i, { left: o, right:
|
|
3442
|
-
},
|
|
3443
|
-
return
|
|
3444
|
-
},
|
|
3445
|
-
var
|
|
3446
|
-
if (
|
|
3447
|
-
return globalThis.__DEV__ !== !1 &&
|
|
3448
|
-
var o =
|
|
3449
|
-
return
|
|
3450
|
-
return
|
|
3451
|
-
return o.request(c) ||
|
|
3452
|
-
}) ||
|
|
3453
|
-
}) :
|
|
3454
|
-
return
|
|
3455
|
-
return o.request(
|
|
3456
|
-
}) ||
|
|
3457
|
-
}), Object.assign(
|
|
3458
|
-
},
|
|
3459
|
-
return this.concat(
|
|
3460
|
-
},
|
|
3461
|
-
return
|
|
3462
|
-
},
|
|
3463
|
-
throw
|
|
3464
|
-
},
|
|
3446
|
+
}, t.split = function(e, r, n) {
|
|
3447
|
+
var o = zt(r), a = zt(n || new t(pr)), i;
|
|
3448
|
+
return Ht(o) && Ht(a) ? i = new t(function(c) {
|
|
3449
|
+
return e(c) ? o.request(c) || M.of() : a.request(c) || M.of();
|
|
3450
|
+
}) : i = new t(function(c, s) {
|
|
3451
|
+
return e(c) ? o.request(c, s) || M.of() : a.request(c, s) || M.of();
|
|
3452
|
+
}), Object.assign(i, { left: o, right: a });
|
|
3453
|
+
}, t.execute = function(e, r) {
|
|
3454
|
+
return e.request(Ro(r.context, Ho(qo(r)))) || M.of();
|
|
3455
|
+
}, t.concat = function(e, r) {
|
|
3456
|
+
var n = zt(e);
|
|
3457
|
+
if (Ht(n))
|
|
3458
|
+
return globalThis.__DEV__ !== !1 && le.warn(47, n), n;
|
|
3459
|
+
var o = zt(r), a;
|
|
3460
|
+
return Ht(o) ? a = new t(function(i) {
|
|
3461
|
+
return n.request(i, function(c) {
|
|
3462
|
+
return o.request(c) || M.of();
|
|
3463
|
+
}) || M.of();
|
|
3464
|
+
}) : a = new t(function(i, c) {
|
|
3465
|
+
return n.request(i, function(s) {
|
|
3466
|
+
return o.request(s, c) || M.of();
|
|
3467
|
+
}) || M.of();
|
|
3468
|
+
}), Object.assign(a, { left: n, right: o });
|
|
3469
|
+
}, t.prototype.split = function(e, r, n) {
|
|
3470
|
+
return this.concat(t.split(e, r, n || new t(pr)));
|
|
3471
|
+
}, t.prototype.concat = function(e) {
|
|
3472
|
+
return t.concat(this, e);
|
|
3473
|
+
}, t.prototype.request = function(e, r) {
|
|
3474
|
+
throw Br(48);
|
|
3475
|
+
}, t.prototype.onError = function(e, r) {
|
|
3465
3476
|
if (globalThis.__DEV__ !== !1 && Go("onError", function() {
|
|
3466
|
-
globalThis.__DEV__ !== !1 &&
|
|
3467
|
-
}),
|
|
3468
|
-
return
|
|
3469
|
-
throw
|
|
3470
|
-
},
|
|
3471
|
-
return globalThis.__DEV__ !== !1 && globalThis.__DEV__ !== !1 &&
|
|
3472
|
-
},
|
|
3477
|
+
globalThis.__DEV__ !== !1 && le.warn(49);
|
|
3478
|
+
}), r && r.error)
|
|
3479
|
+
return r.error(e), !1;
|
|
3480
|
+
throw e;
|
|
3481
|
+
}, t.prototype.setOnError = function(e) {
|
|
3482
|
+
return globalThis.__DEV__ !== !1 && globalThis.__DEV__ !== !1 && le.warn(50), this.onError = e, this;
|
|
3483
|
+
}, t;
|
|
3473
3484
|
})()
|
|
3474
3485
|
);
|
|
3475
|
-
function Wo(
|
|
3476
|
-
return new
|
|
3477
|
-
var
|
|
3478
|
-
return new
|
|
3479
|
-
var
|
|
3480
|
-
return Promise.resolve(
|
|
3481
|
-
return
|
|
3482
|
-
}).then(
|
|
3483
|
-
i || (
|
|
3486
|
+
function Wo(t) {
|
|
3487
|
+
return new Yr(function(e, r) {
|
|
3488
|
+
var n = Io(e, []);
|
|
3489
|
+
return new M(function(o) {
|
|
3490
|
+
var a, i = !1;
|
|
3491
|
+
return Promise.resolve(n).then(function(c) {
|
|
3492
|
+
return t(c, e.getContext());
|
|
3493
|
+
}).then(e.setContext).then(function() {
|
|
3494
|
+
i || (a = r(e).subscribe({
|
|
3484
3495
|
next: o.next.bind(o),
|
|
3485
3496
|
error: o.error.bind(o),
|
|
3486
3497
|
complete: o.complete.bind(o)
|
|
3487
3498
|
}));
|
|
3488
3499
|
}).catch(o.error.bind(o)), function() {
|
|
3489
|
-
i = !0,
|
|
3500
|
+
i = !0, a && a.unsubscribe();
|
|
3490
3501
|
};
|
|
3491
3502
|
});
|
|
3492
3503
|
});
|
|
3493
3504
|
}
|
|
3494
3505
|
const Qo = async () => {
|
|
3495
|
-
const
|
|
3506
|
+
const t = "https://auth.australia-southeast1.gcp.commercetools.com/oauth/token", n = "Basic " + btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN") + ":" + encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));
|
|
3496
3507
|
try {
|
|
3497
|
-
const o = await
|
|
3498
|
-
|
|
3508
|
+
const o = await U.post(
|
|
3509
|
+
t,
|
|
3499
3510
|
new URLSearchParams({ grant_type: "client_credentials" }),
|
|
3500
3511
|
// Only grant_type in body
|
|
3501
3512
|
{
|
|
3502
3513
|
headers: {
|
|
3503
3514
|
"Content-Type": "application/x-www-form-urlencoded",
|
|
3504
|
-
Authorization:
|
|
3515
|
+
Authorization: n
|
|
3505
3516
|
}
|
|
3506
3517
|
}
|
|
3507
3518
|
);
|
|
3508
3519
|
return o.status === 200 && o.data.access_token ? o.data.access_token : (console.error("Failed to fetch token:", o.data), null);
|
|
3509
3520
|
} catch (o) {
|
|
3510
|
-
return
|
|
3521
|
+
return U.isAxiosError(o) ? console.error("Error fetching token:", o.response || o.message) : console.error("Unexpected error:", o), null;
|
|
3511
3522
|
}
|
|
3512
|
-
},
|
|
3513
|
-
uri: `${
|
|
3514
|
-
}),
|
|
3515
|
-
const
|
|
3523
|
+
}, Xo = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", Zo = Qr({
|
|
3524
|
+
uri: `${Xo}`
|
|
3525
|
+
}), ta = Wo(async (t, { headers: e }) => {
|
|
3526
|
+
const r = await Qo();
|
|
3516
3527
|
return {
|
|
3517
3528
|
headers: {
|
|
3518
|
-
...
|
|
3519
|
-
authorization: `Bearer ${
|
|
3529
|
+
...e,
|
|
3530
|
+
authorization: `Bearer ${r}`
|
|
3520
3531
|
}
|
|
3521
3532
|
};
|
|
3522
|
-
}),
|
|
3523
|
-
link:
|
|
3524
|
-
cache: new
|
|
3533
|
+
}), ea = new Xr({
|
|
3534
|
+
link: ta.concat(Zo),
|
|
3535
|
+
cache: new Zr(),
|
|
3525
3536
|
defaultOptions: {
|
|
3526
3537
|
watchQuery: {
|
|
3527
3538
|
fetchPolicy: "cache-and-network"
|
|
3528
3539
|
}
|
|
3529
3540
|
}
|
|
3530
|
-
}),
|
|
3541
|
+
}), ya = () => /* @__PURE__ */ l(tn, { client: ea, children: /* @__PURE__ */ l(un, { children: /* @__PURE__ */ l(So, {}) }) });
|
|
3531
3542
|
export {
|
|
3532
|
-
|
|
3543
|
+
ya as TanyaChatbot,
|
|
3544
|
+
pa as TanyaChatbotProvider
|
|
3533
3545
|
};
|
|
3534
3546
|
//# sourceMappingURL=tanya-chatbot.es.js.map
|