@chatsystem/client 1.1.26 → 1.1.28
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/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/assets/index.DheDN0XW.css +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('*,: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}}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.bottom-0{bottom:0}.bottom-1\\.5{bottom:.375rem}.bottom-10{bottom:2.5rem}.bottom-\\[120px\\]{bottom:120px}.left-0{left:0}.right-0{right:0}.right-10{right:2.5rem}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.z-10{z-index:10}.z-\\[999999999\\]{z-index:999999999}.z-\\[99999999\\]{z-index:99999999}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.mr-3{margin-right:.75rem}.mt-3{margin-top:.75rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-5{margin-top:1.25rem}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-12{height:3rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-\\[520px\\]{height:520px}.h-auto{height:auto}.max-h-12{max-height:3rem}.min-h-0{min-height:0px}.w-10{width:2.5rem}.w-12{width:3rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.max-w-12{max-width:3rem}.max-w-\\[90\\%\\]{max-width:90%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}@keyframes fadeIn{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.animate-fade-in{animation:fadeIn .3s ease-in-out}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-col{flex-direction:column}.content-center{align-content:center}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.overflow-y-auto{overflow-y:auto}.rounded-\\[50\\%\\]{border-radius:50%}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border,.border-\\[1px\\]{border-width:1px}.border-l-4{border-left-width:4px}.border-black{--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity, 1))}.border-red-400{--tw-border-opacity: 1;border-color:rgb(248 113 113 / var(--tw-border-opacity, 1))}.border-slate-400{--tw-border-opacity: 1;border-color:rgb(148 163 184 / var(--tw-border-opacity, 1))}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.\\!bg-blue-700{--tw-bg-opacity: 1 !important;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))!important}.\\!bg-gray-400{--tw-bg-opacity: 1 !important;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))!important}.\\!bg-green-700{--tw-bg-opacity: 1 !important;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))!important}.\\!bg-red-700{--tw-bg-opacity: 1 !important;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))!important}.\\!bg-white{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))!important}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-700{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-slate-300{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.bg-violet-600{--tw-bg-opacity: 1;background-color:rgb(124 58 237 / var(--tw-bg-opacity, 1))}.bg-violet-700{--tw-bg-opacity: 1;background-color:rgb(109 40 217 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3\\.5{padding-top:.875rem;padding-bottom:.875rem}.px-3{padding-left:.75rem;padding-right:.75rem}.pb-2{padding-bottom:.5rem}.text-center{text-align:center}.align-baseline{vertical-align:baseline}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.font-bold{font-weight:700}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.shadow-\\[0_0px_4px_5px_rgba\\(0\\,0\\,0\\,0\\.2\\)\\]{--tw-shadow: 0 0px 4px 5px rgba(0,0,0,.2);--tw-shadow-colored: 0 0px 4px 5px 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)}.outline{outline-style:solid}.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{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;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)}.hover\\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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\\:\\!bg-blue-800:hover{--tw-bg-opacity: 1 !important;background-color:rgb(30 64 175 / var(--tw-bg-opacity, 1))!important}.hover\\:\\!bg-blue-900:hover{--tw-bg-opacity: 1 !important;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))!important}.hover\\:\\!bg-green-800:hover{--tw-bg-opacity: 1 !important;background-color:rgb(22 101 52 / var(--tw-bg-opacity, 1))!important}.hover\\:\\!bg-red-800:hover{--tw-bg-opacity: 1 !important;background-color:rgb(153 27 27 / var(--tw-bg-opacity, 1))!important}.hover\\:\\!bg-slate-500:hover{--tw-bg-opacity: 1 !important;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))!important}.hover\\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.focus\\:ring-4:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-blue-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity, 1))}.focus\\:ring-green-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(134 239 172 / var(--tw-ring-opacity, 1))}.focus\\:ring-red-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(252 165 165 / var(--tw-ring-opacity, 1))}.focus\\:ring-slate-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(203 213 225 / var(--tw-ring-opacity, 1))}.enabled\\:bg-black:enabled{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.enabled\\:bg-white:enabled{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.disabled\\:text-gray-400:disabled{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.disabled\\:opacity-10:disabled{opacity:.1}.dark\\:border-white:is(.dark *){--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.dark\\:bg-white:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.dark\\:text-black:is(.dark *){--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.dark\\:hover\\:bg-white:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.dark\\:focus\\:ring-blue-900:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(30 58 138 / var(--tw-ring-opacity, 1))}.dark\\:focus\\:ring-green-900:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(20 83 45 / var(--tw-ring-opacity, 1))}.dark\\:focus\\:ring-red-900:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(127 29 29 / var(--tw-ring-opacity, 1))}.dark\\:focus\\:ring-slate-900:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(15 23 42 / var(--tw-ring-opacity, 1))}@media (min-width: 768px){.md\\:bottom-2{bottom:.5rem}.md\\:bottom-\\[110px\\]{bottom:110px}.md\\:left-auto{left:auto}.md\\:right-3{right:.75rem}.md\\:right-\\[40px\\]{right:40px}.md\\:top-auto{top:auto}.md\\:h-\\[600px\\]{height:600px}.md\\:w-\\[400px\\]{width:400px}}.chatBox{overflow-x:hidden}.chatBox ol>li{margin-top:10px;background-color:#0000001a;padding:.5rem 1rem 1rem;border-radius:.5rem}.chatBox ol>li>p:first-child,.chatBox ol>li>li:first-child,.chatBox h3,.chatBox h2{font-size:1.5rem;margin:1rem 0}.chatBox a{display:block;cursor:pointer;color:#00f;font-size:1.1rem;margin:1rem 0}.chatBox a:hover{text-decoration:underline}.chatBox img{display:block;margin:2rem 0;max-width:200px}.chatBox hr{margin:1.5rem 0}.menuTransition-enter{opacity:0;transform:scale(.9) translate(200px)}.menuTransition-enter-active{opacity:1;transform:translate(0);transition:opacity .3s,transform .3s}.menuTransition-exit{opacity:1}.menuTransition-exit-active{opacity:0;transform:scale(.5) translate(400px);transition:opacity .3s,transform .3s}p,li,textarea{font-size:14px}textarea::placeholder{font-size:14px}.assetContainer svg{width:2rem;height:2rem}.launcher{background-color:#7c3aed;border-radius:50%;box-shadow:0 0 4px 5px #0003;width:3rem;height:3rem;bottom:40px;right:40px}.launcher .assetContainer svg{fill:#fff}.assistant .assetContainer svg{fill:#32cf56}@tailwind base;@tailwind components;@tailwind utilities;')),document.head.appendChild(t)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
1
2
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react/jsx-runtime"),N=require("react"),xl=require("lottie-react"),Cl=require("@lottiefiles/dotlottie-react"),Bn=require("react-dom");function Il(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Ve=Il(N);var sa=function(e,t){return sa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])},sa(e,t)};function tt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");sa(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var V=function(){return V=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},V.apply(this,arguments)};function fr(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function lt(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function Ba(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fn={exports:{}},Te={};/** @license React v16.13.1
|
|
2
3
|
* react-is.production.min.js
|
|
3
4
|
*
|
|
@@ -33,7 +34,7 @@ Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
|
33
34
|
Try polyfilling it using "@formatjs/intl-relativetimeformat"
|
|
34
35
|
`,dt.MISSING_INTL_API));try{return Bc(e,t,a).format(n,r)}catch(u){e.onError(new nt("Error formatting relative time.",e.locale,u))}return String(n)}var Hc=["style","currency","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","currencyDisplay","currencySign","notation","signDisplay","unit","unitDisplay","numberingSystem","trailingZeroDisplay","roundingPriority","roundingIncrement","roundingMode"];function Ss(e,t,n){var r=e.locale,a=e.formats,i=e.onError;n===void 0&&(n={});var u=n.format,o=u&&Ua(a,"number",u,i)||{},l=Bt(n,Hc,o);return t(r,l)}function Uc(e,t,n,r){r===void 0&&(r={});try{return Ss(e,t,r).format(n)}catch(a){e.onError(new nt("Error formatting number.",e.locale,a))}return String(n)}function jc(e,t,n,r){r===void 0&&(r={});try{return Ss(e,t,r).formatToParts(n)}catch(a){e.onError(new nt("Error formatting number.",e.locale,a))}return[]}function $c(e){var t=e?e[Object.keys(e)[0]]:void 0;return typeof t=="string"}function Yc(e){e.onWarn&&e.defaultRichTextElements&&$c(e.messages||{})&&e.onWarn(`[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled.
|
|
35
36
|
Please consider using "@formatjs/cli" to pre-compile your messages for performance.
|
|
36
|
-
For more details see https://formatjs.io/docs/getting-started/message-distribution`)}function Gc(e,t){var n=Sc(t),r=V(V({},gs),e),a=r.locale,i=r.defaultLocale,u=r.onError;return a?!Intl.NumberFormat.supportedLocalesOf(a).length&&u?u(new xi('Missing locale data for locale: "'.concat(a,'" in Intl.NumberFormat. Using default locale: "').concat(i,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):!Intl.DateTimeFormat.supportedLocalesOf(a).length&&u&&u(new xi('Missing locale data for locale: "'.concat(a,'" in Intl.DateTimeFormat. Using default locale: "').concat(i,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):(u&&u(new gc('"locale" was not configured, using "'.concat(i,'" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))),r.locale=r.defaultLocale||"en"),Yc(r),V(V({},r),{formatters:n,formatNumber:Uc.bind(null,r,n.getNumberFormat),formatNumberToParts:jc.bind(null,r,n.getNumberFormat),formatRelativeTime:Fc.bind(null,r,n.getRelativeTimeFormat),formatDate:xc.bind(null,r,n.getDateTimeFormat),formatDateToParts:Nc.bind(null,r,n.getDateTimeFormat),formatTime:Cc.bind(null,r,n.getDateTimeFormat),formatDateTimeRange:Ic.bind(null,r,n.getDateTimeFormat),formatTimeToParts:Oc.bind(null,r,n.getDateTimeFormat),formatPlural:wc.bind(null,r,n.getPluralRules),formatMessage:ma.bind(null,r,n),$t:ma.bind(null,r,n),formatList:Dc.bind(null,r,n.getListFormat),formatListToParts:ys.bind(null,r,n.getListFormat),formatDisplayName:Rc.bind(null,r,n.getDisplayNames)})}function xs(e){es(e,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}var Cs=V(V({},gs),{textComponent:Ve.Fragment});function zc(e){return function(t){return e(Ve.Children.toArray(t))}}function Vc(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t),a=n.length;if(r.length!==a)return!1;for(var i=0;i<a;i++){var u=n[i];if(e[u]!==t[u]||!Object.prototype.hasOwnProperty.call(t,u))return!1}return!0}var ja=typeof window<"u"&&!window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__?window.__REACT_INTL_CONTEXT__||(window.__REACT_INTL_CONTEXT__=Ve.createContext(null)):Ve.createContext(null);ja.Consumer;var qc=ja.Provider,Wc=qc,Xc=ja;function hr(){var e=Ve.useContext(Xc);return xs(e),e}var pa;(function(e){e.formatDate="FormattedDate",e.formatTime="FormattedTime",e.formatNumber="FormattedNumber",e.formatList="FormattedList",e.formatDisplayName="FormattedDisplayName"})(pa||(pa={}));var Ea;(function(e){e.formatDate="FormattedDateParts",e.formatTime="FormattedTimeParts",e.formatNumber="FormattedNumberParts",e.formatList="FormattedListParts"})(Ea||(Ea={}));function Is(e){var t=function(n){var r=hr(),a=n.value,i=n.children,u=fr(n,["value","children"]),o=typeof a=="string"?new Date(a||0):a,l=e==="formatDate"?r.formatDateToParts(o,u):r.formatTimeToParts(o,u);return i(l)};return t.displayName=Ea[e],t}function Rn(e){var t=function(n){var r=hr(),a=n.value,i=n.children,u=fr(n,["value","children"]),o=r[e](a,u);if(typeof i=="function")return i(o);var l=r.textComponent||Ve.Fragment;return Ve.createElement(l,null,o)};return t.displayName=pa[e],t}function Ns(e){return e&&Object.keys(e).reduce(function(t,n){var r=e[n];return t[n]=bs(r)?zc(r):r,t},{})}var Oi=function(e,t,n,r){for(var a=[],i=4;i<arguments.length;i++)a[i-4]=arguments[i];var u=Ns(r),o=ma.apply(void 0,lt([e,t,n,u],a,!1));return Array.isArray(o)?Ve.Children.toArray(o):o},Li=function(e,t){var n=e.defaultRichTextElements,r=fr(e,["defaultRichTextElements"]),a=Ns(n),i=Gc(V(V(V({},Cs),r),{defaultRichTextElements:a}),t),u={locale:i.locale,timeZone:i.timeZone,fallbackOnEmptyString:i.fallbackOnEmptyString,formats:i.formats,defaultLocale:i.defaultLocale,defaultFormats:i.defaultFormats,messages:i.messages,onError:i.onError,defaultRichTextElements:a};return V(V({},i),{formatMessage:Oi.bind(null,u,i.formatters),$t:Oi.bind(null,u,i.formatters)})};function Pr(e){return{locale:e.locale,timeZone:e.timeZone,fallbackOnEmptyString:e.fallbackOnEmptyString,formats:e.formats,textComponent:e.textComponent,messages:e.messages,defaultLocale:e.defaultLocale,defaultFormats:e.defaultFormats,onError:e.onError,onWarn:e.onWarn,wrapRichTextChunksInFragment:e.wrapRichTextChunksInFragment,defaultRichTextElements:e.defaultRichTextElements}}var Qc=(function(e){tt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.cache=As(),n.state={cache:n.cache,intl:Li(Pr(n.props),n.cache),prevConfig:Pr(n.props)},n}return t.getDerivedStateFromProps=function(n,r){var a=r.prevConfig,i=r.cache,u=Pr(n);return Vc(a,u)?null:{intl:Li(u,i),prevConfig:u}},t.prototype.render=function(){return xs(this.state.intl),Ve.createElement(Wc,{value:this.state.intl},this.props.children)},t.displayName="IntlProvider",t.defaultProps=Cs,t})(Ve.PureComponent);Rn("formatDate");Rn("formatTime");Rn("formatNumber");Rn("formatList");Rn("formatDisplayName");Is("formatDate");Is("formatTime");const Kc={"generic.language.english":"English","generic.language.french":"French","generic.connect.google":"Connect with Google","generic.button.title.save":"Save","page.login.button.login":"Login / Register","page.login.google.login":"Continue with Google","navbar.button.home":"Home","navbar.button.pricing":"Pricing","navbar.button.login":"Login","navbar.button.demo":"Demo","navbar.userMenu.logout":"Log out","navbar.userMenu.profile":"Profile","navbar.userMenu.backOffice":"Back-office","home.header.catchphase":"The catchphrase you wanted","home.header.subcatchphase":"Discover the new software that will change it all","home.header.CTA":"See more","home.section.bulletsPointParagraphe1.title":"Management","home.section.bulletsPointParagraphe1.text":"Take advantage of a complete solution to have a direct point of view on all of your units.","home.section.bulletsPointParagraphe2.title":"Automation","home.section.bulletsPointParagraphe2.text":"In just a few clicks, manage your entire fleet. Implement macros and synergies on your systems.","home.section.bulletsPointParagraphe3.title":"Reporting","home.section.bulletsPointParagraphe3.text":"With its BI module, our software allows you to monitor performance and optimize your costs.","home.realm.title":"See the root of your business in a few clicks","home.realm.text":"The security of your data is at the heart of our concerns. Our software was created in France, we are ISO 27001 certified and all our servers are located in Europe.","home.realm.cta":"Discover our solution","home.testimonials.title":"What our customers say","home.testimonials.1.text":"Since using the software, we have better control of the flow of goods and relevant performance monitoring.","home.testimonials.1.job":"Developer @Wordpress","home.testimonials.1.name":"Loic Martins","home.testimonials.2.text":"Putting the software solution into production allowed us to completely reorganize the teams.","home.testimonials.2.job":"Community Manager @Comet","home.testimonials.2.name":"Anna Wang","home.testimonials.3.text":"Mastery of the logistics subject is obvious with the software solution.","home.testimonials.3.job":"Product Owner @April","home.testimonials.3.name":"Louis Bachant","home.test.section.title":"Try it out now","home.test.section.CTA":"See our solution","pricing.CTA.pleaseLogin":"Login to buy","pricing.page.title":"Choose your plan","pricing.page.subtitle":"No obligation: cancel at any time with one click.","subscribe.paymentRecap.title":"Payment Summary","subscribe.paymentRecap.customerName":"Name","subscribe.paymentRecap.customerMail":"Email","subscribe.paymentRecap.additionnalMention":"Mention to add","subscribe.paymentRecap.totalAmount":"Total Amount","subscribe.paymentForm.title":"Bank card","subscribe.paymentForm.cardNumber":"Card number","subscribe.paymentForm.expiresAt":"Expires at","subscribe.paymentForm.CVCNumber":"CVC number","subscribe.paymentForm.CTA.loading":"Loading ...","subscribe.paymentForm.CTA.pay":"Pay now","subscribe.success.title":"Payment successful","subscribe.success.paragraph1":"Your payment has been processed successfully. You are now suscribed !","subscribe.success.paragraph2":"Your new options are now available.","myAccount.page.leftMenu.general":"General","myAccount.page.leftMenu.profile":"Profile","chatbot.placeholder.content":"Message the assistant...","chatbot.chatline.label.user":"You","chatbot.chatline.label.assistant":"Assistant","chatbot.chatline.loading.function.genericSearchMessage":"I'm looking for products","chatbot.chatline.loading.function.search":"Search","chatbot.chatline.loading.function.extractProductName":"Looking into the cavern","chatbot.chatline.loading.function.suggestProductName":"Consulting the shadocks","chatbot.chatline.loading.function.criteriaDefinition":"Looking for ziboublis","chatbot.chatline.loading.function.searchStock":"Searching Stock","chatbot.chatline.loading.function.step":"Step","chatbot.chatline.loading.cancel":"Cancel","footer.tab.title.general":"General","footer.tab.title.about":"About","footer.tab.title.resources":"Resources","footer.tab.title.legal":"Legal","footer.tab.title.social":"Social","footer.tab.search":"Search","footer.tab.pricing":"Pricing","footer.tab.termsAndConditions":"Terms and conditions","footer.tab.finalCopyright":"Copyright © 2023 Logiciel, Inc. All rights reserved."},Zc={"generic.language.english":"Anglais","generic.language.french":"Français","generic.connect.google":"Se connecter avec Google","generic.button.title.save":"Sauvegarder","page.login.button.login":"Se connecter / S'inscrire","page.login.google.login":"Continuer avec Google","navbar.button.home":"Accueil","navbar.button.pricing":"Tarifs","navbar.button.login":"Se Connecter","navbar.button.demo":"Demo","navbar.userMenu.logout":"Déconnection","navbar.userMenu.profile":"Profil","navbar.userMenu.backOffice":"Back-office","home.header.catchphase":"Catchphrase de l'espace","home.header.subcatchphase":"Découvrez le logiciel qui met fin à vos problèmes","home.header.CTA":"Voir notre solution","home.section.bulletsPointParagraphe1.title":"Management","home.section.bulletsPointParagraphe1.text":"Profitez d'une solution complète pour avoir un point de vue direct sur l'ensemble de vos unités.","home.section.bulletsPointParagraphe2.title":"Automatisation","home.section.bulletsPointParagraphe2.text":"En quelques clicks, gérez l'ensemble de votre flotte. Mettez en place des macros et des synergies sur vos systèmes.","home.section.bulletsPointParagraphe3.title":"Reporting","home.section.bulletsPointParagraphe3.text":"Avec son module BI, notre logiciel vous permet de monitorer la performance et d'optimiser vos coûts. A l'euro prêt","home.realm.title":"Le coeur du métier en quelques clics","home.realm.text":"La sécurité de vos données est au cœur de nos préoccupations. Notre logiciel a été créé en France, nous sommes certifiés ISO 27001 et tous nos serveurs sont situés en Europe.","home.realm.cta":"Voir notre solution","home.testimonials.title":"Nos clients parlent de nous","home.testimonials.1.text":"Depuis notre utilisation du logiciel, nous avons un meilleur contrôle du flux de marchandises et un suivi de performance pertinent.","home.testimonials.1.job":"Developpeur @Wordpress","home.testimonials.1.name":"Loic Martins","home.testimonials.2.text":"La mise en production de la solution logicielle nous a permis de réorganiser complètement les équipes.","home.testimonials.2.job":"Community Manager @Comet","home.testimonials.2.name":"Anna Wang","home.testimonials.3.text":"La maitrise du sujet logistique est une évidence avec la solution logicielle.","home.testimonials.3.job":"Product Owner @April","home.testimonials.3.name":"Louis Bachant","home.test.section.title":"Testez dès maintenant","home.test.section.CTA":"Voir notre solution","pricing.CTA.pleaseLogin":"Connectez-vous","pricing.page.title":"Choisissez votre plan","pricing.page.subtitle":"Sans engagement : annulez à tout moment en un clic.","subscribe.paymentRecap.title":"Récapitulatif de paiement","subscribe.paymentRecap.customerName":"Nom","subscribe.paymentRecap.customerMail":"Email","subscribe.paymentRecap.additionnalMention":"Mention à ajouter","subscribe.paymentRecap.totalAmount":"Total","subscribe.paymentForm.title":"Carte bancaire","subscribe.paymentForm.cardNumber":"Numéro de carte","subscribe.paymentForm.expiresAt":"Expire le","subscribe.paymentForm.CVCNumber":"Numéro CVV","subscribe.paymentForm.CTA.loading":"Chargement ...","subscribe.paymentForm.CTA.pay":"S'abonner","subscribe.success.title":"Paiement effectué avec succès","subscribe.success.paragraph1":"Votre paiement a bien été accepté. Vous êtes désormais abonné !","subscribe.success.paragraph2":"Toutes vos options sont maintenant disponibles.","myAccount.page.leftMenu.general":"Général","myAccount.page.leftMenu.profile":"Profil","chatbot.placeholder.content":"Envoyez un message à l'assistant ...","chatbot.chatline.label.user":"Vous","chatbot.chatline.label.assistant":"Assistant","chatbot.chatline.loading.function.search":"Recherche","chatbot.chatline.loading.function.genericSearchMessage":"Je cherche des produits","chatbot.chatline.loading.function.extractProductName":"Recherche dans la caverne","chatbot.chatline.loading.function.suggestProductName":"Consultation des shadocks","chatbot.chatline.loading.function.criteriaDefinition":"Recherche des ziboublis","chatbot.chatline.loading.function.searchStock":"Recherche en stock","chatbot.chatline.loading.function.step":"Etape","chatbot.chatline.loading.cancel":"Annuler","footer.tab.title.general":"Général","footer.tab.title.about":"A propos","footer.tab.title.resources":"Ressources","footer.tab.title.legal":"Mentions Légales","footer.tab.title.social":"Social","footer.tab.search":"Rechercher","footer.tab.pricing":"Tarifs","footer.tab.termsAndConditions":"Termes et conditions","footer.tab.finalCopyright":"Copyright © 2023 Logiciel, Inc. Tous droits réservés."};var Ke=(e=>(e.FRENCH="fr-FR",e.ENGLISH="en-US",e))(Ke||{});const mr={[Ke.ENGLISH]:{translatedText:Kc,pictureName:Ke.ENGLISH,langID:0,locale:Ke.ENGLISH},[Ke.FRENCH]:{translatedText:Zc,pictureName:Ke.FRENCH,langID:1,locale:Ke.FRENCH}},Jc=Object.keys(mr);Jc.reduce((e,t)=>{const n=mr[t];return[...e,n]},[]);const ef="languageSettings",tf=(e,t)=>{let n,r;return typeof window<"u"&&(r=window.localStorage.getItem(ef)),r&&e?.[r]!==void 0?n=e[r]:(n=e[t],n.isDefault=!0),n},nf=(e,t)=>{const[n,r]=N.useState(e[t]),a=i=>{Object.keys(e).includes(i?.locale)?r(i):r(e[Ke.ENGLISH])};return N.useEffect(()=>{let i=tf(e,t);i.locale!==t&&r(e[i.locale])},[]),{appCurrentLang:n,handleSetContextCurrentLang:a}},Os=N.createContext({appCurrentLang:mr[Ke.ENGLISH],setAppCurrentLang:()=>{}}),Ls=N.createContext({conversation:[],setConversation:()=>{}});var Lt={},Ri;function rf(){if(Ri)return Lt;Ri=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.AgentDisplayFacetRoleType=Lt.AgentDisplayFacetModeType=void 0;var e;(function(n){n.SPRITESHEET="spritesheet",n.LOTTIE="lottie",n.IMAGE="image",n.SVG="svg",n.VIDEO="video"})(e||(Lt.AgentDisplayFacetModeType=e={}));var t;return(function(n){n.LAUNCHER="launcher",n.ASSISTANT="assistant",n.SEARCH="search"})(t||(Lt.AgentDisplayFacetRoleType=t={})),Lt}var Ge=rf();const Dr=e=>({mode:Ge.AgentDisplayFacetModeType.SVG,role:e}),af=()=>({agent:{display:{name:"",CSSRules:"",[Ge.AgentDisplayFacetRoleType.LAUNCHER]:Dr(Ge.AgentDisplayFacetRoleType.LAUNCHER),[Ge.AgentDisplayFacetRoleType.ASSISTANT]:Dr(Ge.AgentDisplayFacetRoleType.ASSISTANT),[Ge.AgentDisplayFacetRoleType.SEARCH]:Dr(Ge.AgentDisplayFacetRoleType.SEARCH)},text:{initialText:""}}}),pr=N.createContext({companySettings:af(),setCompanySettings:()=>{}}),Rs=()=>({hasFetchedSettings:!1,hasDisplayedCSS:!1}),uf=()=>{const[e,t]=N.useState(Rs());return{appInternalContext:e,setAppInternalContext:t,setHasFetchedSettings:()=>{t(a=>({...a,hasFetchedSettings:!0}))},setHasDisplayedCss:()=>{t(a=>({...a,hasDisplayedCSS:!0}))}}},vs=N.createContext({appInternalContext:Rs(),setAppInternalContext:()=>{},setHasFetchedSettings:()=>{}}),sf=e=>Object.values(Ke).includes(e),of=e=>sf(e)?e:(console.log(`Language ${e} not handled for now. Using ${Ke.ENGLISH}.`),Ke.ENGLISH);class Zn{constructor(){}static getApiUrl=()=>process.env.NODE_ENV==="development"?"http://localhost:3001":"https://www.api.chatsystem.ai";static getHeaders=({contentType:t="text/plain"})=>({"Content-Type":t});static getFetchConfig=({contentType:t="text/plain",httpVerb:n="GET",body:r,options:a={}})=>{const i={method:n,headers:this.getHeaders({contentType:t}),...a};return r&&(i.body=JSON.stringify(r)),i}}const lf=({agentId:e,appToken:t,onFetched:n})=>{const[r,a]=N.useState({}),i={companySettings:r,setCompanySettings:a},[u,o]=N.useState([]),l={conversation:u,setConversation:o};return N.useEffect(()=>{const c=Zn.getApiUrl(),f=Zn.getFetchConfig({httpVerb:"GET",contentType:"application/json"});fetch(`${c}/company/settings/${t}/${e}`,f).then(async d=>{const m=await d.json();a(m),o([{userType:"assistant",content:m.agent.text.initialText}]),n?.()}).catch(d=>console.log("error in fetch",d))},[t,e]),{contextCompanySettings:i,contextInitialChatbotStartingText:l}};function cf(e,t={},n){const{id:r,nonce:a,target:i,disableConstructable:u}=t,o=i??document.head,l=N.useRef(null),c=N.useRef(null);N.useEffect(()=>{if(!e)return;if(!u&&"adoptedStyleSheets"in o&&typeof CSSStyleSheet<"u"&&"replaceSync"in CSSStyleSheet.prototype)return l.current||(l.current=new CSSStyleSheet,o.adoptedStyleSheets=[...o.adoptedStyleSheets,l.current]),l.current.replaceSync(e),n?.(),()=>{const d=o.adoptedStyleSheets||[],m=d.indexOf(l.current);if(m>=0){const h=d.slice();h.splice(m,1),o.adoptedStyleSheets=h}l.current=null};if(!c.current){const d=document.createElement("style");d.type="text/css",r&&(d.id=r),a&&(d.nonce=a),(o instanceof Document&&o.head||o).appendChild(d),c.current=d}return c.current.textContent=e,n?.(),()=>{c.current?.parentNode?.removeChild(c.current),c.current=null}},[e,r,a,i,u])}const Zt=globalThis;Zt.__WIDGET_ASSET_CACHE__||(Zt.__WIDGET_ASSET_CACHE__={svg:new Map,img:new Map,lot:new Map,spr:new Map});Zt.__WIDGET_PRELOAD_KEYS__||(Zt.__WIDGET_PRELOAD_KEYS__=new Set);const kr=Zt.__WIDGET_PRELOAD_KEYS__,St=Zt.__WIDGET_ASSET_CACHE__,ff="widget-assets-v1";async function Er(e,t){const n=await caches.open(ff),r=await n.match(e,{ignoreSearch:!1});if(r)return r.clone();const a=await fetch(e,{cache:"force-cache",mode:"cors",keepalive:!0,...t});if(!a.ok)throw new Error(`HTTP ${a.status} for ${e}`);return n.put(e,a.clone()),a}async function Ps(e){const t=St.svg.get(e);if(t)return t.promise;const n=(async()=>{const a=await(await Er(e)).text();if(typeof globalThis.DOMPurify<"u"&&typeof globalThis.DOMPurify.sanitize=="function")try{const u=new DOMParser().parseFromString(a,"image/svg+xml"),o=new XMLSerializer().serializeToString(u.documentElement);return{sanitized:globalThis.DOMPurify.sanitize(o,{USE_PROFILES:{svg:!0,svgFilters:!0}})}}catch{return{sanitized:globalThis.DOMPurify.sanitize(a,{USE_PROFILES:{svg:!0,svgFilters:!0}})}}else return{sanitized:a}})();return St.svg.set(e,{promise:n,ts:Date.now()}),n}function Ds(e){const t=St.img.get(e);if(t)return t.promise;const n=(async()=>{const a=await(await Er(e)).blob();return{blobUrl:URL.createObjectURL(a)}})();return St.img.set(e,{promise:n,ts:Date.now()}),n}function ks(e){const t=St.lot.get(e);if(t)return t.promise;const n=(async()=>{const a=await(await Er(e)).arrayBuffer(),i=new Uint8Array(a);if(i.length>=4&&i[0]===80&&i[1]===75&&i[2]===3&&i[3]===4||e.endsWith(".lottie"))return{kind:"zip",blobUrl:URL.createObjectURL(new Blob([a],{type:"application/zip"}))};const o=new TextDecoder().decode(i);return{kind:"json",data:JSON.parse(o)}})();return St.lot.set(e,{promise:n,ts:Date.now()}),n}function ws(e){const t=St.spr.get(e);if(t)return t.promise;const n=(async()=>{const a=await(await Er(e)).blob();let i=null;try{i=await createImageBitmap(a)}catch{i=null}const{imgEl:u,width:o,height:l}=await new Promise((c,f)=>{const d=URL.createObjectURL(a),m=new Image;m.crossOrigin="anonymous",m.onload=()=>{const h=m.naturalWidth,y=m.naturalHeight;c({imgEl:m,width:h,height:y})},m.onerror=()=>{URL.revokeObjectURL(d),f(new Error("Spritesheet image decode failed"))},m.src=d,m.decode?.().catch(()=>{})});return{imgEl:u,bitmap:i,width:o,height:l}})();return St.spr.set(e,{promise:n,ts:Date.now()}),n}function df(e){e.images?.forEach(t=>void Ds(t)),e.svgs?.forEach(t=>void Ps(t)),e.lotties?.forEach(t=>void ks(t)),e.sprites?.forEach(t=>void ws(t))}function hf(e){try{const t=document.createElement("link");t.rel="preconnect",t.href=e,t.crossOrigin="anonymous",document.head.appendChild(t);const n=document.createElement("link");n.rel="dns-prefetch",n.href=e,document.head.appendChild(n)}catch(t){console.log("error in injectPreconnect",t)}}function Ms(e){return new URL(e,document.baseURI).toString()}function mf(e,t){const n=document.head.querySelectorAll('link[rel="preload"]');for(const r of n)if((e?r.as===e||r.getAttribute("as")===e:!0)&&r.href===t)return!0;return!1}function jn(e,t,n,r){const a=Ms(n),i=`${e}|${t??""}|${a}`;if(kr.has(i))return;if(mf(t,a)){kr.add(i);return}const u=document.createElement("link");u.rel=e,t&&(u.as=t),u.href=a,u.crossOrigin="anonymous",r&&(u.type=r),u.setAttribute("data-chatsystem-preload","1"),document.head.appendChild(u),kr.add(i)}function pf(e){const t=u=>Array.from(new Set((u??[]).map(Ms))),n=t(e.images),r=t(e.svgs),a=t(e.lotties),i=t(e.sprites);n.forEach(u=>jn("preload","image",u)),r.forEach(u=>jn("preload","fetch",u,"image/svg+xml")),a.forEach(u=>jn("preload","fetch",u,"application/zip")),i.forEach(u=>jn("preload","fetch",u))}function Ef(e){const{manifest:t,origins:n}=bf(e);n.forEach(hf),pf(t),df(t)}function bf(e){const t=Tf(e),n=new Set,r=new Set,a=new Set,i=new Set;for(const{url:l,mode:c}of t)switch(gf(c,l)){case"svg":r.add(l);break;case"lottie":a.add(l);break;case"spritesheet":i.add(l);break;case"image":n.add(l);break}const u={images:Array.from(n),svgs:Array.from(r),lotties:Array.from(a),sprites:Array.from(i)},o=Af(u);return{manifest:u,origins:o}}function Tf(e){if(!e?.agent?.display)return[];const t=e.agent.display,n=[t.launcher,t.assistant,t.search].filter(Boolean),r=[];for(const a of n)a?.assetUrl&&r.push({url:a.assetUrl,mode:a.mode});return r}function gf(e,t){if(e)switch(e){case"svg":return"svg";case"lottie":return"lottie";case"spritesheet":return"spritesheet";case"image":return"image";case"video":return"video"}try{const r=new URL(t,document.baseURI).pathname.toLowerCase();if(r.endsWith(".svg"))return"svg";if(r.endsWith(".lottie")||r.endsWith(".zip")||r.endsWith(".json"))return r.endsWith(".json"),"lottie";if(/\.(png|webp|jpg|jpeg|gif|avi,ef)$/.test(r))return"image";if(/\.(mp4|webm|mov|m4v|ogg)$/.test(r))return"video"}catch(n){console.log("error in normalizeKind:",n)}return"unknown"}function Af(e){const t=new Set,n=r=>{if(r)try{const a=new URL(r,document.baseURI);t.add(`${a.protocol}//${a.host}`)}catch(a){console.log("error in uniqueOriginsFromManifest",a)}};return(e.images??[]).forEach(n),(e.svgs??[]).forEach(n),(e.lotties??[]).forEach(n),(e.sprites??[]).forEach(n),Array.from(t)}const _f=({children:e,appToken:t,agentId:n})=>{var r=navigator.language;console.log("App boot"),console.log("Brower language",r);const a=of(r),{appCurrentLang:i,handleSetContextCurrentLang:u}=nf(mr,a),o={appCurrentLang:i,setAppCurrentLang:u},l=uf(),{contextCompanySettings:c,contextInitialChatbotStartingText:f}=lf({agentId:n,appToken:t,onFetched:l.setHasFetchedSettings});return Ef(c.companySettings),cf(c.companySettings?.agent?.display?.CSSRules,{id:`${n}`},l.setHasDisplayedCss),console.log("hasDIsplayedCss",l.appInternalContext.hasDisplayedCSS),v.jsx(v.Fragment,{children:v.jsx(Qc,{locale:i?.locale,messages:i?.translatedText,children:v.jsx(Os.Provider,{value:o,children:v.jsx(vs.Provider,{value:l,children:v.jsx(pr.Provider,{value:c,children:v.jsx(Ls.Provider,{value:f,children:l.appInternalContext.hasDisplayedCSS&&e})})})})})})},yf=e=>Object.values(tn).includes(e),Sf=e=>yf(e)?e:(console.warn(`Display mode not valid. Using ${tn.LAUNCHER} as default.`),tn.LAUNCHER),xf=e=>Ve.createElement("svg",{fill:"#000000",height:"800px",width:"800px",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 330 330",xmlSpace:"preserve",...e},Ve.createElement("path",{id:"XMLID_102_",d:"M325.607,79.393c-5.857-5.857-15.355-5.858-21.213,0.001l-139.39,139.393L25.607,79.393 c-5.857-5.857-15.355-5.858-21.213,0.001c-5.858,5.858-5.858,15.355,0,21.213l150.004,150c2.813,2.813,6.628,4.393,10.606,4.393 s7.794-1.581,10.606-4.394l149.996-150C331.465,94.749,331.465,85.251,325.607,79.393z"})),Cf=({src:e})=>{const[t,n]=N.useState(null);return N.useEffect(()=>{let r=!1;return Ds(e).then(({blobUrl:a})=>{n(a)}).catch(()=>n(null)),()=>{t&&!r&&(URL.revokeObjectURL(t),r=!0)}},[e]),v.jsx("img",{src:t??e,decoding:"async",loading:"eager"})};function If(e){return!!e&&typeof e=="object"&&"blob"in e&&e.blob instanceof Blob}function Nf({src:e,autoplay:t=!0,loop:n=!0,className:r,style:a,placeholder:i,fallback:u,onLoaded:o,onError:l}){const[c,f]=N.useState({kind:"loading"});return N.useEffect(()=>{let d=null,m=!1;return f({kind:"loading"}),ks(e).then(async h=>{if(!m)if(h.kind==="zip"){const y=If(h)?h.blob:await(await fetch(h.blobUrl)).blob();d=URL.createObjectURL(y),f({kind:"lottieZip",blobUrl:d}),o?.(d)}else f({kind:"json",data:h.data}),o?.(h.data)}).catch(h=>!m&&(f({kind:"error",err:h}),l?.(h))),()=>{m=!0,d&&URL.revokeObjectURL(d)}},[e]),c.kind==="loading"?v.jsx("div",{className:"flex items-center justify-center rounded-xl border border-dashed p-6 text-sm opacity-70 "+(r??""),style:{minHeight:96,...a},children:i??"Loading animation…"}):c.kind==="error"?v.jsx("div",{className:"flex items-center justify-center rounded-xl border p-6 text-sm text-red-600 "+(r??""),style:{minHeight:96,...a},children:u??"Failed to load animation"}):c.kind==="json"?v.jsx(xl,{animationData:c.data,loop:n,autoplay:t,className:r,style:a,rendererSettings:{preserveAspectRatio:"xMidYMid meet"}}):v.jsx(Cl.DotLottieReact,{src:c.blobUrl,loop:n,autoplay:t,className:r,style:a})}async function Of(e,t={}){const{minPeriod:n=8,maxPeriod:r=Math.floor(Math.min(e.width,e.height)/2),gutterSearchRadius:a=3,debug:i=!1}=t;if(e.width<n*2||e.height<n*2)return i&&console.warn("detectGrid: image too small"),null;const u=document.createElement("canvas");u.width=e.naturalWidth,u.height=e.naturalHeight;const o=u.getContext("2d");if(!o)return null;o.drawImage(e,0,0);const{data:l}=o.getImageData(0,0,u.width,u.height),c=u.width,f=u.height,d=new Uint8ClampedArray(c*f);for(let Y=0;Y<f;Y++){let F=Y*c;for(let B=0;B<c;B++){const G=(F+B)*4;d[F+B]=.299*l[G]+.587*l[G+1]+.114*l[G+2]|0}}const m=new Float32Array(c),h=new Float32Array(f);for(let Y=1;Y<c-1;Y++){let F=0;for(let B=0;B<f;B++){const G=B*c+Y,$=d[G+1]-d[G-1];F+=Math.abs($)}m[Y]=F}for(let Y=1;Y<f-1;Y++){let F=0;for(let B=0;B<c;B++){const G=Y*c+B,$=d[G+c]-d[G-c];F+=Math.abs($)}h[Y]=F}const y=vi(m,n,Math.min(r,c/2)),A=vi(h,n,Math.min(r,f/2));if(!y||!A)return i&&console.warn("detectGrid: could not find periods"),null;const R=Math.max(1,Math.round(c/y)),S=Math.max(1,Math.round(f/A)),P=Pi(m,y,R,a),O=Pi(h,A,S,a),w=Math.max(1,y-P),C=Math.max(1,A-O);if(w*R>c+2||C*S>f+2)return i&&console.warn("detectGrid: sanity check failed"),null;const I=ba(m,60),W=ba(h,60),se=Math.max(0,Di(m,I)),ne=Math.max(0,Di(h,W));return i&&console.log({periodX:y,periodY:A,columns:R,rows:S,gutterX:P,gutterY:O,frameWidth:w,frameHeight:C,originX:se,originY:ne}),{columns:R,rows:S,frameWidth:w,frameHeight:C,gutterX:P,gutterY:O,originX:se,originY:ne}}function vi(e,t,n){const r=Bs(e);let a=0;for(let h=0;h<e.length;h++){const y=e[h]-r;a+=y*y}if(a===0)return null;const i=new Float32Array(n+1);let u=0,o=-1/0;for(let h=t;h<=n;h++){let y=0;for(let R=0;R+h<e.length;R++)y+=(e[R]-r)*(e[R+h]-r);const A=y/a;i[h]=A,A>o&&(o=A,u=h)}if(u<=t||u>=n)return u||null;const l=i[u-1],c=i[u],f=i[u+1],d=l-2*c+f,m=d===0?0:.5*(l-f)/d;return u+m}function Pi(e,t,n,r){const a=[];for(let o=1;o<n;o++){const l=o*t;let c=1/0,f=l;for(let d=-r;d<=r;d++){const m=l+d;if(m<=0||m>=e.length)continue;const h=e[m];h<c&&(c=h,f=m)}a.push(f)}if(a.length<1)return 0;let i=[];for(const o of a){const l=e[o]*1.5+ba(e,10)*.5;let c=o,f=o;for(;c>1&&e[c-1]<=l;)c--;for(;f<e.length-2&&e[f+1]<=l;)f++;i.push(Math.max(0,f-c+1))}const u=Math.round(Bs(i));return Math.max(0,Math.min(u,Math.floor(t/4)))}function Bs(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t/e.length}function ba(e,t){const n=Array.from(e);n.sort((a,i)=>a-i);const r=Math.max(0,Math.min(n.length-1,Math.floor(t/100*n.length)));return n[r]}function Di(e,t){for(let n=0;n<e.length;n++)if(e[n]>t)return n;return 0}function Lf(e,t,n,r,a){const{data:i}=e.getImageData(t,n,r,a);let u=0;for(let o=3;o<i.length;o+=4)u+=i[o];return u/(255*(i.length/4))<.03}const Rf=N.forwardRef(function({src:t,frameWidth:n,frameHeight:r,columns:a,rows:i,gutterX:u=0,gutterY:o=0,frameCount:l,atlasFrames:c,fps:f=12,autoplay:d=!0,loop:m=!0,startFrame:h=0,direction:y="forward",scale:A=1,backgroundColor:R,className:S,style:P,pauseWhenHidden:O=!1,onLoad:w,onEnd:C,onFrame:I},W){const se=N.useRef(null),ne=N.useRef(null),[Y,F]=N.useState(null),[B,G]=N.useState(null),[$,X]=N.useState(null),[oe,pe]=N.useState(!1),[ve,Le]=N.useState(!!d),[p,H]=N.useState(h),Q=N.useRef(1),[T,q]=N.useState(null),Z=Math.max(1,Math.floor(typeof window<"u"&&window.devicePixelRatio||1));N.useEffect(()=>{let ce=!1;return pe(!1),ws(t).then(({imgEl:Ie,bitmap:Ee})=>{ce||(F(Ie),G(Ee),X({w:Ie.naturalWidth,h:Ie.naturalHeight}),pe(!0),w?.())}).catch(()=>{}),()=>{ce=!0}},[t,w]),N.useEffect(()=>{let ce=!1;return(async()=>{if(!Y)return;if(c&&c.length){q(null);return}if(!(!n||!r||!a||!i)){q(null);return}const Ee=await Of(Y,{debug:!0});ce||(Ee?q({frameWidth:Ee.frameWidth,frameHeight:Ee.frameHeight,columns:Ee.columns,rows:Ee.rows,gutterX:Ee.gutterX,gutterY:Ee.gutterY}):(q(null),console.warn("RemoteSpritesheet: auto-detect failed; please provide grid props.")))})(),()=>{ce=!0}},[Y,c,n,r,a,i]);const z=T?.frameWidth??n,K=T?.frameHeight??r,te=T?.columns??a,ie=T?.rows??i,J=T?.gutterX??u,_e=T?.gutterY??o,j=N.useMemo(()=>{if(c&&c.length>0)return{cols:0,rows:0};if(!$||!z||!K)return{cols:0,rows:0};const ce=te??Math.floor(($.w+J)/(z+J)),Ie=ie??Math.floor(($.h+_e)/(K+_e));return{cols:Math.max(0,ce),rows:Math.max(0,Ie)}},[c,$,z,K,te,ie,J,_e]),xe=N.useMemo(()=>{if(c?.length)return c;if(!z||!K)return[];const{cols:ce,rows:Ie}=j;if(!ce||!Ie)return[];const Ee=Math.min(l??ce*Ie,ce*Ie),be=[];for(let Ne=0;Ne<Ee;Ne++){const Fe=Ne%ce,we=Math.floor(Ne/ce),qe=T?.originX??0,Nr=T?.originY??0,L=qe+Fe*(z+J),U=Nr+we*(K+_e);be.push({x:L,y:U,w:z,h:K})}if(Y&&be.length){const Ne=document.createElement("canvas");Ne.width=Y.naturalWidth,Ne.height=Y.naturalHeight;const Fe=Ne.getContext("2d");if(Fe){Fe.drawImage(Y,0,0);let we=be.length;for(;we>0&&Lf(Fe,be[we-1].x,be[we-1].y,be[we-1].w,be[we-1].h);)we--;return be.slice(0,we)}}return be},[c,j,l,z,K,J,_e,Y,T?.originX,T?.originY]),ke=()=>{const ce=se.current;if(!ce||xe.length===0)return;const Ie=xe[Math.max(0,Math.min(p,xe.length-1))],Ee=Math.max(1,Math.round(Ie.w*A)),be=Math.max(1,Math.round(Ie.h*A));ce.style.width=Ee+"px",ce.style.height=be+"px",ce.width=Ee*Z,ce.height=be*Z};N.useEffect(()=>{ke()},[oe,A,xe.length,Z,p]);const Ce=ce=>{const Ie=B??Y??null,Ee=se.current;if(!Ee||!Ie||xe.length===0)return;const be=Ee.getContext("2d");if(!be)return;be.save(),be.setTransform(1,0,0,1,0,0),be.clearRect(0,0,Ee.width,Ee.height),R&&(be.fillStyle=R,be.fillRect(0,0,Ee.width,Ee.height));const Ne=xe[ce];be.scale(Z,Z),be.drawImage(Ie,Ne.x,Ne.y,Ne.w,Ne.h,0,0,Math.round(Ne.w*A),Math.round(Ne.h*A)),be.restore()};return N.useEffect(()=>{if(!oe||xe.length===0)return;let ce=performance.now();const Ie=1e3/Math.max(1,Math.min(120,f)),Ee=be=>{if(ne.current=requestAnimationFrame(Ee),!ve){Ce(p);return}const Ne=be-ce;if(Ne<Ie){Ce(p);return}ce=be-Ne%Ie,H(Fe=>{const we=xe.length-1;let qe=Fe;return y==="forward"?qe=Fe+1:y==="backward"?qe=Fe-1:((Fe>=we&&Q.current===1||Fe<=0&&Q.current===-1)&&(Q.current*=-1),qe=Fe+Q.current),(qe>we||qe<0)&&(m?qe=y==="backward"?we:0:(qe=Math.max(0,Math.min(qe,we)),Le(!1),C?.())),qe})};return ne.current=requestAnimationFrame(Ee),()=>{ne.current&&cancelAnimationFrame(ne.current)}},[oe,f,ve,m,y,xe.length,p]),N.useEffect(()=>{Ce(p),I?.(p)},[p,oe,A,Z]),N.useEffect(()=>{if(!O)return;const ce=()=>{document.hidden&&Le(!1)};return document.addEventListener("visibilitychange",ce),()=>document.removeEventListener("visibilitychange",ce)},[O]),N.useImperativeHandle(W,()=>({play:()=>Le(!0),pause:()=>Le(!1),toggle:()=>Le(ce=>!ce),gotoFrame:ce=>H(()=>Math.max(0,Math.min(ce,Math.max(0,xe.length-1)))),isPlaying:()=>ve,currentFrame:()=>p}),[ve,p,xe.length]),v.jsx("div",{className:S,style:P,children:v.jsx("canvas",{ref:se,"aria-label":"spritesheet animation"})})});function vf({url:e,className:t}){const[n,r]=N.useState(""),[a,i]=N.useState(null);return N.useEffect(()=>{let u=!1;return Ps(e).then(({sanitized:o})=>{u||(r(o),i(null))}).catch(o=>!u&&i(o.message??"Failed to load")),()=>{u=!0}},[e]),a?v.jsxs("div",{className:t,role:"alert",children:["Couldn’t load SVG: ",a]}):n?v.jsx("div",{className:t,dangerouslySetInnerHTML:{__html:n}}):v.jsx("div",{className:t})}const $a=({facet:e})=>{const{mode:t,assetUrl:n}=e;return v.jsxs("div",{className:"assetContainer",children:[t===Ge.AgentDisplayFacetModeType.LOTTIE&&v.jsx(Nf,{src:n,autoplay:!0,onError:r=>console.error(r)}),t===Ge.AgentDisplayFacetModeType.SVG&&v.jsx("div",{children:v.jsx(vf,{url:n})}),t===Ge.AgentDisplayFacetModeType.IMAGE&&v.jsx(Cf,{src:n}),t===Ge.AgentDisplayFacetModeType.SPRITESHEET&&v.jsx(Rf,{src:n})]})},Pf=({isWidgetOpen:e,setIsWidgetOpen:t})=>{const{companySettings:n}=N.useContext(pr);return v.jsxs("div",{className:`launcher
|
|
37
|
+
For more details see https://formatjs.io/docs/getting-started/message-distribution`)}function Gc(e,t){var n=Sc(t),r=V(V({},gs),e),a=r.locale,i=r.defaultLocale,u=r.onError;return a?!Intl.NumberFormat.supportedLocalesOf(a).length&&u?u(new xi('Missing locale data for locale: "'.concat(a,'" in Intl.NumberFormat. Using default locale: "').concat(i,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):!Intl.DateTimeFormat.supportedLocalesOf(a).length&&u&&u(new xi('Missing locale data for locale: "'.concat(a,'" in Intl.DateTimeFormat. Using default locale: "').concat(i,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):(u&&u(new gc('"locale" was not configured, using "'.concat(i,'" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))),r.locale=r.defaultLocale||"en"),Yc(r),V(V({},r),{formatters:n,formatNumber:Uc.bind(null,r,n.getNumberFormat),formatNumberToParts:jc.bind(null,r,n.getNumberFormat),formatRelativeTime:Fc.bind(null,r,n.getRelativeTimeFormat),formatDate:xc.bind(null,r,n.getDateTimeFormat),formatDateToParts:Nc.bind(null,r,n.getDateTimeFormat),formatTime:Cc.bind(null,r,n.getDateTimeFormat),formatDateTimeRange:Ic.bind(null,r,n.getDateTimeFormat),formatTimeToParts:Oc.bind(null,r,n.getDateTimeFormat),formatPlural:wc.bind(null,r,n.getPluralRules),formatMessage:ma.bind(null,r,n),$t:ma.bind(null,r,n),formatList:Dc.bind(null,r,n.getListFormat),formatListToParts:ys.bind(null,r,n.getListFormat),formatDisplayName:Rc.bind(null,r,n.getDisplayNames)})}function xs(e){es(e,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}var Cs=V(V({},gs),{textComponent:Ve.Fragment});function zc(e){return function(t){return e(Ve.Children.toArray(t))}}function Vc(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t),a=n.length;if(r.length!==a)return!1;for(var i=0;i<a;i++){var u=n[i];if(e[u]!==t[u]||!Object.prototype.hasOwnProperty.call(t,u))return!1}return!0}var ja=typeof window<"u"&&!window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__?window.__REACT_INTL_CONTEXT__||(window.__REACT_INTL_CONTEXT__=Ve.createContext(null)):Ve.createContext(null);ja.Consumer;var qc=ja.Provider,Wc=qc,Xc=ja;function hr(){var e=Ve.useContext(Xc);return xs(e),e}var pa;(function(e){e.formatDate="FormattedDate",e.formatTime="FormattedTime",e.formatNumber="FormattedNumber",e.formatList="FormattedList",e.formatDisplayName="FormattedDisplayName"})(pa||(pa={}));var Ea;(function(e){e.formatDate="FormattedDateParts",e.formatTime="FormattedTimeParts",e.formatNumber="FormattedNumberParts",e.formatList="FormattedListParts"})(Ea||(Ea={}));function Is(e){var t=function(n){var r=hr(),a=n.value,i=n.children,u=fr(n,["value","children"]),o=typeof a=="string"?new Date(a||0):a,l=e==="formatDate"?r.formatDateToParts(o,u):r.formatTimeToParts(o,u);return i(l)};return t.displayName=Ea[e],t}function Rn(e){var t=function(n){var r=hr(),a=n.value,i=n.children,u=fr(n,["value","children"]),o=r[e](a,u);if(typeof i=="function")return i(o);var l=r.textComponent||Ve.Fragment;return Ve.createElement(l,null,o)};return t.displayName=pa[e],t}function Ns(e){return e&&Object.keys(e).reduce(function(t,n){var r=e[n];return t[n]=bs(r)?zc(r):r,t},{})}var Oi=function(e,t,n,r){for(var a=[],i=4;i<arguments.length;i++)a[i-4]=arguments[i];var u=Ns(r),o=ma.apply(void 0,lt([e,t,n,u],a,!1));return Array.isArray(o)?Ve.Children.toArray(o):o},Li=function(e,t){var n=e.defaultRichTextElements,r=fr(e,["defaultRichTextElements"]),a=Ns(n),i=Gc(V(V(V({},Cs),r),{defaultRichTextElements:a}),t),u={locale:i.locale,timeZone:i.timeZone,fallbackOnEmptyString:i.fallbackOnEmptyString,formats:i.formats,defaultLocale:i.defaultLocale,defaultFormats:i.defaultFormats,messages:i.messages,onError:i.onError,defaultRichTextElements:a};return V(V({},i),{formatMessage:Oi.bind(null,u,i.formatters),$t:Oi.bind(null,u,i.formatters)})};function Pr(e){return{locale:e.locale,timeZone:e.timeZone,fallbackOnEmptyString:e.fallbackOnEmptyString,formats:e.formats,textComponent:e.textComponent,messages:e.messages,defaultLocale:e.defaultLocale,defaultFormats:e.defaultFormats,onError:e.onError,onWarn:e.onWarn,wrapRichTextChunksInFragment:e.wrapRichTextChunksInFragment,defaultRichTextElements:e.defaultRichTextElements}}var Qc=(function(e){tt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.cache=As(),n.state={cache:n.cache,intl:Li(Pr(n.props),n.cache),prevConfig:Pr(n.props)},n}return t.getDerivedStateFromProps=function(n,r){var a=r.prevConfig,i=r.cache,u=Pr(n);return Vc(a,u)?null:{intl:Li(u,i),prevConfig:u}},t.prototype.render=function(){return xs(this.state.intl),Ve.createElement(Wc,{value:this.state.intl},this.props.children)},t.displayName="IntlProvider",t.defaultProps=Cs,t})(Ve.PureComponent);Rn("formatDate");Rn("formatTime");Rn("formatNumber");Rn("formatList");Rn("formatDisplayName");Is("formatDate");Is("formatTime");const Kc={"generic.language.english":"English","generic.language.french":"French","generic.connect.google":"Connect with Google","generic.button.title.save":"Save","page.login.button.login":"Login / Register","page.login.google.login":"Continue with Google","navbar.button.home":"Home","navbar.button.pricing":"Pricing","navbar.button.login":"Login","navbar.button.demo":"Demo","navbar.userMenu.logout":"Log out","navbar.userMenu.profile":"Profile","navbar.userMenu.backOffice":"Back-office","home.header.catchphase":"The catchphrase you wanted","home.header.subcatchphase":"Discover the new software that will change it all","home.header.CTA":"See more","home.section.bulletsPointParagraphe1.title":"Management","home.section.bulletsPointParagraphe1.text":"Take advantage of a complete solution to have a direct point of view on all of your units.","home.section.bulletsPointParagraphe2.title":"Automation","home.section.bulletsPointParagraphe2.text":"In just a few clicks, manage your entire fleet. Implement macros and synergies on your systems.","home.section.bulletsPointParagraphe3.title":"Reporting","home.section.bulletsPointParagraphe3.text":"With its BI module, our software allows you to monitor performance and optimize your costs.","home.realm.title":"See the root of your business in a few clicks","home.realm.text":"The security of your data is at the heart of our concerns. Our software was created in France, we are ISO 27001 certified and all our servers are located in Europe.","home.realm.cta":"Discover our solution","home.testimonials.title":"What our customers say","home.testimonials.1.text":"Since using the software, we have better control of the flow of goods and relevant performance monitoring.","home.testimonials.1.job":"Developer @Wordpress","home.testimonials.1.name":"Loic Martins","home.testimonials.2.text":"Putting the software solution into production allowed us to completely reorganize the teams.","home.testimonials.2.job":"Community Manager @Comet","home.testimonials.2.name":"Anna Wang","home.testimonials.3.text":"Mastery of the logistics subject is obvious with the software solution.","home.testimonials.3.job":"Product Owner @April","home.testimonials.3.name":"Louis Bachant","home.test.section.title":"Try it out now","home.test.section.CTA":"See our solution","pricing.CTA.pleaseLogin":"Login to buy","pricing.page.title":"Choose your plan","pricing.page.subtitle":"No obligation: cancel at any time with one click.","subscribe.paymentRecap.title":"Payment Summary","subscribe.paymentRecap.customerName":"Name","subscribe.paymentRecap.customerMail":"Email","subscribe.paymentRecap.additionnalMention":"Mention to add","subscribe.paymentRecap.totalAmount":"Total Amount","subscribe.paymentForm.title":"Bank card","subscribe.paymentForm.cardNumber":"Card number","subscribe.paymentForm.expiresAt":"Expires at","subscribe.paymentForm.CVCNumber":"CVC number","subscribe.paymentForm.CTA.loading":"Loading ...","subscribe.paymentForm.CTA.pay":"Pay now","subscribe.success.title":"Payment successful","subscribe.success.paragraph1":"Your payment has been processed successfully. You are now suscribed !","subscribe.success.paragraph2":"Your new options are now available.","myAccount.page.leftMenu.general":"General","myAccount.page.leftMenu.profile":"Profile","chatbot.placeholder.content":"Message the assistant...","chatbot.chatline.label.user":"You","chatbot.chatline.label.assistant":"Assistant","chatbot.chatline.loading.function.genericSearchMessage":"I'm looking for products","chatbot.chatline.loading.function.search":"Search","chatbot.chatline.loading.function.extractProductName":"Looking into the cavern","chatbot.chatline.loading.function.suggestProductName":"Consulting the shadocks","chatbot.chatline.loading.function.criteriaDefinition":"Looking for ziboublis","chatbot.chatline.loading.function.searchStock":"Searching Stock","chatbot.chatline.loading.function.step":"Step","chatbot.chatline.loading.cancel":"Cancel","footer.tab.title.general":"General","footer.tab.title.about":"About","footer.tab.title.resources":"Resources","footer.tab.title.legal":"Legal","footer.tab.title.social":"Social","footer.tab.search":"Search","footer.tab.pricing":"Pricing","footer.tab.termsAndConditions":"Terms and conditions","footer.tab.finalCopyright":"Copyright © 2023 Logiciel, Inc. All rights reserved."},Zc={"generic.language.english":"Anglais","generic.language.french":"Français","generic.connect.google":"Se connecter avec Google","generic.button.title.save":"Sauvegarder","page.login.button.login":"Se connecter / S'inscrire","page.login.google.login":"Continuer avec Google","navbar.button.home":"Accueil","navbar.button.pricing":"Tarifs","navbar.button.login":"Se Connecter","navbar.button.demo":"Demo","navbar.userMenu.logout":"Déconnection","navbar.userMenu.profile":"Profil","navbar.userMenu.backOffice":"Back-office","home.header.catchphase":"Catchphrase de l'espace","home.header.subcatchphase":"Découvrez le logiciel qui met fin à vos problèmes","home.header.CTA":"Voir notre solution","home.section.bulletsPointParagraphe1.title":"Management","home.section.bulletsPointParagraphe1.text":"Profitez d'une solution complète pour avoir un point de vue direct sur l'ensemble de vos unités.","home.section.bulletsPointParagraphe2.title":"Automatisation","home.section.bulletsPointParagraphe2.text":"En quelques clicks, gérez l'ensemble de votre flotte. Mettez en place des macros et des synergies sur vos systèmes.","home.section.bulletsPointParagraphe3.title":"Reporting","home.section.bulletsPointParagraphe3.text":"Avec son module BI, notre logiciel vous permet de monitorer la performance et d'optimiser vos coûts. A l'euro prêt","home.realm.title":"Le coeur du métier en quelques clics","home.realm.text":"La sécurité de vos données est au cœur de nos préoccupations. Notre logiciel a été créé en France, nous sommes certifiés ISO 27001 et tous nos serveurs sont situés en Europe.","home.realm.cta":"Voir notre solution","home.testimonials.title":"Nos clients parlent de nous","home.testimonials.1.text":"Depuis notre utilisation du logiciel, nous avons un meilleur contrôle du flux de marchandises et un suivi de performance pertinent.","home.testimonials.1.job":"Developpeur @Wordpress","home.testimonials.1.name":"Loic Martins","home.testimonials.2.text":"La mise en production de la solution logicielle nous a permis de réorganiser complètement les équipes.","home.testimonials.2.job":"Community Manager @Comet","home.testimonials.2.name":"Anna Wang","home.testimonials.3.text":"La maitrise du sujet logistique est une évidence avec la solution logicielle.","home.testimonials.3.job":"Product Owner @April","home.testimonials.3.name":"Louis Bachant","home.test.section.title":"Testez dès maintenant","home.test.section.CTA":"Voir notre solution","pricing.CTA.pleaseLogin":"Connectez-vous","pricing.page.title":"Choisissez votre plan","pricing.page.subtitle":"Sans engagement : annulez à tout moment en un clic.","subscribe.paymentRecap.title":"Récapitulatif de paiement","subscribe.paymentRecap.customerName":"Nom","subscribe.paymentRecap.customerMail":"Email","subscribe.paymentRecap.additionnalMention":"Mention à ajouter","subscribe.paymentRecap.totalAmount":"Total","subscribe.paymentForm.title":"Carte bancaire","subscribe.paymentForm.cardNumber":"Numéro de carte","subscribe.paymentForm.expiresAt":"Expire le","subscribe.paymentForm.CVCNumber":"Numéro CVV","subscribe.paymentForm.CTA.loading":"Chargement ...","subscribe.paymentForm.CTA.pay":"S'abonner","subscribe.success.title":"Paiement effectué avec succès","subscribe.success.paragraph1":"Votre paiement a bien été accepté. Vous êtes désormais abonné !","subscribe.success.paragraph2":"Toutes vos options sont maintenant disponibles.","myAccount.page.leftMenu.general":"Général","myAccount.page.leftMenu.profile":"Profil","chatbot.placeholder.content":"Envoyez un message à l'assistant ...","chatbot.chatline.label.user":"Vous","chatbot.chatline.label.assistant":"Assistant","chatbot.chatline.loading.function.search":"Recherche","chatbot.chatline.loading.function.genericSearchMessage":"Je cherche des produits","chatbot.chatline.loading.function.extractProductName":"Recherche dans la caverne","chatbot.chatline.loading.function.suggestProductName":"Consultation des shadocks","chatbot.chatline.loading.function.criteriaDefinition":"Recherche des ziboublis","chatbot.chatline.loading.function.searchStock":"Recherche en stock","chatbot.chatline.loading.function.step":"Etape","chatbot.chatline.loading.cancel":"Annuler","footer.tab.title.general":"Général","footer.tab.title.about":"A propos","footer.tab.title.resources":"Ressources","footer.tab.title.legal":"Mentions Légales","footer.tab.title.social":"Social","footer.tab.search":"Rechercher","footer.tab.pricing":"Tarifs","footer.tab.termsAndConditions":"Termes et conditions","footer.tab.finalCopyright":"Copyright © 2023 Logiciel, Inc. Tous droits réservés."};var Ke=(e=>(e.FRENCH="fr-FR",e.ENGLISH="en-US",e))(Ke||{});const mr={[Ke.ENGLISH]:{translatedText:Kc,pictureName:Ke.ENGLISH,langID:0,locale:Ke.ENGLISH},[Ke.FRENCH]:{translatedText:Zc,pictureName:Ke.FRENCH,langID:1,locale:Ke.FRENCH}},Jc=Object.keys(mr);Jc.reduce((e,t)=>{const n=mr[t];return[...e,n]},[]);const ef="languageSettings",tf=(e,t)=>{let n,r;return typeof window<"u"&&(r=window.localStorage.getItem(ef)),r&&e?.[r]!==void 0?n=e[r]:(n=e[t],n.isDefault=!0),n},nf=(e,t)=>{const[n,r]=N.useState(e[t]),a=i=>{Object.keys(e).includes(i?.locale)?r(i):r(e[Ke.ENGLISH])};return N.useEffect(()=>{let i=tf(e,t);i.locale!==t&&r(e[i.locale])},[]),{appCurrentLang:n,handleSetContextCurrentLang:a}},Os=N.createContext({appCurrentLang:mr[Ke.ENGLISH],setAppCurrentLang:()=>{}}),Ls=N.createContext({conversation:[],setConversation:()=>{}});var Lt={},Ri;function rf(){if(Ri)return Lt;Ri=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.AgentDisplayFacetRoleType=Lt.AgentDisplayFacetModeType=void 0;var e;(function(n){n.SPRITESHEET="spritesheet",n.LOTTIE="lottie",n.IMAGE="image",n.SVG="svg",n.VIDEO="video"})(e||(Lt.AgentDisplayFacetModeType=e={}));var t;return(function(n){n.LAUNCHER="launcher",n.ASSISTANT="assistant",n.SEARCH="search"})(t||(Lt.AgentDisplayFacetRoleType=t={})),Lt}var Ge=rf();const Dr=e=>({mode:Ge.AgentDisplayFacetModeType.SVG,role:e}),af=()=>({agent:{display:{name:"",CSSRules:"",[Ge.AgentDisplayFacetRoleType.LAUNCHER]:Dr(Ge.AgentDisplayFacetRoleType.LAUNCHER),[Ge.AgentDisplayFacetRoleType.ASSISTANT]:Dr(Ge.AgentDisplayFacetRoleType.ASSISTANT),[Ge.AgentDisplayFacetRoleType.SEARCH]:Dr(Ge.AgentDisplayFacetRoleType.SEARCH)},text:{initialText:""}}}),pr=N.createContext({companySettings:af(),setCompanySettings:()=>{}}),Rs=()=>({hasFetchedSettings:!1,hasDisplayedCSS:!1}),uf=()=>{const[e,t]=N.useState(Rs());return{appInternalContext:e,setAppInternalContext:t,setHasFetchedSettings:()=>{t(a=>({...a,hasFetchedSettings:!0}))},setHasDisplayedCss:()=>{t(a=>({...a,hasDisplayedCSS:!0}))}}},vs=N.createContext({appInternalContext:Rs(),setAppInternalContext:()=>{},setHasFetchedSettings:()=>{}}),sf=e=>Object.values(Ke).includes(e),of=e=>sf(e)?e:(console.log(`Language ${e} not handled for now. Using ${Ke.ENGLISH}.`),Ke.ENGLISH);class Zn{constructor(){}static getApiUrl=()=>process.env.NODE_ENV==="development"?"http://localhost:3001":"https://www.api.chatsystem.ai";static getHeaders=({contentType:t="text/plain"})=>({"Content-Type":t});static getFetchConfig=({contentType:t="text/plain",httpVerb:n="GET",body:r,options:a={}})=>{const i={method:n,headers:this.getHeaders({contentType:t}),...a};return r&&(i.body=JSON.stringify(r)),i}}const lf=({agentId:e,appToken:t,onFetched:n})=>{const[r,a]=N.useState({}),i={companySettings:r,setCompanySettings:a},[u,o]=N.useState([]),l={conversation:u,setConversation:o};return N.useEffect(()=>{const c=Zn.getApiUrl(),f=Zn.getFetchConfig({httpVerb:"GET",contentType:"application/json"});fetch(`${c}/company/settings/${t}/${e}`,f).then(async d=>{const m=await d.json();a(m),o([{userType:"assistant",content:m.agent.text.initialText}]),n?.()}).catch(d=>console.log("error in fetch",d))},[t,e]),{contextCompanySettings:i,contextInitialChatbotStartingText:l}};function cf(e,t={},n){const{id:r,nonce:a,target:i,disableConstructable:u}=t,o=i??document.head,l=N.useRef(null),c=N.useRef(null);N.useEffect(()=>{if(!e){n?.(),console.log("No custom css found.");return}if(!u&&"adoptedStyleSheets"in o&&typeof CSSStyleSheet<"u"&&"replaceSync"in CSSStyleSheet.prototype)return l.current||(l.current=new CSSStyleSheet,o.adoptedStyleSheets=[...o.adoptedStyleSheets,l.current]),l.current.replaceSync(e),console.log("Loading custom css via stylesheet."),n?.(),()=>{const d=o.adoptedStyleSheets||[],m=d.indexOf(l.current);if(m>=0){const h=d.slice();h.splice(m,1),o.adoptedStyleSheets=h}l.current=null};if(!c.current){const d=document.createElement("style");d.type="text/css",r&&(d.id=r),a&&(d.nonce=a),(o instanceof Document&&o.head||o).appendChild(d),c.current=d}return c.current.textContent=e,console.log("Loading custom css via style tag."),n?.(),()=>{c.current?.parentNode?.removeChild(c.current),c.current=null}},[e,r,a,i,u])}const Zt=globalThis;Zt.__WIDGET_ASSET_CACHE__||(Zt.__WIDGET_ASSET_CACHE__={svg:new Map,img:new Map,lot:new Map,spr:new Map});Zt.__WIDGET_PRELOAD_KEYS__||(Zt.__WIDGET_PRELOAD_KEYS__=new Set);const kr=Zt.__WIDGET_PRELOAD_KEYS__,St=Zt.__WIDGET_ASSET_CACHE__,ff="widget-assets-v1";async function Er(e,t){const n=await caches.open(ff),r=await n.match(e,{ignoreSearch:!1});if(r)return r.clone();const a=await fetch(e,{cache:"force-cache",mode:"cors",keepalive:!0,...t});if(!a.ok)throw new Error(`HTTP ${a.status} for ${e}`);return n.put(e,a.clone()),a}async function Ps(e){const t=St.svg.get(e);if(t)return t.promise;const n=(async()=>{const a=await(await Er(e)).text();if(typeof globalThis.DOMPurify<"u"&&typeof globalThis.DOMPurify.sanitize=="function")try{const u=new DOMParser().parseFromString(a,"image/svg+xml"),o=new XMLSerializer().serializeToString(u.documentElement);return{sanitized:globalThis.DOMPurify.sanitize(o,{USE_PROFILES:{svg:!0,svgFilters:!0}})}}catch{return{sanitized:globalThis.DOMPurify.sanitize(a,{USE_PROFILES:{svg:!0,svgFilters:!0}})}}else return{sanitized:a}})();return St.svg.set(e,{promise:n,ts:Date.now()}),n}function Ds(e){const t=St.img.get(e);if(t)return t.promise;const n=(async()=>{const a=await(await Er(e)).blob();return{blobUrl:URL.createObjectURL(a)}})();return St.img.set(e,{promise:n,ts:Date.now()}),n}function ks(e){const t=St.lot.get(e);if(t)return t.promise;const n=(async()=>{const a=await(await Er(e)).arrayBuffer(),i=new Uint8Array(a);if(i.length>=4&&i[0]===80&&i[1]===75&&i[2]===3&&i[3]===4||e.endsWith(".lottie"))return{kind:"zip",blobUrl:URL.createObjectURL(new Blob([a],{type:"application/zip"}))};const o=new TextDecoder().decode(i);return{kind:"json",data:JSON.parse(o)}})();return St.lot.set(e,{promise:n,ts:Date.now()}),n}function ws(e){const t=St.spr.get(e);if(t)return t.promise;const n=(async()=>{const a=await(await Er(e)).blob();let i=null;try{i=await createImageBitmap(a)}catch{i=null}const{imgEl:u,width:o,height:l}=await new Promise((c,f)=>{const d=URL.createObjectURL(a),m=new Image;m.crossOrigin="anonymous",m.onload=()=>{const h=m.naturalWidth,y=m.naturalHeight;c({imgEl:m,width:h,height:y})},m.onerror=()=>{URL.revokeObjectURL(d),f(new Error("Spritesheet image decode failed"))},m.src=d,m.decode?.().catch(()=>{})});return{imgEl:u,bitmap:i,width:o,height:l}})();return St.spr.set(e,{promise:n,ts:Date.now()}),n}function df(e){e.images?.forEach(t=>void Ds(t)),e.svgs?.forEach(t=>void Ps(t)),e.lotties?.forEach(t=>void ks(t)),e.sprites?.forEach(t=>void ws(t))}function hf(e){try{const t=document.createElement("link");t.rel="preconnect",t.href=e,t.crossOrigin="anonymous",document.head.appendChild(t);const n=document.createElement("link");n.rel="dns-prefetch",n.href=e,document.head.appendChild(n)}catch(t){console.log("error in injectPreconnect",t)}}function Ms(e){return new URL(e,document.baseURI).toString()}function mf(e,t){const n=document.head.querySelectorAll('link[rel="preload"]');for(const r of n)if((e?r.as===e||r.getAttribute("as")===e:!0)&&r.href===t)return!0;return!1}function jn(e,t,n,r){const a=Ms(n),i=`${e}|${t??""}|${a}`;if(kr.has(i))return;if(mf(t,a)){kr.add(i);return}const u=document.createElement("link");u.rel=e,t&&(u.as=t),u.href=a,u.crossOrigin="anonymous",r&&(u.type=r),u.setAttribute("data-chatsystem-preload","1"),document.head.appendChild(u),kr.add(i)}function pf(e){const t=u=>Array.from(new Set((u??[]).map(Ms))),n=t(e.images),r=t(e.svgs),a=t(e.lotties),i=t(e.sprites);n.forEach(u=>jn("preload","image",u)),r.forEach(u=>jn("preload","fetch",u,"image/svg+xml")),a.forEach(u=>jn("preload","fetch",u,"application/zip")),i.forEach(u=>jn("preload","fetch",u))}function Ef(e){const{manifest:t,origins:n}=bf(e);n.forEach(hf),pf(t),df(t)}function bf(e){const t=Tf(e),n=new Set,r=new Set,a=new Set,i=new Set;for(const{url:l,mode:c}of t)switch(gf(c,l)){case"svg":r.add(l);break;case"lottie":a.add(l);break;case"spritesheet":i.add(l);break;case"image":n.add(l);break}const u={images:Array.from(n),svgs:Array.from(r),lotties:Array.from(a),sprites:Array.from(i)},o=Af(u);return{manifest:u,origins:o}}function Tf(e){if(!e?.agent?.display)return[];const t=e.agent.display,n=[t.launcher,t.assistant,t.search].filter(Boolean),r=[];for(const a of n)a?.assetUrl&&r.push({url:a.assetUrl,mode:a.mode});return r}function gf(e,t){if(e)switch(e){case"svg":return"svg";case"lottie":return"lottie";case"spritesheet":return"spritesheet";case"image":return"image";case"video":return"video"}try{const r=new URL(t,document.baseURI).pathname.toLowerCase();if(r.endsWith(".svg"))return"svg";if(r.endsWith(".lottie")||r.endsWith(".zip")||r.endsWith(".json"))return r.endsWith(".json"),"lottie";if(/\.(png|webp|jpg|jpeg|gif|avi,ef)$/.test(r))return"image";if(/\.(mp4|webm|mov|m4v|ogg)$/.test(r))return"video"}catch(n){console.log("error in normalizeKind:",n)}return"unknown"}function Af(e){const t=new Set,n=r=>{if(r)try{const a=new URL(r,document.baseURI);t.add(`${a.protocol}//${a.host}`)}catch(a){console.log("error in uniqueOriginsFromManifest",a)}};return(e.images??[]).forEach(n),(e.svgs??[]).forEach(n),(e.lotties??[]).forEach(n),(e.sprites??[]).forEach(n),Array.from(t)}const _f=({children:e,appToken:t,agentId:n})=>{var r=navigator.language;console.log("App boot"),console.log("Brower language",r);const a=of(r),{appCurrentLang:i,handleSetContextCurrentLang:u}=nf(mr,a),o={appCurrentLang:i,setAppCurrentLang:u},l=uf(),{contextCompanySettings:c,contextInitialChatbotStartingText:f}=lf({agentId:n,appToken:t,onFetched:l.setHasFetchedSettings});return Ef(c.companySettings),cf(c.companySettings?.agent?.display?.CSSRules,{id:`${n}`},l.setHasDisplayedCss),v.jsx(v.Fragment,{children:v.jsx(Qc,{locale:i?.locale,messages:i?.translatedText,children:v.jsx(Os.Provider,{value:o,children:v.jsx(vs.Provider,{value:l,children:v.jsx(pr.Provider,{value:c,children:v.jsx(Ls.Provider,{value:f,children:l.appInternalContext.hasDisplayedCSS&&e})})})})})})},yf=e=>Object.values(tn).includes(e),Sf=e=>yf(e)?e:(console.warn(`Display mode not valid. Using ${tn.LAUNCHER} as default.`),tn.LAUNCHER),xf=e=>Ve.createElement("svg",{fill:"#000000",height:"800px",width:"800px",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 330 330",xmlSpace:"preserve",...e},Ve.createElement("path",{id:"XMLID_102_",d:"M325.607,79.393c-5.857-5.857-15.355-5.858-21.213,0.001l-139.39,139.393L25.607,79.393 c-5.857-5.857-15.355-5.858-21.213,0.001c-5.858,5.858-5.858,15.355,0,21.213l150.004,150c2.813,2.813,6.628,4.393,10.606,4.393 s7.794-1.581,10.606-4.394l149.996-150C331.465,94.749,331.465,85.251,325.607,79.393z"})),Cf=({src:e})=>{const[t,n]=N.useState(null);return N.useEffect(()=>{let r=!1;return Ds(e).then(({blobUrl:a})=>{n(a)}).catch(()=>n(null)),()=>{t&&!r&&(URL.revokeObjectURL(t),r=!0)}},[e]),v.jsx("img",{src:t??e,decoding:"async",loading:"eager"})};function If(e){return!!e&&typeof e=="object"&&"blob"in e&&e.blob instanceof Blob}function Nf({src:e,autoplay:t=!0,loop:n=!0,className:r,style:a,placeholder:i,fallback:u,onLoaded:o,onError:l}){const[c,f]=N.useState({kind:"loading"});return N.useEffect(()=>{let d=null,m=!1;return f({kind:"loading"}),ks(e).then(async h=>{if(!m)if(h.kind==="zip"){const y=If(h)?h.blob:await(await fetch(h.blobUrl)).blob();d=URL.createObjectURL(y),f({kind:"lottieZip",blobUrl:d}),o?.(d)}else f({kind:"json",data:h.data}),o?.(h.data)}).catch(h=>!m&&(f({kind:"error",err:h}),l?.(h))),()=>{m=!0,d&&URL.revokeObjectURL(d)}},[e]),c.kind==="loading"?v.jsx("div",{className:"flex items-center justify-center rounded-xl border border-dashed p-6 text-sm opacity-70 "+(r??""),style:{minHeight:96,...a},children:i??"Loading animation…"}):c.kind==="error"?v.jsx("div",{className:"flex items-center justify-center rounded-xl border p-6 text-sm text-red-600 "+(r??""),style:{minHeight:96,...a},children:u??"Failed to load animation"}):c.kind==="json"?v.jsx(xl,{animationData:c.data,loop:n,autoplay:t,className:r,style:a,rendererSettings:{preserveAspectRatio:"xMidYMid meet"}}):v.jsx(Cl.DotLottieReact,{src:c.blobUrl,loop:n,autoplay:t,className:r,style:a})}async function Of(e,t={}){const{minPeriod:n=8,maxPeriod:r=Math.floor(Math.min(e.width,e.height)/2),gutterSearchRadius:a=3,debug:i=!1}=t;if(e.width<n*2||e.height<n*2)return i&&console.warn("detectGrid: image too small"),null;const u=document.createElement("canvas");u.width=e.naturalWidth,u.height=e.naturalHeight;const o=u.getContext("2d");if(!o)return null;o.drawImage(e,0,0);const{data:l}=o.getImageData(0,0,u.width,u.height),c=u.width,f=u.height,d=new Uint8ClampedArray(c*f);for(let Y=0;Y<f;Y++){let F=Y*c;for(let B=0;B<c;B++){const G=(F+B)*4;d[F+B]=.299*l[G]+.587*l[G+1]+.114*l[G+2]|0}}const m=new Float32Array(c),h=new Float32Array(f);for(let Y=1;Y<c-1;Y++){let F=0;for(let B=0;B<f;B++){const G=B*c+Y,$=d[G+1]-d[G-1];F+=Math.abs($)}m[Y]=F}for(let Y=1;Y<f-1;Y++){let F=0;for(let B=0;B<c;B++){const G=Y*c+B,$=d[G+c]-d[G-c];F+=Math.abs($)}h[Y]=F}const y=vi(m,n,Math.min(r,c/2)),A=vi(h,n,Math.min(r,f/2));if(!y||!A)return i&&console.warn("detectGrid: could not find periods"),null;const R=Math.max(1,Math.round(c/y)),S=Math.max(1,Math.round(f/A)),P=Pi(m,y,R,a),O=Pi(h,A,S,a),w=Math.max(1,y-P),C=Math.max(1,A-O);if(w*R>c+2||C*S>f+2)return i&&console.warn("detectGrid: sanity check failed"),null;const I=ba(m,60),W=ba(h,60),se=Math.max(0,Di(m,I)),ne=Math.max(0,Di(h,W));return i&&console.log({periodX:y,periodY:A,columns:R,rows:S,gutterX:P,gutterY:O,frameWidth:w,frameHeight:C,originX:se,originY:ne}),{columns:R,rows:S,frameWidth:w,frameHeight:C,gutterX:P,gutterY:O,originX:se,originY:ne}}function vi(e,t,n){const r=Bs(e);let a=0;for(let h=0;h<e.length;h++){const y=e[h]-r;a+=y*y}if(a===0)return null;const i=new Float32Array(n+1);let u=0,o=-1/0;for(let h=t;h<=n;h++){let y=0;for(let R=0;R+h<e.length;R++)y+=(e[R]-r)*(e[R+h]-r);const A=y/a;i[h]=A,A>o&&(o=A,u=h)}if(u<=t||u>=n)return u||null;const l=i[u-1],c=i[u],f=i[u+1],d=l-2*c+f,m=d===0?0:.5*(l-f)/d;return u+m}function Pi(e,t,n,r){const a=[];for(let o=1;o<n;o++){const l=o*t;let c=1/0,f=l;for(let d=-r;d<=r;d++){const m=l+d;if(m<=0||m>=e.length)continue;const h=e[m];h<c&&(c=h,f=m)}a.push(f)}if(a.length<1)return 0;let i=[];for(const o of a){const l=e[o]*1.5+ba(e,10)*.5;let c=o,f=o;for(;c>1&&e[c-1]<=l;)c--;for(;f<e.length-2&&e[f+1]<=l;)f++;i.push(Math.max(0,f-c+1))}const u=Math.round(Bs(i));return Math.max(0,Math.min(u,Math.floor(t/4)))}function Bs(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t/e.length}function ba(e,t){const n=Array.from(e);n.sort((a,i)=>a-i);const r=Math.max(0,Math.min(n.length-1,Math.floor(t/100*n.length)));return n[r]}function Di(e,t){for(let n=0;n<e.length;n++)if(e[n]>t)return n;return 0}function Lf(e,t,n,r,a){const{data:i}=e.getImageData(t,n,r,a);let u=0;for(let o=3;o<i.length;o+=4)u+=i[o];return u/(255*(i.length/4))<.03}const Rf=N.forwardRef(function({src:t,frameWidth:n,frameHeight:r,columns:a,rows:i,gutterX:u=0,gutterY:o=0,frameCount:l,atlasFrames:c,fps:f=12,autoplay:d=!0,loop:m=!0,startFrame:h=0,direction:y="forward",scale:A=1,backgroundColor:R,className:S,style:P,pauseWhenHidden:O=!1,onLoad:w,onEnd:C,onFrame:I},W){const se=N.useRef(null),ne=N.useRef(null),[Y,F]=N.useState(null),[B,G]=N.useState(null),[$,X]=N.useState(null),[oe,pe]=N.useState(!1),[ve,Le]=N.useState(!!d),[p,H]=N.useState(h),Q=N.useRef(1),[T,q]=N.useState(null),Z=Math.max(1,Math.floor(typeof window<"u"&&window.devicePixelRatio||1));N.useEffect(()=>{let ce=!1;return pe(!1),ws(t).then(({imgEl:Ie,bitmap:Ee})=>{ce||(F(Ie),G(Ee),X({w:Ie.naturalWidth,h:Ie.naturalHeight}),pe(!0),w?.())}).catch(()=>{}),()=>{ce=!0}},[t,w]),N.useEffect(()=>{let ce=!1;return(async()=>{if(!Y)return;if(c&&c.length){q(null);return}if(!(!n||!r||!a||!i)){q(null);return}const Ee=await Of(Y,{debug:!0});ce||(Ee?q({frameWidth:Ee.frameWidth,frameHeight:Ee.frameHeight,columns:Ee.columns,rows:Ee.rows,gutterX:Ee.gutterX,gutterY:Ee.gutterY}):(q(null),console.warn("RemoteSpritesheet: auto-detect failed; please provide grid props.")))})(),()=>{ce=!0}},[Y,c,n,r,a,i]);const z=T?.frameWidth??n,K=T?.frameHeight??r,te=T?.columns??a,ie=T?.rows??i,J=T?.gutterX??u,_e=T?.gutterY??o,j=N.useMemo(()=>{if(c&&c.length>0)return{cols:0,rows:0};if(!$||!z||!K)return{cols:0,rows:0};const ce=te??Math.floor(($.w+J)/(z+J)),Ie=ie??Math.floor(($.h+_e)/(K+_e));return{cols:Math.max(0,ce),rows:Math.max(0,Ie)}},[c,$,z,K,te,ie,J,_e]),xe=N.useMemo(()=>{if(c?.length)return c;if(!z||!K)return[];const{cols:ce,rows:Ie}=j;if(!ce||!Ie)return[];const Ee=Math.min(l??ce*Ie,ce*Ie),be=[];for(let Ne=0;Ne<Ee;Ne++){const Fe=Ne%ce,we=Math.floor(Ne/ce),qe=T?.originX??0,Nr=T?.originY??0,L=qe+Fe*(z+J),U=Nr+we*(K+_e);be.push({x:L,y:U,w:z,h:K})}if(Y&&be.length){const Ne=document.createElement("canvas");Ne.width=Y.naturalWidth,Ne.height=Y.naturalHeight;const Fe=Ne.getContext("2d");if(Fe){Fe.drawImage(Y,0,0);let we=be.length;for(;we>0&&Lf(Fe,be[we-1].x,be[we-1].y,be[we-1].w,be[we-1].h);)we--;return be.slice(0,we)}}return be},[c,j,l,z,K,J,_e,Y,T?.originX,T?.originY]),ke=()=>{const ce=se.current;if(!ce||xe.length===0)return;const Ie=xe[Math.max(0,Math.min(p,xe.length-1))],Ee=Math.max(1,Math.round(Ie.w*A)),be=Math.max(1,Math.round(Ie.h*A));ce.style.width=Ee+"px",ce.style.height=be+"px",ce.width=Ee*Z,ce.height=be*Z};N.useEffect(()=>{ke()},[oe,A,xe.length,Z,p]);const Ce=ce=>{const Ie=B??Y??null,Ee=se.current;if(!Ee||!Ie||xe.length===0)return;const be=Ee.getContext("2d");if(!be)return;be.save(),be.setTransform(1,0,0,1,0,0),be.clearRect(0,0,Ee.width,Ee.height),R&&(be.fillStyle=R,be.fillRect(0,0,Ee.width,Ee.height));const Ne=xe[ce];be.scale(Z,Z),be.drawImage(Ie,Ne.x,Ne.y,Ne.w,Ne.h,0,0,Math.round(Ne.w*A),Math.round(Ne.h*A)),be.restore()};return N.useEffect(()=>{if(!oe||xe.length===0)return;let ce=performance.now();const Ie=1e3/Math.max(1,Math.min(120,f)),Ee=be=>{if(ne.current=requestAnimationFrame(Ee),!ve){Ce(p);return}const Ne=be-ce;if(Ne<Ie){Ce(p);return}ce=be-Ne%Ie,H(Fe=>{const we=xe.length-1;let qe=Fe;return y==="forward"?qe=Fe+1:y==="backward"?qe=Fe-1:((Fe>=we&&Q.current===1||Fe<=0&&Q.current===-1)&&(Q.current*=-1),qe=Fe+Q.current),(qe>we||qe<0)&&(m?qe=y==="backward"?we:0:(qe=Math.max(0,Math.min(qe,we)),Le(!1),C?.())),qe})};return ne.current=requestAnimationFrame(Ee),()=>{ne.current&&cancelAnimationFrame(ne.current)}},[oe,f,ve,m,y,xe.length,p]),N.useEffect(()=>{Ce(p),I?.(p)},[p,oe,A,Z]),N.useEffect(()=>{if(!O)return;const ce=()=>{document.hidden&&Le(!1)};return document.addEventListener("visibilitychange",ce),()=>document.removeEventListener("visibilitychange",ce)},[O]),N.useImperativeHandle(W,()=>({play:()=>Le(!0),pause:()=>Le(!1),toggle:()=>Le(ce=>!ce),gotoFrame:ce=>H(()=>Math.max(0,Math.min(ce,Math.max(0,xe.length-1)))),isPlaying:()=>ve,currentFrame:()=>p}),[ve,p,xe.length]),v.jsx("div",{className:S,style:P,children:v.jsx("canvas",{ref:se,"aria-label":"spritesheet animation"})})});function vf({url:e,className:t}){const[n,r]=N.useState(""),[a,i]=N.useState(null);return N.useEffect(()=>{let u=!1;return Ps(e).then(({sanitized:o})=>{u||(r(o),i(null))}).catch(o=>!u&&i(o.message??"Failed to load")),()=>{u=!0}},[e]),a?v.jsxs("div",{className:t,role:"alert",children:["Couldn’t load SVG: ",a]}):n?v.jsx("div",{className:t,dangerouslySetInnerHTML:{__html:n}}):v.jsx("div",{className:t})}const $a=({facet:e})=>{const{mode:t,assetUrl:n}=e;return v.jsxs("div",{className:"assetContainer",children:[t===Ge.AgentDisplayFacetModeType.LOTTIE&&v.jsx(Nf,{src:n,autoplay:!0,onError:r=>console.error(r)}),t===Ge.AgentDisplayFacetModeType.SVG&&v.jsx("div",{children:v.jsx(vf,{url:n})}),t===Ge.AgentDisplayFacetModeType.IMAGE&&v.jsx(Cf,{src:n}),t===Ge.AgentDisplayFacetModeType.SPRITESHEET&&v.jsx(Rf,{src:n})]})},Pf=({isWidgetOpen:e,setIsWidgetOpen:t})=>{const{companySettings:n}=N.useContext(pr);return v.jsxs("div",{className:`launcher
|
|
37
38
|
fixed
|
|
38
39
|
z-[999999999]
|
|
39
40
|
transition
|