@yartsun/hypershadow-widget 0.1.12 → 0.1.13
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/lib/index.cjs.js +75 -45
- package/dist/lib/index.es.js +3481 -3319
- package/dist/lib/style.css +1 -1
- package/dist/standalone/hs-widget.css +1 -1
- package/dist/standalone/hs-widget.es.js +8501 -8259
- package/dist/standalone/hs-widget.iife.js +99 -69
- package/dist/static/widget/v1/chat/assets/ChatWrapper.vue_vue_type_style_index_0_lang-BYUUyq1B.js +106 -0
- package/dist/{widget/chat/assets/__federation_expose_Chat-B-cuBP_G.js → static/widget/v1/chat/assets/federation-expose-Chat-Xz4ujhml.js} +1 -1
- package/dist/static/widget/v1/chat/assets/federation-expose-Utils-BEpxBLK-.js +1 -0
- package/dist/static/widget/v1/chat/assets/{federation-import-CxlH6xnb.js → federation-import-bOe-N7Y_.js} +1 -1
- package/dist/static/widget/v1/chat/assets/federation-shared-vue-ElFYw5cl.js +23 -0
- package/dist/static/widget/v1/chat/assets/index-D6FIEbUe.js +5 -0
- package/dist/static/widget/v1/chat/assets/remoteChat.js +1 -1
- package/dist/static/widget/v1/chat/assets/style-DxPu28t-.css +1 -0
- package/dist/static/widget/v1/chat/index.html +5 -5
- package/package.json +2 -2
- package/types/message.types.ts +1 -0
- package/dist/static/widget/v1/chat/assets/ChatWrapper.vue_vue_type_style_index_0_lang-Cgm8_td1.js +0 -76
- package/dist/static/widget/v1/chat/assets/federation-expose-Chat-DeARWUZA.js +0 -1
- package/dist/static/widget/v1/chat/assets/federation-expose-Utils-BmSDJTj0.js +0 -1
- package/dist/static/widget/v1/chat/assets/federation-shared-vue-MGgX2WkV.js +0 -22
- package/dist/static/widget/v1/chat/assets/index-Begpz7o5.js +0 -5
- package/dist/static/widget/v1/chat/assets/style-DL26ESls.css +0 -1
- package/dist/widget/chat/assets/ChatWrapper.vue_vue_type_style_index_0_lang-CSxaiIok.js +0 -3
- package/dist/widget/chat/assets/__federation_fn_import-CxlH6xnb.js +0 -1
- package/dist/widget/chat/assets/__federation_shared_vue-MGgX2WkV.js +0 -22
- package/dist/widget/chat/assets/federation-utils-DDIHa9Ih.js +0 -1
- package/dist/widget/chat/assets/index-DN9zikYF.js +0 -5
- package/dist/widget/chat/assets/remoteChat.js +0 -1
- package/dist/widget/chat/assets/style-GHzhDfDI.css +0 -1
- package/dist/widget/chat/index.html +0 -22
- package/dist/widget/chat/init.js +0 -28
- package/dist/widget/chat/vite.svg +0 -1
package/dist/static/widget/v1/chat/assets/ChatWrapper.vue_vue_type_style_index_0_lang-BYUUyq1B.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import{importShared as B}from"./federation-import-bOe-N7Y_.js";import{c as cl,cn as zo}from"./federation-expose-Utils-BEpxBLK-.js";const Cr=i=>typeof i=="boolean"?`${i}`:i===0?"0":i,xr=cl,ul=(i,e)=>t=>{var s;if(e?.variants==null)return xr(i,t?.class,t?.className);const{variants:n,defaultVariants:r}=e,o=Object.keys(n).map(c=>{const u=t?.[c],d=r?.[c];if(u===null)return null;const g=Cr(u)||Cr(d);return n[c][g]}),a=t&&Object.entries(t).reduce((c,u)=>{let[d,g]=u;return g===void 0||(c[d]=g),c},{}),l=e==null||(s=e.compoundVariants)===null||s===void 0?void 0:s.reduce((c,u)=>{let{class:d,className:g,...f}=u;return Object.entries(f).every(m=>{let[h,w]=m;return Array.isArray(w)?w.includes({...r,...a}[h]):{...r,...a}[h]===w})?[...c,d,g]:c},[]);return xr(i,o,l,t?.class,t?.className)},{Fragment:dl}=await B("vue");function Bo(i){return i?i.flatMap(e=>e.type===dl?Bo(e.children):[e]):[]}const{Comment:hl,cloneVNode:gl,defineComponent:fl,mergeProps:pl}=await B("vue"),ml=fl({name:"PrimitiveSlot",inheritAttrs:!1,setup(i,{attrs:e,slots:t}){return()=>{if(!t.default)return null;const s=Bo(t.default()),n=s.findIndex(l=>l.type!==hl);if(n===-1)return s;const r=s[n];delete r.props?.ref;const o=r.props?pl(e,r.props):e,a=gl({...r,props:{}},o);return s.length===1?a:(s[n]=a,s)}}}),{defineComponent:wl,h:On}=await B("vue"),yl=["area","img","input"],bl=wl({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(i,{attrs:e,slots:t}){const s=i.asChild?"template":i.as;return typeof s=="string"&&yl.includes(s)?()=>On(s,e):s!=="template"?()=>On(i.as,e,{default:t.default}):()=>On(ml,e,{default:t.default})}}),{defineComponent:vl}=await B("vue"),{unref:In,renderSlot:Cl,normalizeClass:xl,withCtx:kl,openBlock:_l,createBlock:Sl}=await B("vue"),at=vl({__name:"Button",props:{variant:{},size:{},class:{},asChild:{type:Boolean},as:{default:"button"}},setup(i){const e=i;return(t,s)=>(_l(),Sl(In(bl),{"data-slot":"button",as:i.as,"as-child":i.asChild,class:xl(In(zo)(In(Tl)({variant:i.variant,size:i.size}),e.class))},{default:kl(()=>[Cl(t.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),Tl=ul("tw:inline-flex tw:cursor-pointer tw:items-center tw:justify-center tw:whitespace-nowrap tw:text-sm tw:transition-all disabled:tw:pointer-events-none disabled:tw:opacity-50 [&_svg]:tw:pointer-events-none [&_svg:not([class*='size-'])]:tw:size-4 tw:shrink-0 [&_svg]:tw:shrink-0 tw:outline-none focus-visible:tw:border-ring focus-visible:tw:ring-ring/50 focus-visible:tw:ring-[3px] aria-invalid:tw:ring-destructive/20 dark:aria-invalid:tw:ring-destructive/40 aria-invalid:tw:border-destructive",{variants:{variant:{default:"tw:bg-primary tw:text-primary-foreground tw:shadow-xs hover:tw:bg-primary/90",destructive:"tw:bg-destructive tw:text-white tw:shadow-xs hover:tw:bg-destructive/90 focus-visible:tw:ring-destructive/20 dark:focus-visible:tw:ring-destructive/40 dark:tw:bg-destructive/60",outlined:"tw:border tw:bg-background tw:shadow-xs hover:tw:bg-accent hover:tw:text-accent-foreground dark:tw:bg-input/30 dark:tw:border-input dark:hover:tw:bg-input/50",secondary:"tw:bg-secondary tw:text-secondary-foreground tw:shadow-xs hover:tw:bg-secondary/80",ghost:"hover:tw:bg-accent hover:tw:text-accent-foreground dark:hover:tw:bg-accent/50",link:"tw:text-primary tw:underline-offset-4 hover:tw:underline",filled:"tw:border-transparent tw:bg-primary tw:text-primary-foreground [a&]:hover:tw:bg-primary/90",invisible:"tw:border-transparent tw:p-0! tw:bg-transparent tw:text-primary-foreground [a&]:hover:tw:bg-transparent"},size:{md:"tw:px-2 tw:py-1 tw:text-xs tw:h-6 tw:gap-1",sm:"tw:px-2 tw:py-1 tw:text-xs tw:h-5 tw:gap-1",lg:"tw:px-3 tw:py-1 tw:text-base tw:h-8 tw:gap-1",icon:"tw:size-9"}},defaultVariants:{variant:"default",size:"md"}}),Rl={md:16};function Eo(i){const e=i.getKey("settings.borderRadius")??16;return typeof e!="number"?Rl.md:e}function $l(i,e=8){if(i<=0)return 0;const t=i-e;return t<=0?4:Math.max(4,t)}function Fs(i,e=8){const t=Eo(i);return{borderRadius:`${$l(t,e)}px`}}const bi=i=>i?i.replace(/<br>/g,"<br />").replace(/\n/g,"<br />"):"",{defineComponent:Dl}=await B("vue"),{normalizeClass:ys,normalizeStyle:ht,openBlock:bs,createElementBlock:Qs,createCommentVNode:Js,unref:Fn,createElementVNode:en,toDisplayString:Ml,withCtx:zl,createBlock:Bl}=await B("vue"),El=["innerHTML"],Pl=["innerHTML"],Al=["innerHTML"],Vl=["width","height"],{computed:Yt}=await B("vue"),Ll=`
|
|
2
|
+
<svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path d="M21.76 16.42L15.36 4.9C14.5 3.35 13.31 2.5 12 2.5C10.69 2.5 9.49998 3.35 8.63998 4.9L2.23998 16.42C1.42998 17.89 1.33998 19.3 1.98998 20.41C2.63998 21.52 3.91998 22.13 5.59998 22.13H18.4C20.08 22.13 21.36 21.52 22.01 20.41C22.66 19.3 22.57 17.88 21.76 16.42ZM11.25 9.5C11.25 9.09 11.59 8.75 12 8.75C12.41 8.75 12.75 9.09 12.75 9.5V14.5C12.75 14.91 12.41 15.25 12 15.25C11.59 15.25 11.25 14.91 11.25 14.5V9.5ZM12.71 18.21C12.66 18.25 12.61 18.29 12.56 18.33C12.5 18.37 12.44 18.4 12.38 18.42C12.32 18.45 12.26 18.47 12.19 18.48C12.13 18.49 12.06 18.5 12 18.5C11.94 18.5 11.87 18.49 11.8 18.48C11.74 18.47 11.68 18.45 11.62 18.42C11.56 18.4 11.5 18.37 11.44 18.33C11.39 18.29 11.34 18.25 11.29 18.21C11.11 18.02 11 17.76 11 17.5C11 17.24 11.11 16.98 11.29 16.79C11.34 16.75 11.39 16.71 11.44 16.67C11.5 16.63 11.56 16.6 11.62 16.58C11.68 16.55 11.74 16.53 11.8 16.52C11.93 16.49 12.07 16.49 12.19 16.52C12.26 16.53 12.32 16.55 12.38 16.58C12.44 16.6 12.5 16.63 12.56 16.67C12.61 16.71 12.66 16.75 12.71 16.79C12.89 16.98 13 17.24 13 17.5C13 17.76 12.89 18.02 12.71 18.21Z" fill="currentColor"/>
|
|
4
|
+
</svg>`,kr=Dl({__name:"ChatError",props:{warningElement:{},headlineText:{},descriptionText:{},resetButtonText:{},type:{},configDesignClass:{},borderOffset:{},restartChat:{type:Function}},setup(i){const e=i,t=Yt(()=>e.configDesignClass?.getKey("settings.globalRoundingRadius")?Fs(e.configDesignClass,8):{borderRadius:e.warningElement.resetButton?.borderRadius+"px"}),s=Yt(()=>{const l=e.configDesignClass?.getKey("settings.globalRoundingRadius")?Fs(e.configDesignClass,8):{borderRadius:e.warningElement.content.borderRadius+"px"};return e.warningElement.warningStyle==="gradient"?{...l,"border-bottom-left-radius":"0px !important","border-bottom-right-radius":"0px !important"}:l}),n=Yt(()=>{const l=e.warningElement.content.bgColor;if(e.warningElement.warningStyle==="gradient"){const c=l?.match(/rgba?\(([^)]+)\)/);if(c){const[u,d,g]=c[1].split(",").map(f=>f.trim());return{background:`linear-gradient(180deg, ${l} 0%, rgba(${u}, ${d}, ${g}, 0) 100%)`}}else if(l?.startsWith("#")){const u=l.replace("#",""),d=parseInt(u.substr(0,2),16),g=parseInt(u.substr(2,2),16),f=parseInt(u.substr(4,2),16);return{background:`linear-gradient(180deg, ${l} 0%, rgba(${d}, ${g}, ${f}, 0) 100%)`}}}else if(e.warningElement.warningStyle==="faded"){const c=l?.match(/rgba?\(([^)]+)\)/);if(c){const[u,d,g]=c[1].split(",").map(f=>f.trim());return{backgroundColor:`rgba(${u}, ${d}, ${g}, 0.2)`,border:`1px solid ${l}`}}else if(l?.startsWith("#")){const u=l.replace("#",""),d=parseInt(u.substr(0,2),16),g=parseInt(u.substr(2,2),16),f=parseInt(u.substr(4,2),16);return{backgroundColor:`rgba(${d}, ${g}, ${f}, 0.2)`,border:`1px solid ${l}`}}}return{backgroundColor:l}}),r=Yt(()=>{const l=e.warningElement?.content?.icon?.src||Ll;try{const d=new DOMParser().parseFromString(String(l),"image/svg+xml").documentElement;return d.setAttribute("width","1em"),d.setAttribute("height","1em"),d.querySelectorAll("[fill], [stroke]").forEach(f=>{const m=f.getAttribute("fill");m&&m!=="none"&&!m.startsWith("url(")&&f.setAttribute("fill","currentColor");const h=f.getAttribute("stroke");h&&h!=="none"&&!h.startsWith("url(")&&f.setAttribute("stroke","currentColor")}),d.outerHTML}catch{return String(l)}}),o=Yt(()=>e.type==="launchIssue"?"24px":"16px"),a=Yt(()=>e.warningElement.resetButton?{backgroundColor:e.warningElement.resetButton.bgColor,color:e.warningElement.resetButton.color}:{});return(l,c)=>(bs(),Qs("div",{class:ys(["tw:w-full tw:flex tw:items-center tw:flex-[1_0_0] tw:self-stretch",{"tw:flex-row tw:items-center tw:justify-between":i.type==="connectionIssue"||i.type==="reconnecting","tw:flex-col tw:items-center tw:justify-center tw:h-full":i.type==="launchIssue","tw:p-4":i.warningElement.warningStyle==="gradient","tw:p-2":i.warningElement.warningStyle!=="gradient"}]),style:ht({...n.value,...s.value,paddingTop:(i.warningElement.content?.verticalPadding||null)+"px",paddingBottom:(i.warningElement.content?.verticalPadding||null)+"px"})},[en("div",{class:ys(["tw:flex tw:gap-1 tw:items-center svg-inherit",{"tw:flex-row":i.type==="connectionIssue"||i.type==="reconnecting","tw:flex-col ":i.type==="launchIssue"}]),style:ht({gap:(i.warningElement.content?.verticalSpacing||4)+"px"})},[i.warningElement.content.icon?.showIcon?(bs(),Qs("div",{key:0,style:ht({color:i.warningElement.content.icon?.color||i.warningElement.content.color,fontSize:o.value,width:(i.warningElement.content.icon?.size||16)+"px",height:(i.warningElement.content.icon?.size||16)+"px"}),class:ys({"tw:w-4 tw:h-4 tw:animate-spin":i.type==="reconnecting"}),innerHTML:r.value},null,14,El)):Js("",!0),en("div",{class:ys(["tw:transition-all tw:justify-center tw:text-center tw:leading-none",{"tw:text-left tw:text-xs":i.type==="connectionIssue"||i.type==="reconnecting","tw:text-center tw:text-sm":i.type==="launchIssue"}]),innerHTML:Fn(bi)(i.headlineText),style:ht({color:i.warningElement.content?.headlineColor||i.warningElement.content.color,fontSize:(i.warningElement.content?.headlineTextSize||i.warningElement.content.fontSize)+"px"})},null,14,Pl),en("p",{class:"tw:text-center tw:justify-center tw:text-xs tw:leading-none",style:ht({color:i.warningElement.content.color,fontSize:(i.warningElement.content?.subTextSize||i.warningElement.content.fontSize)+"px"}),innerHTML:Fn(bi)(i.descriptionText)},null,12,Al)],6),i.warningElement.resetButton?(bs(),Bl(Fn(at),{key:0,size:i.warningElement.resetButton?.size,class:ys([{"tw:mt-8":i.type==="launchIssue"||i.type==="reconnecting"}]),variant:"default",style:ht([a.value,t.value]),onClick:i.restartChat},{default:zl(()=>[i.warningElement.resetButton?.showType!=="text"?(bs(),Qs("svg",{key:0,width:i.warningElement.resetButton.fontSize?i.warningElement.resetButton.fontSize+4:16,height:i.warningElement.resetButton.fontSize?i.warningElement.resetButton.fontSize+4:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:ht({fill:i.warningElement.resetButton.color||"#2F2F31"})},[...c[0]||(c[0]=[en("path",{d:"M10.7935 1.83337H5.20683C2.78016 1.83337 1.3335 3.28004 1.3335 5.70671V11.2867C1.3335 13.72 2.78016 15.1667 5.20683 15.1667H10.7868C13.2135 15.1667 14.6602 13.72 14.6602 11.2934V5.70671C14.6668 3.28004 13.2202 1.83337 10.7935 1.83337ZM8.00016 12.6667C6.80683 12.6667 5.8735 12.0734 5.24016 11.4867V11.96C5.24016 12.2334 5.0135 12.46 4.74016 12.46C4.46683 12.46 4.24016 12.2334 4.24016 11.96V10.1267C4.24016 9.85337 4.46683 9.62671 4.74016 9.62671H6.3935C6.66683 9.62671 6.8935 9.85337 6.8935 10.1267C6.8935 10.4 6.66683 10.6267 6.3935 10.6267H5.7935C6.28683 11.12 7.0535 11.6667 8.00016 11.6667C9.74683 11.6667 11.1668 10.2467 11.1668 8.50004C11.1668 8.22671 11.3935 8.00004 11.6668 8.00004C11.9402 8.00004 12.1668 8.22671 12.1668 8.50004C12.1668 10.8 10.3002 12.6667 8.00016 12.6667ZM12.1668 6.86004C12.1668 6.88004 12.1668 6.90004 12.1668 6.91337C12.1602 6.98671 12.1402 7.05337 12.1068 7.11337C12.0735 7.17337 12.0268 7.22671 11.9668 7.27337C11.9202 7.30671 11.8668 7.33337 11.8068 7.35337C11.7602 7.36671 11.7135 7.37337 11.6668 7.37337H10.0468C9.7735 7.37337 9.54683 7.14671 9.54683 6.87337C9.54683 6.60004 9.7735 6.37337 10.0468 6.37337H10.6002C10.0668 5.88004 9.20683 5.33337 8.0135 5.33337C6.26683 5.33337 4.84683 6.75337 4.84683 8.50004C4.84683 8.77337 4.62016 9.00004 4.34683 9.00004C4.0735 9.00004 3.8335 8.77337 3.8335 8.50004C3.8335 6.20004 5.70016 4.33337 8.00016 4.33337C9.4335 4.33337 10.4868 4.95337 11.1668 5.54671V5.04004C11.1668 4.76671 11.3935 4.54004 11.6668 4.54004C11.9402 4.54004 12.1668 4.76671 12.1668 5.04004V6.86004Z"},null,-1)])],12,Vl)):Js("",!0),i.warningElement.resetButton?.showType!=="icon"?(bs(),Qs("span",{key:1,style:ht({fontSize:i.warningElement.resetButton.fontSize+"px"})},Ml(i.resetButtonText||"Restart"),5)):Js("",!0)]),_:1},8,["size","class","style","onClick"])):Js("",!0)],6))}});function rt(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Po(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.__proto__=e}/*!
|
|
5
|
+
* GSAP 3.14.2
|
|
6
|
+
* https://gsap.com
|
|
7
|
+
*
|
|
8
|
+
* @license Copyright 2008-2025, GreenSock. All rights reserved.
|
|
9
|
+
* Subject to the terms at https://gsap.com/standard-license
|
|
10
|
+
* @author: Jack Doyle, jack@greensock.com
|
|
11
|
+
*/var Pe={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},us={duration:.5,overwrite:!1,delay:0},Ii,he,Y,Fe=1e8,j=1/Fe,vi=Math.PI*2,Ol=vi/4,Il=0,Ao=Math.sqrt,Fl=Math.cos,Kl=Math.sin,ce=function(e){return typeof e=="string"},se=function(e){return typeof e=="function"},lt=function(e){return typeof e=="number"},Fi=function(e){return typeof e>"u"},Qe=function(e){return typeof e=="object"},Ce=function(e){return e!==!1},Ki=function(){return typeof window<"u"},tn=function(e){return se(e)||ce(e)},Vo=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},pe=Array.isArray,Ul=/random\([^)]+\)/g,Nl=/,\s*/g,_r=/(?:-?\.?\d|\.)+/gi,Lo=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,is=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Kn=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Oo=/[+-]=-?[.\d]+/,Wl=/[^,'"\[\]\s]+/gi,Hl=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,ee,Ge,Ci,Ui,Ae={},yn={},Io,Fo=function(e){return(yn=ds(e,Ae))&&Se},Ni=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},Ks=function(e,t){return!t&&console.warn(e)},Ko=function(e,t){return e&&(Ae[e]=t)&&yn&&(yn[e]=t)||Ae},Us=function(){return 0},jl={suppressEvents:!0,isStart:!0,kill:!1},pn={suppressEvents:!0,kill:!1},ql={suppressEvents:!0},Wi={},vt=[],xi={},Uo,Me={},Un={},Sr=30,mn=[],Hi="",ji=function(e){var t=e[0],s,n;if(Qe(t)||se(t)||(e=[e]),!(s=(t._gsap||{}).harness)){for(n=mn.length;n--&&!mn[n].targetTest(t););s=mn[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new ha(e[n],s)))||e.splice(n,1);return e},Ft=function(e){return e._gsap||ji(Ke(e))[0]._gsap},No=function(e,t,s){return(s=e[t])&&se(s)?e[t]():Fi(s)&&e.getAttribute&&e.getAttribute(t)||s},xe=function(e,t){return(e=e.split(",")).forEach(t)||e},ie=function(e){return Math.round(e*1e5)/1e5||0},J=function(e){return Math.round(e*1e7)/1e7||0},as=function(e,t){var s=t.charAt(0),n=parseFloat(t.substr(2));return e=parseFloat(e),s==="+"?e+n:s==="-"?e-n:s==="*"?e*n:e/n},Zl=function(e,t){for(var s=t.length,n=0;e.indexOf(t[n])<0&&++n<s;);return n<s},bn=function(){var e=vt.length,t=vt.slice(0),s,n;for(xi={},vt.length=0,s=0;s<e;s++)n=t[s],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},qi=function(e){return!!(e._initted||e._startAt||e.add)},Wo=function(e,t,s,n){vt.length&&!he&&bn(),e.render(t,s,!!(he&&t<0&&qi(e))),vt.length&&!he&&bn()},Ho=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(Wl).length<2?t:ce(e)?e.trim():e},jo=function(e){return e},Ve=function(e,t){for(var s in t)s in e||(e[s]=t[s]);return e},Gl=function(e){return function(t,s){for(var n in s)n in t||n==="duration"&&e||n==="ease"||(t[n]=s[n])}},ds=function(e,t){for(var s in t)e[s]=t[s];return e},Tr=function i(e,t){for(var s in t)s!=="__proto__"&&s!=="constructor"&&s!=="prototype"&&(e[s]=Qe(t[s])?i(e[s]||(e[s]={}),t[s]):t[s]);return e},vn=function(e,t){var s={},n;for(n in e)n in t||(s[n]=e[n]);return s},Vs=function(e){var t=e.parent||ee,s=e.keyframes?Gl(pe(e.keyframes)):Ve;if(Ce(e.inherit))for(;t;)s(e,t.vars.defaults),t=t.parent||t._dp;return e},Yl=function(e,t){for(var s=e.length,n=s===t.length;n&&s--&&e[s]===t[s];);return s<0},qo=function(e,t,s,n,r){var o=e[n],a;if(r)for(a=t[r];o&&o[r]>a;)o=o._prev;return o?(t._next=o._next,o._next=t):(t._next=e[s],e[s]=t),t._next?t._next._prev=t:e[n]=t,t._prev=o,t.parent=t._dp=e,t},$n=function(e,t,s,n){s===void 0&&(s="_first"),n===void 0&&(n="_last");var r=t._prev,o=t._next;r?r._next=o:e[s]===t&&(e[s]=o),o?o._prev=r:e[n]===t&&(e[n]=r),t._next=t._prev=t.parent=null},xt=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Kt=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var s=e;s;)s._dirty=1,s=s.parent;return e},Xl=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},ki=function(e,t,s,n){return e._startAt&&(he?e._startAt.revert(pn):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,n))},Ql=function i(e){return!e||e._ts&&i(e.parent)},Rr=function(e){return e._repeat?hs(e._tTime,e=e.duration()+e._rDelay)*e:0},hs=function(e,t){var s=Math.floor(e=J(e/t));return e&&s===e?s-1:s},Cn=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Dn=function(e){return e._end=J(e._start+(e._tDur/Math.abs(e._ts||e._rts||j)||0))},Mn=function(e,t){var s=e._dp;return s&&s.smoothChildTiming&&e._ts&&(e._start=J(s._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Dn(e),s._dirty||Kt(s,e)),e},Zo=function(e,t){var s;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(s=Cn(e.rawTime(),t),(!t._dur||Zs(0,t.totalDuration(),s)-t._tTime>j)&&t.render(s,!0)),Kt(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(s=e;s._dp;)s.rawTime()>=0&&s.totalTime(s._tTime),s=s._dp;e._zTime=-j}},Ye=function(e,t,s,n){return t.parent&&xt(t),t._start=J((lt(s)?s:s||e!==ee?Ie(e,s,t):e._time)+t._delay),t._end=J(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),qo(e,t,"_first","_last",e._sort?"_start":0),_i(t)||(e._recent=t),n||Zo(e,t),e._ts<0&&Mn(e,e._tTime),e},Go=function(e,t){return(Ae.ScrollTrigger||Ni("scrollTrigger",t))&&Ae.ScrollTrigger.create(t,e)},Yo=function(e,t,s,n,r){if(Gi(e,t,r),!e._initted)return 1;if(!s&&e._pt&&!he&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&Uo!==ze.frame)return vt.push(e),e._lazy=[r,n],1},Jl=function i(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||i(t))},_i=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},ec=function(e,t,s,n){var r=e.ratio,o=t<0||!t&&(!e._start&&Jl(e)&&!(!e._initted&&_i(e))||(e._ts<0||e._dp._ts<0)&&!_i(e))?0:1,a=e._rDelay,l=0,c,u,d;if(a&&e._repeat&&(l=Zs(0,e._tDur,t),u=hs(l,a),e._yoyo&&u&1&&(o=1-o),u!==hs(e._tTime,a)&&(r=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==r||he||n||e._zTime===j||!t&&e._zTime){if(!e._initted&&Yo(e,t,n,s,l))return;for(d=e._zTime,e._zTime=t||(s?j:0),s||(s=t&&!d),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=l,c=e._pt;c;)c.r(o,c.d),c=c._next;t<0&&ki(e,t,s,!0),e._onUpdate&&!s&&Be(e,"onUpdate"),l&&e._repeat&&!s&&e.parent&&Be(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===o&&(o&&xt(e,1),!s&&!he&&(Be(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},tc=function(e,t,s){var n;if(s>t)for(n=e._first;n&&n._start<=s;){if(n.data==="isPause"&&n._start>t)return n;n=n._next}else for(n=e._last;n&&n._start>=s;){if(n.data==="isPause"&&n._start<t)return n;n=n._prev}},gs=function(e,t,s,n){var r=e._repeat,o=J(t)||0,a=e._tTime/e._tDur;return a&&!n&&(e._time*=o/e._dur),e._dur=o,e._tDur=r?r<0?1e10:J(o*(r+1)+e._rDelay*r):o,a>0&&!n&&Mn(e,e._tTime=e._tDur*a),e.parent&&Dn(e),s||Kt(e.parent,e),e},$r=function(e){return e instanceof ye?Kt(e):gs(e,e._dur)},sc={_start:0,endTime:Us,totalDuration:Us},Ie=function i(e,t,s){var n=e.labels,r=e._recent||sc,o=e.duration()>=Fe?r.endTime(!1):e._dur,a,l,c;return ce(t)&&(isNaN(t)||t in n)?(l=t.charAt(0),c=t.substr(-1)==="%",a=t.indexOf("="),l==="<"||l===">"?(a>=0&&(t=t.replace(/=/,"")),(l==="<"?r._start:r.endTime(r._repeat>=0))+(parseFloat(t.substr(1))||0)*(c?(a<0?r:s).totalDuration()/100:1)):a<0?(t in n||(n[t]=o),n[t]):(l=parseFloat(t.charAt(a-1)+t.substr(a+1)),c&&s&&(l=l/100*(pe(s)?s[0]:s).totalDuration()),a>1?i(e,t.substr(0,a-1),s)+l:o+l)):t==null?o:+t},Ls=function(e,t,s){var n=lt(t[1]),r=(n?2:1)+(e<2?0:1),o=t[r],a,l;if(n&&(o.duration=t[1]),o.parent=s,e){for(a=o,l=s;l&&!("immediateRender"in a);)a=l.vars.defaults||{},l=Ce(l.vars.inherit)&&l.parent;o.immediateRender=Ce(a.immediateRender),e<2?o.runBackwards=1:o.startAt=t[r-1]}return new re(t[0],o,t[r+1])},St=function(e,t){return e||e===0?t(e):t},Zs=function(e,t,s){return s<e?e:s>t?t:s},fe=function(e,t){return!ce(e)||!(t=Hl.exec(e))?"":t[1]},nc=function(e,t,s){return St(s,function(n){return Zs(e,t,n)})},Si=[].slice,Xo=function(e,t){return e&&Qe(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&Qe(e[0]))&&!e.nodeType&&e!==Ge},ic=function(e,t,s){return s===void 0&&(s=[]),e.forEach(function(n){var r;return ce(n)&&!t||Xo(n,1)?(r=s).push.apply(r,Ke(n)):s.push(n)})||s},Ke=function(e,t,s){return Y&&!t&&Y.selector?Y.selector(e):ce(e)&&!s&&(Ci||!fs())?Si.call((t||Ui).querySelectorAll(e),0):pe(e)?ic(e,s):Xo(e)?Si.call(e,0):e?[e]:[]},Ti=function(e){return e=Ke(e)[0]||Ks("Invalid scope")||{},function(t){var s=e.current||e.nativeElement||e;return Ke(t,s.querySelectorAll?s:s===e?Ks("Invalid scope")||Ui.createElement("div"):e)}},Qo=function(e){return e.sort(function(){return .5-Math.random()})},Jo=function(e){if(se(e))return e;var t=Qe(e)?e:{each:e},s=Ut(t.ease),n=t.from||0,r=parseFloat(t.base)||0,o={},a=n>0&&n<1,l=isNaN(n)||a,c=t.axis,u=n,d=n;return ce(n)?u=d={center:.5,edges:.5,end:1}[n]||0:!a&&l&&(u=n[0],d=n[1]),function(g,f,m){var h=(m||t).length,w=o[h],b,y,p,v,C,S,_,R,T;if(!w){if(T=t.grid==="auto"?0:(t.grid||[1,Fe])[1],!T){for(_=-Fe;_<(_=m[T++].getBoundingClientRect().left)&&T<h;);T<h&&T--}for(w=o[h]=[],b=l?Math.min(T,h)*u-.5:n%T,y=T===Fe?0:l?h*d/T-.5:n/T|0,_=0,R=Fe,S=0;S<h;S++)p=S%T-b,v=y-(S/T|0),w[S]=C=c?Math.abs(c==="y"?v:p):Ao(p*p+v*v),C>_&&(_=C),C<R&&(R=C);n==="random"&&Qo(w),w.max=_-R,w.min=R,w.v=h=(parseFloat(t.amount)||parseFloat(t.each)*(T>h?h-1:c?c==="y"?h/T:T:Math.max(T,h/T))||0)*(n==="edges"?-1:1),w.b=h<0?r-h:r,w.u=fe(t.amount||t.each)||0,s=s&&h<0?ca(s):s}return h=(w[g]-w.min)/w.max||0,J(w.b+(s?s(h):h)*w.v)+w.u}},Ri=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(s){var n=J(Math.round(parseFloat(s)/e)*e*t);return(n-n%1)/t+(lt(s)?0:fe(s))}},ea=function(e,t){var s=pe(e),n,r;return!s&&Qe(e)&&(n=s=e.radius||Fe,e.values?(e=Ke(e.values),(r=!lt(e[0]))&&(n*=n)):e=Ri(e.increment)),St(t,s?se(e)?function(o){return r=e(o),Math.abs(r-o)<=n?r:o}:function(o){for(var a=parseFloat(r?o.x:o),l=parseFloat(r?o.y:0),c=Fe,u=0,d=e.length,g,f;d--;)r?(g=e[d].x-a,f=e[d].y-l,g=g*g+f*f):g=Math.abs(e[d]-a),g<c&&(c=g,u=d);return u=!n||c<=n?e[u]:o,r||u===o||lt(o)?u:u+fe(o)}:Ri(e))},ta=function(e,t,s,n){return St(pe(e)?!t:s===!0?!!(s=0):!n,function(){return pe(e)?e[~~(Math.random()*e.length)]:(s=s||1e-5)&&(n=s<1?Math.pow(10,(s+"").length-2):1)&&Math.floor(Math.round((e-s/2+Math.random()*(t-e+s*.99))/s)*s*n)/n})},rc=function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return function(n){return t.reduce(function(r,o){return o(r)},n)}},oc=function(e,t){return function(s){return e(parseFloat(s))+(t||fe(s))}},ac=function(e,t,s){return na(e,t,0,1,s)},sa=function(e,t,s){return St(s,function(n){return e[~~t(n)]})},lc=function i(e,t,s){var n=t-e;return pe(e)?sa(e,i(0,e.length),t):St(s,function(r){return(n+(r-e)%n)%n+e})},cc=function i(e,t,s){var n=t-e,r=n*2;return pe(e)?sa(e,i(0,e.length-1),t):St(s,function(o){return o=(r+(o-e)%r)%r||0,e+(o>n?r-o:o)})},Ns=function(e){return e.replace(Ul,function(t){var s=t.indexOf("[")+1,n=t.substring(s||7,s?t.indexOf("]"):t.length-1).split(Nl);return ta(s?n:+n[0],s?0:+n[1],+n[2]||1e-5)})},na=function(e,t,s,n,r){var o=t-e,a=n-s;return St(r,function(l){return s+((l-e)/o*a||0)})},uc=function i(e,t,s,n){var r=isNaN(e+t)?0:function(f){return(1-f)*e+f*t};if(!r){var o=ce(e),a={},l,c,u,d,g;if(s===!0&&(n=1)&&(s=null),o)e={p:e},t={p:t};else if(pe(e)&&!pe(t)){for(u=[],d=e.length,g=d-2,c=1;c<d;c++)u.push(i(e[c-1],e[c]));d--,r=function(m){m*=d;var h=Math.min(g,~~m);return u[h](m-h)},s=t}else n||(e=ds(pe(e)?[]:{},e));if(!u){for(l in t)Zi.call(a,e,l,"get",t[l]);r=function(m){return Qi(m,a)||(o?e.p:e)}}}return St(s,r)},Dr=function(e,t,s){var n=e.labels,r=Fe,o,a,l;for(o in n)a=n[o]-t,a<0==!!s&&a&&r>(a=Math.abs(a))&&(l=o,r=a);return l},Be=function(e,t,s){var n=e.vars,r=n[t],o=Y,a=e._ctx,l,c,u;if(r)return l=n[t+"Params"],c=n.callbackScope||e,s&&vt.length&&bn(),a&&(Y=a),u=l?r.apply(c,l):r.call(c),Y=o,u},Es=function(e){return xt(e),e.scrollTrigger&&e.scrollTrigger.kill(!!he),e.progress()<1&&Be(e,"onInterrupt"),e},rs,ia=[],ra=function(e){if(e)if(e=!e.name&&e.default||e,Ki()||e.headless){var t=e.name,s=se(e),n=t&&!s&&e.init?function(){this._props=[]}:e,r={init:Us,render:Qi,add:Zi,kill:Tc,modifier:Sc,rawVars:0},o={targetTest:0,get:0,getSetter:Xi,aliases:{},register:0};if(fs(),e!==n){if(Me[t])return;Ve(n,Ve(vn(e,r),o)),ds(n.prototype,ds(r,vn(e,o))),Me[n.prop=t]=n,e.targetTest&&(mn.push(n),Wi[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}Ko(t,n),e.register&&e.register(Se,n,ke)}else ia.push(e)},H=255,Ps={aqua:[0,H,H],lime:[0,H,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,H],navy:[0,0,128],white:[H,H,H],olive:[128,128,0],yellow:[H,H,0],orange:[H,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[H,0,0],pink:[H,192,203],cyan:[0,H,H],transparent:[H,H,H,0]},Nn=function(e,t,s){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(s-t)*e*6:e<.5?s:e*3<2?t+(s-t)*(2/3-e)*6:t)*H+.5|0},oa=function(e,t,s){var n=e?lt(e)?[e>>16,e>>8&H,e&H]:0:Ps.black,r,o,a,l,c,u,d,g,f,m;if(!n){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Ps[e])n=Ps[e];else if(e.charAt(0)==="#"){if(e.length<6&&(r=e.charAt(1),o=e.charAt(2),a=e.charAt(3),e="#"+r+r+o+o+a+a+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return n=parseInt(e.substr(1,6),16),[n>>16,n>>8&H,n&H,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),n=[e>>16,e>>8&H,e&H]}else if(e.substr(0,3)==="hsl"){if(n=m=e.match(_r),!t)l=+n[0]%360/360,c=+n[1]/100,u=+n[2]/100,o=u<=.5?u*(c+1):u+c-u*c,r=u*2-o,n.length>3&&(n[3]*=1),n[0]=Nn(l+1/3,r,o),n[1]=Nn(l,r,o),n[2]=Nn(l-1/3,r,o);else if(~e.indexOf("="))return n=e.match(Lo),s&&n.length<4&&(n[3]=1),n}else n=e.match(_r)||Ps.transparent;n=n.map(Number)}return t&&!m&&(r=n[0]/H,o=n[1]/H,a=n[2]/H,d=Math.max(r,o,a),g=Math.min(r,o,a),u=(d+g)/2,d===g?l=c=0:(f=d-g,c=u>.5?f/(2-d-g):f/(d+g),l=d===r?(o-a)/f+(o<a?6:0):d===o?(a-r)/f+2:(r-o)/f+4,l*=60),n[0]=~~(l+.5),n[1]=~~(c*100+.5),n[2]=~~(u*100+.5)),s&&n.length<4&&(n[3]=1),n},aa=function(e){var t=[],s=[],n=-1;return e.split(Ct).forEach(function(r){var o=r.match(is)||[];t.push.apply(t,o),s.push(n+=o.length+1)}),t.c=s,t},Mr=function(e,t,s){var n="",r=(e+n).match(Ct),o=t?"hsla(":"rgba(",a=0,l,c,u,d;if(!r)return e;if(r=r.map(function(g){return(g=oa(g,t,1))&&o+(t?g[0]+","+g[1]+"%,"+g[2]+"%,"+g[3]:g.join(","))+")"}),s&&(u=aa(e),l=s.c,l.join(n)!==u.c.join(n)))for(c=e.replace(Ct,"1").split(is),d=c.length-1;a<d;a++)n+=c[a]+(~l.indexOf(a)?r.shift()||o+"0,0,0,0)":(u.length?u:r.length?r:s).shift());if(!c)for(c=e.split(Ct),d=c.length-1;a<d;a++)n+=c[a]+r[a];return n+c[d]},Ct=(function(){var i="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Ps)i+="|"+e+"\\b";return new RegExp(i+")","gi")})(),dc=/hsl[a]?\(/,la=function(e){var t=e.join(" "),s;if(Ct.lastIndex=0,Ct.test(t))return s=dc.test(t),e[1]=Mr(e[1],s),e[0]=Mr(e[0],s,aa(e[1])),!0},Ws,ze=(function(){var i=Date.now,e=500,t=33,s=i(),n=s,r=1e3/240,o=r,a=[],l,c,u,d,g,f,m=function h(w){var b=i()-n,y=w===!0,p,v,C,S;if((b>e||b<0)&&(s+=b-t),n+=b,C=n-s,p=C-o,(p>0||y)&&(S=++d.frame,g=C-d.time*1e3,d.time=C=C/1e3,o+=p+(p>=r?4:r-p),v=1),y||(l=c(h)),v)for(f=0;f<a.length;f++)a[f](C,g,S,w)};return d={time:0,frame:0,tick:function(){m(!0)},deltaRatio:function(w){return g/(1e3/(w||60))},wake:function(){Io&&(!Ci&&Ki()&&(Ge=Ci=window,Ui=Ge.document||{},Ae.gsap=Se,(Ge.gsapVersions||(Ge.gsapVersions=[])).push(Se.version),Fo(yn||Ge.GreenSockGlobals||!Ge.gsap&&Ge||{}),ia.forEach(ra)),u=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&d.sleep(),c=u||function(w){return setTimeout(w,o-d.time*1e3+1|0)},Ws=1,m(2))},sleep:function(){(u?cancelAnimationFrame:clearTimeout)(l),Ws=0,c=Us},lagSmoothing:function(w,b){e=w||1/0,t=Math.min(b||33,e)},fps:function(w){r=1e3/(w||240),o=d.time*1e3+r},add:function(w,b,y){var p=b?function(v,C,S,_){w(v,C,S,_),d.remove(p)}:w;return d.remove(w),a[y?"unshift":"push"](p),fs(),p},remove:function(w,b){~(b=a.indexOf(w))&&a.splice(b,1)&&f>=b&&f--},_listeners:a},d})(),fs=function(){return!Ws&&ze.wake()},O={},hc=/^[\d.\-M][\d.\-,\s]/,gc=/["']/g,fc=function(e){for(var t={},s=e.substr(1,e.length-3).split(":"),n=s[0],r=1,o=s.length,a,l,c;r<o;r++)l=s[r],a=r!==o-1?l.lastIndexOf(","):l.length,c=l.substr(0,a),t[n]=isNaN(c)?c.replace(gc,"").trim():+c,n=l.substr(a+1).trim();return t},pc=function(e){var t=e.indexOf("(")+1,s=e.indexOf(")"),n=e.indexOf("(",t);return e.substring(t,~n&&n<s?e.indexOf(")",s+1):s)},mc=function(e){var t=(e+"").split("("),s=O[t[0]];return s&&t.length>1&&s.config?s.config.apply(null,~e.indexOf("{")?[fc(t[1])]:pc(e).split(",").map(Ho)):O._CE&&hc.test(e)?O._CE("",e):s},ca=function(e){return function(t){return 1-e(1-t)}},ua=function i(e,t){for(var s=e._first,n;s;)s instanceof ye?i(s,t):s.vars.yoyoEase&&(!s._yoyo||!s._repeat)&&s._yoyo!==t&&(s.timeline?i(s.timeline,t):(n=s._ease,s._ease=s._yEase,s._yEase=n,s._yoyo=t)),s=s._next},Ut=function(e,t){return e&&(se(e)?e:O[e]||mc(e))||t},Ht=function(e,t,s,n){s===void 0&&(s=function(l){return 1-t(1-l)}),n===void 0&&(n=function(l){return l<.5?t(l*2)/2:1-t((1-l)*2)/2});var r={easeIn:t,easeOut:s,easeInOut:n},o;return xe(e,function(a){O[a]=Ae[a]=r,O[o=a.toLowerCase()]=s;for(var l in r)O[o+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=O[a+"."+l]=r[l]}),r},da=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},Wn=function i(e,t,s){var n=t>=1?t:1,r=(s||(e?.3:.45))/(t<1?t:1),o=r/vi*(Math.asin(1/n)||0),a=function(u){return u===1?1:n*Math.pow(2,-10*u)*Kl((u-o)*r)+1},l=e==="out"?a:e==="in"?function(c){return 1-a(1-c)}:da(a);return r=vi/r,l.config=function(c,u){return i(e,c,u)},l},Hn=function i(e,t){t===void 0&&(t=1.70158);var s=function(o){return o?--o*o*((t+1)*o+t)+1:0},n=e==="out"?s:e==="in"?function(r){return 1-s(1-r)}:da(s);return n.config=function(r){return i(e,r)},n};xe("Linear,Quad,Cubic,Quart,Quint,Strong",function(i,e){var t=e<5?e+1:e;Ht(i+",Power"+(t-1),e?function(s){return Math.pow(s,t)}:function(s){return s},function(s){return 1-Math.pow(1-s,t)},function(s){return s<.5?Math.pow(s*2,t)/2:1-Math.pow((1-s)*2,t)/2})});O.Linear.easeNone=O.none=O.Linear.easeIn;Ht("Elastic",Wn("in"),Wn("out"),Wn());(function(i,e){var t=1/e,s=2*t,n=2.5*t,r=function(a){return a<t?i*a*a:a<s?i*Math.pow(a-1.5/e,2)+.75:a<n?i*(a-=2.25/e)*a+.9375:i*Math.pow(a-2.625/e,2)+.984375};Ht("Bounce",function(o){return 1-r(1-o)},r)})(7.5625,2.75);Ht("Expo",function(i){return Math.pow(2,10*(i-1))*i+i*i*i*i*i*i*(1-i)});Ht("Circ",function(i){return-(Ao(1-i*i)-1)});Ht("Sine",function(i){return i===1?1:-Fl(i*Ol)+1});Ht("Back",Hn("in"),Hn("out"),Hn());O.SteppedEase=O.steps=Ae.SteppedEase={config:function(e,t){e===void 0&&(e=1);var s=1/e,n=e+(t?0:1),r=t?1:0,o=1-j;return function(a){return((n*Zs(0,o,a)|0)+r)*s}}};us.ease=O["quad.out"];xe("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(i){return Hi+=i+","+i+"Params,"});var ha=function(e,t){this.id=Il++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:No,this.set=t?t.getSetter:Xi},Hs=(function(){function i(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,gs(this,+t.duration,1,1),this.data=t.data,Y&&(this._ctx=Y,Y.data.push(this)),Ws||ze.wake()}var e=i.prototype;return e.delay=function(s){return s||s===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+s-this._delay),this._delay=s,this):this._delay},e.duration=function(s){return arguments.length?this.totalDuration(this._repeat>0?s+(s+this._rDelay)*this._repeat:s):this.totalDuration()&&this._dur},e.totalDuration=function(s){return arguments.length?(this._dirty=0,gs(this,this._repeat<0?s:(s-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(s,n){if(fs(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(Mn(this,s),!r._dp||r.parent||Zo(r,this);r&&r.parent;)r.parent._time!==r._start+(r._ts>=0?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&s<this._tDur||this._ts<0&&s>0||!this._tDur&&!s)&&Ye(this._dp,this,this._start-this._delay)}return(this._tTime!==s||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===j||!this._initted&&this._dur&&s||!s&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=s),Wo(this,s,n)),this},e.time=function(s,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),s+Rr(this))%(this._dur+this._rDelay)||(s?this._dur:0),n):this._time},e.totalProgress=function(s,n){return arguments.length?this.totalTime(this.totalDuration()*s,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(s,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-s:s)+Rr(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(s,n){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(s-1)*r,n):this._repeat?hs(this._tTime,r)+1:1},e.timeScale=function(s,n){if(!arguments.length)return this._rts===-j?0:this._rts;if(this._rts===s)return this;var r=this.parent&&this._ts?Cn(this.parent._time,this):this._tTime;return this._rts=+s||0,this._ts=this._ps||s===-j?0:this._rts,this.totalTime(Zs(-Math.abs(this._delay),this.totalDuration(),r),n!==!1),Dn(this),Xl(this)},e.paused=function(s){return arguments.length?(this._ps!==s&&(this._ps=s,s?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(fs(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==j&&(this._tTime-=j)))),this):this._ps},e.startTime=function(s){if(arguments.length){this._start=J(s);var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&Ye(n,this,this._start-this._delay),this}return this._start},e.endTime=function(s){return this._start+(Ce(s)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(s){var n=this.parent||this._dp;return n?s&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Cn(n.rawTime(s),this):this._tTime:this._tTime},e.revert=function(s){s===void 0&&(s=ql);var n=he;return he=s,qi(this)&&(this.timeline&&this.timeline.revert(s),this.totalTime(-.01,s.suppressEvents)),this.data!=="nested"&&s.kill!==!1&&this.kill(),he=n,this},e.globalTime=function(s){for(var n=this,r=arguments.length?s:n.rawTime();n;)r=n._start+r/(Math.abs(n._ts)||1),n=n._dp;return!this.parent&&this._sat?this._sat.globalTime(s):r},e.repeat=function(s){return arguments.length?(this._repeat=s===1/0?-2:s,$r(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(s){if(arguments.length){var n=this._time;return this._rDelay=s,$r(this),n?this.time(n):this}return this._rDelay},e.yoyo=function(s){return arguments.length?(this._yoyo=s,this):this._yoyo},e.seek=function(s,n){return this.totalTime(Ie(this,s),Ce(n))},e.restart=function(s,n){return this.play().totalTime(s?-this._delay:0,Ce(n)),this._dur||(this._zTime=-j),this},e.play=function(s,n){return s!=null&&this.seek(s,n),this.reversed(!1).paused(!1)},e.reverse=function(s,n){return s!=null&&this.seek(s||this.totalDuration(),n),this.reversed(!0).paused(!1)},e.pause=function(s,n){return s!=null&&this.seek(s,n),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(s){return arguments.length?(!!s!==this.reversed()&&this.timeScale(-this._rts||(s?-j:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-j,this},e.isActive=function(){var s=this.parent||this._dp,n=this._start,r;return!!(!s||this._ts&&this._initted&&s.isActive()&&(r=s.rawTime(!0))>=n&&r<this.endTime(!0)-j)},e.eventCallback=function(s,n,r){var o=this.vars;return arguments.length>1?(n?(o[s]=n,r&&(o[s+"Params"]=r),s==="onUpdate"&&(this._onUpdate=n)):delete o[s],this):o[s]},e.then=function(s){var n=this,r=n._prom;return new Promise(function(o){var a=se(s)?s:jo,l=function(){var u=n.then;n.then=null,r&&r(),se(a)&&(a=a(n))&&(a.then||a===n)&&(n.then=u),o(a),n.then=u};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?l():n._prom=l})},e.kill=function(){Es(this)},i})();Ve(Hs.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-j,_prom:0,_ps:!1,_rts:1});var ye=(function(i){Po(e,i);function e(s,n){var r;return s===void 0&&(s={}),r=i.call(this,s)||this,r.labels={},r.smoothChildTiming=!!s.smoothChildTiming,r.autoRemoveChildren=!!s.autoRemoveChildren,r._sort=Ce(s.sortChildren),ee&&Ye(s.parent||ee,rt(r),n),s.reversed&&r.reverse(),s.paused&&r.paused(!0),s.scrollTrigger&&Go(rt(r),s.scrollTrigger),r}var t=e.prototype;return t.to=function(n,r,o){return Ls(0,arguments,this),this},t.from=function(n,r,o){return Ls(1,arguments,this),this},t.fromTo=function(n,r,o,a){return Ls(2,arguments,this),this},t.set=function(n,r,o){return r.duration=0,r.parent=this,Vs(r).repeatDelay||(r.repeat=0),r.immediateRender=!!r.immediateRender,new re(n,r,Ie(this,o),1),this},t.call=function(n,r,o){return Ye(this,re.delayedCall(0,n,r),o)},t.staggerTo=function(n,r,o,a,l,c,u){return o.duration=r,o.stagger=o.stagger||a,o.onComplete=c,o.onCompleteParams=u,o.parent=this,new re(n,o,Ie(this,l)),this},t.staggerFrom=function(n,r,o,a,l,c,u){return o.runBackwards=1,Vs(o).immediateRender=Ce(o.immediateRender),this.staggerTo(n,r,o,a,l,c,u)},t.staggerFromTo=function(n,r,o,a,l,c,u,d){return a.startAt=o,Vs(a).immediateRender=Ce(a.immediateRender),this.staggerTo(n,r,a,l,c,u,d)},t.render=function(n,r,o){var a=this._time,l=this._dirty?this.totalDuration():this._tDur,c=this._dur,u=n<=0?0:J(n),d=this._zTime<0!=n<0&&(this._initted||!c),g,f,m,h,w,b,y,p,v,C,S,_;if(this!==ee&&u>l&&n>=0&&(u=l),u!==this._tTime||o||d){if(a!==this._time&&c&&(u+=this._time-a,n+=this._time-a),g=u,v=this._start,p=this._ts,b=!p,d&&(c||(a=this._zTime),(n||!r)&&(this._zTime=n)),this._repeat){if(S=this._yoyo,w=c+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(w*100+n,r,o);if(g=J(u%w),u===l?(h=this._repeat,g=c):(C=J(u/w),h=~~C,h&&h===C&&(g=c,h--),g>c&&(g=c)),C=hs(this._tTime,w),!a&&this._tTime&&C!==h&&this._tTime-C*w-this._dur<=0&&(C=h),S&&h&1&&(g=c-g,_=1),h!==C&&!this._lock){var R=S&&C&1,T=R===(S&&h&1);if(h<C&&(R=!R),a=R?0:u%c?c:u,this._lock=1,this.render(a||(_?0:J(h*w)),r,!c)._lock=0,this._tTime=u,!r&&this.parent&&Be(this,"onRepeat"),this.vars.repeatRefresh&&!_&&(this.invalidate()._lock=1,C=h),a&&a!==this._time||b!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(c=this._dur,l=this._tDur,T&&(this._lock=2,a=R?c:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!_&&this.invalidate()),this._lock=0,!this._ts&&!b)return this;ua(this,_)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(y=tc(this,J(a),J(g)),y&&(u-=g-(g=y._start))),this._tTime=u,this._time=g,this._act=!p,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,a=0),!a&&u&&c&&!r&&!C&&(Be(this,"onStart"),this._tTime!==u))return this;if(g>=a&&n>=0)for(f=this._first;f;){if(m=f._next,(f._act||g>=f._start)&&f._ts&&y!==f){if(f.parent!==this)return this.render(n,r,o);if(f.render(f._ts>0?(g-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(g-f._start)*f._ts,r,o),g!==this._time||!this._ts&&!b){y=0,m&&(u+=this._zTime=-j);break}}f=m}else{f=this._last;for(var z=n<0?n:g;f;){if(m=f._prev,(f._act||z<=f._end)&&f._ts&&y!==f){if(f.parent!==this)return this.render(n,r,o);if(f.render(f._ts>0?(z-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(z-f._start)*f._ts,r,o||he&&qi(f)),g!==this._time||!this._ts&&!b){y=0,m&&(u+=this._zTime=z?-j:j);break}}f=m}}if(y&&!r&&(this.pause(),y.render(g>=a?0:-j)._zTime=g>=a?1:-1,this._ts))return this._start=v,Dn(this),this.render(n,r,o);this._onUpdate&&!r&&Be(this,"onUpdate",!0),(u===l&&this._tTime>=this.totalDuration()||!u&&a)&&(v===this._start||Math.abs(p)!==Math.abs(this._ts))&&(this._lock||((n||!c)&&(u===l&&this._ts>0||!u&&this._ts<0)&&xt(this,1),!r&&!(n<0&&!a)&&(u||a||!l)&&(Be(this,u===l&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u<l&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(n,r){var o=this;if(lt(r)||(r=Ie(this,r,n)),!(n instanceof Hs)){if(pe(n))return n.forEach(function(a){return o.add(a,r)}),this;if(ce(n))return this.addLabel(n,r);if(se(n))n=re.delayedCall(0,n);else return this}return this!==n?Ye(this,n,r):this},t.getChildren=function(n,r,o,a){n===void 0&&(n=!0),r===void 0&&(r=!0),o===void 0&&(o=!0),a===void 0&&(a=-Fe);for(var l=[],c=this._first;c;)c._start>=a&&(c instanceof re?r&&l.push(c):(o&&l.push(c),n&&l.push.apply(l,c.getChildren(!0,r,o)))),c=c._next;return l},t.getById=function(n){for(var r=this.getChildren(1,1,1),o=r.length;o--;)if(r[o].vars.id===n)return r[o]},t.remove=function(n){return ce(n)?this.removeLabel(n):se(n)?this.killTweensOf(n):(n.parent===this&&$n(this,n),n===this._recent&&(this._recent=this._last),Kt(this))},t.totalTime=function(n,r){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=J(ze.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),i.prototype.totalTime.call(this,n,r),this._forcing=0,this):this._tTime},t.addLabel=function(n,r){return this.labels[n]=Ie(this,r),this},t.removeLabel=function(n){return delete this.labels[n],this},t.addPause=function(n,r,o){var a=re.delayedCall(0,r||Us,o);return a.data="isPause",this._hasPause=1,Ye(this,a,Ie(this,n))},t.removePause=function(n){var r=this._first;for(n=Ie(this,n);r;)r._start===n&&r.data==="isPause"&&xt(r),r=r._next},t.killTweensOf=function(n,r,o){for(var a=this.getTweensOf(n,o),l=a.length;l--;)wt!==a[l]&&a[l].kill(n,r);return this},t.getTweensOf=function(n,r){for(var o=[],a=Ke(n),l=this._first,c=lt(r),u;l;)l instanceof re?Zl(l._targets,a)&&(c?(!wt||l._initted&&l._ts)&&l.globalTime(0)<=r&&l.globalTime(l.totalDuration())>r:!r||l.isActive())&&o.push(l):(u=l.getTweensOf(a,r)).length&&o.push.apply(o,u),l=l._next;return o},t.tweenTo=function(n,r){r=r||{};var o=this,a=Ie(o,n),l=r,c=l.startAt,u=l.onStart,d=l.onStartParams,g=l.immediateRender,f,m=re.to(o,Ve({ease:r.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:r.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale())||j,onStart:function(){if(o.pause(),!f){var w=r.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale());m._dur!==w&&gs(m,w,0,1).render(m._time,!0,!0),f=1}u&&u.apply(m,d||[])}},r));return g?m.render(0):m},t.tweenFromTo=function(n,r,o){return this.tweenTo(r,Ve({startAt:{time:Ie(this,n)}},o))},t.recent=function(){return this._recent},t.nextLabel=function(n){return n===void 0&&(n=this._time),Dr(this,Ie(this,n))},t.previousLabel=function(n){return n===void 0&&(n=this._time),Dr(this,Ie(this,n),1)},t.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+j)},t.shiftChildren=function(n,r,o){o===void 0&&(o=0);var a=this._first,l=this.labels,c;for(n=J(n);a;)a._start>=o&&(a._start+=n,a._end+=n),a=a._next;if(r)for(c in l)l[c]>=o&&(l[c]+=n);return Kt(this)},t.invalidate=function(n){var r=this._first;for(this._lock=0;r;)r.invalidate(n),r=r._next;return i.prototype.invalidate.call(this,n)},t.clear=function(n){n===void 0&&(n=!0);for(var r=this._first,o;r;)o=r._next,this.remove(r),r=o;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),Kt(this)},t.totalDuration=function(n){var r=0,o=this,a=o._last,l=Fe,c,u,d;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-n:n));if(o._dirty){for(d=o.parent;a;)c=a._prev,a._dirty&&a.totalDuration(),u=a._start,u>l&&o._sort&&a._ts&&!o._lock?(o._lock=1,Ye(o,a,u-a._delay,1)._lock=0):l=u,u<0&&a._ts&&(r-=u,(!d&&!o._dp||d&&d.smoothChildTiming)&&(o._start+=J(u/o._ts),o._time-=u,o._tTime-=u),o.shiftChildren(-u,!1,-1/0),l=0),a._end>r&&a._ts&&(r=a._end),a=c;gs(o,o===ee&&o._time>r?o._time:r,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(n){if(ee._ts&&(Wo(ee,Cn(n,ee)),Uo=ze.frame),ze.frame>=Sr){Sr+=Pe.autoSleep||120;var r=ee._first;if((!r||!r._ts)&&Pe.autoSleep&&ze._listeners.length<2){for(;r&&!r._ts;)r=r._next;r||ze.sleep()}}},e})(Hs);Ve(ye.prototype,{_lock:0,_hasPause:0,_forcing:0});var wc=function(e,t,s,n,r,o,a){var l=new ke(this._pt,e,t,0,1,ya,null,r),c=0,u=0,d,g,f,m,h,w,b,y;for(l.b=s,l.e=n,s+="",n+="",(b=~n.indexOf("random("))&&(n=Ns(n)),o&&(y=[s,n],o(y,e,t),s=y[0],n=y[1]),g=s.match(Kn)||[];d=Kn.exec(n);)m=d[0],h=n.substring(c,d.index),f?f=(f+1)%5:h.substr(-5)==="rgba("&&(f=1),m!==g[u++]&&(w=parseFloat(g[u-1])||0,l._pt={_next:l._pt,p:h||u===1?h:",",s:w,c:m.charAt(1)==="="?as(w,m)-w:parseFloat(m)-w,m:f&&f<4?Math.round:0},c=Kn.lastIndex);return l.c=c<n.length?n.substring(c,n.length):"",l.fp=a,(Oo.test(n)||b)&&(l.e=0),this._pt=l,l},Zi=function(e,t,s,n,r,o,a,l,c,u){se(n)&&(n=n(r||0,e,o));var d=e[t],g=s!=="get"?s:se(d)?c?e[t.indexOf("set")||!se(e["get"+t.substr(3)])?t:"get"+t.substr(3)](c):e[t]():d,f=se(d)?c?xc:ma:Yi,m;if(ce(n)&&(~n.indexOf("random(")&&(n=Ns(n)),n.charAt(1)==="="&&(m=as(g,n)+(fe(g)||0),(m||m===0)&&(n=m))),!u||g!==n||$i)return!isNaN(g*n)&&n!==""?(m=new ke(this._pt,e,t,+g||0,n-(g||0),typeof d=="boolean"?_c:wa,0,f),c&&(m.fp=c),a&&m.modifier(a,this,e),this._pt=m):(!d&&!(t in e)&&Ni(t,n),wc.call(this,e,t,g,n,f,l||Pe.stringFilter,c))},yc=function(e,t,s,n,r){if(se(e)&&(e=Os(e,r,t,s,n)),!Qe(e)||e.style&&e.nodeType||pe(e)||Vo(e))return ce(e)?Os(e,r,t,s,n):e;var o={},a;for(a in e)o[a]=Os(e[a],r,t,s,n);return o},ga=function(e,t,s,n,r,o){var a,l,c,u;if(Me[e]&&(a=new Me[e]).init(r,a.rawVars?t[e]:yc(t[e],n,r,o,s),s,n,o)!==!1&&(s._pt=l=new ke(s._pt,r,e,0,1,a.render,a,0,a.priority),s!==rs))for(c=s._ptLookup[s._targets.indexOf(r)],u=a._props.length;u--;)c[a._props[u]]=l;return a},wt,$i,Gi=function i(e,t,s){var n=e.vars,r=n.ease,o=n.startAt,a=n.immediateRender,l=n.lazy,c=n.onUpdate,u=n.runBackwards,d=n.yoyoEase,g=n.keyframes,f=n.autoRevert,m=e._dur,h=e._startAt,w=e._targets,b=e.parent,y=b&&b.data==="nested"?b.vars.targets:w,p=e._overwrite==="auto"&&!Ii,v=e.timeline,C,S,_,R,T,z,D,P,F,ne,M,K,Z;if(v&&(!g||!r)&&(r="none"),e._ease=Ut(r,us.ease),e._yEase=d?ca(Ut(d===!0?r:d,us.ease)):0,d&&e._yoyo&&!e._repeat&&(d=e._yEase,e._yEase=e._ease,e._ease=d),e._from=!v&&!!n.runBackwards,!v||g&&!n.stagger){if(P=w[0]?Ft(w[0]).harness:0,K=P&&n[P.prop],C=vn(n,Wi),h&&(h._zTime<0&&h.progress(1),t<0&&u&&a&&!f?h.render(-1,!0):h.revert(u&&m?pn:jl),h._lazy=0),o){if(xt(e._startAt=re.set(w,Ve({data:"isStart",overwrite:!1,parent:b,immediateRender:!0,lazy:!h&&Ce(l),startAt:null,delay:0,onUpdate:c&&function(){return Be(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(he||!a&&!f)&&e._startAt.revert(pn),a&&m&&t<=0&&s<=0){t&&(e._zTime=t);return}}else if(u&&m&&!h){if(t&&(a=!1),_=Ve({overwrite:!1,data:"isFromStart",lazy:a&&!h&&Ce(l),immediateRender:a,stagger:0,parent:b},C),K&&(_[P.prop]=K),xt(e._startAt=re.set(w,_)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(he?e._startAt.revert(pn):e._startAt.render(-1,!0)),e._zTime=t,!a)i(e._startAt,j,j);else if(!t)return}for(e._pt=e._ptCache=0,l=m&&Ce(l)||l&&!m,S=0;S<w.length;S++){if(T=w[S],D=T._gsap||ji(w)[S]._gsap,e._ptLookup[S]=ne={},xi[D.id]&&vt.length&&bn(),M=y===w?S:y.indexOf(T),P&&(F=new P).init(T,K||C,e,M,y)!==!1&&(e._pt=R=new ke(e._pt,T,F.name,0,1,F.render,F,0,F.priority),F._props.forEach(function(oe){ne[oe]=R}),F.priority&&(z=1)),!P||K)for(_ in C)Me[_]&&(F=ga(_,C,e,M,T,y))?F.priority&&(z=1):ne[_]=R=Zi.call(e,T,_,"get",C[_],M,y,0,n.stringFilter);e._op&&e._op[S]&&e.kill(T,e._op[S]),p&&e._pt&&(wt=e,ee.killTweensOf(T,ne,e.globalTime(t)),Z=!e.parent,wt=0),e._pt&&l&&(xi[D.id]=1)}z&&ba(e),e._onInit&&e._onInit(e)}e._onUpdate=c,e._initted=(!e._op||e._pt)&&!Z,g&&t<=0&&v.render(Fe,!0,!0)},bc=function(e,t,s,n,r,o,a,l){var c=(e._pt&&e._ptCache||(e._ptCache={}))[t],u,d,g,f;if(!c)for(c=e._ptCache[t]=[],g=e._ptLookup,f=e._targets.length;f--;){if(u=g[f][t],u&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==t&&u.fp!==t;)u=u._next;if(!u)return $i=1,e.vars[t]="+=0",Gi(e,a),$i=0,l?Ks(t+" not eligible for reset"):1;c.push(u)}for(f=c.length;f--;)d=c[f],u=d._pt||d,u.s=(n||n===0)&&!r?n:u.s+(n||0)+o*u.c,u.c=s-u.s,d.e&&(d.e=ie(s)+fe(d.e)),d.b&&(d.b=u.s+fe(d.b))},vc=function(e,t){var s=e[0]?Ft(e[0]).harness:0,n=s&&s.aliases,r,o,a,l;if(!n)return t;r=ds({},t);for(o in n)if(o in r)for(l=n[o].split(","),a=l.length;a--;)r[l[a]]=r[o];return r},Cc=function(e,t,s,n){var r=t.ease||n||"power1.inOut",o,a;if(pe(t))a=s[e]||(s[e]=[]),t.forEach(function(l,c){return a.push({t:c/(t.length-1)*100,v:l,e:r})});else for(o in t)a=s[o]||(s[o]=[]),o==="ease"||a.push({t:parseFloat(e),v:t[o],e:r})},Os=function(e,t,s,n,r){return se(e)?e.call(t,s,n,r):ce(e)&&~e.indexOf("random(")?Ns(e):e},fa=Hi+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",pa={};xe(fa+",id,stagger,delay,duration,paused,scrollTrigger",function(i){return pa[i]=1});var re=(function(i){Po(e,i);function e(s,n,r,o){var a;typeof n=="number"&&(r.duration=n,n=r,r=null),a=i.call(this,o?n:Vs(n))||this;var l=a.vars,c=l.duration,u=l.delay,d=l.immediateRender,g=l.stagger,f=l.overwrite,m=l.keyframes,h=l.defaults,w=l.scrollTrigger,b=l.yoyoEase,y=n.parent||ee,p=(pe(s)||Vo(s)?lt(s[0]):"length"in n)?[s]:Ke(s),v,C,S,_,R,T,z,D;if(a._targets=p.length?ji(p):Ks("GSAP target "+s+" not found. https://gsap.com",!Pe.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=f,m||g||tn(c)||tn(u)){if(n=a.vars,v=a.timeline=new ye({data:"nested",defaults:h||{},targets:y&&y.data==="nested"?y.vars.targets:p}),v.kill(),v.parent=v._dp=rt(a),v._start=0,g||tn(c)||tn(u)){if(_=p.length,z=g&&Jo(g),Qe(g))for(R in g)~fa.indexOf(R)&&(D||(D={}),D[R]=g[R]);for(C=0;C<_;C++)S=vn(n,pa),S.stagger=0,b&&(S.yoyoEase=b),D&&ds(S,D),T=p[C],S.duration=+Os(c,rt(a),C,T,p),S.delay=(+Os(u,rt(a),C,T,p)||0)-a._delay,!g&&_===1&&S.delay&&(a._delay=u=S.delay,a._start+=u,S.delay=0),v.to(T,S,z?z(C,T,p):0),v._ease=O.none;v.duration()?c=u=0:a.timeline=0}else if(m){Vs(Ve(v.vars.defaults,{ease:"none"})),v._ease=Ut(m.ease||n.ease||"none");var P=0,F,ne,M;if(pe(m))m.forEach(function(K){return v.to(p,K,">")}),v.duration();else{S={};for(R in m)R==="ease"||R==="easeEach"||Cc(R,m[R],S,m.easeEach);for(R in S)for(F=S[R].sort(function(K,Z){return K.t-Z.t}),P=0,C=0;C<F.length;C++)ne=F[C],M={ease:ne.e,duration:(ne.t-(C?F[C-1].t:0))/100*c},M[R]=ne.v,v.to(p,M,P),P+=M.duration;v.duration()<c&&v.to({},{duration:c-v.duration()})}}c||a.duration(c=v.duration())}else a.timeline=0;return f===!0&&!Ii&&(wt=rt(a),ee.killTweensOf(p),wt=0),Ye(y,rt(a),r),n.reversed&&a.reverse(),n.paused&&a.paused(!0),(d||!c&&!m&&a._start===J(y._time)&&Ce(d)&&Ql(rt(a))&&y.data!=="nested")&&(a._tTime=-j,a.render(Math.max(0,-u)||0)),w&&Go(rt(a),w),a}var t=e.prototype;return t.render=function(n,r,o){var a=this._time,l=this._tDur,c=this._dur,u=n<0,d=n>l-j&&!u?l:n<j?0:n,g,f,m,h,w,b,y,p,v;if(!c)ec(this,n,r,o);else if(d!==this._tTime||!n||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==u||this._lazy){if(g=d,p=this.timeline,this._repeat){if(h=c+this._rDelay,this._repeat<-1&&u)return this.totalTime(h*100+n,r,o);if(g=J(d%h),d===l?(m=this._repeat,g=c):(w=J(d/h),m=~~w,m&&m===w?(g=c,m--):g>c&&(g=c)),b=this._yoyo&&m&1,b&&(v=this._yEase,g=c-g),w=hs(this._tTime,h),g===a&&!o&&this._initted&&m===w)return this._tTime=d,this;m!==w&&(p&&this._yEase&&ua(p,b),this.vars.repeatRefresh&&!b&&!this._lock&&g!==h&&this._initted&&(this._lock=o=1,this.render(J(h*m),!0).invalidate()._lock=0))}if(!this._initted){if(Yo(this,u?n:g,o,r,d))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&m!==w))return this;if(c!==this._dur)return this.render(n,r,o)}if(this._tTime=d,this._time=g,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=y=(v||this._ease)(g/c),this._from&&(this.ratio=y=1-y),!a&&d&&!r&&!w&&(Be(this,"onStart"),this._tTime!==d))return this;for(f=this._pt;f;)f.r(y,f.d),f=f._next;p&&p.render(n<0?n:p._dur*p._ease(g/this._dur),r,o)||this._startAt&&(this._zTime=n),this._onUpdate&&!r&&(u&&ki(this,n,r,o),Be(this,"onUpdate")),this._repeat&&m!==w&&this.vars.onRepeat&&!r&&this.parent&&Be(this,"onRepeat"),(d===this._tDur||!d)&&this._tTime===d&&(u&&!this._onUpdate&&ki(this,n,!0,!0),(n||!c)&&(d===this._tDur&&this._ts>0||!d&&this._ts<0)&&xt(this,1),!r&&!(u&&!a)&&(d||a||b)&&(Be(this,d===l?"onComplete":"onReverseComplete",!0),this._prom&&!(d<l&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),i.prototype.invalidate.call(this,n)},t.resetTo=function(n,r,o,a,l){Ws||ze.wake(),this._ts||this.play();var c=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||Gi(this,c),u=this._ease(c/this._dur),bc(this,n,r,o,a,u,c,l)?this.resetTo(n,r,o,a,1):(Mn(this,0),this.parent||qo(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(n,r){if(r===void 0&&(r="all"),!n&&(!r||r==="all"))return this._lazy=this._pt=0,this.parent?Es(this):this.scrollTrigger&&this.scrollTrigger.kill(!!he),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(n,r,wt&&wt.vars.overwrite!==!0)._first||Es(this),this.parent&&o!==this.timeline.totalDuration()&&gs(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,l=n?Ke(n):a,c=this._ptLookup,u=this._pt,d,g,f,m,h,w,b;if((!r||r==="all")&&Yl(a,l))return r==="all"&&(this._pt=0),Es(this);for(d=this._op=this._op||[],r!=="all"&&(ce(r)&&(h={},xe(r,function(y){return h[y]=1}),r=h),r=vc(a,r)),b=a.length;b--;)if(~l.indexOf(a[b])){g=c[b],r==="all"?(d[b]=r,m=g,f={}):(f=d[b]=d[b]||{},m=r);for(h in m)w=g&&g[h],w&&((!("kill"in w.d)||w.d.kill(h)===!0)&&$n(this,w,"_pt"),delete g[h]),f!=="all"&&(f[h]=1)}return this._initted&&!this._pt&&u&&Es(this),this},e.to=function(n,r){return new e(n,r,arguments[2])},e.from=function(n,r){return Ls(1,arguments)},e.delayedCall=function(n,r,o,a){return new e(r,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:r,onReverseComplete:r,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},e.fromTo=function(n,r,o){return Ls(2,arguments)},e.set=function(n,r){return r.duration=0,r.repeatDelay||(r.repeat=0),new e(n,r)},e.killTweensOf=function(n,r,o){return ee.killTweensOf(n,r,o)},e})(Hs);Ve(re.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});xe("staggerTo,staggerFrom,staggerFromTo",function(i){re[i]=function(){var e=new ye,t=Si.call(arguments,0);return t.splice(i==="staggerFromTo"?5:4,0,0),e[i].apply(e,t)}});var Yi=function(e,t,s){return e[t]=s},ma=function(e,t,s){return e[t](s)},xc=function(e,t,s,n){return e[t](n.fp,s)},kc=function(e,t,s){return e.setAttribute(t,s)},Xi=function(e,t){return se(e[t])?ma:Fi(e[t])&&e.setAttribute?kc:Yi},wa=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},_c=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},ya=function(e,t){var s=t._pt,n="";if(!e&&t.b)n=t.b;else if(e===1&&t.e)n=t.e;else{for(;s;)n=s.p+(s.m?s.m(s.s+s.c*e):Math.round((s.s+s.c*e)*1e4)/1e4)+n,s=s._next;n+=t.c}t.set(t.t,t.p,n,t)},Qi=function(e,t){for(var s=t._pt;s;)s.r(e,s.d),s=s._next},Sc=function(e,t,s,n){for(var r=this._pt,o;r;)o=r._next,r.p===n&&r.modifier(e,t,s),r=o},Tc=function(e){for(var t=this._pt,s,n;t;)n=t._next,t.p===e&&!t.op||t.op===e?$n(this,t,"_pt"):t.dep||(s=1),t=n;return!s},Rc=function(e,t,s,n){n.mSet(e,t,n.m.call(n.tween,s,n.mt),n)},ba=function(e){for(var t=e._pt,s,n,r,o;t;){for(s=t._next,n=r;n&&n.pr>t.pr;)n=n._next;(t._prev=n?n._prev:o)?t._prev._next=t:r=t,(t._next=n)?n._prev=t:o=t,t=s}e._pt=r},ke=(function(){function i(t,s,n,r,o,a,l,c,u){this.t=s,this.s=r,this.c=o,this.p=n,this.r=a||wa,this.d=l||this,this.set=c||Yi,this.pr=u||0,this._next=t,t&&(t._prev=this)}var e=i.prototype;return e.modifier=function(s,n,r){this.mSet=this.mSet||this.set,this.set=Rc,this.m=s,this.mt=r,this.tween=n},i})();xe(Hi+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(i){return Wi[i]=1});Ae.TweenMax=Ae.TweenLite=re;Ae.TimelineLite=Ae.TimelineMax=ye;ee=new ye({sortChildren:!1,defaults:us,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Pe.stringFilter=la;var Nt=[],wn={},$c=[],zr=0,Dc=0,jn=function(e){return(wn[e]||$c).map(function(t){return t()})},Di=function(){var e=Date.now(),t=[];e-zr>2&&(jn("matchMediaInit"),Nt.forEach(function(s){var n=s.queries,r=s.conditions,o,a,l,c;for(a in n)o=Ge.matchMedia(n[a]).matches,o&&(l=1),o!==r[a]&&(r[a]=o,c=1);c&&(s.revert(),l&&t.push(s))}),jn("matchMediaRevert"),t.forEach(function(s){return s.onMatch(s,function(n){return s.add(null,n)})}),zr=e,jn("matchMedia"))},va=(function(){function i(t,s){this.selector=s&&Ti(s),this.data=[],this._r=[],this.isReverted=!1,this.id=Dc++,t&&this.add(t)}var e=i.prototype;return e.add=function(s,n,r){se(s)&&(r=n,n=s,s=se);var o=this,a=function(){var c=Y,u=o.selector,d;return c&&c!==o&&c.data.push(o),r&&(o.selector=Ti(r)),Y=o,d=n.apply(o,arguments),se(d)&&o._r.push(d),Y=c,o.selector=u,o.isReverted=!1,d};return o.last=a,s===se?a(o,function(l){return o.add(null,l)}):s?o[s]=a:a},e.ignore=function(s){var n=Y;Y=null,s(this),Y=n},e.getTweens=function(){var s=[];return this.data.forEach(function(n){return n instanceof i?s.push.apply(s,n.getTweens()):n instanceof re&&!(n.parent&&n.parent.data==="nested")&&s.push(n)}),s},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(s,n){var r=this;if(s?(function(){for(var a=r.getTweens(),l=r.data.length,c;l--;)c=r.data[l],c.data==="isFlip"&&(c.revert(),c.getChildren(!0,!0,!1).forEach(function(u){return a.splice(a.indexOf(u),1)}));for(a.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,d){return d.g-u.g||-1/0}).forEach(function(u){return u.t.revert(s)}),l=r.data.length;l--;)c=r.data[l],c instanceof ye?c.data!=="nested"&&(c.scrollTrigger&&c.scrollTrigger.revert(),c.kill()):!(c instanceof re)&&c.revert&&c.revert(s);r._r.forEach(function(u){return u(s,r)}),r.isReverted=!0})():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),n)for(var o=Nt.length;o--;)Nt[o].id===this.id&&Nt.splice(o,1)},e.revert=function(s){this.kill(s||{})},i})(),Mc=(function(){function i(t){this.contexts=[],this.scope=t,Y&&Y.data.push(this)}var e=i.prototype;return e.add=function(s,n,r){Qe(s)||(s={matches:s});var o=new va(0,r||this.scope),a=o.conditions={},l,c,u;Y&&!o.selector&&(o.selector=Y.selector),this.contexts.push(o),n=o.add("onMatch",n),o.queries=s;for(c in s)c==="all"?u=1:(l=Ge.matchMedia(s[c]),l&&(Nt.indexOf(o)<0&&Nt.push(o),(a[c]=l.matches)&&(u=1),l.addListener?l.addListener(Di):l.addEventListener("change",Di)));return u&&n(o,function(d){return o.add(null,d)}),this},e.revert=function(s){this.kill(s||{})},e.kill=function(s){this.contexts.forEach(function(n){return n.kill(s,!0)})},i})(),xn={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];t.forEach(function(n){return ra(n)})},timeline:function(e){return new ye(e)},getTweensOf:function(e,t){return ee.getTweensOf(e,t)},getProperty:function(e,t,s,n){ce(e)&&(e=Ke(e)[0]);var r=Ft(e||{}).get,o=s?jo:Ho;return s==="native"&&(s=""),e&&(t?o((Me[t]&&Me[t].get||r)(e,t,s,n)):function(a,l,c){return o((Me[a]&&Me[a].get||r)(e,a,l,c))})},quickSetter:function(e,t,s){if(e=Ke(e),e.length>1){var n=e.map(function(u){return Se.quickSetter(u,t,s)}),r=n.length;return function(u){for(var d=r;d--;)n[d](u)}}e=e[0]||{};var o=Me[t],a=Ft(e),l=a.harness&&(a.harness.aliases||{})[t]||t,c=o?function(u){var d=new o;rs._pt=0,d.init(e,s?u+s:u,rs,0,[e]),d.render(1,d),rs._pt&&Qi(1,rs)}:a.set(e,l);return o?c:function(u){return c(e,l,s?u+s:u,a,1)}},quickTo:function(e,t,s){var n,r=Se.to(e,Ve((n={},n[t]="+=0.1",n.paused=!0,n.stagger=0,n),s||{})),o=function(l,c,u){return r.resetTo(t,l,c,u)};return o.tween=r,o},isTweening:function(e){return ee.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Ut(e.ease,us.ease)),Tr(us,e||{})},config:function(e){return Tr(Pe,e||{})},registerEffect:function(e){var t=e.name,s=e.effect,n=e.plugins,r=e.defaults,o=e.extendTimeline;(n||"").split(",").forEach(function(a){return a&&!Me[a]&&!Ae[a]&&Ks(t+" effect requires "+a+" plugin.")}),Un[t]=function(a,l,c){return s(Ke(a),Ve(l||{},r),c)},o&&(ye.prototype[t]=function(a,l,c){return this.add(Un[t](a,Qe(l)?l:(c=l)&&{},this),c)})},registerEase:function(e,t){O[e]=Ut(t)},parseEase:function(e,t){return arguments.length?Ut(e,t):O},getById:function(e){return ee.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var s=new ye(e),n,r;for(s.smoothChildTiming=Ce(e.smoothChildTiming),ee.remove(s),s._dp=0,s._time=s._tTime=ee._time,n=ee._first;n;)r=n._next,(t||!(!n._dur&&n instanceof re&&n.vars.onComplete===n._targets[0]))&&Ye(s,n,n._start-n._delay),n=r;return Ye(ee,s,0),s},context:function(e,t){return e?new va(e,t):Y},matchMedia:function(e){return new Mc(e)},matchMediaRefresh:function(){return Nt.forEach(function(e){var t=e.conditions,s,n;for(n in t)t[n]&&(t[n]=!1,s=1);s&&e.revert()})||Di()},addEventListener:function(e,t){var s=wn[e]||(wn[e]=[]);~s.indexOf(t)||s.push(t)},removeEventListener:function(e,t){var s=wn[e],n=s&&s.indexOf(t);n>=0&&s.splice(n,1)},utils:{wrap:lc,wrapYoyo:cc,distribute:Jo,random:ta,snap:ea,normalize:ac,getUnit:fe,clamp:nc,splitColor:oa,toArray:Ke,selector:Ti,mapRange:na,pipe:rc,unitize:oc,interpolate:uc,shuffle:Qo},install:Fo,effects:Un,ticker:ze,updateRoot:ye.updateRoot,plugins:Me,globalTimeline:ee,core:{PropTween:ke,globals:Ko,Tween:re,Timeline:ye,Animation:Hs,getCache:Ft,_removeLinkedListItem:$n,reverting:function(){return he},context:function(e){return e&&Y&&(Y.data.push(e),e._ctx=Y),Y},suppressOverwrites:function(e){return Ii=e}}};xe("to,from,fromTo,delayedCall,set,killTweensOf",function(i){return xn[i]=re[i]});ze.add(ye.updateRoot);rs=xn.to({},{duration:0});var zc=function(e,t){for(var s=e._pt;s&&s.p!==t&&s.op!==t&&s.fp!==t;)s=s._next;return s},Bc=function(e,t){var s=e._targets,n,r,o;for(n in t)for(r=s.length;r--;)o=e._ptLookup[r][n],o&&(o=o.d)&&(o._pt&&(o=zc(o,n)),o&&o.modifier&&o.modifier(t[n],e,s[r],n))},qn=function(e,t){return{name:e,headless:1,rawVars:1,init:function(n,r,o){o._onInit=function(a){var l,c;if(ce(r)&&(l={},xe(r,function(u){return l[u]=1}),r=l),t){l={};for(c in r)l[c]=t(r[c]);r=l}Bc(a,r)}}}},Se=xn.registerPlugin({name:"attr",init:function(e,t,s,n,r){var o,a,l;this.tween=s;for(o in t)l=e.getAttribute(o)||"",a=this.add(e,"setAttribute",(l||0)+"",t[o],n,r,0,0,o),a.op=o,a.b=l,this._props.push(o)},render:function(e,t){for(var s=t._pt;s;)he?s.set(s.t,s.p,s.b,s):s.r(e,s.d),s=s._next}},{name:"endArray",headless:1,init:function(e,t){for(var s=t.length;s--;)this.add(e,s,e[s]||0,t[s],0,0,0,0,0,1)}},qn("roundProps",Ri),qn("modifiers"),qn("snap",ea))||xn;re.version=ye.version=Se.version="3.14.2";Io=1;Ki()&&fs();O.Power0;O.Power1;O.Power2;O.Power3;O.Power4;O.Linear;O.Quad;O.Cubic;O.Quart;O.Quint;O.Strong;O.Elastic;O.Back;O.SteppedEase;O.Bounce;O.Sine;O.Expo;O.Circ;/*!
|
|
12
|
+
* CSSPlugin 3.14.2
|
|
13
|
+
* https://gsap.com
|
|
14
|
+
*
|
|
15
|
+
* Copyright 2008-2025, GreenSock. All rights reserved.
|
|
16
|
+
* Subject to the terms at https://gsap.com/standard-license
|
|
17
|
+
* @author: Jack Doyle, jack@greensock.com
|
|
18
|
+
*/var Br,yt,ls,Ji,It,Er,er,Ec=function(){return typeof window<"u"},ct={},Ot=180/Math.PI,cs=Math.PI/180,Xt=Math.atan2,Pr=1e8,tr=/([A-Z])/g,Pc=/(left|right|width|margin|padding|x)/i,Ac=/[\s,\(]\S/,Xe={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Mi=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},Vc=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},Lc=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},Oc=function(e,t){return t.set(t.t,t.p,e===1?t.e:e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},Ic=function(e,t){var s=t.s+t.c*e;t.set(t.t,t.p,~~(s+(s<0?-.5:.5))+t.u,t)},Ca=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},xa=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},Fc=function(e,t,s){return e.style[t]=s},Kc=function(e,t,s){return e.style.setProperty(t,s)},Uc=function(e,t,s){return e._gsap[t]=s},Nc=function(e,t,s){return e._gsap.scaleX=e._gsap.scaleY=s},Wc=function(e,t,s,n,r){var o=e._gsap;o.scaleX=o.scaleY=s,o.renderTransform(r,o)},Hc=function(e,t,s,n,r){var o=e._gsap;o[t]=s,o.renderTransform(r,o)},te="transform",_e=te+"Origin",jc=function i(e,t){var s=this,n=this.target,r=n.style,o=n._gsap;if(e in ct&&r){if(this.tfm=this.tfm||{},e!=="transform")e=Xe[e]||e,~e.indexOf(",")?e.split(",").forEach(function(a){return s.tfm[a]=ot(n,a)}):this.tfm[e]=o.x?o[e]:ot(n,e),e===_e&&(this.tfm.zOrigin=o.zOrigin);else return Xe.transform.split(",").forEach(function(a){return i.call(s,a,t)});if(this.props.indexOf(te)>=0)return;o.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(_e,t,"")),e=te}(r||t)&&this.props.push(e,t,r[e])},ka=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},qc=function(){var e=this.props,t=this.target,s=t.style,n=t._gsap,r,o;for(r=0;r<e.length;r+=3)e[r+1]?e[r+1]===2?t[e[r]](e[r+2]):t[e[r]]=e[r+2]:e[r+2]?s[e[r]]=e[r+2]:s.removeProperty(e[r].substr(0,2)==="--"?e[r]:e[r].replace(tr,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)n[o]=this.tfm[o];n.svg&&(n.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),r=er(),(!r||!r.isStart)&&!s[te]&&(ka(s),n.zOrigin&&s[_e]&&(s[_e]+=" "+n.zOrigin+"px",n.zOrigin=0,n.renderTransform()),n.uncache=1)}},_a=function(e,t){var s={target:e,props:[],revert:qc,save:jc};return e._gsap||Se.core.getCache(e),t&&e.style&&e.nodeType&&t.split(",").forEach(function(n){return s.save(n)}),s},Sa,zi=function(e,t){var s=yt.createElementNS?yt.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):yt.createElement(e);return s&&s.style?s:yt.createElement(e)},Ee=function i(e,t,s){var n=getComputedStyle(e);return n[t]||n.getPropertyValue(t.replace(tr,"-$1").toLowerCase())||n.getPropertyValue(t)||!s&&i(e,ps(t)||t,1)||""},Ar="O,Moz,ms,Ms,Webkit".split(","),ps=function(e,t,s){var n=t||It,r=n.style,o=5;if(e in r&&!s)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(Ar[o]+e in r););return o<0?null:(o===3?"ms":o>=0?Ar[o]:"")+e},Bi=function(){Ec()&&window.document&&(Br=window,yt=Br.document,ls=yt.documentElement,It=zi("div")||{style:{}},zi("div"),te=ps(te),_e=te+"Origin",It.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Sa=!!ps("perspective"),er=Se.core.reverting,Ji=1)},Vr=function(e){var t=e.ownerSVGElement,s=zi("svg",t&&t.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=e.cloneNode(!0),r;n.style.display="block",s.appendChild(n),ls.appendChild(s);try{r=n.getBBox()}catch{}return s.removeChild(n),ls.removeChild(s),r},Lr=function(e,t){for(var s=t.length;s--;)if(e.hasAttribute(t[s]))return e.getAttribute(t[s])},Ta=function(e){var t,s;try{t=e.getBBox()}catch{t=Vr(e),s=1}return t&&(t.width||t.height)||s||(t=Vr(e)),t&&!t.width&&!t.x&&!t.y?{x:+Lr(e,["x","cx","x1"])||0,y:+Lr(e,["y","cy","y1"])||0,width:0,height:0}:t},Ra=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&Ta(e))},kt=function(e,t){if(t){var s=e.style,n;t in ct&&t!==_e&&(t=te),s.removeProperty?(n=t.substr(0,2),(n==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),s.removeProperty(n==="--"?t:t.replace(tr,"-$1").toLowerCase())):s.removeAttribute(t)}},bt=function(e,t,s,n,r,o){var a=new ke(e._pt,t,s,0,1,o?xa:Ca);return e._pt=a,a.b=n,a.e=r,e._props.push(s),a},Or={deg:1,rad:1,turn:1},Zc={grid:1,flex:1},_t=function i(e,t,s,n){var r=parseFloat(s)||0,o=(s+"").trim().substr((r+"").length)||"px",a=It.style,l=Pc.test(t),c=e.tagName.toLowerCase()==="svg",u=(c?"client":"offset")+(l?"Width":"Height"),d=100,g=n==="px",f=n==="%",m,h,w,b;if(n===o||!r||Or[n]||Or[o])return r;if(o!=="px"&&!g&&(r=i(e,t,s,"px")),b=e.getCTM&&Ra(e),(f||o==="%")&&(ct[t]||~t.indexOf("adius")))return m=b?e.getBBox()[l?"width":"height"]:e[u],ie(f?r/m*d:r/100*m);if(a[l?"width":"height"]=d+(g?o:n),h=n!=="rem"&&~t.indexOf("adius")||n==="em"&&e.appendChild&&!c?e:e.parentNode,b&&(h=(e.ownerSVGElement||{}).parentNode),(!h||h===yt||!h.appendChild)&&(h=yt.body),w=h._gsap,w&&f&&w.width&&l&&w.time===ze.time&&!w.uncache)return ie(r/w.width*d);if(f&&(t==="height"||t==="width")){var y=e.style[t];e.style[t]=d+n,m=e[u],y?e.style[t]=y:kt(e,t)}else(f||o==="%")&&!Zc[Ee(h,"display")]&&(a.position=Ee(e,"position")),h===e&&(a.position="static"),h.appendChild(It),m=It[u],h.removeChild(It),a.position="absolute";return l&&f&&(w=Ft(h),w.time=ze.time,w.width=h[u]),ie(g?m*r/d:m&&r?d/m*r:0)},ot=function(e,t,s,n){var r;return Ji||Bi(),t in Xe&&t!=="transform"&&(t=Xe[t],~t.indexOf(",")&&(t=t.split(",")[0])),ct[t]&&t!=="transform"?(r=qs(e,n),r=t!=="transformOrigin"?r[t]:r.svg?r.origin:_n(Ee(e,_e))+" "+r.zOrigin+"px"):(r=e.style[t],(!r||r==="auto"||n||~(r+"").indexOf("calc("))&&(r=kn[t]&&kn[t](e,t,s)||Ee(e,t)||No(e,t)||(t==="opacity"?1:0))),s&&!~(r+"").trim().indexOf(" ")?_t(e,t,r,s)+s:r},Gc=function(e,t,s,n){if(!s||s==="none"){var r=ps(t,e,1),o=r&&Ee(e,r,1);o&&o!==s?(t=r,s=o):t==="borderColor"&&(s=Ee(e,"borderTopColor"))}var a=new ke(this._pt,e.style,t,0,1,ya),l=0,c=0,u,d,g,f,m,h,w,b,y,p,v,C;if(a.b=s,a.e=n,s+="",n+="",n.substring(0,6)==="var(--"&&(n=Ee(e,n.substring(4,n.indexOf(")")))),n==="auto"&&(h=e.style[t],e.style[t]=n,n=Ee(e,t)||n,h?e.style[t]=h:kt(e,t)),u=[s,n],la(u),s=u[0],n=u[1],g=s.match(is)||[],C=n.match(is)||[],C.length){for(;d=is.exec(n);)w=d[0],y=n.substring(l,d.index),m?m=(m+1)%5:(y.substr(-5)==="rgba("||y.substr(-5)==="hsla(")&&(m=1),w!==(h=g[c++]||"")&&(f=parseFloat(h)||0,v=h.substr((f+"").length),w.charAt(1)==="="&&(w=as(f,w)+v),b=parseFloat(w),p=w.substr((b+"").length),l=is.lastIndex-p.length,p||(p=p||Pe.units[t]||v,l===n.length&&(n+=p,a.e+=p)),v!==p&&(f=_t(e,t,h,p)||0),a._pt={_next:a._pt,p:y||c===1?y:",",s:f,c:b-f,m:m&&m<4||t==="zIndex"?Math.round:0});a.c=l<n.length?n.substring(l,n.length):""}else a.r=t==="display"&&n==="none"?xa:Ca;return Oo.test(n)&&(a.e=0),this._pt=a,a},Ir={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Yc=function(e){var t=e.split(" "),s=t[0],n=t[1]||"50%";return(s==="top"||s==="bottom"||n==="left"||n==="right")&&(e=s,s=n,n=e),t[0]=Ir[s]||s,t[1]=Ir[n]||n,t.join(" ")},Xc=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var s=t.t,n=s.style,r=t.u,o=s._gsap,a,l,c;if(r==="all"||r===!0)n.cssText="",l=1;else for(r=r.split(","),c=r.length;--c>-1;)a=r[c],ct[a]&&(l=1,a=a==="transformOrigin"?_e:te),kt(s,a);l&&(kt(s,te),o&&(o.svg&&s.removeAttribute("transform"),n.scale=n.rotate=n.translate="none",qs(s,1),o.uncache=1,ka(n)))}},kn={clearProps:function(e,t,s,n,r){if(r.data!=="isFromStart"){var o=e._pt=new ke(e._pt,t,s,0,0,Xc);return o.u=n,o.pr=-10,o.tween=r,e._props.push(s),1}}},js=[1,0,0,1,0,0],$a={},Da=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},Fr=function(e){var t=Ee(e,te);return Da(t)?js:t.substr(7).match(Lo).map(ie)},sr=function(e,t){var s=e._gsap||Ft(e),n=e.style,r=Fr(e),o,a,l,c;return s.svg&&e.getAttribute("transform")?(l=e.transform.baseVal.consolidate().matrix,r=[l.a,l.b,l.c,l.d,l.e,l.f],r.join(",")==="1,0,0,1,0,0"?js:r):(r===js&&!e.offsetParent&&e!==ls&&!s.svg&&(l=n.display,n.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(c=1,a=e.nextElementSibling,ls.appendChild(e)),r=Fr(e),l?n.display=l:kt(e,"display"),c&&(a?o.insertBefore(e,a):o?o.appendChild(e):ls.removeChild(e))),t&&r.length>6?[r[0],r[1],r[4],r[5],r[12],r[13]]:r)},Ei=function(e,t,s,n,r,o){var a=e._gsap,l=r||sr(e,!0),c=a.xOrigin||0,u=a.yOrigin||0,d=a.xOffset||0,g=a.yOffset||0,f=l[0],m=l[1],h=l[2],w=l[3],b=l[4],y=l[5],p=t.split(" "),v=parseFloat(p[0])||0,C=parseFloat(p[1])||0,S,_,R,T;s?l!==js&&(_=f*w-m*h)&&(R=v*(w/_)+C*(-h/_)+(h*y-w*b)/_,T=v*(-m/_)+C*(f/_)-(f*y-m*b)/_,v=R,C=T):(S=Ta(e),v=S.x+(~p[0].indexOf("%")?v/100*S.width:v),C=S.y+(~(p[1]||p[0]).indexOf("%")?C/100*S.height:C)),n||n!==!1&&a.smooth?(b=v-c,y=C-u,a.xOffset=d+(b*f+y*h)-b,a.yOffset=g+(b*m+y*w)-y):a.xOffset=a.yOffset=0,a.xOrigin=v,a.yOrigin=C,a.smooth=!!n,a.origin=t,a.originIsAbsolute=!!s,e.style[_e]="0px 0px",o&&(bt(o,a,"xOrigin",c,v),bt(o,a,"yOrigin",u,C),bt(o,a,"xOffset",d,a.xOffset),bt(o,a,"yOffset",g,a.yOffset)),e.setAttribute("data-svg-origin",v+" "+C)},qs=function(e,t){var s=e._gsap||new ha(e);if("x"in s&&!t&&!s.uncache)return s;var n=e.style,r=s.scaleX<0,o="px",a="deg",l=getComputedStyle(e),c=Ee(e,_e)||"0",u,d,g,f,m,h,w,b,y,p,v,C,S,_,R,T,z,D,P,F,ne,M,K,Z,oe,L,G,me,N,qt,ve,Je;return u=d=g=h=w=b=y=p=v=0,f=m=1,s.svg=!!(e.getCTM&&Ra(e)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(n[te]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[te]!=="none"?l[te]:"")),n.scale=n.rotate=n.translate="none"),_=sr(e,s.svg),s.svg&&(s.uncache?(oe=e.getBBox(),c=s.xOrigin-oe.x+"px "+(s.yOrigin-oe.y)+"px",Z=""):Z=!t&&e.getAttribute("data-svg-origin"),Ei(e,Z||c,!!Z||s.originIsAbsolute,s.smooth!==!1,_)),C=s.xOrigin||0,S=s.yOrigin||0,_!==js&&(D=_[0],P=_[1],F=_[2],ne=_[3],u=M=_[4],d=K=_[5],_.length===6?(f=Math.sqrt(D*D+P*P),m=Math.sqrt(ne*ne+F*F),h=D||P?Xt(P,D)*Ot:0,y=F||ne?Xt(F,ne)*Ot+h:0,y&&(m*=Math.abs(Math.cos(y*cs))),s.svg&&(u-=C-(C*D+S*F),d-=S-(C*P+S*ne))):(Je=_[6],qt=_[7],G=_[8],me=_[9],N=_[10],ve=_[11],u=_[12],d=_[13],g=_[14],R=Xt(Je,N),w=R*Ot,R&&(T=Math.cos(-R),z=Math.sin(-R),Z=M*T+G*z,oe=K*T+me*z,L=Je*T+N*z,G=M*-z+G*T,me=K*-z+me*T,N=Je*-z+N*T,ve=qt*-z+ve*T,M=Z,K=oe,Je=L),R=Xt(-F,N),b=R*Ot,R&&(T=Math.cos(-R),z=Math.sin(-R),Z=D*T-G*z,oe=P*T-me*z,L=F*T-N*z,ve=ne*z+ve*T,D=Z,P=oe,F=L),R=Xt(P,D),h=R*Ot,R&&(T=Math.cos(R),z=Math.sin(R),Z=D*T+P*z,oe=M*T+K*z,P=P*T-D*z,K=K*T-M*z,D=Z,M=oe),w&&Math.abs(w)+Math.abs(h)>359.9&&(w=h=0,b=180-b),f=ie(Math.sqrt(D*D+P*P+F*F)),m=ie(Math.sqrt(K*K+Je*Je)),R=Xt(M,K),y=Math.abs(R)>2e-4?R*Ot:0,v=ve?1/(ve<0?-ve:ve):0),s.svg&&(Z=e.getAttribute("transform"),s.forceCSS=e.setAttribute("transform","")||!Da(Ee(e,te)),Z&&e.setAttribute("transform",Z))),Math.abs(y)>90&&Math.abs(y)<270&&(r?(f*=-1,y+=h<=0?180:-180,h+=h<=0?180:-180):(m*=-1,y+=y<=0?180:-180)),t=t||s.uncache,s.x=u-((s.xPercent=u&&(!t&&s.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-u)?-50:0)))?e.offsetWidth*s.xPercent/100:0)+o,s.y=d-((s.yPercent=d&&(!t&&s.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-d)?-50:0)))?e.offsetHeight*s.yPercent/100:0)+o,s.z=g+o,s.scaleX=ie(f),s.scaleY=ie(m),s.rotation=ie(h)+a,s.rotationX=ie(w)+a,s.rotationY=ie(b)+a,s.skewX=y+a,s.skewY=p+a,s.transformPerspective=v+o,(s.zOrigin=parseFloat(c.split(" ")[2])||!t&&s.zOrigin||0)&&(n[_e]=_n(c)),s.xOffset=s.yOffset=0,s.force3D=Pe.force3D,s.renderTransform=s.svg?Jc:Sa?Ma:Qc,s.uncache=0,s},_n=function(e){return(e=e.split(" "))[0]+" "+e[1]},Zn=function(e,t,s){var n=fe(t);return ie(parseFloat(t)+parseFloat(_t(e,"x",s+"px",n)))+n},Qc=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,Ma(e,t)},$t="0deg",vs="0px",Dt=") ",Ma=function(e,t){var s=t||this,n=s.xPercent,r=s.yPercent,o=s.x,a=s.y,l=s.z,c=s.rotation,u=s.rotationY,d=s.rotationX,g=s.skewX,f=s.skewY,m=s.scaleX,h=s.scaleY,w=s.transformPerspective,b=s.force3D,y=s.target,p=s.zOrigin,v="",C=b==="auto"&&e&&e!==1||b===!0;if(p&&(d!==$t||u!==$t)){var S=parseFloat(u)*cs,_=Math.sin(S),R=Math.cos(S),T;S=parseFloat(d)*cs,T=Math.cos(S),o=Zn(y,o,_*T*-p),a=Zn(y,a,-Math.sin(S)*-p),l=Zn(y,l,R*T*-p+p)}w!==vs&&(v+="perspective("+w+Dt),(n||r)&&(v+="translate("+n+"%, "+r+"%) "),(C||o!==vs||a!==vs||l!==vs)&&(v+=l!==vs||C?"translate3d("+o+", "+a+", "+l+") ":"translate("+o+", "+a+Dt),c!==$t&&(v+="rotate("+c+Dt),u!==$t&&(v+="rotateY("+u+Dt),d!==$t&&(v+="rotateX("+d+Dt),(g!==$t||f!==$t)&&(v+="skew("+g+", "+f+Dt),(m!==1||h!==1)&&(v+="scale("+m+", "+h+Dt),y.style[te]=v||"translate(0, 0)"},Jc=function(e,t){var s=t||this,n=s.xPercent,r=s.yPercent,o=s.x,a=s.y,l=s.rotation,c=s.skewX,u=s.skewY,d=s.scaleX,g=s.scaleY,f=s.target,m=s.xOrigin,h=s.yOrigin,w=s.xOffset,b=s.yOffset,y=s.forceCSS,p=parseFloat(o),v=parseFloat(a),C,S,_,R,T;l=parseFloat(l),c=parseFloat(c),u=parseFloat(u),u&&(u=parseFloat(u),c+=u,l+=u),l||c?(l*=cs,c*=cs,C=Math.cos(l)*d,S=Math.sin(l)*d,_=Math.sin(l-c)*-g,R=Math.cos(l-c)*g,c&&(u*=cs,T=Math.tan(c-u),T=Math.sqrt(1+T*T),_*=T,R*=T,u&&(T=Math.tan(u),T=Math.sqrt(1+T*T),C*=T,S*=T)),C=ie(C),S=ie(S),_=ie(_),R=ie(R)):(C=d,R=g,S=_=0),(p&&!~(o+"").indexOf("px")||v&&!~(a+"").indexOf("px"))&&(p=_t(f,"x",o,"px"),v=_t(f,"y",a,"px")),(m||h||w||b)&&(p=ie(p+m-(m*C+h*_)+w),v=ie(v+h-(m*S+h*R)+b)),(n||r)&&(T=f.getBBox(),p=ie(p+n/100*T.width),v=ie(v+r/100*T.height)),T="matrix("+C+","+S+","+_+","+R+","+p+","+v+")",f.setAttribute("transform",T),y&&(f.style[te]=T)},eu=function(e,t,s,n,r){var o=360,a=ce(r),l=parseFloat(r)*(a&&~r.indexOf("rad")?Ot:1),c=l-n,u=n+c+"deg",d,g;return a&&(d=r.split("_")[1],d==="short"&&(c%=o,c!==c%(o/2)&&(c+=c<0?o:-o)),d==="cw"&&c<0?c=(c+o*Pr)%o-~~(c/o)*o:d==="ccw"&&c>0&&(c=(c-o*Pr)%o-~~(c/o)*o)),e._pt=g=new ke(e._pt,t,s,n,c,Vc),g.e=u,g.u="deg",e._props.push(s),g},Kr=function(e,t){for(var s in t)e[s]=t[s];return e},tu=function(e,t,s){var n=Kr({},s._gsap),r="perspective,force3D,transformOrigin,svgOrigin",o=s.style,a,l,c,u,d,g,f,m;n.svg?(c=s.getAttribute("transform"),s.setAttribute("transform",""),o[te]=t,a=qs(s,1),kt(s,te),s.setAttribute("transform",c)):(c=getComputedStyle(s)[te],o[te]=t,a=qs(s,1),o[te]=c);for(l in ct)c=n[l],u=a[l],c!==u&&r.indexOf(l)<0&&(f=fe(c),m=fe(u),d=f!==m?_t(s,l,c,m):parseFloat(c),g=parseFloat(u),e._pt=new ke(e._pt,a,l,d,g-d,Mi),e._pt.u=m||0,e._props.push(l));Kr(a,n)};xe("padding,margin,Width,Radius",function(i,e){var t="Top",s="Right",n="Bottom",r="Left",o=(e<3?[t,s,n,r]:[t+r,t+s,n+s,n+r]).map(function(a){return e<2?i+a:"border"+a+i});kn[e>1?"border"+i:i]=function(a,l,c,u,d){var g,f;if(arguments.length<4)return g=o.map(function(m){return ot(a,m,c)}),f=g.join(" "),f.split(g[0]).length===5?g[0]:f;g=(u+"").split(" "),f={},o.forEach(function(m,h){return f[m]=g[h]=g[h]||g[(h-1)/2|0]}),a.init(l,f,d)}});var za={name:"css",register:Bi,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,s,n,r){var o=this._props,a=e.style,l=s.vars.startAt,c,u,d,g,f,m,h,w,b,y,p,v,C,S,_,R,T;Ji||Bi(),this.styles=this.styles||_a(e),R=this.styles.props,this.tween=s;for(h in t)if(h!=="autoRound"&&(u=t[h],!(Me[h]&&ga(h,t,s,n,e,r)))){if(f=typeof u,m=kn[h],f==="function"&&(u=u.call(s,n,e,r),f=typeof u),f==="string"&&~u.indexOf("random(")&&(u=Ns(u)),m)m(this,e,h,u,s)&&(_=1);else if(h.substr(0,2)==="--")c=(getComputedStyle(e).getPropertyValue(h)+"").trim(),u+="",Ct.lastIndex=0,Ct.test(c)||(w=fe(c),b=fe(u),b?w!==b&&(c=_t(e,h,c,b)+b):w&&(u+=w)),this.add(a,"setProperty",c,u,n,r,0,0,h),o.push(h),R.push(h,0,a[h]);else if(f!=="undefined"){if(l&&h in l?(c=typeof l[h]=="function"?l[h].call(s,n,e,r):l[h],ce(c)&&~c.indexOf("random(")&&(c=Ns(c)),fe(c+"")||c==="auto"||(c+=Pe.units[h]||fe(ot(e,h))||""),(c+"").charAt(1)==="="&&(c=ot(e,h))):c=ot(e,h),g=parseFloat(c),y=f==="string"&&u.charAt(1)==="="&&u.substr(0,2),y&&(u=u.substr(2)),d=parseFloat(u),h in Xe&&(h==="autoAlpha"&&(g===1&&ot(e,"visibility")==="hidden"&&d&&(g=0),R.push("visibility",0,a.visibility),bt(this,a,"visibility",g?"inherit":"hidden",d?"inherit":"hidden",!d)),h!=="scale"&&h!=="transform"&&(h=Xe[h],~h.indexOf(",")&&(h=h.split(",")[0]))),p=h in ct,p){if(this.styles.save(h),T=u,f==="string"&&u.substring(0,6)==="var(--"){if(u=Ee(e,u.substring(4,u.indexOf(")"))),u.substring(0,5)==="calc("){var z=e.style.perspective;e.style.perspective=u,u=Ee(e,"perspective"),z?e.style.perspective=z:kt(e,"perspective")}d=parseFloat(u)}if(v||(C=e._gsap,C.renderTransform&&!t.parseTransform||qs(e,t.parseTransform),S=t.smoothOrigin!==!1&&C.smooth,v=this._pt=new ke(this._pt,a,te,0,1,C.renderTransform,C,0,-1),v.dep=1),h==="scale")this._pt=new ke(this._pt,C,"scaleY",C.scaleY,(y?as(C.scaleY,y+d):d)-C.scaleY||0,Mi),this._pt.u=0,o.push("scaleY",h),h+="X";else if(h==="transformOrigin"){R.push(_e,0,a[_e]),u=Yc(u),C.svg?Ei(e,u,0,S,0,this):(b=parseFloat(u.split(" ")[2])||0,b!==C.zOrigin&&bt(this,C,"zOrigin",C.zOrigin,b),bt(this,a,h,_n(c),_n(u)));continue}else if(h==="svgOrigin"){Ei(e,u,1,S,0,this);continue}else if(h in $a){eu(this,C,h,g,y?as(g,y+u):u);continue}else if(h==="smoothOrigin"){bt(this,C,"smooth",C.smooth,u);continue}else if(h==="force3D"){C[h]=u;continue}else if(h==="transform"){tu(this,u,e);continue}}else h in a||(h=ps(h)||h);if(p||(d||d===0)&&(g||g===0)&&!Ac.test(u)&&h in a)w=(c+"").substr((g+"").length),d||(d=0),b=fe(u)||(h in Pe.units?Pe.units[h]:w),w!==b&&(g=_t(e,h,c,b)),this._pt=new ke(this._pt,p?C:a,h,g,(y?as(g,y+d):d)-g,!p&&(b==="px"||h==="zIndex")&&t.autoRound!==!1?Ic:Mi),this._pt.u=b||0,p&&T!==u?(this._pt.b=c,this._pt.e=T,this._pt.r=Oc):w!==b&&b!=="%"&&(this._pt.b=c,this._pt.r=Lc);else if(h in a)Gc.call(this,e,h,c,y?y+u:u);else if(h in e)this.add(e,h,c||e[h],y?y+u:u,n,r);else if(h!=="parseTransform"){Ni(h,u);continue}p||(h in a?R.push(h,0,a[h]):typeof e[h]=="function"?R.push(h,2,e[h]()):R.push(h,1,c||e[h])),o.push(h)}}_&&ba(this)},render:function(e,t){if(t.tween._time||!er())for(var s=t._pt;s;)s.r(e,s.d),s=s._next;else t.styles.revert()},get:ot,aliases:Xe,getSetter:function(e,t,s){var n=Xe[t];return n&&n.indexOf(",")<0&&(t=n),t in ct&&t!==_e&&(e._gsap.x||ot(e,"x"))?s&&Er===s?t==="scale"?Nc:Uc:(Er=s||{})&&(t==="scale"?Wc:Hc):e.style&&!Fi(e.style[t])?Fc:~t.indexOf("-")?Kc:Xi(e,t)},core:{_removeProperty:kt,_getMatrix:sr}};Se.utils.checkPrefix=ps;Se.core.getStyleSaver=_a;(function(i,e,t,s){var n=xe(i+","+e+","+t,function(r){ct[r]=1});xe(e,function(r){Pe.units[r]="deg",$a[r]=1}),Xe[n[13]]=i+","+e,xe(s,function(r){var o=r.split(":");Xe[o[1]]=n[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");xe("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(i){Pe.units[i]="px"});Se.registerPlugin(za);var A=Se.registerPlugin(za)||Se;A.core.Tween;const Ur={sm:{fontSize:12,sidePadding:8,verticalSpacing:4,borderRadius:8},md:{fontSize:14,sidePadding:12,verticalSpacing:8,borderRadius:10},lg:{fontSize:16,sidePadding:16,verticalSpacing:12,borderRadius:12}};function Qt(i){if(i!=null)return`${i}px`}function Ba(i){return Math.max(0,Math.min(1,i))}function Ea(i){if(!i)return;const e=i.trim();if(/^#([0-9a-fA-F]{3}){1,2}$/.test(e)){let s=0,n=0,r=0;return e.length===4?(s=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16)):(s=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16)),{r:s,g:n,b:r}}const t=e.match(/^rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i);if(t)return{r:Number(t[1]),g:Number(t[2]),b:Number(t[3])}}function Gn(i){const t=Math.max(0,Math.min(255,Math.round(i))).toString(16);return t.length===1?`0${t}`:t}function Pa(i){if(i)return`#${Gn(i.r)}${Gn(i.g)}${Gn(i.b)}`}function Nr(i,e=.12){const t=Ea(i);if(!t)return i;const s=Ba(e);return Pa({r:t.r+(255-t.r)*s,g:t.g+(255-t.g)*s,b:t.b+(255-t.b)*s})}function Aa(i,e=.12){const t=Ea(i);if(!t)return i;const s=Ba(e);return Pa({r:t.r*(1-s),g:t.g*(1-s),b:t.b*(1-s)})}function su(i,e){if(i)switch(e){case"gradient":{const t=Nr(i,.08)||i,s=Aa(i,.12)||i;return`linear-gradient(180deg, ${t} 0%, ${s} 100%)`}case"bubble":return`radial-gradient(120% 120% at 10% 0%, ${Nr(i,.14)||i} 0%, ${i} 60%)`;default:return i}}function nu(i,e){return{...i?Ur[i]:Ur.md,...void 0}}function iu(i,e){const t=nu(i.size),s=i.color,n=su(i.bgColor??e?.fallbackColor,i.bgType),r=Qt(i.fontSize??t.fontSize),o=Qt(i.borderRadius??t.borderRadius),a=Qt(i.verticalPadding),l=Qt(i.sidePadding);let c;i.borderWidth&&i.borderWidth>0?c=`${i.borderWidth}px solid ${i.borderColor||e?.fallbackColor||"currentColor"}`:i.borderColor&&!i.borderWidth&&(c=`1px solid ${i.borderColor}`);const u=i.width?i.width+(i.borderWidth??0):void 0,d=i.height?i.height+(i.borderWidth??0):void 0,g={color:s,background:n,fontSize:r,borderRadius:o,width:Qt(u),height:Qt(d),padding:a&&l?`${a} ${l}`:void 0,border:c},f={};for(const m in g){const h=g[m];h!=null&&h!==""&&(f[m]=String(h))}return f}const{defineComponent:ru}=await B("vue"),{normalizeStyle:Yn,openBlock:Xn,createElementBlock:Qn,createCommentVNode:ou}=await B("vue"),au=["innerHTML"],lu=["src"],{computed:Cs}=await B("vue"),cu=ru({__name:"ChatCollapsed",props:{element:{},toggleChat:{type:Function}},setup(i){const e=i,t=Cs(()=>e.element),s=Cs(()=>iu(t.value)),n=Cs(()=>{const a=e.element.logo;return a?a.includes("<svg"):!1}),r=Cs(()=>{const a=e.element.logo;return a&&a.replace('width="',"").replace('height="',"").replace('"',""),a}),o=Cs(()=>{const a=e.element.icon?.size;return a?a+"px":void 0});return(a,l)=>(Xn(),Qn("div",{style:Yn([s.value,{"box-sizing":"content-box"}]),class:"chat-collapsed tw:transition-all tw:flex tw:cursor-pointer tw:items-center tw:justify-center",onClick:l[0]||(l[0]=(...c)=>i.toggleChat&&i.toggleChat(...c))},[n.value?(Xn(),Qn("span",{key:0,class:"hs-collapsed-logo tw:transition-all",innerHTML:r.value,style:Yn({width:o.value,height:o.value})},null,12,au)):r.value?(Xn(),Qn("img",{key:1,class:"tw:transition-all",src:r.value,alt:"logo",style:Yn({width:o.value,height:o.value})},null,12,lu)):ou("",!0)],4))}}),uu={required:["settings","texts","sections"],version:"3.1"},du=JSON.parse('{"bottom":{"btnSend":{"bgColor":"#5E4AC6","borderColor":"#595959","borderRadius":100,"borderWidth":0,"color":"#FFFFFF","fontSize":13,"icon":{"color":"#fff","showIcon":true,"size":18,"src":"<svg width=\\"18\\" height=\\"18\\" viewBox=\\"0 0 18 18\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\">\\n<path d=\\"M13.5525 6.38248L7.13245 3.17248C2.81995 1.01248 1.04995 2.78248 3.20995 7.09498L3.86245 8.39998C4.04995 8.78248 4.04995 9.22498 3.86245 9.60748L3.20995 10.905C1.04995 15.2175 2.81245 16.9875 7.13245 14.8275L13.5525 11.6175C16.4325 10.1775 16.4325 7.82248 13.5525 6.38248ZM11.13 9.56248H7.07995C6.77245 9.56248 6.51745 9.30748 6.51745 8.99998C6.51745 8.69248 6.77245 8.43748 7.07995 8.43748H11.13C11.4375 8.43748 11.6925 8.69248 11.6925 8.99998C11.6925 9.30748 11.4375 9.56248 11.13 9.56248Z\\" fill=\\"currentColor\\"/>\\n</svg>\\n"},"showType":"icon","size":"md"},"btnVoice":{"bgColor":"#FFFFFF1A","borderRadius":100,"borderWidth":0,"borderColor":"#595959","color":"#fff","fontSize":12,"icon":{"color":"#fff","showIcon":true,"size":18,"src":"<svg width=\\"20\\" height=\\"20\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"2\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"><path d=\\"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z\\"></path><path d=\\"M19 10v2a7 7 0 0 1-14 0v-2\\"></path><line x1=\\"12\\" x2=\\"12\\" y1=\\"19\\" y2=\\"22\\"></line></svg>"},"showType":"icon","size":"md"},"disclaimer":{"bgColor":"#FF0000","color":"#4C4C4C","fontSize":9,"height":12},"inputSend":{"bgColor":"#151515","bgType":"plain","borderColor":"#595959","borderRadius":8,"borderWidth":0,"color":"#EEECEC","fontSize":12,"inputStyle":"inside","paddingHorizontal":9,"paddingVertical":10,"sidePadding":7,"size":"lg"},"params":{"disclaimerShow":true,"size":"md"}},"colapsed":{"bgColor":"#7D52F4","borderColor":"rgba(29, 29, 31, 0.90)","borderRadius":50,"borderWidth":8,"color":"#fff","height":56,"icon":{"showIcon":true,"size":18},"logo":"<svg width=\\"18\\" height=\\"18\\" viewBox=\\"0 0 18 18\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path d=\\"M8.22048 12.26L8.71413 11.1293C9.1535 10.1231 9.94426 9.32209 10.9307 8.88424L12.2895 8.28107C12.7215 8.08931 12.7215 7.46082 12.2895 7.26906L10.9731 6.68472C9.9613 6.23561 9.15637 5.40496 8.72453 4.3644L8.22447 3.15941C8.0389 2.71224 7.42105 2.71224 7.23548 3.15941L6.7354 4.36439C6.30357 5.40496 5.49861 6.23561 4.48686 6.68472L3.17045 7.26906C2.73843 7.46082 2.73843 8.08931 3.17045 8.28107L4.5293 8.88424C5.51569 9.32209 6.30646 10.1231 6.7458 11.1293L7.23948 12.26C7.42924 12.6946 8.03069 12.6946 8.22048 12.26ZM13.1632 15.0131L13.302 14.6949C13.5495 14.1275 13.9953 13.6758 14.5515 13.4287L14.9792 13.2386C15.2106 13.1358 15.2106 12.7996 14.9792 12.6969L14.5754 12.5174C14.0049 12.264 13.5511 11.7955 13.3078 11.2089L13.1653 10.865C13.0659 10.6254 12.7346 10.6254 12.6352 10.865L12.4927 11.2089C12.2494 11.7955 11.7957 12.264 11.2251 12.5174L10.8213 12.6969C10.59 12.7996 10.59 13.1358 10.8213 13.2386L11.249 13.4287C11.8053 13.6758 12.251 14.1275 12.4985 14.6949L12.6374 15.0131C12.739 15.246 13.0615 15.246 13.1632 15.0131Z\\" fill=\\"currentColor\\"/></svg>","width":56},"inside":{"activeSnippet":{"element":{"bgColor":"#292929","borderColor":"#595959","borderRadius":12,"borderWidth":0,"color":"#fff","fontSize":12,"sidePadding":8,"verticalSpacing":8},"headerChip":{"bgColor":"transparent","bgType":"filled","borderRadius":12,"color":"#595959","fontSize":12,"size":"md"},"noButton":{"bgColor":"#C20E4D","borderRadius":12,"color":"#fff","fontSize":12},"params":{"buttonStyle":"filled","buttonType":"both","size":"md"},"propertyColor":"rgba(255, 255, 255, 0.30)","valueColor":"#fff","yesButton":{"bgColor":"#12A150","borderRadius":12,"color":"#fff","fontSize":12}},"dataAction":{"activeStepColor":"#fff","bodyFillColor":"#424242","headerFillColor":"#0B0A13","headerText":"Talking to the data","pastStepColor":"#515151","strokeColor":"#3F3F3F","strokeWidth":1,"type":"steps"},"messageBot":{"bgColor":"#292929","bgType":"bubble","borderColor":"#595959","borderRadius":12,"borderWidth":0,"color":"#fff","fontSize":14,"size":"md"},"messageUser":{"bgColor":"#F8F8F933","bgType":"bubble","borderColor":"#595959","borderRadius":12,"borderWidth":1,"color":"#F9F8F8","fontSize":14,"size":"md"},"params":{"sidePadding":8,"size":"md","verticalPadding":8},"welcomeMessage":{"bgColor":"#101010","bgType":"gradient","borderColor":"#595959","borderRadius":12,"borderWidth":0,"color":"#fff","fontSize":14,"size":"lg"}},"loader":{"activeStep":{"color":"#FFF","fontSize":12,"icon":{"color":"#fff","showIcon":true,"size":16,"src":"<svg width=\\"20\\" height=\\"20\\" viewBox=\\"0 0 20 20\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path d=\\"M7.56943 3.05554C6.22707 3.05554 5.13888 4.14374 5.13888 5.4861C5.13888 5.61121 5.14835 5.73411 5.1666 5.85413C3.97524 6.01056 3.05554 7.02981 3.05554 8.26388C3.05554 8.94394 3.33487 9.55881 3.78506 9.99999C3.33487 10.4412 3.05554 11.056 3.05554 11.7361C3.05554 12.7096 3.62748 13.5489 4.45383 13.937C4.4476 14.0128 4.44443 14.0894 4.44443 14.1667C4.44443 15.7007 5.68808 16.9444 7.22221 16.9444C8.05185 16.9444 8.79658 16.5807 9.30554 16.004V3.78506C8.86436 3.33487 8.24953 3.05554 7.56943 3.05554ZM10.6944 3.78506V16.004C11.2034 16.5807 11.9481 16.9444 12.7778 16.9444C14.3119 16.9444 15.5555 15.7007 15.5555 14.1667C15.5555 14.0894 15.5523 14.0128 15.5462 13.937C16.3725 13.5489 16.9444 12.7096 16.9444 11.7361C16.9444 11.056 16.6651 10.4412 16.2149 9.99999C16.6651 9.55881 16.9444 8.94394 16.9444 8.26388C16.9444 7.02981 16.0247 6.01056 14.8334 5.85413C14.8517 5.73411 14.8611 5.61121 14.8611 5.4861C14.8611 4.14374 13.7729 3.05554 12.4305 3.05554C11.7505 3.05554 11.1356 3.33487 10.6944 3.78506Z\\" fill=\\"currentColor\\"/></svg>"}},"completeStep":{"color":"#8E8E8F","fontSize":12,"icon":{"color":"#8E8E8F","showIcon":true,"size":16,"src":"<svg width=\\"16\\" height=\\"16\\" viewBox=\\"0 0 16 16\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path opacity=\\"0.4\\" d=\\"M7.99967 14.6666C11.6816 14.6666 14.6663 11.6818 14.6663 7.99992C14.6663 4.31802 11.6816 1.33325 7.99967 1.33325C4.31778 1.33325 1.33301 4.31802 1.33301 7.99992C1.33301 11.6818 4.31778 14.6666 7.99967 14.6666Z\\" fill=\\"currentColor\\"></path><path d=\\"M7.05297 10.3867C6.91964 10.3867 6.79297 10.3334 6.69964 10.2401L4.81297 8.3534C4.61964 8.16007 4.61964 7.84007 4.81297 7.64673C5.0063 7.4534 5.3263 7.4534 5.51964 7.64673L7.05297 9.18007L10.4796 5.7534C10.673 5.56007 10.993 5.56007 11.1863 5.7534C11.3796 5.94673 11.3796 6.26673 11.1863 6.46006L7.4063 10.2401C7.31297 10.3334 7.1863 10.3867 7.05297 10.3867Z\\" fill=\\"currentColor\\"></path></svg>"},"verticalSpacing":8},"typingLoader":{"bgColor":"#2F2F31","color":"#8E8E8F"}},"top":{"buttons":{"bgColor":"#2F2F31","borderRadius":12,"color":"#BBBBBD","showType":"icon"},"chipWidgetTitle":{"bgColor":"#5E4AC6","borderRadius":12,"color":"#BFB6E9","showType":"both"},"params":{"bgColor":"#5E4AC6","bgStyle":"invisible","border":{"color":"#991717","width":0},"borderRadius":12,"buttonStyle":"invisible","chipStyle":"filled","paddingHorizontal":0,"paddingVertical":1,"sideMargin":12,"size":"lg"}},"warnings":{"connectionIssue":{"content":{"bgColor":"#8A7045","color":"#fff","icon":{"color":"#fff","showIcon":true,"size":16,"src":"<svg width=\\"24\\" height=\\"25\\" viewBox=\\"0 0 24 25\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\">\\n<path d=\\"M21.76 16.42L15.36 4.9C14.5 3.35 13.31 2.5 12 2.5C10.69 2.5 9.49998 3.35 8.63998 4.9L2.23998 16.42C1.42998 17.89 1.33998 19.3 1.98998 20.41C2.63998 21.52 3.91998 22.13 5.59998 22.13H18.4C20.08 22.13 21.36 21.52 22.01 20.41C22.66 19.3 22.57 17.88 21.76 16.42ZM11.25 9.5C11.25 9.09 11.59 8.75 12 8.75C12.41 8.75 12.75 9.09 12.75 9.5V14.5C12.75 14.91 12.41 15.25 12 15.25C11.59 15.25 11.25 14.91 11.25 14.5V9.5ZM12.71 18.21C12.66 18.25 12.61 18.29 12.56 18.33C12.5 18.37 12.44 18.4 12.38 18.42C12.32 18.45 12.26 18.47 12.19 18.48C12.13 18.49 12.06 18.5 12 18.5C11.94 18.5 11.87 18.49 11.8 18.48C11.74 18.47 11.68 18.45 11.62 18.42C11.56 18.4 11.5 18.37 11.44 18.33C11.39 18.29 11.34 18.25 11.29 18.21C11.11 18.02 11 17.76 11 17.5C11 17.24 11.11 16.98 11.29 16.79C11.34 16.75 11.39 16.71 11.44 16.67C11.5 16.63 11.56 16.6 11.62 16.58C11.68 16.55 11.74 16.53 11.8 16.52C11.93 16.49 12.07 16.49 12.19 16.52C12.26 16.53 12.32 16.55 12.38 16.58C12.44 16.6 12.5 16.63 12.56 16.67C12.61 16.71 12.66 16.75 12.71 16.79C12.89 16.98 13 17.24 13 17.5C13 17.76 12.89 18.02 12.71 18.21Z\\" fill=\\"#FFCC77\\"/>\\n</svg>"},"sidePadding":12,"verticalSpacing":8},"resetButton":{"bgColor":"#e5e1dd","bgType":"filled","borderRadius":12,"color":"#2e2e30","fontSize":12,"icon":{"color":"#2e2e30","showIcon":true,"size":16,"src":"<svg width=\\"16\\" height=\\"17\\" viewBox=\\"0 0 16 17\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path d=\\"M10.793 1.83301H5.20634C2.77967 1.83301 1.33301 3.27967 1.33301 5.70634V11.2863C1.33301 13.7197 2.77967 15.1663 5.20634 15.1663H10.7863C13.213 15.1663 14.6597 13.7197 14.6597 11.293V5.70634C14.6663 3.27967 13.2197 1.83301 10.793 1.83301ZM7.99967 12.6663C6.80634 12.6663 5.87301 12.073 5.23967 11.4863V11.9597C5.23967 12.233 5.01301 12.4597 4.73967 12.4597C4.46634 12.4597 4.23967 12.233 4.23967 11.9597V10.1263C4.23967 9.85301 4.46634 9.62634 4.73967 9.62634H6.39301C6.66634 9.62634 6.89301 9.85301 6.89301 10.1263C6.89301 10.3997 6.66634 10.6263 6.39301 10.6263H5.79301C6.28634 11.1197 7.05301 11.6663 7.99967 11.6663C9.74634 11.6663 11.1663 10.2463 11.1663 8.49967C11.1663 8.22634 11.393 7.99967 11.6663 7.99967C11.9397 7.99967 12.1663 8.22634 12.1663 8.49967C12.1663 10.7997 10.2997 12.6663 7.99967 12.6663ZM12.1663 6.85967C12.1663 6.87967 12.1663 6.89967 12.1663 6.91301C12.1597 6.98634 12.1397 7.05301 12.1063 7.11301C12.073 7.17301 12.0263 7.22634 11.9663 7.27301C11.9197 7.30634 11.8663 7.33301 11.8063 7.35301C11.7597 7.36634 11.713 7.37301 11.6663 7.37301H10.0463C9.77301 7.37301 9.54634 7.14634 9.54634 6.87301C9.54634 6.59967 9.77301 6.37301 10.0463 6.37301H10.5997C10.0663 5.87967 9.20634 5.33301 8.01301 5.33301C6.26634 5.33301 4.84634 6.75301 4.84634 8.49967C4.84634 8.77301 4.61967 8.99967 4.34634 8.99967C4.07301 8.99967 3.83301 8.77301 3.83301 8.49967C3.83301 6.19967 5.69967 4.33301 7.99967 4.33301C9.43301 4.33301 10.4863 4.95301 11.1663 5.54634V5.03967C11.1663 4.76634 11.393 4.53967 11.6663 4.53967C11.9397 4.53967 12.1663 4.76634 12.1663 5.03967V6.85967Z\\" fill=\\"currentColor\\"/></svg>"},"showType":"both","size":"md"},"warningStyle":"faded"},"disableInputIssue":{"content":{"bgColor":"#8A7045","color":"#fff","icon":{"color":"#FFF","showIcon":true,"src":"<svg width=\\"17\\" height=\\"16\\" viewBox=\\"0 0 17 16\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\">\\n<path d=\\"M4 4.02667C3.06667 5.08667 2.5 6.48 2.5 8C2.5 11.3133 5.18667 14 8.5 14C11.8133 14 14.5 11.3133 14.5 8C14.5 4.68667 11.8133 2 8.5 2C8.02667 2 7.56667 2.05333 7.12667 2.16\\" stroke=\\"currentColor\\" stroke-width=\\"1.5\\" stroke-miterlimit=\\"10\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"/>\\n</svg>"}},"warningStyle":"gradient"},"launchIssue":{"content":{"bgColor":"#8A7045","color":"#fff","headlineColor":"#f9c97c","headlineTextSize":12,"icon":{"color":"#FFCC77","showIcon":true,"size":24,"src":"<svg width=\\"24\\" height=\\"25\\" viewBox=\\"0 0 24 25\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path d=\\"M21.76 16.42L15.36 4.9C14.5 3.35 13.31 2.5 12 2.5C10.69 2.5 9.5 3.35 8.64 4.9L2.24 16.42C1.43 17.89 1.34 19.3 1.99 20.41C2.64 21.52 3.92 22.13 5.6 22.13H18.4C20.08 22.13 21.36 21.52 22.01 20.41C22.66 19.3 22.57 17.88 21.76 16.42ZM12.71 18.21C12.66 18.25 12.61 18.29 12.56 18.33C12.5 18.37 12.44 18.4 12.38 18.42C12.32 18.45 12.26 18.47 12.19 18.48C12.13 18.49 12.06 18.5 12 18.5C11.94 18.5 11.87 18.49 11.8 18.48C11.74 18.47 11.68 18.45 11.62 18.42C11.56 18.4 11.5 18.37 11.44 18.33C11.39 18.29 11.34 18.25 11.29 18.21C11.11 18.02 11 17.76 11 17.5C11 17.24 11.11 16.98 11.29 16.79C11.34 16.75 11.39 16.71 11.44 16.67C11.5 16.63 11.56 16.6 11.62 16.58C11.68 16.55 11.74 16.53 11.8 16.52C11.93 16.49 12.07 16.49 12.19 16.52C12.26 16.53 12.32 16.55 12.38 16.58C12.44 16.6 12.5 16.63 12.56 16.67C12.61 16.71 12.66 16.75 12.71 16.79C12.89 16.98 13 17.24 13 17.5C13 17.76 12.89 18.02 12.71 18.21ZM11.25 9.5C11.25 9.09 11.59 8.75 12 8.75C12.41 8.75 12.75 9.09 12.75 9.5V14.5C12.75 14.91 12.41 15.25 12 15.25C11.59 15.25 11.25 14.91 11.25 14.5V9.5Z\\" fill=\\"currentColor\\"/></svg>"},"sidePadding":8,"subTextSize":12,"verticalSpacing":4},"resetButton":{"bgColor":"#e5e1dd","bgType":"filled","borderRadius":12,"color":"#2e2e30","fontSize":12,"icon":{"color":"#2e2e30","showIcon":true,"size":16,"src":"<svg width=\\"16\\" height=\\"17\\" viewBox=\\"0 0 16 17\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path d=\\"M10.793 1.83301H5.20634C2.77967 1.83301 1.33301 3.27967 1.33301 5.70634V11.2863C1.33301 13.7197 2.77967 15.1663 5.20634 15.1663H10.7863C13.213 15.1663 14.6597 13.7197 14.6597 11.293V5.70634C14.6663 3.27967 13.2197 1.83301 10.793 1.83301ZM7.99967 12.6663C6.80634 12.6663 5.87301 12.073 5.23967 11.4863V11.9597C5.23967 12.233 5.01301 12.4597 4.73967 12.4597C4.46634 12.4597 4.23967 12.233 4.23967 11.9597V10.1263C4.23967 9.85301 4.46634 9.62634 4.73967 9.62634H6.39301C6.66634 9.62634 6.89301 9.85301 6.89301 10.1263C6.89301 10.3997 6.66634 10.6263 6.39301 10.6263H5.79301C6.28634 11.1197 7.05301 11.6663 7.99967 11.6663C9.74634 11.6663 11.1663 10.2463 11.1663 8.49967C11.1663 8.22634 11.393 7.99967 11.6663 7.99967C11.9397 7.99967 12.1663 8.22634 12.1663 8.49967C12.1663 10.7997 10.2997 12.6663 7.99967 12.6663ZM12.1663 6.85967C12.1663 6.87967 12.1663 6.89967 12.1663 6.91301C12.1597 6.98634 12.1397 7.05301 12.1063 7.11301C12.073 7.17301 12.0263 7.22634 11.9663 7.27301C11.9197 7.30634 11.8663 7.33301 11.8063 7.35301C11.7597 7.36634 11.713 7.37301 11.6663 7.37301H10.0463C9.77301 7.37301 9.54634 7.14634 9.54634 6.87301C9.54634 6.59967 9.77301 6.37301 10.0463 6.37301H10.5997C10.0663 5.87967 9.20634 5.33301 8.01301 5.33301C6.26634 5.33301 4.84634 6.75301 4.84634 8.49967C4.84634 8.77301 4.61967 8.99967 4.34634 8.99967C4.07301 8.99967 3.83301 8.77301 3.83301 8.49967C3.83301 6.19967 5.69967 4.33301 7.99967 4.33301C9.43301 4.33301 10.4863 4.95301 11.1663 5.54634V5.03967C11.1663 4.76634 11.393 4.53967 11.6663 4.53967C11.9397 4.53967 12.1663 4.76634 12.1663 5.03967V6.85967Z\\" fill=\\"currentColor\\"/></svg>"},"showType":"both","size":"md"},"warningStyle":"faded"},"reconnectIssue":{"content":{"bgColor":"#8A7045","borderRadius":12,"color":"#fff","icon":{"color":"#FFF","showIcon":true,"size":16,"src":"<svg width=\\"17\\" height=\\"16\\" viewBox=\\"0 0 17 16\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\">\\n<path d=\\"M4 4.02667C3.06667 5.08667 2.5 6.48 2.5 8C2.5 11.3133 5.18667 14 8.5 14C11.8133 14 14.5 11.3133 14.5 8C14.5 4.68667 11.8133 2 8.5 2C8.02667 2 7.56667 2.05333 7.12667 2.16\\" stroke=\\"currentColor\\" stroke-width=\\"1.5\\" stroke-miterlimit=\\"10\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"/>\\n</svg>"},"margin":8,"sidePadding":8,"verticalSpacing":8},"warningStyle":"gradient"}}}'),hu={bgChat:"#212121",borderRadius:18,container:{gradient:"#34257F",innerBorder:{color:"#000",style:"solid",width:0},outerBorder:{color:"#2929294D",style:"solid",width:0}},fontFamily:"MacPaw Fixel",fontWeight:500,gapMessageLine:12,globalRoundingRadius:!0,launchView:"closed",letterSpacing:-.2,lineHeight:1.2,loader:"dots",logo:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.22048 12.26L8.71413 11.1293C9.1535 10.1231 9.94426 9.32209 10.9307 8.88424L12.2895 8.28107C12.7215 8.08931 12.7215 7.46082 12.2895 7.26906L10.9731 6.68472C9.9613 6.23561 9.15637 5.40496 8.72453 4.3644L8.22447 3.15941C8.0389 2.71224 7.42105 2.71224 7.23548 3.15941L6.7354 4.36439C6.30357 5.40496 5.49861 6.23561 4.48686 6.68472L3.17045 7.26906C2.73843 7.46082 2.73843 8.08931 3.17045 8.28107L4.5293 8.88424C5.51569 9.32209 6.30646 10.1231 6.7458 11.1293L7.23948 12.26C7.42924 12.6946 8.03069 12.6946 8.22048 12.26ZM13.1632 15.0131L13.302 14.6949C13.5495 14.1275 13.9953 13.6758 14.5515 13.4287L14.9792 13.2386C15.2106 13.1358 15.2106 12.7996 14.9792 12.6969L14.5754 12.5174C14.0049 12.264 13.5511 11.7955 13.3078 11.2089L13.1653 10.865C13.0659 10.6254 12.7346 10.6254 12.6352 10.865L12.4927 11.2089C12.2494 11.7955 11.7957 12.264 11.2251 12.5174L10.8213 12.6969C10.59 12.7996 10.59 13.1358 10.8213 13.2386L11.249 13.4287C11.8053 13.6758 12.251 14.1275 12.4985 14.6949L12.6374 15.0131C12.739 15.246 13.0615 15.246 13.1632 15.0131Z" fill="currentColor"/></svg>',mode:"collapsed",offset:{x:24,y:36},position:"bottomRight",size:{height:550,width:500},theme:"light"},gu={disableInputText:"Can’t send a message while processing the previous request",disclaimer:"Disclaimer text",inputPlaceholder:"Type question",issueText:"Something went wrong, please restart",launchIssueText:"Please restart the chat, it should work",launchIssueTitle:"There was a glitch",reconnectText:"Connection issue, trying to reconnect",sendButton:"Send",typingLoader:"AI-Co-pilot typing",welcomeMessage:"👋 Hey there, I’m your AI data assistant. With me you can talk to your data and get instant insights about your leads, deals, clients and everything in-between",widgetTitle:"HyperShadow"},fu={schema:uu,sections:du,settings:hu,texts:gu},V=fu;class je{canApply(e){return e.fromVersion===this.appliesTo.from&&e.toVersion===this.appliesTo.to}rollback(e){return{success:!1,errors:[`Rollback not implemented for strategy: ${this.name}`],warnings:[],modified:!1}}createSuccessResult(e,t=[]){return{success:!0,data:e,errors:[],warnings:t,modified:!0}}createErrorResult(e,t){return{success:!1,data:t,errors:e,warnings:[],modified:!1}}}class pu extends je{constructor(){super(...arguments),this.name="AddSettingsFieldsV1toV2",this.description="Добавляет новые поля loader, buttonStyle, buttonType в settings",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[],n={...t.settings,loader:V.settings.loader};return s.push(`Добавлены поля loader: '${n.loader}'`),this.createSuccessResult({...t,settings:n},s)}catch(t){return this.createErrorResult([`Ошибка при добавлении полей settings: ${t}`])}}}class mu extends je{constructor(){super(...arguments),this.name="AddChipStyleV1toV2",this.description="Добавляет поле chipStyle в sections.top.params",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[];return t.sections.top.params={...t.sections.top.params,chipStyle:V.sections.top.params.chipStyle},s.push(`Добавлено поле chipStyle: '${V.sections.top.params.chipStyle}' в sections.top.params`),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении chipStyle: ${t}`])}}}class wu extends je{constructor(){super(...arguments),this.name="AddMessageBgTypeV1toV2",this.description="Добавляет поле bgType в messageUser и messageBot",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[];return t.sections.inside.messageUser={...t.sections.inside.messageUser,bgType:V.sections.inside.messageUser.bgType},t.sections.inside.messageBot={...t.sections.inside.messageBot,bgType:V.sections.inside.messageBot.bgType},s.push("Добавлены поля bgType для messageUser и messageBot"),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении bgType для сообщений: ${t}`])}}}class yu extends je{constructor(){super(...arguments),this.name="AddActionButtonsV1toV2",this.description="Добавляет кнопки aprooveButton и rejectButton в inside секцию",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[];return t.sections.inside={...t.sections.inside},s.push("Добавлены кнопки aprooveButton и rejectButton"),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении кнопок действий: ${t}`])}}}class bu extends je{constructor(){super(...arguments),this.name="EnhanceInputSendV1toV2",this.description="Добавляет borderStyle, inputStyle, bgType в inputSend",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[];return t.sections.bottom.inputSend={...t.sections.bottom.inputSend,borderStyle:{borderColor:V.sections.bottom.inputSend.borderColor,borderWidth:V.sections.bottom.inputSend.borderWidth},inputStyle:V.sections.bottom.inputSend.inputStyle,bgType:V.sections.bottom.inputSend.bgType},s.push("Расширен inputSend с новыми полями borderStyle, inputStyle, bgType"),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при расширении inputSend: ${t}`])}}}class vu extends je{constructor(){super(...arguments),this.name="AddBottomElementsV1toV2",this.description="Добавляет warningAlert и disclaimer в bottom секцию",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[];return t.sections.bottom={...t.sections.bottom},s.push("Добавлены warningAlert и disclaimer в bottom секцию"),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении элементов bottom: ${t}`])}}}const Cu=[new pu,new mu,new wu,new yu,new bu,new vu];class xu extends je{constructor(){super(...arguments),this.name="AddThemeAndContainerV2toV3",this.description="Adds theme and container (innerBorder, outerBorder, gradient) to settings",this.appliesTo={from:"2.0",to:"3.0"}}apply(e){try{const t={...e.config},s=[];if(t.settings.theme||(t.settings.theme=V.settings.theme,s.push(`Добавлено поле theme: '${t.settings.theme}'`)),t.settings.container||(t.settings.container={innerBorder:{width:V.settings.container?.innerBorder?.width||0,color:V.settings.container?.innerBorder?.color||"transparent",style:V.settings.container?.innerBorder?.style||"solid"},outerBorder:{width:V.settings.container?.outerBorder?.width||0,color:V.settings.container?.outerBorder?.color||"transparent",style:V.settings.container?.outerBorder?.style||"solid"},gradient:V.settings.container?.gradient||"transparent"},s.push("Added container object with innerBorder, outerBorder, gradient")),typeof t.settings.borderRadius=="string"){const n={0:0,sm:4,md:8,lg:12};t.settings.borderRadius=n[t.settings.borderRadius]??12,s.push(`Конвертирован borderRadius из строки в число: ${t.settings.borderRadius}`)}return this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении theme и container: ${t}`])}}}class ku extends je{constructor(){super(...arguments),this.name="AddTopParamsV2toV3",this.description="Добавляет border, sideMargin, borderRadius в sections.top.params",this.appliesTo={from:"2.0",to:"3.0"}}apply(e){try{const t={...e.config},s=[];return t.sections?.top?.params||(t.sections.top=t.sections.top||{},t.sections.top.params={}),t.sections.top.params.border||(t.sections.top.params.border={width:V.sections.top.params.border?.width||0,color:V.sections.top.params.border?.color||"transparent"},s.push("Добавлено поле border в sections.top.params")),t.sections.top.params.sideMargin===void 0&&(t.sections.top.params.sideMargin=V.sections.top.params.sideMargin||0,s.push(`Добавлено поле sideMargin: ${t.sections.top.params.sideMargin}`)),t.sections.top.params.borderRadius===void 0&&(t.sections.top.params.borderRadius=V.sections.top.params.borderRadius||12,s.push(`Добавлено поле borderRadius: ${t.sections.top.params.borderRadius}`)),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении полей top.params: ${t}`])}}}class _u extends je{constructor(){super(...arguments),this.name="AddDataActionV2toV3",this.description="Добавляет dataAction в sections.inside",this.appliesTo={from:"2.0",to:"3.0"}}apply(e){try{const t={...e.config},s=[];t.sections?.inside||(t.sections.inside={});const n=V?.sections?.inside?.dataAction,r=n&&typeof n=="object"?n:{type:"steps",headerFillColor:"#595959",headerText:"#fff",bodyFillColor:"#595959",activeStepColor:"#fff",pastStepColor:"#fff",strokeColor:"#595959",strokeWidth:0},o=()=>JSON.parse(JSON.stringify(r)),a=t.sections.inside.dataAction;return a?typeof a=="string"?(t.sections.inside.dataAction={...o(),type:a},s.push(`Upgraded dataAction from string to object (type: '${a}')`)):typeof a=="object"&&(t.sections.inside.dataAction={...o(),...a},t.sections.inside.dataAction.type||(t.sections.inside.dataAction.type=o().type,s.push(`Filled missing dataAction.type with default ('${t.sections.inside.dataAction.type}')`))):(t.sections.inside.dataAction=o(),s.push(`Added dataAction object (type: '${t.sections.inside.dataAction.type}')`)),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении dataAction: ${t}`])}}}class Su extends je{constructor(){super(...arguments),this.name="EnhanceWelcomeMessageV2toV3",this.description="Расширяет welcomeMessage с borderColor и другими полями",this.appliesTo={from:"2.0",to:"3.0"}}apply(e){try{const t={...e.config},s=[];t.sections?.inside?.welcomeMessage||(t.sections.inside.welcomeMessage={});const n=t.sections.inside.welcomeMessage,r=V.sections.inside.welcomeMessage;return!n.borderColor&&r.borderColor&&(n.borderColor=r.borderColor,s.push("Добавлено поле borderColor для welcomeMessage")),!n.bgType&&r.bgType&&(n.bgType=r.bgType,s.push(`Добавлено поле bgType для welcomeMessage: '${n.bgType}'`)),!n.bgColor&&r.bgColor&&(n.bgColor=r.bgColor,s.push("Добавлено поле bgColor для welcomeMessage")),n.borderWidth===void 0&&r.borderWidth!==void 0&&(n.borderWidth=r.borderWidth,s.push("Добавлено поле borderWidth для welcomeMessage")),!n.fontSize&&r.fontSize&&(n.fontSize=r.fontSize,s.push("Добавлено поле fontSize для welcomeMessage")),!n.size&&r.size&&(n.size=r.size,s.push("Добавлено поле size для welcomeMessage")),!n.borderRadius&&r.borderRadius&&(n.borderRadius=r.borderRadius,s.push("Добавлено поле borderRadius для welcomeMessage")),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при расширении welcomeMessage: ${t}`])}}}class Tu extends je{constructor(){super(...arguments),this.name="AddVoiceButtonV2toV3",this.description="Добавляет btnVoice в sections.bottom",this.appliesTo={from:"2.0",to:"3.0"}}apply(e){try{const t={...e.config},s=[];return t.sections?.bottom||(t.sections.bottom={}),t.sections.bottom.btnVoice||(t.sections.bottom.btnVoice={color:V.sections.bottom.btnVoice?.color||"#fff",bgColor:V.sections.bottom.btnVoice?.bgColor||"rgba(255, 255, 255, 0.10)",showType:V.sections.bottom.btnVoice?.showType||"icon",borderRadius:V.sections.bottom.btnVoice?.borderRadius||50,borderColor:V.sections.bottom.btnVoice?.borderColor||"#595959",borderWidth:V.sections.bottom.btnVoice?.borderWidth||1,size:V.sections.bottom.btnVoice?.size||"md",fontSize:V.sections.bottom.btnVoice?.fontSize||12,icon:V.sections.bottom.btnVoice?.icon||{showIcon:!0,src:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 1.5C8.20156 1.5 7.5 2.20156 7.5 3V9C7.5 9.79844 8.20156 10.5 9 10.5C9.79844 10.5 10.5 9.79844 10.5 9V3C10.5 2.20156 9.79844 1.5 9 1.5Z" fill="currentColor"/><path d="M13.5 7.5C13.0852 7.5 12.75 7.83516 12.75 8.25V9C12.75 10.2422 11.7422 11.25 10.5 11.25C9.25781 11.25 8.25 10.2422 8.25 9V8.25C8.25 7.83516 7.91484 7.5 7.5 7.5C7.08516 7.5 6.75 7.83516 6.75 8.25V9C6.75 10.8609 8.13906 12.375 9.9375 12.6562V14.25H7.5C7.08516 14.25 6.75 14.5852 6.75 15C6.75 15.4148 7.08516 15.75 7.5 15.75H10.5C10.9148 15.75 11.25 15.4148 11.25 15C11.25 14.5852 10.9148 14.25 10.5 14.25H10.3125V12.6562C12.1109 12.375 13.5 10.8609 13.5 9V8.25C13.5 7.83516 13.1648 7.5 12.75 7.5Z" fill="currentColor"/></svg>',color:"#fff",size:18}},t.sections.bottom.btnVoice.bgColor||(t.sections.bottom.btnVoice.bgColor=V.sections.bottom.btnVoice.bgColor,s.push(`Добавлено поле bgColor для btnVoice: '${t.sections.bottom.btnVoice.bgColor}'`)),s.push("Добавлен btnVoice в sections.bottom")),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении btnVoice: ${t}`])}}}const Wr=[new xu,new ku,new _u,new Su,new Tu];function Hr(i,e){return i==="3.0"&&e==="3.1"?Wr.map(s=>{const n=Object.create(s);return n.appliesTo={from:"3.0",to:"3.1"},n}):[...Cu,...Wr].filter(s=>s.appliesTo.from===i&&s.appliesTo.to===e)}class Ru{constructor(){this.name="DetectVersion",this.description="Определяет версию конфигурации"}execute(e){try{const s=new nr().detect(e);return s?{success:!0,data:{version:s,config:e},errors:[],warnings:[],modified:!1}:{success:!1,errors:["Не удалось определить версию конфигурации"],warnings:[],modified:!1}}catch(t){return{success:!1,errors:[`Ошибка при детекции версии: ${t}`],warnings:[],modified:!1}}}}class $u{constructor(){this.name="ValidateConfig",this.description="Валидирует конфигурацию для указанной версии"}execute(e,t){try{const n=new zu().validate(e,t.version);return{success:n.isValid,data:{validationResult:n,config:e},errors:n.errors,warnings:n.warnings,modified:!1}}catch(s){return{success:!1,errors:[`Ошибка при валидации: ${s}`],warnings:[],modified:!1}}}}class Du{constructor(){this.name="CleanConfig",this.description="Очищает конфигурацию от неизвестных полей для указанной версии"}execute(e,t){try{return t.preserveUnknown?{success:!0,data:e,errors:[],warnings:["Очистка пропущена - preserveUnknown: true"],modified:!1}:{success:!0,data:this.cleanConfigForVersion(e,t.version),errors:[],warnings:["Конфигурация очищена от неизвестных полей"],modified:!0}}catch(s){return{success:!1,errors:[`Ошибка при очистке конфигурации: ${s}`],warnings:[],modified:!1}}}cleanConfigForVersion(e,t){return{...e}}}class Mu{constructor(){this.name="BackupConfig",this.description="Создает резервную копию конфигурации"}execute(e,t){try{const s=t?.timestamp?Date.now():void 0;return{success:!0,data:{backup:{original:JSON.parse(JSON.stringify(e)),timestamp:s||Date.now(),version:new nr().detect(e)},config:e},errors:[],warnings:[],modified:!1}}catch(s){return{success:!1,errors:[`Ошибка при создании резервной копии: ${s}`],warnings:[],modified:!1}}}}class nr{detect(e){try{return!e||!e.settings||!e.sections?null:e?.schema?.version==="3.1"?"3.1":[e.settings.theme!==void 0,e.settings.container!==void 0,e.sections.top.params?.border!==void 0,e.sections.top.params?.sideMargin!==void 0,e.sections.top.params?.borderRadius!==void 0,e.sections.inside.dataAction!==void 0,e.sections.bottom.btnVoice!==void 0,e.sections.inside.welcomeMessage?.borderColor!==void 0].filter(Boolean).length>=3?e?.schema?.version==="3.1"?"3.1":"3.0":[e.settings.loader!==void 0,e.settings.buttonStyle!==void 0,e.settings.buttonType!==void 0,e.sections.top.params?.chipStyle!==void 0,e.sections.inside.messageUser?.bgType!==void 0,e.sections.inside.aprooveButton!==void 0,e.sections.bottom.inputSend?.borderStyle!==void 0,e.sections.bottom.warningAlert!==void 0,e.sections.bottom.disclaimer!==void 0].filter(Boolean).length>=3?"2.0":[e.settings.widgetTitle!==void 0,e.settings.bgChat!==void 0,e.sections.top!==void 0,e.sections.inside!==void 0,e.sections.bottom!==void 0].every(Boolean)?"1.0":null}catch(t){return console.error("Ошибка при детекции версии:",t),null}}}class zu{validate(e,t){const s=[],n=[];try{if(!e)return s.push("Конфигурация не может быть пустой"),{isValid:!1,errors:s,warnings:n};switch(e.settings||s.push("Отсутствует секция settings"),e.sections||s.push("Отсутствует секция sections"),e.sections&&(e.sections.top||s.push("Отсутствует секция sections.top"),e.sections.inside||s.push("Отсутствует секция sections.inside"),e.sections.bottom||s.push("Отсутствует секция sections.bottom")),t){case"1.0":this.validateV1(e,s,n);break;case"2.0":this.validateV2(e,s,n);break;case"3.0":case"3.1":this.validateV3(e,s,n);break;default:n.push(`Валидация для версии ${t} не реализована`)}return{isValid:s.length===0,errors:s,warnings:n}}catch(r){return s.push(`Ошибка при валидации: ${r}`),{isValid:!1,errors:s,warnings:n}}}validateV1(e,t,s){const n=["settings.widgetTitle","settings.welcomeMessage","settings.bgChat"];for(const r of n)this.getNestedValue(e,r)||t.push(`Отсутствует обязательное поле: ${r}`)}validateV2(e,t,s){this.validateV1(e,t,s);const n=["settings.loader","settings.buttonStyle","sections.inside.aprooveButton","sections.bottom.warningAlert"];for(const r of n)this.getNestedValue(e,r)||s.push(`Рекомендуется добавить поле V2: ${r}`)}validateV3(e,t,s){this.validateV2(e,t,s);const n=["settings.theme","settings.container","sections.top.params.border","sections.top.params.sideMargin","sections.top.params.borderRadius","sections.inside.dataAction","sections.bottom.btnVoice"];for(const r of n)this.getNestedValue(e,r)||s.push(`Рекомендуется добавить поле V3: ${r}`);e.settings?.container&&(e.settings.container.innerBorder||s.push("settings.container.innerBorder рекомендуется добавить"),e.settings.container.outerBorder||s.push("settings.container.outerBorder рекомендуется добавить"),e.settings.container.gradient||s.push("settings.container.gradient is recommended to add"))}getNestedValue(e,t){return t.split(".").reduce((s,n)=>s?.[n],e)}}class Va{static createCommand(e){const t=this.commands.get(e);return t?t():null}static getAllCommands(){return Array.from(this.commands.keys())}static registerCommand(e,t){this.commands.set(e,t)}}Va.commands=new Map([["DetectVersion",()=>new Ru],["ValidateConfig",()=>new $u],["CleanConfig",()=>new Du],["BackupConfig",()=>new Mu]]);const os=["1.0","2.0","3.0","3.1"],Bu=os[os.length-1];class La{constructor(e=!1){this.verbose=e}info(e,t){this.verbose&&console.log(`[INFO] ${e}`,t?JSON.stringify(t,null,2):"")}warn(e,t){console.warn(`[WARN] ${e}`,t?JSON.stringify(t,null,2):"")}error(e,t){console.error(`[ERROR] ${e}`,t?JSON.stringify(t,null,2):"")}debug(e,t){this.verbose&&console.debug(`[DEBUG] ${e}`,t?JSON.stringify(t,null,2):"")}}class Eu{constructor(e){this.logger=e||new La,this.versionDetector=new nr}setSchemaVersion(e,t){if(!e||typeof e!="object")return;const s=e.schema;if(!s||typeof s!="object"){e.schema={version:t,required:[]};return}s.version=t,Array.isArray(s.required)||(s.required=[])}async migrate(e,t,s={}){const n=Date.now();this.logger.info(`Начинаем миграцию к версии ${t}`);try{const r=this.versionDetector.detect(e);if(!r)return this.createErrorResult("Не удалось определить версию исходной конфигурации",n);if(this.logger.info(`Определена исходная версия: ${r}`),r===t)return this.logger.info("Конфигурация уже соответствует целевой версии"),this.createSuccessResult(e,r,t,[],n);const o=this.buildMigrationPath(r,t);if(o.length===0)return this.createErrorResult(`Не найден путь миграции с ${r} на ${t}`,n);this.logger.info(`План миграции: ${o.map(d=>`${d.from} -> ${d.to}`).join(" -> ")}`);let a=e;const l=[],c=[];for(const d of o){const g=await this.executeStep(a,d.from,d.to,s);if(!g.success)return this.createErrorResult(`Ошибка на шаге ${d.from} -> ${d.to}: ${g.errors.join(", ")}`,n,g.errors);a=g.data,l.push(...g.appliedStrategies),c.push(...g.warnings)}this.setSchemaVersion(a,t);const u=Va.createCommand("ValidateConfig");if(u){const d=u.execute(a,{version:t});if(!d.success&&s.strict)return this.createErrorResult(`Валидация не прошла: ${d.errors.join(", ")}`,n,d.errors);c.push(...d.warnings)}return this.logger.info("Миграция успешно завершена"),this.createSuccessResult(a,r,t,l,n,c)}catch(r){return this.logger.error("Критическая ошибка при миграции",r),this.createErrorResult(`Критическая ошибка: ${r}`,n)}}async dryRun(e,t,s={}){const n=Date.now();try{const r=this.versionDetector.detect(e);if(!r)return this.createFailedReport(n,"unknown",t,"Не удалось определить версию");const a=this.buildMigrationPath(r,t).flatMap(l=>Hr(l.from,l.to));return{timestamp:new Date,fromVersion:r,toVersion:t,success:!0,duration:Date.now()-n,appliedStrategies:a.map(l=>({name:l.name,success:!0,errors:[],warnings:[]})),totalErrors:0,totalWarnings:0,summary:`Будет применено ${a.length} стратегий для миграции с ${r} на ${t}`}}catch(r){return this.createFailedReport(n,"unknown",t,`Ошибка: ${r}`)}}async executeStep(e,t,s,n){const r=Date.now();this.logger.info(`Выполняем шаг: ${t} -> ${s}`);let o=Hr(t,s);if(n.onlyStrategies?.length&&(o=o.filter(g=>n.onlyStrategies.includes(g.name))),n.excludeStrategies?.length&&(o=o.filter(g=>!n.excludeStrategies.includes(g.name))),o.length===0)return this.createErrorResult(`Не найдено стратегий для миграции ${t} -> ${s}`,r);const a={fromVersion:t,toVersion:s,config:e,options:n};let l={...e};const c=[],u=[],d=[];for(const g of o){if(this.logger.debug(`Применяем стратегию: ${g.name}`),!g.canApply({...a,config:l})){this.logger.debug(`Стратегия ${g.name} не применима, пропускаем`);continue}const f=g.apply({...a,config:l});if(f.success)f.modified&&f.data&&(l=f.data),c.push(g.name),d.push(...f.warnings),this.logger.debug(`Стратегия ${g.name} успешно применена`);else if(this.logger.error(`Стратегия ${g.name} завершилась с ошибкой`,f.errors),u.push(...f.errors),n.strict)return this.createErrorResult(`Стратегия ${g.name} завершилась с ошибкой: ${f.errors.join(", ")}`,r,u)}return this.createSuccessResult(l,t,s,c,r,d,u)}buildMigrationPath(e,t){const s=os.indexOf(e),n=os.indexOf(t);if(s===-1||n===-1)return[];const r=[];if(s<n)for(let o=s;o<n;o++)r.push({from:os[o],to:os[o+1]});else if(s>n)return[];return r}createSuccessResult(e,t,s,n,r,o=[],a=[]){return{success:!0,data:e,errors:a,warnings:o,fromVersion:t,toVersion:s,appliedStrategies:n}}createErrorResult(e,t,s=[]){return{success:!1,errors:[e,...s],warnings:[],fromVersion:"unknown",toVersion:"unknown",appliedStrategies:[]}}createFailedReport(e,t,s,n){return{timestamp:new Date,fromVersion:t,toVersion:s,success:!1,duration:Date.now()-e,appliedStrategies:[],totalErrors:1,totalWarnings:0,summary:n}}}class Pu{constructor(e=!0){const t=new La(e);this.migrator=new Eu(t)}async migrateV1toV2(e,t){return this.migrator.migrate(e,"2.0",t)}async migrateV2toV3(e,t){return this.migrator.migrate(e,"3.0",t)}async migrateToLatest(e,t){return this.migrator.migrate(e,Bu,t)}async migrate(e,t,s){return this.migrator.migrate(e,t,s)}async preview(e,t,s){return this.migrator.dryRun(e,t,s)}async canMigrate(e,t){try{return(await this.preview(e,t)).success}catch{return!1}}}const Au=new Pu;async function Vu(i,e){try{const t=await Au.migrateToLatest(i,e);return t.success?t.data:null}catch{return null}}const Ze=i=>typeof i=="string"&&i.length>=0,jr=i=>typeof i=="number"&&!Number.isNaN(i),xs=(i,e)=>typeof i=="string"&&e.includes(i);function Lu(i){const e=[];if(!i||typeof i!="object")return{isValid:!1,errors:["config: must be an object"]};const t=i.settings||{};jr(t.letterSpacing)||t.letterSpacing===void 0||e.push("settings.letterSpacing: number"),Ze(t.bgChat)||t.bgChat===void 0||e.push("settings.bgChat: string"),Ze(t.fontFamily)||t.fontFamily===void 0||e.push("settings.fontFamily: string"),jr(t.fontWeight)||t.fontWeight===void 0||e.push("settings.fontWeight: number"),t.logo===void 0||Ze(t.logo)||e.push("settings.logo: string (svg or url)"),t.widgetTitle===void 0||Ze(t.widgetTitle)||e.push("settings.widgetTitle: string"),t.position===void 0&&e.push("settings.position: undefined");const s=i.texts||{};s.launchIssueTitle===void 0||Ze(s.launchIssueTitle)||e.push("texts.launchIssueTitle: string"),s.issueText===void 0||Ze(s.issueText)||e.push("texts.issueText: string"),s.widgetTitle===void 0||Ze(s.widgetTitle)||e.push("texts.widgetTitle: string"),s.hideText===void 0||Ze(s.hideText)||e.push("texts.hideText: string");const n=i.sections?.top||{},r=n.params||{};r.size===void 0||xs(r.size,["sm","md","lg"])||e.push("sections.top.params.size: sm|md|lg"),r.chipStyle===void 0||xs(r.chipStyle,["filled","outlined","invisible"])||e.push("sections.top.params.chipStyle: filled|outlined|invisible"),r.buttonStyle===void 0||xs(r.buttonStyle,["filled","outlined","invisible"])||e.push("sections.top.params.buttonStyle: filled|outlined|invisible"),r.buttonType===void 0||xs(r.buttonType,["icon","text","both"])||e.push("sections.top.params.buttonType: icon|text|both"),n?.chipWidgetTitle?.color===void 0||Ze(n?.chipWidgetTitle?.color)||e.push("sections.top.chipWidgetTitle.color: string"),n?.chipWidgetTitle?.bgColor===void 0||Ze(n?.chipWidgetTitle?.bgColor)||e.push("sections.top.chipWidgetTitle.bgColor: string"),n?.btnClose===void 0||typeof n?.btnClose=="object"||e.push("sections.top.btnClose: object");const a=(i.sections?.bottom||{}).params||{};a.size===void 0||xs(a.size,["sm","md","lg"])||e.push("sections.bottom.params.size: sm|md|lg");const l=i.sections?.warnings||{};return l.launchIssue===void 0||typeof l.launchIssue=="object"||e.push("sections.warnings.launchIssue: object"),l.connectionIssue===void 0||typeof l.connectionIssue=="object"||e.push("sections.warnings.connectionIssue: object"),{isValid:e.length===0,errors:e}}class Ou{config;constructor(e){this.config=e}getFlatRecursiveConfig(e,t="",s={}){for(const n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;const r=e[n],o=t?`${t}.${n}`:n;r!==null&&typeof r=="object"&&!Array.isArray(r)?this.getFlatRecursiveConfig(r,o,s):s[o]=r}return s}get configFlat(){return this.getFlatRecursiveConfig(this.config)}getConfig(){return this.config}getKey(e){return this.configFlat[e]??void 0}getKeyObject(e){return e.split(".").reduce((t,s)=>t&&t[s]!==void 0?t[s]:"undefined",this.config)}}const Pi={sm:"tw:h-[20px] tw:px-1.5 tw:py-0 tw:[font-size:10px] [&_svg]:tw:size-4",md:"tw:h-[24px] tw:px-2 tw:py-1 tw:text-xs [&_svg]:tw:size-4.5",lg:"tw:h-[28px] tw:px-3 tw:py-1 tw:text-sm [&_svg]:tw:size-5"};function Ai(i){return i==="sm"||i==="md"||i==="lg"?Pi[i]:Pi.md}function ir(i,e){try{const s={top:"sections.top.params.size",inside:"sections.inside.params.size",bottom:"sections.bottom.params.size"}[e],n=i?.getKey(s);return Ai(n)}catch{return Pi.md}}const{defineComponent:Iu}=await B("vue"),{normalizeClass:ks,openBlock:et,createElementBlock:tt,createCommentVNode:Mt,toDisplayString:qr,unref:Jn,normalizeStyle:sn,withCtx:ei,createVNode:ti,createElementVNode:Zr,withModifiers:Gr}=await B("vue"),Fu=["aria-expanded"],Ku=["innerHTML"],Uu=["src","alt"],Nu={key:2},Wu={key:0,class:"tw:flex tw:items-center tw:w-full tw:justify-end tw:gap-1.5 header-buttons"},Hu=["width","height"],ju={key:1},qu=["width","height"],Zu={key:1},{computed:$e}=await B("vue"),Gu=Iu({__name:"ChatHeader",props:{isChatOpen:{type:Boolean},toggleChat:{type:Function},configDesignClass:{},sectionBorderRadius:{},mainBorderRadius:{},isPreview:{type:Boolean},isEmbedded:{type:Boolean},restartChat:{type:Function}},setup(i){const e=i,t=$e(()=>e.configDesignClass.getKeyObject("sections.top.params")),s=$e(()=>ir(e.configDesignClass,"top")),n=(w,b="px")=>typeof w=="number"?`${w}${b}`:w,r=$e(()=>{let w="";switch(t.value.bgStyle){case"gradient":w=`linear-gradient(180deg, ${t.value.bgColor} 0%, ${e.configDesignClass.getKey("settings.bgChat")} 100%)`;break;case"filled":w=t.value.bgColor;break;case"invisible":w="transparent";break;default:w="transparent";break}const y=!!e.configDesignClass.getKey("settings.globalRoundingRadius")?`${e.mainBorderRadius}px`:n(t.value.borderRadius),p=e.configDesignClass.getKey("settings.container.gradient"),v=t.value.border,C=v?.width>0?`${v.width}px solid ${v.color}`:"none",S=`${t.value.sideMargin}px`;return{borderTopLeftRadius:t.value.bgStyle==="invisible"?0:y,borderTopRightRadius:t.value.bgStyle==="invisible"?0:y,borderBottomLeftRadius:t.value.bgStyle==="invisible"?0:p&&p!=="transparent"?y:0,borderBottomRightRadius:t.value.bgStyle==="invisible"?0:p&&p!=="transparent"?y:0,background:w,padding:`${t.value.paddingVertical}px ${t.value.paddingHorizontal}px`,margin:S,maxWidth:`calc(100% - ${S} * 2)`,borderBottom:C}}),o=$e(()=>{const w=e.configDesignClass.getKey("texts.widgetTitle"),b=e.configDesignClass.getKey("settings.widgetTitle");return w&&w!=="undefined"?w:b&&b!=="undefined"?b:""}),a=$e(()=>e.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")),l=$e(()=>{const w=e.configDesignClass.getKey("sections.top.params.chipStyle"),b=e.configDesignClass.getKey("sections.top.chipWidgetTitle.color"),y=e.configDesignClass.getKey("sections.top.chipWidgetTitle.bgColor"),p=w==="outlined",v=w==="filled",C=w==="invisible";return{borderRadius:e.configDesignClass.getKey("settings.globalRoundingRadius")?e.sectionBorderRadius.borderRadius:e.configDesignClass.getKey("sections.top.chipWidgetTitle.borderRadius")+"px",color:b,border:p?`1px solid ${y}`:"none",padding:C?"0px":null,"background-color":v?y:"transparent"}}),c=$e(()=>e.configDesignClass.getKey("sections.top.buttons.showType")),u=$e(()=>{const w=e.configDesignClass.getKey("sections.top.buttons.showType");return w&&w!=="undefined"?w:"icon"}),d=$e(()=>{const w=e.configDesignClass.getKeyObject("sections.top.buttons");return{color:w?.color??"#fff",bgColor:w?.bgColor??"#000"}}),g=$e(()=>{const w=e.configDesignClass.getKey("sections.top.params.buttonStyle"),b=w==="outlined",y=w==="invisible",p=d.value;return{borderRadius:e.configDesignClass.getKey("settings.globalRoundingRadius")?e.sectionBorderRadius.borderRadius:e.configDesignClass.getKey("sections.top.buttons.borderRadius")+"px",color:p.color,border:b?`1px solid ${p.bgColor}`:"none",padding:y?"0px":null,"background-color":y?"transparent":w==="filled"?p.bgColor:"transparent"}}),f=$e(()=>{const w=e.configDesignClass.getKey("texts.hideText");return w&&w!=="undefined"?w:"Hide"}),m=$e(()=>e.configDesignClass.getKey("settings.logo").includes("<svg")),h=$e(()=>e.configDesignClass.getKey("settings.logo"));return(w,b)=>(et(),tt("div",{onClick:b[0]||(b[0]=(...y)=>i.toggleChat&&i.toggleChat(...y)),class:"chat-action tw:transition-all tw:cursor-pointer tw:flex tw:items-center tw:w-full tw:justify-start",style:sn(r.value),role:"button","aria-expanded":i.isChatOpen},[ti(Jn(at),{class:ks(["tw:transition-all tw:flex tw:items-center tw:shadow-none header-title",s.value]),variant:a.value,size:i.configDesignClass.getKey("sections.top.params.size"),style:sn(l.value),type:"button","aria-label":o.value,title:o.value},{default:ei(()=>[m.value&&i.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")!=="text"?(et(),tt("div",{key:0,class:ks(["header-logo",i.configDesignClass.getKey("sections.top.params.size")]),innerHTML:h.value},null,10,Ku)):h.value&&i.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")!=="text"?(et(),tt("img",{key:1,src:h.value,alt:i.configDesignClass.getKey("sections.top.iconWidget.alt"),class:ks(i.configDesignClass.getKey("sections.top.params.size")==="sm"?"tw:w-3 tw:h-3":"tw:w-4 tw:h-4")},null,10,Uu)):Mt("",!0),i.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")!=="icon"?(et(),tt("span",Nu,qr(o.value),1)):Mt("",!0)]),_:1},8,["class","variant","size","style","aria-label","title"]),i.isChatOpen?(et(),tt("div",Wu,[ti(Jn(at),{variant:c.value,class:ks(["tw:transition-all",[s.value]]),size:i.configDesignClass.getKey("sections.top.params.size"),style:sn(g.value),type:"button","aria-label":f.value,title:f.value,onClick:Gr(i.restartChat,["stop"])},{default:ei(()=>[u.value!=="text"?(et(),tt("svg",{key:0,width:i.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",height:i.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...b[1]||(b[1]=[Zr("path",{d:"M10.7935 1.33333H5.20683C2.78016 1.33333 1.3335 2.77999 1.3335 5.20666V10.7867C1.3335 13.22 2.78016 14.6667 5.20683 14.6667H10.7868C13.2135 14.6667 14.6602 13.22 14.6602 10.7933V5.20666C14.6668 2.77999 13.2202 1.33333 10.7935 1.33333ZM8.00016 12.1667C6.80683 12.1667 5.8735 11.5733 5.24016 10.9867V11.46C5.24016 11.7333 5.0135 11.96 4.74016 11.96C4.46683 11.96 4.24016 11.7333 4.24016 11.46V9.62666C4.24016 9.35333 4.46683 9.12666 4.74016 9.12666H6.3935C6.66683 9.12666 6.8935 9.35333 6.8935 9.62666C6.8935 9.89999 6.66683 10.1267 6.3935 10.1267H5.7935C6.28683 10.62 7.0535 11.1667 8.00016 11.1667C9.74683 11.1667 11.1668 9.74666 11.1668 8C11.1668 7.72666 11.3935 7.5 11.6668 7.5C11.9402 7.5 12.1668 7.72666 12.1668 8C12.1668 10.3 10.3002 12.1667 8.00016 12.1667ZM12.1668 6.35999C12.1668 6.37999 12.1668 6.39999 12.1668 6.41333C12.1602 6.48666 12.1402 6.55333 12.1068 6.61333C12.0735 6.67333 12.0268 6.72666 11.9668 6.77333C11.9202 6.80666 11.8668 6.83333 11.8068 6.85333C11.7602 6.86666 11.7135 6.87333 11.6668 6.87333H10.0468C9.7735 6.87333 9.54683 6.64666 9.54683 6.37333C9.54683 6.1 9.7735 5.87333 10.0468 5.87333H10.6002C10.0668 5.38 9.20683 4.83333 8.0135 4.83333C6.26683 4.83333 4.84683 6.25333 4.84683 8C4.84683 8.27333 4.62016 8.5 4.34683 8.5C4.0735 8.5 3.8335 8.27333 3.8335 8C3.8335 5.7 5.70016 3.83333 8.00016 3.83333C9.4335 3.83333 10.4868 4.45333 11.1668 5.04666V4.53999C11.1668 4.26666 11.3935 4.03999 11.6668 4.03999C11.9402 4.03999 12.1668 4.26666 12.1668 4.53999V6.35999Z",fill:"currentColor"},null,-1)])],8,Hu)):Mt("",!0),u.value!=="icon"?(et(),tt("span",ju," Restart ")):Mt("",!0)]),_:1},8,["variant","class","size","style","aria-label","title","onClick"]),ti(Jn(at),{variant:c.value,class:ks(["tw:transition-all",[s.value]]),size:i.configDesignClass.getKey("sections.top.params.size"),style:sn(g.value),type:"button","aria-label":f.value,title:f.value,onClick:Gr(i.toggleChat,["stop"])},{default:ei(()=>[u.value!=="text"?(et(),tt("svg",{key:0,width:i.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",height:i.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...b[2]||(b[2]=[Zr("path",{d:"M10.7935 1.33337H5.20683C2.78016 1.33337 1.3335 2.78004 1.3335 5.20671V10.7867C1.3335 13.22 2.78016 14.6667 5.20683 14.6667H10.7868C13.2135 14.6667 14.6602 13.22 14.6602 10.7934V5.20671C14.6668 2.78004 13.2202 1.33337 10.7935 1.33337ZM12.3335 10.9334C12.3335 11.9334 11.9335 12.3334 10.9335 12.3334H8.40016C7.40016 12.3334 7.00016 11.9334 7.00016 10.9334V9.73337C7.00016 8.73337 7.40016 8.33337 8.40016 8.33337H10.9335C11.9335 8.33337 12.3335 8.73337 12.3335 9.73337V10.9334Z",fill:"currentColor"},null,-1)])],8,qu)):Mt("",!0),u.value!=="icon"?(et(),tt("span",Zu,qr(f.value),1)):Mt("",!0)]),_:1},8,["variant","class","size","style","aria-label","title","onClick"])])):Mt("",!0)],12,Fu))}}),{shallowRef:tg,watchEffect:sg,readonly:ng,watch:ig,customRef:rg,getCurrentScope:og,onScopeDispose:ag,effectScope:lg,getCurrentInstance:cg,hasInjectionContext:ug,inject:dg,provide:hg,ref:gg,isRef:fg,unref:pg,toValue:mg,computed:wg,reactive:yg,toRefs:bg,toRef:vg,shallowReadonly:Cg,onBeforeMount:xg,nextTick:kg,onBeforeUnmount:_g,onMounted:Sg,onUnmounted:Tg,isReactive:Rg}=await B("vue");typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Yu=i=>typeof i<"u",{isRef:$g,shallowRef:Dg,ref:Xu,watchEffect:Mg,computed:Qu,inject:zg,defineComponent:Bg,h:Eg,TransitionGroup:Pg,Fragment:Ag,shallowReactive:Vg,toValue:Lg,unref:Og,getCurrentInstance:Ju,onMounted:Ig,watch:Yr,customRef:Fg,onUpdated:Kg,readonly:Ug,reactive:Ng,hasInjectionContext:Wg,toRaw:Hg,shallowReadonly:jg,nextTick:ed,markRaw:qg,getCurrentScope:Zg,isReadonly:Gg,onBeforeUpdate:Yg}=await B("vue");function td(i){return JSON.parse(JSON.stringify(i))}function Oa(i,e,t,s={}){var n,r,o;const{clone:a=!1,passive:l=!1,eventName:c,deep:u=!1,defaultValue:d,shouldEmit:g}=s,f=Ju(),m=t||f?.emit||((n=f?.$emit)==null?void 0:n.bind(f))||((o=(r=f?.proxy)==null?void 0:r.$emit)==null?void 0:o.bind(f?.proxy));let h=c;e||(e="modelValue"),h=h||`update:${e.toString()}`;const w=p=>a?typeof a=="function"?a(p):td(p):p,b=()=>Yu(i[e])?w(i[e]):d,y=p=>{g?g(p)&&m(h,p):m(h,p)};if(l){const p=b(),v=Xu(p);let C=!1;return Yr(()=>i[e],S=>{C||(C=!0,v.value=w(S),ed(()=>C=!1))}),Yr(v,S=>{!C&&(S!==i[e]||u)&&y(S)},{deep:u}),v}else return Qu({get(){return b()},set(p){y(p)}})}const{defineComponent:sd}=await B("vue"),{unref:Xr,isRef:nd,vModelText:id,normalizeClass:rd,withDirectives:od,openBlock:ad,createElementBlock:ld}=await B("vue"),cd=sd({__name:"Textarea",props:{class:{},defaultValue:{},modelValue:{}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,n=Oa(t,"modelValue",e,{passive:!0,defaultValue:t.defaultValue});return(r,o)=>od((ad(),ld("textarea",{"onUpdate:modelValue":o[0]||(o[0]=a=>nd(n)?n.value=a:null),style:{resize:"none"},"data-slot":"textarea",class:rd(Xr(zo)("tw:md:text-sm",t.class))},null,2)),[[id,Xr(n)]])}}),{defineComponent:ud}=await B("vue"),{normalizeStyle:si,createElementVNode:zt,openBlock:Jt,createElementBlock:_s,createCommentVNode:dd,toDisplayString:hd,unref:gd,normalizeClass:fd,withCtx:pd,createBlock:md}=await B("vue"),wd=["innerHTML"],yd=["width","height"],bd=["width","height"],vd=["width","height"],Cd={key:4,class:"tw:absolute tw:-top-6 tw:-translate-x-1/2 tw:left-1/2 tw:text-xs tw:text-white tw:bg-red-500 tw:px-2 tw:py-0.5 tw:rounded-full tw:whitespace-nowrap"},{computed:Qr}=await B("vue"),Jr=ud({__name:"VoiceButton",props:{isRecording:{type:Boolean},isTranscribing:{type:Boolean},isPreview:{type:Boolean},disabled:{type:Boolean},formattedDuration:{},color:{},bgColor:{},borderRadius:{},iconSrc:{},iconSize:{},type:{},showType:{}},emits:["toggle"],setup(i){const e=i,t=Qr(()=>{const n=e.iconSize;return typeof n=="number"&&Number.isFinite(n)?Math.max(1,n):n==="sm"?16:n==="lg"?24:20}),s=Qr(()=>`${t.value}px`);return(n,r)=>(Jt(),md(gd(at),{type:"button","data-voice-type":i.type,"data-voice-show-type":i.showType,class:fd(["btn-voice tw:relative tw:shadow-none tw:flex-shrink-0 tw:p-2 tw:transition-all tw:duration-200 hover:tw:brightness-110",{"voice-recording":i.isRecording},{"tw:opacity-50 tw:cursor-not-allowed":(i.isTranscribing||i.disabled)&&!i.isPreview}]),size:"icon",style:si({backgroundColor:i.isRecording?"#ef4444":i.bgColor,color:i.isRecording?"#fff":i.color,borderRadius:i.borderRadius}),disabled:i.isTranscribing||i.disabled,onClick:r[0]||(r[0]=o=>n.$emit("toggle")),title:i.isRecording?"Stop recording":"Start voice input"},{default:pd(()=>[!i.isRecording&&!i.isTranscribing&&i.iconSrc?(Jt(),_s("div",{key:0,class:"svg-icon",style:si({width:s.value,height:s.value})},[zt("div",{innerHTML:i.iconSrc,style:si({width:s.value,height:s.value})},null,12,wd)],4)):!i.isRecording&&!i.isTranscribing?(Jt(),_s("svg",{key:1,width:t.value,height:t.value,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...r[1]||(r[1]=[zt("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"},null,-1),zt("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"},null,-1),zt("line",{x1:"12",x2:"12",y1:"19",y2:"22"},null,-1)])],8,yd)):i.isRecording?(Jt(),_s("svg",{key:2,width:t.value,height:t.value,viewBox:"0 0 24 24",fill:"currentColor"},[...r[2]||(r[2]=[zt("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"},null,-1)])],8,bd)):(Jt(),_s("svg",{key:3,width:t.value,height:t.value,viewBox:"0 0 24 24",fill:"none",class:"tw:animate-spin"},[...r[3]||(r[3]=[zt("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"2",opacity:"0.25"},null,-1),zt("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1)])],8,vd)),i.isRecording?(Jt(),_s("span",Cd,hd(i.formattedDuration),1)):dd("",!0)]),_:1},8,["data-voice-type","data-voice-show-type","class","style","disabled","title"]))}}),{ref:Ss,computed:eo,unref:xd}=await B("vue");function kd(i){const e=()=>xd(i.transcribeUrl),t=Ss(!1),s=Ss(!1),n=Ss(!0),r=Ss(null),o=Ss(0);let a=null,l=[],c=null,u=null;const d=i.maxDuration;(typeof navigator>"u"||!navigator.mediaDevices?.getUserMedia)&&(n.value=!1);const g=()=>{const p=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg"];for(const v of p)if(MediaRecorder.isTypeSupported(v))return v;return"audio/webm"},f=async()=>{if(!(!n.value||t.value))try{r.value=null,l=[],o.value=0,c=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,sampleRate:16e3}});const p=g();a=new MediaRecorder(c,{mimeType:p}),a.ondataavailable=v=>{v.data.size>0&&l.push(v.data)},a.onstop=async()=>{u&&(clearInterval(u),u=null);const v=new Blob(l,{type:p});c&&(c.getTracks().forEach(C=>C.stop()),c=null),await w(v)},a.onerror=()=>{r.value="Recording error",m()},a.start(250),t.value=!0,u=setInterval(()=>{o.value++,o.value>=d&&m()},1e3)}catch(p){p.name==="NotAllowedError"?r.value="Microphone access denied":p.name==="NotFoundError"?r.value="No microphone found":r.value=p.message||"Failed to start recording",r.value&&i.onError?.(r.value)}},m=()=>{a&&t.value&&(a.stop(),t.value=!1)},h=()=>{t.value?m():f()},w=async p=>{s.value=!0,r.value=null;const v=e();if(!v){r.value="Transcribe URL not configured",i.onError?.(r.value),s.value=!1;return}try{const C=new FormData;C.append("audio",p,"recording.webm");const S=await fetch(v,{method:"POST",body:C});if(!S.ok)throw new Error(`HTTP ${S.status}`);const _=await S.json();if(_.success&&_.text)i.onTranscript?.(_.text);else throw new Error(_.error||"Transcription failed")}catch(C){r.value=C.message||"Transcription failed",r.value&&i.onError?.(r.value)}finally{s.value=!1}},b=eo(()=>{const p=Math.floor(o.value/60),v=o.value%60;return`${p}:${v.toString().padStart(2,"0")}`}),y=eo(()=>t.value||s.value);return{isRecording:t,isTranscribing:s,isSupported:n,isBusy:y,error:r,recordingDuration:o,formattedDuration:b,startRecording:f,stopRecording:m,toggleRecording:h}}class _d{structure;options;html="";constructor(e,t){this.structure=e,this.options={escape:t?.escape??!0,whitelistStyles:t?.whitelistStyles??["color","background","borderColor","borderRadius"]}}build(e){return this.html=this.renderLayout(this.structure.layout,this.structure.bindings||{},e),this}buildStyle(e){return Object.entries(e).forEach(([t,s])=>{const n=Object.entries(s.style||{}).map(([o,a])=>`${o}: ${a};`).join(""),r=new RegExp(`(<\\w+)([^>]*)(data-visual="${this.escapeRegExp(t)}")([^>]*)(>)`,"g");this.html=this.html.replace(r,(o,a,l,c,u,d)=>{const g=l+u,f=g.match(/class="([^"]*)"/)?.[1]||"",m=g.match(/style="([^"]*)"/)?.[1]||"",h=l.replace(/\s*class="[^"]*"/g,"").replace(/\s*style="[^"]*"/g,""),w=u.replace(/\s*class="[^"]*"/g,"").replace(/\s*style="[^"]*"/g,""),b=[f,s.class].filter(Boolean).join(" "),y=[m,n].filter(Boolean).join(" ");return`${a}${h}${w} class="${b}" style="${y}"${d}`})}),this}result(){return this.html}renderLayout(e,t,s){let n=e;return t&&(Object.entries(t).forEach(([r,o])=>{const a=new RegExp(`\\{${this.escapeRegExp(r)}\\}`,"g");if(o.type==="text"){const l=s?.[r]?.text;n=n.replace(a,this.safeText(typeof l=="string"||typeof l=="number"?String(l):""));return}if(o.type==="button"){const l=s?.[r]?.text;n=n.replace(a,this.safeText(typeof l=="string"||typeof l=="number"?String(l):""));return}if(o.type==="repeater"){const l=Array.isArray(s?.[r])?s[r]:[],c=o.layout||"",u=o.bindings||{},d=l.map(g=>this.renderLayout(c,u,g)).join("");n=n.replace(a,d);return}}),n=n.replace(/style=\"([^\"]*)\"/g,(r,o)=>{const a=o.split(";").map(l=>l.trim()).filter(Boolean).filter(l=>{const[c]=l.split(":");return this.options.whitelistStyles.includes((c||"").trim())}).join("; ");return`style="${this.safeAttr(a)}"`})),n}safeText(e){return this.options.escape?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\"/g,""").replace(/'/g,"'"):e}safeAttr(e){return this.safeText(e)}escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}}const Sd={layout:'<div class="tw:flex tw:items-center tw:justify-between tw:w-full" data-visual="container"><div class="tw:flex tw:flex-col tw:gap-1"><span data-visual="headerChip" style="padding: 0 !important;">Action title</span><div data-visual="title">{title}</div></div><div class="tw:flex tw:gap-2"><button data-cb="confirm" data-visual="actionConfirm" class="tw:rounded-full tw:w-8 tw:min-h-8 tw:flex tw:items-center tw:justify-center"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.3337 4L6.00033 11.3333L2.66699 8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button><button data-cb="cancel" data-visual="actionCancel" style="border-radius: 0 !important;" class="tw:rounded-full tw:w-8 tw:min-h-8 tw:flex tw:items-center tw:justify-center"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 4L4 12M4 4L12 12" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button></div></div>',bindings:{title:{type:"text"},actionConfirm:{type:"button"},actionCancel:{type:"button"}}},{computed:ge}=await B("vue");function Td(i){const e=ge(()=>{const p=i?.getKeyObject("sections.inside.activeSnippet"),v=i?.getKeyObject("sections.activeSnippet"),C=p&&p!=="undefined"?p:v;return C&&C!=="undefined"?C:{}}),t=(p,v)=>{if(!v)return p;switch(v){case"outlined":return{color:p.background,background:"transparent",border:`1px solid ${p.borderColor||p.background}`};case"invisible":return{color:p.background,background:"transparent"};default:return p}},s=ge(()=>i?.getKey("sections.inside.activeSnippet.element.bgColor")),n=ge(()=>i?.getKey("sections.inside.activeSnippet.element.color")),r=ge(()=>i?.getKey("sections.inside.activeSnippet.element.sidePadding")),o=ge(()=>i?.getKey("sections.inside.activeSnippet.element.verticalSpacing")),a=ge(()=>i?.getKey("sections.inside.activeSnippet.element.borderWidth")+"px solid "+i?.getKey("sections.inside.activeSnippet.element.borderColor")),l=ge(()=>({color:e.value?.headerChip?.color,background:e.value?.headerChip?.bgColor,borderColor:e.value?.headerChip?.borderColor,bgColor:e.value?.headerChip?.bgColor})),c=ge(()=>t(l.value,e.value?.headerChip?.bgType)),u=ge(()=>({...c.value,"border-radius":i?.getKey("settings.globalRoundingRadius")?Fs(i,2).borderRadius:e.value?.headerChip?.borderRadius+"px","font-size":e.value?.headerChip?.fontSize+"px"})),d=ge(()=>e.value?.propertyColor),g=ge(()=>e.value?.valueColor),f=ge(()=>({color:e.value?.yesButton?.color,background:e.value?.yesButton?.bgColor,borderRadius:"100px"})),m=ge(()=>({color:e.value?.noButton?.color,background:e.value?.noButton?.bgColor,borderRadius:"100px"})),h=ge(()=>{const p=i?.getKey("sections.inside.activeSnippet.params.size"),v=i?.getKey("sections.inside.params.size");return Ai(p!=="undefined"?p:v)}),w=ge(()=>{const p=i?.getKey("sections.inside.activeSnippet.headerChip.size");return Ai(p)}),b=p=>{const v=(p.id||"").toLowerCase(),S=v==="confirm"||v==="yes"?f.value:m.value,_=i?.getKey("sections.inside.activeSnippet.params.buttonStyle");return t(S,_)},y=ge(()=>i?.getKey("settings.globalRoundingRadius")?Fs(i,8):{borderRadius:i?.getKey("sections.inside.activeSnippet.element.borderRadius")+"px"});return{containerBg:s,containerColor:n,sidePadding:r,verticalSpacing:o,headerChip:u,propertyColor:d,border:a,valueColor:g,yesButton:f,noButton:m,buttonStyle:b,getButtonStyle:t,actionBtnSizeClass:h,buttonRadiusStyle:y,chipSizeClass:w}}const{defineComponent:Rd}=await B("vue"),{openBlock:$d,createElementBlock:Dd}=await B("vue"),Md=["innerHTML"],{computed:nn}=await B("vue"),zd=Rd({__name:"DynamicSnippet",props:{structure:{},data:{},message:{},configDesignClass:{}},emits:["action"],setup(i,{emit:e}){const t=i,{containerBg:s,containerColor:n,headerChip:r,yesButton:o,noButton:a,actionBtnSizeClass:l,buttonRadiusStyle:c,verticalSpacing:u,sidePadding:d,valueColor:g,getButtonStyle:f,border:m,chipSizeClass:h}=Td(t.configDesignClass),w=nn(()=>t.configDesignClass?.getKey("sections.inside.activeSnippet.params.buttonStyle")),b=nn(()=>({background:s.value,color:n.value,"border-radius":t.configDesignClass?.getKey("settings.globalRoundingRadius")?c.value.borderRadius:t.configDesignClass?.getKey("sections.inside.activeSnippet.element.borderRadius")+"px",border:m.value,padding:`${d.value}px`,gap:`${u.value}px`})),y=nn(()=>({container:{style:b.value},headerChip:{style:{...r.value,height:"auto",padding:"0",background:"transparent"},class:h.value},actionConfirm:{class:l.value,style:{...f(o.value,w.value),flex:"1","line-height":"1","border-radius":"100px","font-size":t.configDesignClass?.getKey("sections.inside.activeSnippet.yesButton.fontSize")+"px"}},title:{style:{color:g.value,"font-size":t.configDesignClass?.getKey("sections.inside.activeSnippet.element.fontSize")+"px"}},actionCancel:{class:l.value,style:{...f(a.value,w.value),flex:"1","line-height":"1","border-radius":"100px","font-size":t.configDesignClass?.getKey("sections.inside.activeSnippet.yesButton.fontSize")+"px"}}})),p=e,v=nn(()=>new _d(t.structure).build(t.data).buildStyle(y.value).result()),C=S=>{const _=S.target;if(!_)return;const T=_.closest("[data-cb]")?.getAttribute("data-cb");T&&t.message.snippet?.sequence&&p("action",T,t.message.snippet.sequence)};return(S,_)=>($d(),Dd("div",{class:"tw:mt-1 tw:mb-1",onClick:C,innerHTML:v.value},null,8,Md))}}),{defineComponent:Bd}=await B("vue"),{createElementVNode:Oe,openBlock:Ne,createElementBlock:gt,createTextVNode:to,unref:de,withModifiers:ni,normalizeStyle:De,withCtx:ii,createVNode:rn,createCommentVNode:Bt,createBlock:ri,isRef:Ed,withKeys:Pd,normalizeClass:on,toDisplayString:oi}=await B("vue"),Ad={key:0,class:"svg-icon"},Vd=["innerHTML"],Ld={key:1},{computed:ae,nextTick:Od,onMounted:Id,ref:Fd,watch:Kd}=await B("vue"),ai=120,Ud=Bd({__name:"ChatBottom",props:{mainBorderRadius:{},isProduction:{type:Boolean},isPreview:{type:Boolean},configDesignClass:{},messageText:{},sendMessage:{type:Function},sectionBorderRadius:{},classSize:{},isInputDisabled:{type:Boolean},showReconnectNotice:{type:Boolean},restartChat:{type:Function},isStreaming:{type:Boolean},transcribeUrl:{},snippet:{}},emits:["update:messageText","trace","snippetAction"],setup(i,{emit:e}){const t=i,s=ae(()=>({text:"",isUser:!1,snippet:t.snippet?{sequence:t.snippet.sequence,id:t.snippet.id||"",data:t.snippet.data}:void 0})),n=ae(()=>t.transcribeUrl||t.configDesignClass?.getKey("settings.transcribeUrl")||""),r=ae(()=>!!n.value),o=ae(()=>t.configDesignClass?.getKey("sections.bottom.btnVoice.color")||t.configDesignClass?.getKey("sections.bottom.inputSend.color")||"#fff"),a=ae(()=>t.configDesignClass?.getKey("sections.bottom.btnVoice.bgColor")),l=ae(()=>t.configDesignClass?.getKeyObject("sections.bottom.inputSend")),c=ae(()=>t.configDesignClass?.getKey("sections.bottom.btnVoice.icon.src")||null),u=ae(()=>t.configDesignClass?.getKey("sections.bottom.btnVoice.icon.size")),d=ae(()=>{if(f.value==="icon")return t.configDesignClass?.getKey("sections.bottom.btnVoice.borderRadius")+"px";if(!!t.configDesignClass?.getKey("settings.globalRoundingRadius"))return t.sectionBorderRadius?.borderRadius;const G=t.configDesignClass?.getKey("sections.bottom.btnVoice.borderRadius");return typeof G=="number"?`${G}px`:"9999px"}),g=ae(()=>t.configDesignClass?.getKey("sections.bottom.btnVoice.type")),f=ae(()=>t.configDesignClass?.getKey("sections.bottom.btnVoice.showType")),{isRecording:m,isTranscribing:h,isSupported:w,formattedDuration:b,toggleRecording:y}=kd({transcribeUrl:n,maxDuration:60,onTranscript:L=>{S.value=L},onError:L=>{console.error("Voice recording error:",L)}}),p=()=>{t.sendMessage()},v=e,C=L=>{t.snippet?.sequence&&v("snippetAction",L,t.snippet.sequence)},S=Oa(t,"messageText",v,{passive:!0}),_=ae(()=>{const L=t.configDesignClass?.getKey("sections.bottom.inputSend.inputStyle");return L==="stacked"||L==="elastic"||L==="inside"?L:"inside"}),R=ae(()=>_.value==="stacked"),T=ae(()=>_.value==="elastic"),z=Fd(null),D=()=>{const L=z.value?.$el;return L instanceof HTMLTextAreaElement?L:null},P=()=>{if(!T.value)return;const L=D();if(!L)return;L.style.height="auto";const G=Math.min(L.scrollHeight,ai);L.style.height=`${G}px`,L.style.overflowY=L.scrollHeight>ai?"auto":"hidden"},F=()=>{P()};Kd([S,T],async()=>{await Od(),requestAnimationFrame(P)},{immediate:!0});const ne=ae(()=>t.configDesignClass.getKeyObject("sections.bottom.btnSend")),M=ae(()=>ir(ne.value,"bottom")),K=ae(()=>t.configDesignClass.getKey("sections.bottom.inputSend.size")),Z=ae(()=>t.configDesignClass.getKey("sections.bottom.btnSend.icon.showIcon")?t.configDesignClass.getKey("sections.bottom.btnSend.icon.src"):null),oe=ae(()=>{const L=t.configDesignClass.getKey("texts.disclaimerText"),G=t.configDesignClass.getKey("texts.disclaimer"),me=L&&L!=="undefined"?L:G,qt=!!t.configDesignClass.getKey("sections.bottom.params.disclaimerShow");return me&&me!=="undefined"&&qt?me:""});return Id(()=>{}),(L,G)=>(Ne(),gt("div",null,[i.isProduction?Bt("",!0):(Ne(),gt("div",{key:0,class:"tw:flex tw:flex-row tw:gap-2",style:De({padding:"0 "+i.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px"})},[rn(de(at),{type:"button",style:De({backgroundColor:"#27272A",borderRadius:i.configDesignClass.getKey("settings.globalRoundingRadius")?i.sectionBorderRadius.borderRadius:i.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px"}),class:"tw:flex-shrink-1 tw:flex-grow-1 tw:text-white","aria-label":"Copy last message",title:"Copy last message",onClick:G[0]||(G[0]=ni(me=>L.$emit("trace",{action:"copyLast"}),["stop"]))},{default:ii(()=>[...G[3]||(G[3]=[Oe("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Oe("path",{opacity:"0.4",d:"M17.5 5.83464V14.168C17.5 16.668 16.25 18.3346 13.3333 18.3346H7.5C8.50833 17.5763 9.16667 16.3596 9.16667 15.0013C9.16667 12.7013 7.3 10.8346 5 10.8346C4.05833 10.8346 3.19167 11.143 2.5 11.668V5.83464C2.5 3.33464 3.75 1.66797 6.66667 1.66797H13.3333C16.25 1.66797 17.5 3.33464 17.5 5.83464Z",fill:"white"}),Oe("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.084 3.125C12.4292 3.125 12.709 3.40482 12.709 3.75V5.41667C12.709 5.98816 13.1792 6.45833 13.7507 6.45833H15.4173C15.7625 6.45833 16.0423 6.73816 16.0423 7.08333C16.0423 7.42851 15.7625 7.70833 15.4173 7.70833H13.7507C12.4888 7.70833 11.459 6.67851 11.459 5.41667V3.75C11.459 3.40482 11.7388 3.125 12.084 3.125Z",fill:"white"}),Oe("path",{d:"M5.00065 10.832C2.70065 10.832 0.833984 12.6987 0.833984 14.9987C0.833984 17.2987 2.70065 19.1654 5.00065 19.1654C7.30065 19.1654 9.16732 17.2987 9.16732 14.9987C9.16732 12.6987 7.30065 10.832 5.00065 10.832ZM4.30065 16.057C4.50899 16.2654 4.50899 16.607 4.30065 16.8237C4.19232 16.932 4.05899 16.982 3.91733 16.982C3.77566 16.982 3.64231 16.932 3.53398 16.8237L2.09233 15.382C1.88399 15.1737 1.88399 14.832 2.09233 14.6153L3.53398 13.1737C3.74231 12.9654 4.08399 12.9654 4.30065 13.1737C4.50899 13.382 4.50899 13.7237 4.30065 13.9403L3.24233 14.9987L4.30065 16.057ZM7.90066 15.382L6.45898 16.8237C6.35065 16.932 6.21733 16.982 6.07566 16.982C5.93399 16.982 5.80064 16.932 5.69231 16.8237C5.48397 16.6154 5.48397 16.2737 5.69231 16.057L6.75066 14.9987L5.69231 13.9403C5.48397 13.732 5.48397 13.3904 5.69231 13.1737C5.90064 12.9654 6.24232 12.9654 6.45898 13.1737L7.90066 14.6153C8.10899 14.832 8.10899 15.1654 7.90066 15.382Z",fill:"white"})],-1),to(" Log last function call ",-1)])]),_:1},8,["style"]),rn(de(at),{type:"button",class:"tw:flex-shrink-1 tw:flex-grow-1 tw:text-white",style:De({backgroundColor:"#27272A",borderRadius:i.configDesignClass.getKey("settings.globalRoundingRadius")?i.sectionBorderRadius.borderRadius:i.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px"}),"aria-label":"Copy all",title:"Copy all",onClick:G[1]||(G[1]=ni(me=>L.$emit("trace",{action:"copyAll"}),["stop"]))},{default:ii(()=>[...G[4]||(G[4]=[Oe("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Oe("path",{opacity:"0.4",d:"M17.5 5.83464V14.168C17.5 16.668 16.25 18.3346 13.3333 18.3346H6.66667C3.75 18.3346 2.5 16.668 2.5 14.168V5.83464C2.5 3.33464 3.75 1.66797 6.66667 1.66797H13.3333C16.25 1.66797 17.5 3.33464 17.5 5.83464Z",fill:"white"}),Oe("path",{d:"M15.4173 7.70833H13.7507C12.484 7.70833 11.459 6.68333 11.459 5.41667V3.75C11.459 3.40833 11.7423 3.125 12.084 3.125C12.4257 3.125 12.709 3.40833 12.709 3.75V5.41667C12.709 5.99167 13.1757 6.45833 13.7507 6.45833H15.4173C15.759 6.45833 16.0423 6.74167 16.0423 7.08333C16.0423 7.425 15.759 7.70833 15.4173 7.70833Z",fill:"white"}),Oe("path",{d:"M8.33255 14.7922C8.17422 14.7922 8.01589 14.7339 7.89089 14.6089L6.22422 12.9422C5.98255 12.7006 5.98255 12.3005 6.22422 12.0589L7.89089 10.3922C8.13255 10.1505 8.53255 10.1505 8.77422 10.3922C9.01588 10.6339 9.01588 11.0339 8.77422 11.2756L7.54922 12.5005L8.77422 13.7255C9.01588 13.9672 9.01588 14.3672 8.77422 14.6089C8.64922 14.7339 8.49088 14.7922 8.33255 14.7922Z",fill:"white"}),Oe("path",{d:"M11.6659 14.7922C11.5076 14.7922 11.3492 14.7339 11.2242 14.6089C10.9826 14.3672 10.9826 13.9672 11.2242 13.7255L12.4492 12.5005L11.2242 11.2756C10.9826 11.0339 10.9826 10.6339 11.2242 10.3922C11.4659 10.1505 11.8659 10.1505 12.1076 10.3922L13.7742 12.0589C14.0159 12.3005 14.0159 12.7006 13.7742 12.9422L12.1076 14.6089C11.9826 14.7339 11.8242 14.7922 11.6659 14.7922Z",fill:"white"})],-1),to(" Log all function calls ",-1)])]),_:1},8,["style"])],4)),i.snippet?(Ne(),gt("div",{key:1,class:"tw:transition-all tw:flex tw:flex-col tw:mt-2",style:De({padding:"0 "+i.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px",marginBottom:i.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px"})},[rn(zd,{structure:de(Sd),data:i.snippet.data,message:s.value,configDesignClass:i.configDesignClass,onAction:C},null,8,["structure","data","message","configDesignClass"])],4)):(Ne(),gt("div",{key:2,class:"tw:transition-all tw:flex tw:flex-col tw:items-center tw:relative tw:mt-2",style:De({padding:R.value?"0":"0 "+i.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px"})},[Oe("div",{class:on(["message-input tw:transition-all tw:flex-1 tw:w-full tw:p-0 tw:gap-[10px] tw:flex",[T.value?"tw:flex-1 tw:min-h-[56px] tw:items-center":i.classSize,R.value?"tw:flex-col tw:items-stretch tw:justify-between":T.value?"":" tw:items-end",K.value==="sm"?"tw:items-center":""]]),style:De({order:T.value?"1":void 0,...R.value?{borderRadius:i.configDesignClass.getKey("settings.globalRoundingRadius")?i.mainBorderRadius+"px":i.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}:{borderRadius:i.configDesignClass.getKey("settings.globalRoundingRadius")?i.sectionBorderRadius.borderRadius:i.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px"},"background-color":i.configDesignClass.getKey("sections.bottom.inputSend.bgColor"),"margin-bottom":R.value?"0px":i.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px",border:R.value?"none":`${i.configDesignClass.getKey("sections.bottom.inputSend.borderWidth")}px solid ${i.configDesignClass.getKey("sections.bottom.inputSend.borderColor")}`,borderTop:`${i.configDesignClass.getKey("sections.bottom.inputSend.borderWidth")}px solid ${i.configDesignClass.getKey("sections.bottom.inputSend.borderColor")}`})},[r.value&&de(w)&&T.value?(Ne(),ri(Jr,{key:0,class:"tw:self-end",style:De({marginLeft:i.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px",marginTop:l.value.paddingVertical+"px",marginBottom:l.value.paddingVertical+"px"}),"is-recording":de(m),"is-transcribing":de(h),"is-preview":i.isPreview,disabled:i.isInputDisabled,"formatted-duration":de(b),color:o.value,"bg-color":a.value,"border-radius":d.value,"icon-src":c.value,"icon-size":u.value,type:g.value,"show-type":f.value,onToggle:de(y)},null,8,["style","is-recording","is-transcribing","is-preview","disabled","formatted-duration","color","bg-color","border-radius","icon-src","icon-size","type","show-type","onToggle"])):Bt("",!0),(Ne(),ri(de(cd),{class:on(["tw:transition-all",["tw:w-full tw:outline-none tw:border-0 focus:tw:outline-none",R.value?"tw:h-auto rounded-none":"h-full"]]),placeholder:i.configDesignClass.getKey("texts.inputPlaceholder")||"Type question",rows:T.value?1:K.value==="sm"?2:K.value==="md"?3:4,key:i.configDesignClass.getKey("sections.bottom.inputSend.color"),ref_key:"messageTextareaRef",ref:z,modelValue:de(S),"onUpdate:modelValue":G[2]||(G[2]=me=>Ed(S)?S.value=me:null),onKeyup:Pd(ni(p,["exact"]),["enter"]),onInput:F,style:De({alignSelf:R.value?"flex-start":"auto",color:i.configDesignClass.getKey("sections.bottom.inputSend.color"),fontSize:i.configDesignClass.getKey("sections.bottom.inputSend.fontSize")+"px",lineHeight:i.configDesignClass.getKey("settings.lineHeight"),padding:i.configDesignClass.getKey("sections.bottom.inputSend.paddingVertical")+"px "+i.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px",...T.value?{minHeight:i.configDesignClass.getKey("sections.bottom.inputSend.height")+"px",maxHeight:ai+"px",overflowY:"hidden",paddingLeft:"0px !important"}:{height:i.configDesignClass.getKey("sections.bottom.inputSend.height")+"px"}})},null,8,["placeholder","rows","modelValue","onKeyup","class","style"])),Oe("div",{class:on([R.value?"tw:flex tw:justify-end tw:items-center tw:gap-2":"tw:flex tw:ml-auto tw:items-center tw:gap-2",T.value?"tw:self-end":""]),style:De({marginBottom:i.configDesignClass.getKey("sections.bottom.inputSend.paddingVertical")+"px",marginLeft:R.value?i.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px":"0",marginTop:T.value?i.configDesignClass.getKey("sections.bottom.inputSend.paddingVertical")+"px":"0",marginRight:i.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px"})},[r.value&&de(w)&&!T.value?(Ne(),ri(Jr,{key:0,"is-recording":de(m),"is-transcribing":de(h),"is-preview":i.isPreview,disabled:i.isInputDisabled,"formatted-duration":de(b),color:o.value,"bg-color":a.value,"border-radius":d.value,"icon-src":c.value,"icon-size":u.value,type:g.value,"show-type":f.value,onToggle:de(y)},null,8,["is-recording","is-transcribing","is-preview","disabled","formatted-duration","color","bg-color","border-radius","icon-src","icon-size","type","show-type","onToggle"])):Bt("",!0),R.value&&oe.value?(Ne(),gt("div",{key:1,class:"tw:text-[11px] tw:flex tw:items-center tw:text-center tw:w-full tw:justify-center",style:De({...i.sectionBorderRadius,fontSize:i.configDesignClass.getKey("sections.bottom.disclaimer.fontSize")+"px",height:i.configDesignClass.getKey("sections.bottom.disclaimer.height")+"px",color:i.configDesignClass.getKey("sections.bottom.disclaimer.color")})},oi(oe.value),5)):Bt("",!0),rn(de(at),{class:on(["tw:transition-all",["btn-send tw:bg-transparent tw:shadow-none tw:flex-shrink-0 tw:items-center tw:gap-1",i.configDesignClass.getKey("sections.bottom.btnSend.showType")==="icon"?"tw:rounded-full":M.value,R.value?"":"tw:ml-auto",{"tw:opacity-50":(de(S).trim()===""||i.isInputDisabled)&&!i.isPreview},{"tw:px-3 tw:py-2":i.configDesignClass.getKey("sections.bottom.btnSend.size")==="md"},{"tw:px-2 tw:py-1":i.configDesignClass.getKey("sections.bottom.btnSend.size")==="sm"},{"tw:px-4 tw:py-3":i.configDesignClass.getKey("sections.bottom.btnSend.size")==="lg"}]]),size:i.configDesignClass.getKey("sections.bottom.btnSend.showType")==="icon"?"icon":i.configDesignClass.getKey("sections.bottom.params.size"),onClick:p,style:De({color:i.configDesignClass.getKey("sections.bottom.btnSend.color"),"background-color":i.configDesignClass.getKey("sections.bottom.btnSend.bgColor"),fontSize:i.configDesignClass.getKey("sections.bottom.btnSend.fontSize")+"px",border:i.configDesignClass.getKey("sections.bottom.btnSend.borderWidth")+"px solid "+i.configDesignClass.getKey("sections.bottom.btnSend.borderColor")}),disabled:i.isInputDisabled},{default:ii(()=>[Z.value?(Ne(),gt("div",Ad,[Oe("div",{innerHTML:Z.value,style:De({color:i.configDesignClass.getKey("sections.bottom.btnSend.color"),width:i.configDesignClass.getKey("sections.bottom.btnSend.icon.size")+"px",height:i.configDesignClass.getKey("sections.bottom.btnSend.icon.size")+"px"})},null,12,Vd)])):Bt("",!0),i.configDesignClass.getKey("sections.bottom.btnSend.showType")==="text"||i.configDesignClass.getKey("sections.bottom.btnSend.showType")==="both"?(Ne(),gt("span",Ld,oi(i.configDesignClass.getKey("texts.sendButton")),1)):Bt("",!0)]),_:1},8,["size","class","style","disabled"])],6)],6),!R.value&&oe.value?(Ne(),gt("div",{key:0,class:"tw:px-2 tw:mb-2 tw:flex tw:items-center tw:justify-center",style:De({...i.sectionBorderRadius,fontSize:i.configDesignClass.getKey("sections.bottom.disclaimer.fontSize")+"px",order:T.value?0:2,height:i.configDesignClass.getKey("sections.bottom.disclaimer.height")+"px",color:i.configDesignClass.getKey("sections.bottom.disclaimer.color")})},oi(oe.value),5)):Bt("",!0)],4))]))}});var Q=(i=>(i.Collapsed="collapsed",i.EmptyChat="empty",i.Messages="messages",i.ActionSnippet="action_snippet",i.LaunchIssue="launch_issue",i.ConnectionIssue="connection_issue",i.ReconnectingAttempt="reconnecting_attempt",i.InputBlocked="input_blocked",i.ActionLoader="action_loader",i.TracesMessage="traces_message",i.TracesWithMeta="traces_with_meta",i))(Q||{});const Gs=["Received the request","Processing request","Finalizing request"],Nd=`
|
|
19
|
+
<p>Here's a simple Markdown table with 4 columns and 3 rows:</p>
|
|
20
|
+
<table>
|
|
21
|
+
<thead>
|
|
22
|
+
<tr>
|
|
23
|
+
<th>Column 1</th>
|
|
24
|
+
<th>Column 2</th>
|
|
25
|
+
<th>Column 3</th>
|
|
26
|
+
<th>Column 4</th>
|
|
27
|
+
</tr>
|
|
28
|
+
</thead>
|
|
29
|
+
<tbody><tr>
|
|
30
|
+
<td>Data 1</td>
|
|
31
|
+
<td>Data 2</td>
|
|
32
|
+
<td>Data 3</td>
|
|
33
|
+
<td>Data 4</td>
|
|
34
|
+
</tr>
|
|
35
|
+
<tr>
|
|
36
|
+
<td>Data 5</td>
|
|
37
|
+
<td>Data 6</td>
|
|
38
|
+
<td>Data 7</td>
|
|
39
|
+
<td>Data 8</td>
|
|
40
|
+
</tr>
|
|
41
|
+
<tr>
|
|
42
|
+
<td>Data 9</td>
|
|
43
|
+
<td>Data 10</td>
|
|
44
|
+
<td>Data 11</td>
|
|
45
|
+
<td>Data 12</td>
|
|
46
|
+
</tr>
|
|
47
|
+
</tbody></table>
|
|
48
|
+
<p>You can fill it with any data you like. </p>`;var Ia=(i=>(i.UserMessage="Give me some action",i))(Ia||{});class qe{base(e){return{isChatOpen:!0,isChatActive:!0,messages:[],isConnectionError:!1,isProcessError:!1,isReconnectError:!1,isInputDisabled:!1,showWelcome:!1,useTypewriterAnimation:!1,blockSocket:!0,traceLastShown:!1,...e}}}class Wd extends qe{type=Q.Collapsed;getState(){return this.base({isChatOpen:!1})}}class so extends qe{type=Q.EmptyChat;getState(){return this.base({showWelcome:!0,messages:[]})}}class Hd extends qe{type=Q.Messages;getState(e,t){const s=t?.userMessageText??"Give me some action";return this.base({showWelcome:!0,messages:[{text:s,isUser:!0},{text:Nd,isUser:!1}]})}}class jd extends qe{type=Q.ActionSnippet;getState(e,t){const s=t?.userMessageText??"Give me some action",n={sequence:"38952101547613990",id:"38496103561174822",data:{actionCancel:{text:"Yes"},actionConfirm:{text:"No"},title:{text:"Do you really wanna do this?"}}},o=(t?.traceSteps??Gs).map(a=>({text:a,isUser:!1,isSystem:!0,type:"trace"}));return this.base({showWelcome:!0,messages:[{text:s,isUser:!0},...o,{text:"Here is system’s meaningful response",isUser:!1}],snippet:n})}}class qd extends qe{type=Q.LaunchIssue;getState(){return this.base({isConnectionError:!0})}}class Zd extends qe{type=Q.ConnectionIssue;getState(e,t){const s=t?.userMessageText??"Give me some action",n=!0,o=(t?.traceSteps??Gs).map(a=>({text:a,isUser:!1,isSystem:!0,type:"trace"}));return t?.animateTraces?this.base({isProcessError:!0,showWelcome:n,messages:[{text:s,isUser:!0}],pendingTraces:o,traceAnimationDelay:t.traceAnimationDelay}):this.base({isProcessError:!0,showWelcome:n,messages:[{text:s,isUser:!0},...o]})}}class Gd extends qe{type=Q.ReconnectingAttempt;getState(e,t){const s=t?.userMessageText??"Give me some action",n=!0,o=(t?.traceSteps??Gs).map(a=>({text:a,isUser:!1,isSystem:!0,type:"trace"}));return t?.animateTraces?this.base({isReconnectError:!0,showReconnectNotice:!0,showWelcome:n,messages:[{text:s,isUser:!0}],pendingTraces:o,traceAnimationDelay:t.traceAnimationDelay}):this.base({isReconnectError:!0,showReconnectNotice:!0,showWelcome:n,messages:[{text:s,isUser:!0},...o]})}}class Yd extends qe{type=Q.InputBlocked;getState(e,t){const s=t?.userMessageText??"Give me some action",n=!0,o=(t?.traceSteps??Gs).map(a=>({text:a,isUser:!1,isSystem:!0,type:"trace"}));return t?.animateTraces?this.base({isReconnectError:!0,showReconnectNotice:!0,isInputDisabled:!0,showWelcome:n,messages:[{text:s,isUser:!0}],pendingTraces:o,traceAnimationDelay:t.traceAnimationDelay}):this.base({isReconnectError:!0,showReconnectNotice:!0,isInputDisabled:!0,showWelcome:n,messages:[{text:s,isUser:!0},...o]})}}class Xd extends qe{type=Q.ActionLoader;getState(e,t){const s=t?.userMessageText??"Give me some action";return this.base({showWelcome:!0,messages:[{text:s,isUser:!0}]})}}class Qd extends qe{type=Q.TracesMessage;getState(e,t){const s=t?.userMessageText??"Give me some action",r=(t?.traceSteps??Gs).map(o=>({text:o,isUser:!1,isSystem:!0,type:"trace"}));return t?.animateTraces?this.base({showWelcome:!0,messages:[{text:s,isUser:!0}],pendingTraces:r,traceAnimationDelay:t.traceAnimationDelay}):this.base({showWelcome:!0,messages:[{text:s,isUser:!0},...r]})}}class Jd extends qe{type=Q.TracesWithMeta;getState(e,t){const s=t?.userMessageText??"Give me some action",n=t?.traceSteps??["Step One","API Schema Requested","API Call Conducted","API Call Conducted"],r=[{text:n[0],isUser:!1,isSystem:!0,type:"trace",meta:{step:1}},{text:n[1],isUser:!1,isSystem:!0,type:"trace",meta:{step:2,json:{status:"requested",endpoint:"/v1/schema"}}},{text:n[2],isUser:!1,isSystem:!0,type:"trace",meta:{step:3,json:{status:"ok",code:200}}},{text:n[3],isUser:!1,isSystem:!0,type:"trace"}];return t?.animateTraces?this.base({showWelcome:!0,messages:[{text:s,isUser:!0}],pendingTraces:r,traceAnimationDelay:t.traceAnimationDelay}):this.base({showWelcome:!0,messages:[{text:s,isUser:!0},...r]})}}class e1{static create(e){switch(e){case Q.Collapsed:case"collapsed":return new Wd;case Q.EmptyChat:case"empty":return new so;case Q.Messages:case"messages":return new Hd;case Q.ActionSnippet:case"action_snippet":return new jd;case Q.LaunchIssue:case"launch_issue":return new qd;case Q.ConnectionIssue:case"connection_issue":return new Zd;case Q.ReconnectingAttempt:case"reconnecting_attempt":return new Gd;case Q.InputBlocked:case"input_blocked":return new Yd;case Q.ActionLoader:case"action_loader":return new Xd;case Q.TracesMessage:case"traces_message":return new Qd;case Q.TracesWithMeta:case"traces_with_meta":return new Jd;default:return new so}}}class no{static getScenarioFromUrl(){try{return new URLSearchParams(window.location.search).get("scenario")??void 0}catch{return}}static getState(e,t,s){return{...e1.create(e).getState(t,s),...s??{}}}}const{ref:li,unref:t1,onUnmounted:s1}=await B("vue");function n1(i){const e=li(!1),t=li(!1),s=li(null);let n=null,r=null;const o=()=>t1(i.ttsUrl),a=()=>{n&&(n.pause(),n.src="",n=null),r&&(URL.revokeObjectURL(r),r=null)},l=async f=>{const m=o();if(!m)throw s.value="TTS URL not configured",new Error(s.value);if(!f?.trim())throw s.value="No text to speak",new Error(s.value);d(),t.value=!0,s.value=null;try{const h=await fetch(m,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:f.trim(),voice:i.voice||"nova"})});if(!h.ok){const b=await h.json().catch(()=>({}));throw new Error(b.error||`TTS request failed: ${h.status}`)}const w=await h.blob();return r=URL.createObjectURL(w),new Promise((b,y)=>{n=new Audio(r),n.onplay=()=>{e.value=!0,t.value=!1},n.onended=()=>{e.value=!1,a(),b()},n.onerror=()=>{e.value=!1,t.value=!1,s.value="Audio playback failed",a(),y(s.value)},n.play().catch(p=>{t.value=!1,s.value=p.message,y(p)})})}catch(h){throw t.value=!1,s.value=h.message||"TTS failed",h}},c=()=>{n&&e.value&&(n.pause(),e.value=!1)},u=()=>{n&&!e.value&&(n.play(),e.value=!0)},d=()=>{e.value=!1,t.value=!1,a()},g=f=>{e.value?c():n&&n.paused&&n.currentTime>0?u():f&&l(f)};return s1(()=>{d()}),{isSpeaking:e,isLoading:t,error:s,speak:l,pause:c,resume:u,stop:d,toggle:g}}function rr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var jt=rr();function Fa(i){jt=i}var Is={exec:()=>null};function I(i,e=""){let t=typeof i=="string"?i:i.source,s={replace:(n,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(be.caret,"$1"),t=t.replace(n,o),s},getRegex:()=>new RegExp(t,e)};return s}var i1=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),be={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}#`),htmlBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}<(?:[a-z].*>|!--)`,"i")},r1=/^(?:[ \t]*(?:\n|$))+/,o1=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,a1=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ys=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,l1=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,or=/(?:[*+-]|\d{1,9}[.)])/,Ka=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ua=I(Ka).replace(/bull/g,or).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),c1=I(Ka).replace(/bull/g,or).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ar=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,u1=/^[^\n]+/,lr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,d1=I(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",lr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),h1=I(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,or).getRegex(),zn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",cr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,g1=I("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",cr).replace("tag",zn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Na=I(ar).replace("hr",Ys).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zn).getRegex(),f1=I(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Na).getRegex(),ur={blockquote:f1,code:o1,def:d1,fences:a1,heading:l1,hr:Ys,html:g1,lheading:Ua,list:h1,newline:r1,paragraph:Na,table:Is,text:u1},io=I("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ys).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zn).getRegex(),p1={...ur,lheading:c1,table:io,paragraph:I(ar).replace("hr",Ys).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",io).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zn).getRegex()},m1={...ur,html:I(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",cr).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Is,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:I(ar).replace("hr",Ys).replace("heading",` *#{1,6} *[^
|
|
49
|
+
]`).replace("lheading",Ua).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},w1=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,y1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Wa=/^( {2,}|\\)\n(?!\s*$)/,b1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Bn=/[\p{P}\p{S}]/u,dr=/[\s\p{P}\p{S}]/u,Ha=/[^\s\p{P}\p{S}]/u,v1=I(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,dr).getRegex(),ja=/(?!~)[\p{P}\p{S}]/u,C1=/(?!~)[\s\p{P}\p{S}]/u,x1=/(?:[^\s\p{P}\p{S}]|~)/u,k1=I(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",i1?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),qa=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,_1=I(qa,"u").replace(/punct/g,Bn).getRegex(),S1=I(qa,"u").replace(/punct/g,ja).getRegex(),Za="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",T1=I(Za,"gu").replace(/notPunctSpace/g,Ha).replace(/punctSpace/g,dr).replace(/punct/g,Bn).getRegex(),R1=I(Za,"gu").replace(/notPunctSpace/g,x1).replace(/punctSpace/g,C1).replace(/punct/g,ja).getRegex(),$1=I("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ha).replace(/punctSpace/g,dr).replace(/punct/g,Bn).getRegex(),D1=I(/\\(punct)/,"gu").replace(/punct/g,Bn).getRegex(),M1=I(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),z1=I(cr).replace("(?:-->|$)","-->").getRegex(),B1=I("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",z1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Sn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,E1=I(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Sn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ga=I(/^!?\[(label)\]\[(ref)\]/).replace("label",Sn).replace("ref",lr).getRegex(),Ya=I(/^!?\[(ref)\](?:\[\])?/).replace("ref",lr).getRegex(),P1=I("reflink|nolink(?!\\()","g").replace("reflink",Ga).replace("nolink",Ya).getRegex(),ro=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,hr={_backpedal:Is,anyPunctuation:D1,autolink:M1,blockSkip:k1,br:Wa,code:y1,del:Is,emStrongLDelim:_1,emStrongRDelimAst:T1,emStrongRDelimUnd:$1,escape:w1,link:E1,nolink:Ya,punctuation:v1,reflink:Ga,reflinkSearch:P1,tag:B1,text:b1,url:Is},A1={...hr,link:I(/^!?\[(label)\]\((.*?)\)/).replace("label",Sn).getRegex(),reflink:I(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Sn).getRegex()},Vi={...hr,emStrongRDelimAst:R1,emStrongLDelim:S1,url:I(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ro).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:I(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ro).getRegex()},V1={...Vi,br:I(Wa).replace("{2,}","*").getRegex(),text:I(Vi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},an={normal:ur,gfm:p1,pedantic:m1},Ts={normal:hr,gfm:Vi,breaks:V1,pedantic:A1},L1={"&":"&","<":"<",">":">",'"':""","'":"'"},oo=i=>L1[i];function it(i,e){if(e){if(be.escapeTest.test(i))return i.replace(be.escapeReplace,oo)}else if(be.escapeTestNoEncode.test(i))return i.replace(be.escapeReplaceNoEncode,oo);return i}function ao(i){try{i=encodeURI(i).replace(be.percentDecode,"%")}catch{return null}return i}function lo(i,e){let t=i.replace(be.findPipe,(r,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),s=t.split(be.splitPipe),n=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;n<s.length;n++)s[n]=s[n].trim().replace(be.slashPipe,"|");return s}function Rs(i,e,t){let s=i.length;if(s===0)return"";let n=0;for(;n<s&&i.charAt(s-n-1)===e;)n++;return i.slice(0,s-n)}function O1(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<i.length;s++)if(i[s]==="\\")s++;else if(i[s]===e[0])t++;else if(i[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function co(i,e,t,s,n){let r=e.href,o=e.title||null,a=i[1].replace(n.other.outputLinkReplace,"$1");s.state.inLink=!0;let l={type:i[0].charAt(0)==="!"?"image":"link",raw:t,href:r,title:o,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,l}function I1(i,e,t){let s=i.match(t.other.indentCodeCompensation);if(s===null)return e;let n=s[1];return e.split(`
|
|
50
|
+
`).map(r=>{let o=r.match(t.other.beginningSpace);if(o===null)return r;let[a]=o;return a.length>=n.length?r.slice(n.length):r}).join(`
|
|
51
|
+
`)}var Tn=class{options;rules;lexer;constructor(i){this.options=i||jt}space(i){let e=this.rules.block.newline.exec(i);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(i){let e=this.rules.block.code.exec(i);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Rs(t,`
|
|
52
|
+
`)}}}fences(i){let e=this.rules.block.fences.exec(i);if(e){let t=e[0],s=I1(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(i){let e=this.rules.block.heading.exec(i);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=Rs(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(i){let e=this.rules.block.hr.exec(i);if(e)return{type:"hr",raw:Rs(e[0],`
|
|
53
|
+
`)}}blockquote(i){let e=this.rules.block.blockquote.exec(i);if(e){let t=Rs(e[0],`
|
|
54
|
+
`).split(`
|
|
55
|
+
`),s="",n="",r=[];for(;t.length>0;){let o=!1,a=[],l;for(l=0;l<t.length;l++)if(this.rules.other.blockquoteStart.test(t[l]))a.push(t[l]),o=!0;else if(!o)a.push(t[l]);else break;t=t.slice(l);let c=a.join(`
|
|
56
|
+
`),u=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
57
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
58
|
+
${c}`:c,n=n?`${n}
|
|
59
|
+
${u}`:u;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,r,!0),this.lexer.state.top=d,t.length===0)break;let g=r.at(-1);if(g?.type==="code")break;if(g?.type==="blockquote"){let f=g,m=f.raw+`
|
|
60
|
+
`+t.join(`
|
|
61
|
+
`),h=this.blockquote(m);r[r.length-1]=h,s=s.substring(0,s.length-f.raw.length)+h.raw,n=n.substring(0,n.length-f.text.length)+h.text;break}else if(g?.type==="list"){let f=g,m=f.raw+`
|
|
62
|
+
`+t.join(`
|
|
63
|
+
`),h=this.list(m);r[r.length-1]=h,s=s.substring(0,s.length-g.raw.length)+h.raw,n=n.substring(0,n.length-f.raw.length)+h.raw,t=m.substring(r.at(-1).raw.length).split(`
|
|
64
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:r,text:n}}}list(i){let e=this.rules.block.list.exec(i);if(e){let t=e[1].trim(),s=t.length>1,n={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");let r=this.rules.other.listItemRegex(t),o=!1;for(;i;){let l=!1,c="",u="";if(!(e=r.exec(i))||this.rules.block.hr.test(i))break;c=e[0],i=i.substring(c.length);let d=e[2].split(`
|
|
65
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,h=>" ".repeat(3*h.length)),g=i.split(`
|
|
66
|
+
`,1)[0],f=!d.trim(),m=0;if(this.options.pedantic?(m=2,u=d.trimStart()):f?m=e[1].length+1:(m=e[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,u=d.slice(m),m+=e[1].length),f&&this.rules.other.blankLine.test(g)&&(c+=g+`
|
|
67
|
+
`,i=i.substring(g.length+1),l=!0),!l){let h=this.rules.other.nextBulletRegex(m),w=this.rules.other.hrRegex(m),b=this.rules.other.fencesBeginRegex(m),y=this.rules.other.headingBeginRegex(m),p=this.rules.other.htmlBeginRegex(m);for(;i;){let v=i.split(`
|
|
68
|
+
`,1)[0],C;if(g=v,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),C=g):C=g.replace(this.rules.other.tabCharGlobal," "),b.test(g)||y.test(g)||p.test(g)||h.test(g)||w.test(g))break;if(C.search(this.rules.other.nonSpaceChar)>=m||!g.trim())u+=`
|
|
69
|
+
`+C.slice(m);else{if(f||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(d)||y.test(d)||w.test(d))break;u+=`
|
|
70
|
+
`+g}!f&&!g.trim()&&(f=!0),c+=v+`
|
|
71
|
+
`,i=i.substring(v.length+1),d=C.slice(m)}}n.loose||(o?n.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),n.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(u),loose:!1,text:u,tokens:[]}),n.raw+=c}let a=n.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let l of n.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let u=this.lexer.inlineQueue.length-1;u>=0;u--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[u].src)){this.lexer.inlineQueue[u].src=this.lexer.inlineQueue[u].src.replace(this.rules.other.listReplaceTask,"");break}}let c=this.rules.other.listTaskCheckbox.exec(l.raw);if(c){let u={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};l.checked=u.checked,n.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=u.raw+l.tokens[0].raw,l.tokens[0].text=u.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(u)):l.tokens.unshift({type:"paragraph",raw:u.raw,text:u.raw,tokens:[u]}):l.tokens.unshift(u)}}if(!n.loose){let c=l.tokens.filter(d=>d.type==="space"),u=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));n.loose=u}}if(n.loose)for(let l of n.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return n}}html(i){let e=this.rules.block.html.exec(i);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(i){let e=this.rules.block.def.exec(i);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:s,title:n}}}table(i){let e=this.rules.block.table.exec(i);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=lo(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
72
|
+
`):[],r={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?r.align.push("right"):this.rules.other.tableAlignCenter.test(o)?r.align.push("center"):this.rules.other.tableAlignLeft.test(o)?r.align.push("left"):r.align.push(null);for(let o=0;o<t.length;o++)r.header.push({text:t[o],tokens:this.lexer.inline(t[o]),header:!0,align:r.align[o]});for(let o of n)r.rows.push(lo(o,r.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:r.align[l]})));return r}}lheading(i){let e=this.rules.block.lheading.exec(i);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(i){let e=this.rules.block.paragraph.exec(i);if(e){let t=e[1].charAt(e[1].length-1)===`
|
|
73
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(i){let e=this.rules.block.text.exec(i);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(i){let e=this.rules.inline.escape.exec(i);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(i){let e=this.rules.inline.tag.exec(i);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(i){let e=this.rules.inline.link.exec(i);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let r=Rs(t.slice(0,-1),"\\");if((t.length-r.length)%2===0)return}else{let r=O1(e[2],"()");if(r===-2)return;if(r>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+r;e[2]=e[2].substring(0,r),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let s=e[2],n="";if(this.options.pedantic){let r=this.rules.other.pedanticHrefTitle.exec(s);r&&(s=r[1],n=r[3])}else n=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s=s.slice(1):s=s.slice(1,-1)),co(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(i,e){let t;if((t=this.rules.inline.reflink.exec(i))||(t=this.rules.inline.nolink.exec(i))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[s.toLowerCase()];if(!n){let r=t[0].charAt(0);return{type:"text",raw:r,text:r}}return co(t,n,t[0],this.lexer,this.rules)}}emStrong(i,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(i);if(!(!s||s[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!t||this.rules.inline.punctuation.exec(t))){let n=[...s[0]].length-1,r,o,a=n,l=0,c=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*i.length+n);(s=c.exec(e))!=null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(o=[...r].length,s[3]||s[4]){a+=o;continue}else if((s[5]||s[6])&&n%3&&!((n+o)%3)){l+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let u=[...s[0]][0].length,d=i.slice(0,n+s.index+u+o);if(Math.min(n,o)%2){let f=d.slice(1,-1);return{type:"em",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}let g=d.slice(2,-2);return{type:"strong",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(i){let e=this.rules.inline.code.exec(i);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&n&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(i){let e=this.rules.inline.br.exec(i);if(e)return{type:"br",raw:e[0]}}del(i){let e=this.rules.inline.del.exec(i);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(i){let e=this.rules.inline.autolink.exec(i);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(i){let e;if(e=this.rules.inline.url.exec(i)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(i){let e=this.rules.inline.text.exec(i);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},We=class Li{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||jt,this.options.tokenizer=this.options.tokenizer||new Tn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:be,block:an.normal,inline:Ts.normal};this.options.pedantic?(t.block=an.pedantic,t.inline=Ts.pedantic):this.options.gfm&&(t.block=an.gfm,this.options.breaks?t.inline=Ts.breaks:t.inline=Ts.gfm),this.tokenizer.rules=t}static get rules(){return{block:an,inline:Ts}}static lex(e,t){return new Li(t).lex(e)}static lexInline(e,t){return new Li(t).inlineTokens(e)}lex(e){e=e.replace(be.carriageReturn,`
|
|
74
|
+
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){for(this.options.pedantic&&(e=e.replace(be.tabCharGlobal," ").replace(be.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(o=>(n=o.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let o=t.at(-1);n.raw.length===1&&o!==void 0?o.raw+=`
|
|
75
|
+
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
76
|
+
`)?"":`
|
|
77
|
+
`)+n.raw,o.text+=`
|
|
78
|
+
`+n.text,this.inlineQueue.at(-1).src=o.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);let o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
79
|
+
`)?"":`
|
|
80
|
+
`)+n.raw,o.text+=`
|
|
81
|
+
`+n.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},t.push(n));continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}let r=e;if(this.options.extensions?.startBlock){let o=1/0,a=e.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},a),typeof l=="number"&&l>=0&&(o=Math.min(o,l))}),o<1/0&&o>=0&&(r=e.substring(0,o+1))}if(this.state.top&&(n=this.tokenizer.paragraph(r))){let o=t.at(-1);s&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
|
|
82
|
+
`)?"":`
|
|
83
|
+
`)+n.raw,o.text+=`
|
|
84
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(n),s=r.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let o=t.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
85
|
+
`)?"":`
|
|
86
|
+
`)+n.raw,o.text+=`
|
|
87
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(n);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let s=e,n=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)l.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,n.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let r;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)r=n[2]?n[2].length:0,s=s.slice(0,n.index+r)+"["+"a".repeat(n[0].length-r-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let o=!1,a="";for(;e;){o||(a=""),o=!1;let l;if(this.options.extensions?.inline?.some(u=>(l=u.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let u=t.at(-1);l.type==="text"&&u?.type==="text"?(u.raw+=l.raw,u.text+=l.text):t.push(l);continue}if(l=this.tokenizer.emStrong(e,s,a)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),t.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),t.push(l);continue}let c=e;if(this.options.extensions?.startInline){let u=1/0,d=e.slice(1),g;this.options.extensions.startInline.forEach(f=>{g=f.call({lexer:this},d),typeof g=="number"&&g>=0&&(u=Math.min(u,g))}),u<1/0&&u>=0&&(c=e.substring(0,u+1))}if(l=this.tokenizer.inlineText(c)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(a=l.raw.slice(-1)),o=!0;let u=t.at(-1);u?.type==="text"?(u.raw+=l.raw,u.text+=l.text):t.push(l);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return t}},Rn=class{options;parser;constructor(i){this.options=i||jt}space(i){return""}code({text:i,lang:e,escaped:t}){let s=(e||"").match(be.notSpaceStart)?.[0],n=i.replace(be.endingNewline,"")+`
|
|
88
|
+
`;return s?'<pre><code class="language-'+it(s)+'">'+(t?n:it(n,!0))+`</code></pre>
|
|
89
|
+
`:"<pre><code>"+(t?n:it(n,!0))+`</code></pre>
|
|
90
|
+
`}blockquote({tokens:i}){return`<blockquote>
|
|
91
|
+
${this.parser.parse(i)}</blockquote>
|
|
92
|
+
`}html({text:i}){return i}def(i){return""}heading({tokens:i,depth:e}){return`<h${e}>${this.parser.parseInline(i)}</h${e}>
|
|
93
|
+
`}hr(i){return`<hr>
|
|
94
|
+
`}list(i){let e=i.ordered,t=i.start,s="";for(let o=0;o<i.items.length;o++){let a=i.items[o];s+=this.listitem(a)}let n=e?"ol":"ul",r=e&&t!==1?' start="'+t+'"':"";return"<"+n+r+`>
|
|
95
|
+
`+s+"</"+n+`>
|
|
96
|
+
`}listitem(i){return`<li>${this.parser.parse(i.tokens)}</li>
|
|
97
|
+
`}checkbox({checked:i}){return"<input "+(i?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:i}){return`<p>${this.parser.parseInline(i)}</p>
|
|
98
|
+
`}table(i){let e="",t="";for(let n=0;n<i.header.length;n++)t+=this.tablecell(i.header[n]);e+=this.tablerow({text:t});let s="";for(let n=0;n<i.rows.length;n++){let r=i.rows[n];t="";for(let o=0;o<r.length;o++)t+=this.tablecell(r[o]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
99
|
+
<thead>
|
|
100
|
+
`+e+`</thead>
|
|
101
|
+
`+s+`</table>
|
|
102
|
+
`}tablerow({text:i}){return`<tr>
|
|
103
|
+
${i}</tr>
|
|
104
|
+
`}tablecell(i){let e=this.parser.parseInline(i.tokens),t=i.header?"th":"td";return(i.align?`<${t} align="${i.align}">`:`<${t}>`)+e+`</${t}>
|
|
105
|
+
`}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${it(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:e,tokens:t}){let s=this.parser.parseInline(t),n=ao(i);if(n===null)return s;i=n;let r='<a href="'+i+'"';return e&&(r+=' title="'+it(e)+'"'),r+=">"+s+"</a>",r}image({href:i,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let n=ao(i);if(n===null)return it(t);i=n;let r=`<img src="${i}" alt="${t}"`;return e&&(r+=` title="${it(e)}"`),r+=">",r}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:it(i.text)}},gr=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}checkbox({raw:i}){return i}},He=class Oi{options;renderer;textRenderer;constructor(e){this.options=e||jt,this.options.renderer=this.options.renderer||new Rn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new gr}static parse(e,t){return new Oi(t).parse(e)}static parseInline(e,t){return new Oi(t).parseInline(e)}parse(e){let t="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let o=n,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){t+=a||"";continue}}let r=n;switch(r.type){case"space":{t+=this.renderer.space(r);break}case"hr":{t+=this.renderer.hr(r);break}case"heading":{t+=this.renderer.heading(r);break}case"code":{t+=this.renderer.code(r);break}case"table":{t+=this.renderer.table(r);break}case"blockquote":{t+=this.renderer.blockquote(r);break}case"list":{t+=this.renderer.list(r);break}case"checkbox":{t+=this.renderer.checkbox(r);break}case"html":{t+=this.renderer.html(r);break}case"def":{t+=this.renderer.def(r);break}case"paragraph":{t+=this.renderer.paragraph(r);break}case"text":{t+=this.renderer.text(r);break}default:{let o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return t}parseInline(e,t=this.renderer){let s="";for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let a=this.options.extensions.renderers[r.type].call({parser:this},r);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){s+=a||"";continue}}let o=r;switch(o.type){case"escape":{s+=t.text(o);break}case"html":{s+=t.html(o);break}case"link":{s+=t.link(o);break}case"image":{s+=t.image(o);break}case"checkbox":{s+=t.checkbox(o);break}case"strong":{s+=t.strong(o);break}case"em":{s+=t.em(o);break}case"codespan":{s+=t.codespan(o);break}case"br":{s+=t.br(o);break}case"del":{s+=t.del(o);break}case"text":{s+=t.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},As=class{options;block;constructor(i){this.options=i||jt}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}emStrongMask(i){return i}provideLexer(){return this.block?We.lex:We.lexInline}provideParser(){return this.block?He.parse:He.parseInline}},F1=class{defaults=rr();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=He;Renderer=Rn;TextRenderer=gr;Lexer=We;Tokenizer=Tn;Hooks=As;constructor(...i){this.use(...i)}walkTokens(i,e){let t=[];for(let s of i)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let n=s;for(let r of n.header)t=t.concat(this.walkTokens(r.tokens,e));for(let r of n.rows)for(let o of r)t=t.concat(this.walkTokens(o.tokens,e));break}case"list":{let n=s;t=t.concat(this.walkTokens(n.items,e));break}default:{let n=s;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(r=>{let o=n[r].flat(1/0);t=t.concat(this.walkTokens(o,e))}):n.tokens&&(t=t.concat(this.walkTokens(n.tokens,e)))}}return t}use(...i){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let r=e.renderers[n.name];r?e.renderers[n.name]=function(...o){let a=n.renderer.apply(this,o);return a===!1&&(a=r.apply(this,o)),a}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=e[n.level];r?r.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),s.extensions=e),t.renderer){let n=this.defaults.renderer||new Rn(this.defaults);for(let r in t.renderer){if(!(r in n))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let o=r,a=t.renderer[o],l=n[o];n[o]=(...c)=>{let u=a.apply(n,c);return u===!1&&(u=l.apply(n,c)),u||""}}s.renderer=n}if(t.tokenizer){let n=this.defaults.tokenizer||new Tn(this.defaults);for(let r in t.tokenizer){if(!(r in n))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let o=r,a=t.tokenizer[o],l=n[o];n[o]=(...c)=>{let u=a.apply(n,c);return u===!1&&(u=l.apply(n,c)),u}}s.tokenizer=n}if(t.hooks){let n=this.defaults.hooks||new As;for(let r in t.hooks){if(!(r in n))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let o=r,a=t.hooks[o],l=n[o];As.passThroughHooks.has(r)?n[o]=c=>{if(this.defaults.async&&As.passThroughHooksRespectAsync.has(r))return(async()=>{let d=await a.call(n,c);return l.call(n,d)})();let u=a.call(n,c);return l.call(n,u)}:n[o]=(...c)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(n,c);return d===!1&&(d=await l.apply(n,c)),d})();let u=a.apply(n,c);return u===!1&&(u=l.apply(n,c)),u}}s.hooks=n}if(t.walkTokens){let n=this.defaults.walkTokens,r=t.walkTokens;s.walkTokens=function(o){let a=[];return a.push(r.call(this,o)),n&&(a=a.concat(n.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,e){return We.lex(i,e??this.defaults)}parser(i,e){return He.parse(i,e??this.defaults)}parseMarkdown(i){return(e,t)=>{let s={...t},n={...this.defaults,...s},r=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&s.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=i),n.async)return(async()=>{let o=n.hooks?await n.hooks.preprocess(e):e,a=await(n.hooks?await n.hooks.provideLexer():i?We.lex:We.lexInline)(o,n),l=n.hooks?await n.hooks.processAllTokens(a):a;n.walkTokens&&await Promise.all(this.walkTokens(l,n.walkTokens));let c=await(n.hooks?await n.hooks.provideParser():i?He.parse:He.parseInline)(l,n);return n.hooks?await n.hooks.postprocess(c):c})().catch(r);try{n.hooks&&(e=n.hooks.preprocess(e));let o=(n.hooks?n.hooks.provideLexer():i?We.lex:We.lexInline)(e,n);n.hooks&&(o=n.hooks.processAllTokens(o)),n.walkTokens&&this.walkTokens(o,n.walkTokens);let a=(n.hooks?n.hooks.provideParser():i?He.parse:He.parseInline)(o,n);return n.hooks&&(a=n.hooks.postprocess(a)),a}catch(o){return r(o)}}}onError(i,e){return t=>{if(t.message+=`
|
|
106
|
+
Please report this to https://github.com/markedjs/marked.`,i){let s="<p>An error occurred:</p><pre>"+it(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},Wt=new F1;function U(i,e){return Wt.parse(i,e)}U.options=U.setOptions=function(i){return Wt.setOptions(i),U.defaults=Wt.defaults,Fa(U.defaults),U};U.getDefaults=rr;U.defaults=jt;U.use=function(...i){return Wt.use(...i),U.defaults=Wt.defaults,Fa(U.defaults),U};U.walkTokens=function(i,e){return Wt.walkTokens(i,e)};U.parseInline=Wt.parseInline;U.Parser=He;U.parser=He.parse;U.Renderer=Rn;U.TextRenderer=gr;U.Lexer=We;U.lexer=We.lex;U.Tokenizer=Tn;U.Hooks=As;U.parse=U;U.options;U.setOptions;U.use;U.walkTokens;U.parseInline;He.parse;We.lex;const{defineComponent:K1}=await B("vue"),{createElementVNode:we,toDisplayString:uo,normalizeClass:ln,normalizeStyle:ci,openBlock:Et,createElementBlock:Pt,createCommentVNode:ho,withModifiers:go,unref:es}=await B("vue"),U1={key:"message",class:"message-text tw:flex tw:items-end tw:gap-1 tw:transition-all"},N1=["innerHTML"],W1=["aria-label"],H1={key:1,width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},j1=["aria-label","disabled"],q1={key:1,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{computed:st,onBeforeUnmount:Z1,ref:cn}=await B("vue"),G1=K1({__name:"MessageBot",props:{message:{},welcomeColor:{},color:{},bgColor:{},size:{},bgType:{},fontSize:{},borderWidth:{},borderColor:{},configDesignClass:{},ttsUrl:{}},setup(i){U.setOptions({breaks:!0,gfm:!0});const e=i,t=st(()=>e.ttsUrl||e.configDesignClass?.getKey("settings.ttsUrl")||""),s=st(()=>!!t.value),{speak:n,stop:r,isSpeaking:o,isLoading:a}=n1({ttsUrl:t,voice:"nova"}),l=cn(null),c=cn("idle"),u=cn(!1);let d;const g=()=>{d&&(window.clearTimeout(d),d=void 0)},f=(z=1500)=>{g(),d=window.setTimeout(()=>{c.value="idle"},z)},m=st(()=>{const z=e.message.chunk?.start?"#2F2F31":e.color,D=e.message.chunk?.start?"transparent":e.bgType==="bubble"?e.bgColor:"transparent";return{color:z,backgroundColor:D,fontSize:e.fontSize+"px",border:e.bgType==="bubble"?e.borderWidth+"px solid "+e.borderColor:"none","--hsw-message-table-header-bg":D&&D!=="transparent"?`color-mix(in srgb, ${D} 85%, white)`:D}}),h=()=>{const z=l.value?.innerText?.trim();return z||(e.message.text||"").trim()},w=z=>{const D=document.createElement("textarea");D.value=z,D.setAttribute("readonly",""),D.style.position="fixed",D.style.top="-9999px",D.style.left="-9999px",document.body.appendChild(D),D.select();const P=document.execCommand("copy");return document.body.removeChild(D),P},b=async()=>{const z=h();if(z)try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(z);else if(!w(z))throw new Error("execCommand(copy) failed");c.value="copied",f()}catch(D){console.warn("Copy failed",D),c.value="error",f(2e3)}},y=st(()=>c.value==="copied"?"Copied":c.value==="error"?"Copy failed":"Copy"),p=st(()=>u.value||c.value!=="idle"),v=cn(!1),C=st(()=>a.value?"Loading...":o.value?"Stop":"Speak"),S=st(()=>v.value||o.value||a.value);Z1(()=>{g()});const _=()=>{o.value?r():e.message.text&&n(e.message.text)},R=st(()=>{switch(e.size){case"sm":return e.bgType==="bubble"?" tw:min-h-[25px] tw:py-1 tw:px-2 ":"";case"md":return e.bgType==="bubble"?" tw:min-h-[33px] tw:py-2 tw:px-3":"";case"lg":return e.bgType==="bubble"?" tw:min-h-[40px] tw:py-3 tw:px-4":""}}),T=st(()=>e.message.text?U.parse(e.message.text):"");return(z,D)=>(Et(),Pt("li",{class:ln(["message-item tw:transition-all tw:text-white tw:max-w-[95%] tw:w-fit tw:whitespace-break-spaces tw:transition-colors tw:duration-[250ms] tw:ease-[ease]",[R.value,{"item-primary":!i.message.chunk?.start}]]),style:ci(m.value)},[we("div",U1,[we("span",{ref_key:"messageTextEl",ref:l,class:"tw:flex-1 tw:max-w-[100%] tw:overflow-x-scroll tw:flex markdown-content tw:flex-col",innerHTML:T.value},null,8,N1),i.message.text&&!i.message.chunk?.start&&i.message.chunk?.end?(Et(),Pt("div",{key:0,class:"tw:relative tw:flex-shrink-0 tw:self-end tw:flex",onMouseenter:D[2]||(D[2]=P=>u.value=!0),onMouseleave:D[3]||(D[3]=P=>u.value=!1)},[we("span",{class:ln(["tw:pointer-events-none tw:absolute tw:bottom-full tw:left-[-50%] tw:mb-2 tw:whitespace-nowrap tw:text-[11px] tw:px-2 tw:py-1 tw:rounded tw:bg-black/80 tw:text-white tw:opacity-0 tw:transition-opacity tw:duration-150 tw:z-10",{"tw:opacity-100":p.value}]),role:"tooltip"},uo(y.value),3),we("button",{class:"copy-button tw:opacity-80 tw:ml-2 tw:transition-opacity tw:duration-200 tw:cursor-pointer tw:rounded tw:hover:opacity-100",onClick:go(b,["stop"]),onFocus:D[0]||(D[0]=P=>u.value=!0),onBlur:D[1]||(D[1]=P=>u.value=!1),"aria-label":y.value,type:"button"},[c.value==="copied"?(Et(),Pt("svg",{key:0,xmlns:"http://www.w3.org/2000/svg",class:"tw:w-3.5 tw:h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",style:ci({color:i.color,opacity:.7})},[...D[8]||(D[8]=[we("polyline",{points:"20 6 9 17 4 12"},null,-1)])],4)):(Et(),Pt("svg",H1,[...D[9]||(D[9]=[we("path",{d:"M10.6667 8.60004V11.4C10.6667 13.7334 9.73334 14.6667 7.40001 14.6667H4.60001C2.26668 14.6667 1.33334 13.7334 1.33334 11.4V8.60004C1.33334 6.26671 2.26668 5.33337 4.60001 5.33337H7.40001C9.73334 5.33337 10.6667 6.26671 10.6667 8.60004Z",fill:"#A6A6A6"},null,-1),we("path",{d:"M11.4 1.33337H8.6C6.6793 1.33337 5.71167 1.97031 5.42923 3.49264C5.32764 4.04021 5.79499 4.50004 6.3519 4.50004H7.4C10.2 4.50004 11.5 5.80004 11.5 8.60004V9.64814C11.5 10.205 11.9598 10.6724 12.5074 10.5708C14.0297 10.2884 14.6667 9.32074 14.6667 7.40004V4.60004C14.6667 2.26671 13.7333 1.33337 11.4 1.33337Z",fill:"#A6A6A6"},null,-1)])]))],40,W1)],32)):ho("",!0),s.value&&i.message.text&&!i.message.chunk?.start&&i.message.chunk?.end?(Et(),Pt("div",{key:1,class:"tw:relative tw:flex-shrink-0 tw:self-end tw:flex",onMouseenter:D[6]||(D[6]=P=>v.value=!0),onMouseleave:D[7]||(D[7]=P=>v.value=!1)},[we("span",{class:ln(["tw:pointer-events-none tw:absolute tw:bottom-full tw:left-[-50%] tw:mb-2 tw:whitespace-nowrap tw:text-[11px] tw:px-2 tw:py-1 tw:rounded tw:bg-black/80 tw:text-white tw:opacity-0 tw:transition-opacity tw:duration-150 tw:z-10",{"tw:opacity-100":S.value}]),role:"tooltip"},uo(C.value),3),we("button",{class:ln(["tts-button tw:opacity-80 tw:hover:opacity-100 tw:transition-opacity tw:duration-200 tw:cursor-pointer tw:rounded tw:hover:bg-white",{"tw:opacity-100":es(o)||es(a),"tts-speaking":es(o),"tts-loading":es(a)}]),onClick:go(_,["stop"]),onFocus:D[4]||(D[4]=P=>v.value=!0),onBlur:D[5]||(D[5]=P=>v.value=!1),"aria-label":C.value,disabled:es(a),type:"button"},[es(o)?(Et(),Pt("svg",{key:0,xmlns:"http://www.w3.org/2000/svg",class:"tw:w-3.5 tw:h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",style:ci({color:i.color,opacity:.6})},[...D[10]||(D[10]=[we("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"},null,-1),we("line",{x1:"23",y1:"9",x2:"17",y2:"15"},null,-1),we("line",{x1:"17",y1:"9",x2:"23",y2:"15"},null,-1)])],4)):(Et(),Pt("svg",q1,[...D[11]||(D[11]=[we("path",{d:"M12 11.1666C11.8933 11.1666 11.7933 11.1333 11.7 11.0666C11.48 10.9 11.4333 10.5866 11.6 10.3666C12.6467 8.97331 12.6467 7.02664 11.6 5.63331C11.4333 5.41331 11.48 5.09998 11.7 4.93331C11.92 4.76665 12.2333 4.81331 12.4 5.03331C13.7067 6.77998 13.7067 9.21998 12.4 10.9666C12.3 11.1 12.1533 11.1666 12 11.1666Z",fill:"#A6A6A6"},null,-1),we("path",{d:"M13.22 12.8334C13.1133 12.8334 13.0133 12.8 12.92 12.7334C12.7 12.5667 12.6533 12.2534 12.82 12.0334C14.6 9.66002 14.6 6.34002 12.82 3.96669C12.6533 3.74669 12.7 3.43335 12.92 3.26669C13.14 3.10002 13.4533 3.14669 13.62 3.36669C15.6667 6.09335 15.6667 9.90669 13.62 12.6334C13.5267 12.7667 13.3733 12.8334 13.22 12.8334Z",fill:"#A6A6A6"},null,-1),we("path",{d:"M9.34668 2.52002C8.60001 2.10669 7.64668 2.21335 6.67334 2.82002L4.72668 4.04002C4.59334 4.12002 4.44001 4.16669 4.28668 4.16669H3.66668H3.33334C1.72001 4.16669 0.833344 5.05335 0.833344 6.66669V9.33335C0.833344 10.9467 1.72001 11.8334 3.33334 11.8334H3.66668H4.28668C4.44001 11.8334 4.59334 11.88 4.72668 11.96L6.67334 13.18C7.26001 13.5467 7.83334 13.7267 8.36668 13.7267C8.71334 13.7267 9.04668 13.6467 9.34668 13.48C10.0867 13.0667 10.5 12.2067 10.5 11.06V4.94002C10.5 3.79335 10.0867 2.93335 9.34668 2.52002Z",fill:"#A6A6A6"},null,-1)])]))],42,j1)],32)):ho("",!0)])],6))}}),{defineComponent:Y1}=await B("vue"),{toDisplayString:X1,normalizeClass:Q1,normalizeStyle:J1,openBlock:eh,createElementBlock:th}=await B("vue"),{computed:fo}=await B("vue"),sh=Y1({__name:"MessageUser",props:{message:{},isFirst:{type:Boolean},color:{},bgColor:{},borderWidth:{},borderColor:{},fontSize:{},size:{},bgType:{},configDesignClass:{}},setup(i){const e=i,t=fo(()=>{switch(e.size){case"sm":return e.bgType==="bubble"?" tw:min-h-[25px] tw:py-1 tw:px-2 ":"";case"md":return e.bgType==="bubble"?" tw:min-h-[33px] tw:py-2 tw:px-3":"";case"lg":return e.bgType==="bubble"?" tw:min-h-[40px] tw:py-3 tw:px-4":""}}),s=fo(()=>e.bgType==="bubble"?e.borderWidth+"px solid "+e.borderColor:"none");return(n,r)=>(eh(),th("li",{class:Q1(["message-item tw:transition-all tw:max-w-[95%] tw:w-fit tw:whitespace-break-spaces item-secondary tw:ml-auto",[t.value,{"tw:mt-[5px] !tw:bg-transparent":i.isFirst}]]),style:J1({color:i.color,"background-color":i.bgType==="bubble"?i.bgColor:"transparent",border:s.value,"font-size":i.fontSize+"px"})},X1(i.message.text),7))}}),{defineComponent:nh}=await B("vue"),{normalizeStyle:ft,createElementVNode:po,toDisplayString:ui,openBlock:At,createElementBlock:Vt,createCommentVNode:di,unref:ih,normalizeClass:hi,Transition:rh,withCtx:oh,createVNode:ah}=await B("vue"),lh=["innerHTML"],ch={class:"tw:text-sm"},uh=["innerHTML"],dh=["innerHTML"],hh=["data-text"],{ref:pt,computed:un,onMounted:mo,onBeforeUnmount:gh,watch:wo,nextTick:dn}=await B("vue"),fh=nh({__name:"LoadingMessage",props:{isProduction:{type:Boolean},borderRadius:{},loader:{},text:{},message:{},configDesignClass:{},paused:{type:Boolean},color:{},bgColor:{},loadingTime:{}},setup(i){const e=i,t=pt(null),s=pt(!1);let n=null;const r=pt(null),o=pt(null),a=pt(null),l=pt(null),c=pt(null),u=pt(null),d=un(()=>Number(e.configDesignClass.getKey("sections.loader.completeStep.icon.size"))||16),g=()=>{const y=t.value;if(!y)return;const p=y.closest("li");if(!p)return;const v=p.nextElementSibling;if(!v){s.value=!1;return}const C=v.getAttribute("data-component")==="MessageBot"||typeof v.matches=="function"&&v.matches('[data-component="MessageBot"]')||!!v.querySelector('[data-component="MessageBot"]');s.value=C},f=un(()=>e.configDesignClass.getKey("sections.inside.dataAction.type")),m=un(()=>e.configDesignClass.getKeyObject("sections.inside.dataAction"));mo(()=>{dn(g);const p=t.value?.closest("ul");p&&(n=new MutationObserver(()=>g()),n.observe(p,{childList:!0,subtree:!0}))}),gh(()=>{n&&n.disconnect()}),wo(()=>e.text,()=>dn(g));const h=un(()=>!!e.paused||s.value),w=()=>!e.loader||e.loader==="dots"?a.value:e.loader==="dots-pulse"?l.value:e.loader==="circle-pulse"?c.value:e.loader==="circle-pulse-1"?u.value:a.value,b=y=>{const p=w(),v=o.value,C=r.value;if(!p||!v||!C)return;const S=.3,_="power2.inOut";y?(A.to(p,{opacity:0,scale:.8,duration:S,ease:_}),A.fromTo(v,{opacity:0,scale:.8},{opacity:1,scale:1,duration:S,ease:_}),A.to(C,{width:d.value,duration:S,ease:_})):(A.to(v,{opacity:0,scale:.8,duration:S,ease:_}),A.fromTo(p,{opacity:0,scale:.8},{opacity:1,scale:1,duration:S,ease:_}),dn(()=>{const R=p.scrollWidth||d.value;A.to(C,{width:R,duration:S,ease:_})}))};return wo(h,(y,p)=>{y!==p&&b(y)}),mo(()=>{dn(()=>{const y=r.value,p=w();y&&p&&!h.value&&(y.style.width=p.scrollWidth+"px")})}),(y,p)=>(At(),Vt("li",{key:"loading",ref_key:"rootRef",ref:t,class:hi(["message-text-loading tw:flex tw:justify-start tw:overflow-hidden tw:flex-wrap",{"tw:flex-col tw:border tw:max-w-xs":f.value==="box","tw:border tw:px-3 tw:py-2.5":f.value==="outline","tw:!rounded-none":f.value==="compact","tw:items-center tw:gap-3":f.value!=="box"}]),style:ft({borderColor:m.value.strokeColor,borderWidth:m.value.strokeWidth+"px",borderRadius:i.borderRadius})},[f.value==="box"?(At(),Vt("div",{key:0,class:"tw:flex tw:items-center tw:justify-start tw:gap-1 tw:px-2 tw:py-2.5 tw:border-b",style:ft({backgroundColor:m.value.headerFillColor,color:m.value.pastStepColor,borderColor:m.value.strokeColor,borderBottomWidth:m.value.strokeWidth+"px"})},[po("div",{key:"complete-step-icon",innerHTML:i.configDesignClass.getKey("sections.loader.activeStep.icon.src"),class:"svg-inherit",style:ft({color:i.configDesignClass.getKey("sections.loader.activeStep.icon.color"),height:i.configDesignClass.getKey("sections.loader.activeStep.icon.size")+"px",width:i.configDesignClass.getKey("sections.loader.activeStep.icon.size")+"px"})},null,12,lh),po("span",ch,ui(m.value.headerText),1)],4)):di("",!0),f.value!=="box"?(At(),Vt("div",{key:1,ref_key:"loaderContainerRef",ref:r,class:"loader-container tw:flex tw:items-center tw:justify-center tw:overflow-hidden",style:ft({height:d.value+"px",minWidth:d.value+"px"})},[h.value?(At(),Vt("div",{key:0,ref_key:"completeIconRef",ref:o,innerHTML:i.configDesignClass.getKey("sections.loader.completeStep.icon.src"),class:"svg-inherit tw:absolute",style:ft({color:m.value.activeStepColor,height:d.value+"px",width:d.value+"px"})},null,12,uh)):(At(),Vt("div",{key:1,ref:"activeIconRef",innerHTML:i.configDesignClass.getKey("sections.loader.activeStep.icon.src"),class:"svg-inherit tw:absolute",style:ft({color:m.value.activeStepColor,height:d.value+"px",width:d.value+"px"})},null,12,dh))],4)):di("",!0),ah(rh,{name:"fade-text",mode:"out-in"},{default:oh(()=>[(At(),Vt("span",{class:hi(["tw:transition-all tw:text-sm",{"typing-shimmer":!h.value,"tw:px-3 tw:py-3":f.value==="box"}]),key:i.text,"data-text":i.message?.text?i.message?.text:i.text,style:ft({color:m.value.activeStepColor,background:f.value==="box"?`linear-gradient(0deg, ${m.value.headerFillColor} 0%, ${ih(Aa)(m.value.bodyFillColor,.4)} 100%)`:"transparent"})},ui(h.value?"Thinking completed":i.message?.text?i.message?.text:i.text),15,hh))]),_:1}),i.loadingTime&&i.loadingTime>0&&h.value&&(f.value==="outline"||f.value==="compact")?(At(),Vt("div",{key:2,class:hi(["tw:text-xs",{"tw:w-full tw:-mt-2":f.value==="compact","tw:ml-auto":f.value==="outline"}]),style:ft({color:m.value.pastStepColor})},ui(i.loadingTime)+" seconds total",7)):di("",!0)],6))}}),ph=(i,e)=>{const t=i.__vccOpts||i;for(const[s,n]of e)t[s]=n;return t},yo=ph(fh,[["__scopeId","data-v-b3a29c8f"]]),{defineComponent:mh}=await B("vue"),{normalizeStyle:$s,createElementVNode:mt,normalizeClass:hn,openBlock:gi,createElementBlock:bo,toDisplayString:vo,unref:wh,withCtx:yh,createBlock:bh,createCommentVNode:Xg}=await B("vue"),vh=["data-height"],Ch={class:"tw:transition-all tw:relative tw:w-[16px] tw:flex tw:flex-col tw:items-center tw:gap-1 tw:px-1"},xh={class:"tw:transition-all tw:flex tw:items-center tw:gap-2 tw:leading-none"},{computed:Ds}=await B("vue"),kh=mh({__name:"MessageSystem",props:{isProduction:{type:Boolean},message:{},welcomeColor:{},color:{},bgColor:{},size:{},configDesignClass:{},activeMessage:{type:Boolean},bgType:{},isLast:{type:Boolean},traceLastShown:{type:Boolean},index:{}},setup(i){const e=i,t=Ds(()=>e.index===3&&e.traceLastShown||e.isLast),s=Ds(()=>{switch(e.size){case"sm":return"tw:text-xs";case"md":return"tw:text-xs";case"lg":return"tw:text-base"}}),n=Ds(()=>e.configDesignClass.getKeyObject("sections.inside.dataAction")),r=Ds(()=>t.value?n.value.activeStepColor:n.value.pastStepColor),o=Ds(()=>ir(e.configDesignClass,"inside"));return(a,l)=>(gi(),bo("li",{class:hn(["message-system tw:text-left tw:relative tw:w-full tw:text-white tw:w-fit tw:whitespace-break-spaces tw:transition-colors tw:duration-[250ms] tw:ease-[ease]",s.value]),style:$s([{"margin-bottom":"0px !important"},{"padding-top":i.configDesignClass.getKey("sections.loader.completeStep.verticalSpacing")+"px"}]),"data-height":i.configDesignClass.getKey("sections.loader.completeStep.verticalSpacing")},[mt("div",{key:"message",class:hn(["message-text flex tw:transition-all tw:space-between tw:gap-3 tw:flex tw:items-center tw:align-center",{"tw:mb-0":i.isLast}])},[mt("div",Ch,[mt("hr",{class:"tw:w-[1px] tw:bg-white tw:opacity-20 tw:absolute",style:$s([{display:"none"},{height:i.configDesignClass.getKey("sections.loader.completeStep.verticalSpacing")+6+"px",left:"50%",transform:"translateX(-50%)",bottom:"100%"}])},null,4),mt("span",{class:hn(["tw:w-[8px] tw:h-[8px] tw:rounded-full",{"tw:bg-white":t.value}]),style:$s({backgroundColor:r.value})},null,6)]),mt("div",xh,[i.message.meta&&!i.isProduction?(gi(),bh(wh(at),{key:0,style:$s({color:e.activeMessage?"rgba(255, 255, 255, 0.60)":"#3F3F46",background:e.activeMessage?"#2F2F31":"#ECEDEE",border:e.activeMessage?"none":"1px solid #fff"}),class:hn(["tw:flex tw:items-center tw:gap-1 tw:rounded-md tw:shadow-xs",o.value])},{default:yh(()=>[l[0]||(l[0]=mt("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[mt("path",{d:"M10.7935 1.33301H5.20683C2.78016 1.33301 1.3335 2.77967 1.3335 5.20634V10.7863C1.3335 13.2197 2.78016 14.6663 5.20683 14.6663H10.7868C13.2135 14.6663 14.6602 13.2197 14.6602 10.793V5.20634C14.6668 2.77967 13.2202 1.33301 10.7935 1.33301ZM6.62683 8.84634C6.1735 9.52634 5.54683 10.0797 4.8135 10.4463C4.74683 10.4797 4.66683 10.4997 4.5935 10.4997C4.40683 10.4997 4.2335 10.3997 4.14683 10.2263C4.02016 9.97967 4.12016 9.67967 4.3735 9.55301C4.9535 9.26634 5.44683 8.82634 5.80016 8.29301C5.92016 8.11301 5.92016 7.88634 5.80016 7.70634C5.44016 7.17301 4.94683 6.73301 4.3735 6.44634C4.12016 6.32634 4.02016 6.02634 4.14683 5.77301C4.26683 5.52634 4.56683 5.42634 4.8135 5.55301C5.54683 5.91967 6.1735 6.47301 6.62683 7.15301C6.9735 7.66634 6.9735 8.33301 6.62683 8.84634ZM11.3335 10.4997H8.66683C8.3935 10.4997 8.16683 10.273 8.16683 9.99967C8.16683 9.72634 8.3935 9.49967 8.66683 9.49967H11.3335C11.6068 9.49967 11.8335 9.72634 11.8335 9.99967C11.8335 10.273 11.6068 10.4997 11.3335 10.4997Z",fill:"currentColor"})],-1)),mt("span",null,vo(i.message.text),1)]),_:1},8,["style","class"])):(gi(),bo("p",{key:1,style:$s({color:r.value,"font-size":i.configDesignClass.getKey("sections.loader.completeStep.fontSize")+"px"})},vo(i.message.text),5))])],2)],14,vh))}}),{defineComponent:_h}=await B("vue"),{unref:Sh,createElementVNode:Co,normalizeClass:fi,normalizeStyle:pi,openBlock:ts,createElementBlock:gn,createCommentVNode:mi,renderList:Th,Fragment:xo,resolveDynamicComponent:Rh,createBlock:ko,renderSlot:$h}=await B("vue"),Dh=["innerHTML"],{ref:Mh,watch:zh,nextTick:Bh,computed:Ms}=await B("vue"),Eh=_h({__name:"MessageList",props:{messages:{},isPreview:{type:Boolean},isEmbedded:{type:Boolean},showWelcome:{type:Boolean},sectionBorderRadius:{},isLoading:{type:Boolean},isStreaming:{type:Boolean},configDesignClass:{},activeMessage:{},traceLastShown:{type:Boolean},isProduction:{type:Boolean},ttsUrl:{}},emits:["handleClickMessage"],setup(i,{emit:e}){const t=Mh(null),s=i,n=e,r=b=>{b.meta&&n("handleClickMessage",b)},o=Ms(()=>s.configDesignClass.getKey("sections.inside.dataAction.type")),a=Ms(()=>s.configDesignClass.getKeyObject("sections.inside.dataAction")),l=Ms(()=>s.messages.filter((b,y,p)=>!s.isProduction||o.value==="steps"?!0:!(b.type==="usageTokensByAI"&&y===p.length-1||b.isSystem&&p[y+1]?.isSystem)));zh(s.messages,()=>{u()&&c()},{deep:!0});const c=()=>{Bh(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})},u=()=>{if(!t.value)return!0;const b=t.value;return b.scrollHeight-b.scrollTop-b.clientHeight<=24},d=()=>{},g=b=>{const y=b.replace("#",""),p=parseInt(y.substr(0,2),16),v=parseInt(y.substr(2,2),16),C=parseInt(y.substr(4,2),16),S=Math.max(0,p-12),_=Math.max(0,v-12),R=Math.max(0,C-12);return`linear-gradient(180deg, rgba(${S}, ${_}, ${R}, 0.95) 0%, rgba(0,0,0, 0) 100%)`},f=Ms(()=>{switch(s.configDesignClass.getKey("sections.inside.welcomeMessage.size")){case"sm":return"tw:px-1.5 tw:py-2.5";case"md":return"tw:px-3 tw:py-4";case"lg":return"tw:px-4.5 tw:py-5.5"}}),m=Ms(()=>s.configDesignClass.getKey("sections.inside.welcomeMessage.bgType")==="gradient"?g(s.configDesignClass.getKey("sections.inside.welcomeMessage.bgColor")):s.configDesignClass.getKey("sections.inside.welcomeMessage.bgType")==="bubble"?s.configDesignClass.getKey("sections.inside.welcomeMessage.bgColor"):"transparent"),h=b=>s.configDesignClass.getKey("settings.globalRoundingRadius")?s.sectionBorderRadius.borderRadius:s.configDesignClass.getKey(b?"sections.inside.messageUser.borderRadius":"sections.inside.messageBot.borderRadius")+"px",w=b=>{const y=s.messages.findIndex(_=>_===b);let p=null;if(!b.time)return 0;for(let _=y+1;_<s.messages.length;_++)if(s.messages[_]?.chunkId&&!s.messages[_]?.isUser){p=s.messages[_];break}if(!p?.time)return 0;const v=_=>_?Date.parse(_):NaN,C=b.time&&p?.time?v(p.time)-v(b.time):null;return C?Number((_=>_/1e3)(C).toFixed(1)):null};return(b,y)=>(ts(),gn("ul",{class:"message-list tw:transition-all tw:overflow-y-scroll tw:flex-1 tw:list-none tw:pb-4",ref_key:"messageListRef",ref:t,onScroll:d},[i.showWelcome?(ts(),gn("li",{key:0,class:fi(["tw:transition-all",["tw:text-"+(i.configDesignClass.getKey("sections.inside.params.size")==="sm"?"xs":i.configDesignClass.getKey("sections.inside.params.size")==="md"?"sm":"base")]]),style:pi({color:i.configDesignClass.getKey("sections.inside.welcomeMessage.color"),"margin-bottom":`${i.configDesignClass.getKey("settings.gapMessageLine")}px`})},[Co("div",{key:"message",class:fi(["tw:transition-all",f.value]),style:pi({borderRadius:i.configDesignClass.getKey("settings.globalRoundingRadius")?i.sectionBorderRadius.borderRadius:i.configDesignClass.getKey("sections.inside.welcomeMessage.borderRadius")+"px",color:i.configDesignClass.getKey("sections.inside.welcomeMessage.color"),background:m.value,lineHeight:i.configDesignClass.getKey("settings.lineHeight"),fontSize:i.configDesignClass.getKey("sections.inside.welcomeMessage.fontSize")+"px",letterSpacing:i.configDesignClass.getKey("settings.letterSpacing")+"px",border:`${i.configDesignClass.getKey("sections.inside.welcomeMessage.borderWidth")}px solid ${i.configDesignClass.getKey("sections.inside.welcomeMessage.borderColor")}`})},[Co("div",{innerHTML:Sh(bi)(i.configDesignClass.getKey("texts.welcomeMessage"))},null,8,Dh)],6)],6)):mi("",!0),(ts(!0),gn(xo,null,Th(l.value,(p,v)=>(ts(),gn(xo,{key:v},[p.snippet?mi("",!0):(ts(),ko(Rh(p.isUser?sh:p.isSystem?i.isProduction&&o.value!=="steps"?yo:kh:G1),{key:0,message:p,"data-component":p.isSystem?i.isProduction&&o.value!=="steps"?"LoadingMessage":"MessageSystem":"MessageBot",style:pi({borderRadius:h(p.isUser),"margin-top":`${l.value[v-1]?.isSystem&&!p.isSystem?"12px":"0px"}`,"margin-bottom":`${p.isSystem?"2px":i.configDesignClass.getKey("settings.gapMessageLine")+"px"}`,lineHeight:i.configDesignClass.getKey("settings.lineHeight"),letterSpacing:i.configDesignClass.getKey("settings.letterSpacing")+"px"}),loader:i.configDesignClass.getKey("settings.loader"),color:p.isUser?i.configDesignClass.getKey("sections.inside.messageUser.color"):i.configDesignClass.getKey("sections.inside.messageBot.color"),welcomeColor:i.configDesignClass.getKey("sections.inside.messageUser.color"),bgType:p.isUser?i.configDesignClass.getKey("sections.inside.messageUser.bgType"):i.configDesignClass.getKey("sections.inside.messageBot.bgType"),bgColor:p.isUser?i.configDesignClass.getKey("sections.inside.messageUser.bgColor"):i.configDesignClass.getKey("sections.inside.messageBot.bgColor"),size:p.isUser?i.configDesignClass.getKey("sections.inside.messageUser.size"):i.configDesignClass.getKey("sections.inside.messageBot.size"),fontSize:p.isUser?i.configDesignClass.getKey("sections.inside.messageUser.fontSize"):i.configDesignClass.getKey("sections.inside.messageBot.fontSize"),borderWidth:p.isUser?i.configDesignClass.getKey("sections.inside.messageUser.borderWidth"):i.configDesignClass.getKey("sections.inside.messageBot.borderWidth"),borderColor:p.isUser?i.configDesignClass.getKey("sections.inside.messageUser.borderColor"):i.configDesignClass.getKey("sections.inside.messageBot.borderColor"),index:v,isProduction:i.isProduction||!1,loadingTime:p.isUser?0:p.meta?.traceLoadingTime??w(p),traceLastShown:i.traceLastShown,configDesignClass:i.configDesignClass,ttsUrl:i.ttsUrl,activeMessage:i.activeMessage===p,isLast:v===l.value.length-1,paused:p.meta?.tracePaused,borderRadius:h(p.isUser),onClick:C=>r(p)},null,8,["message","data-component","style","loader","color","welcomeColor","bgType","bgColor","size","fontSize","borderWidth","borderColor","index","isProduction","loadingTime","traceLastShown","configDesignClass","ttsUrl","activeMessage","isLast","paused","borderRadius","onClick"]))],64))),128)),i.isLoading?(ts(),ko(yo,{key:1,class:fi({"tw:mt-8":i.traceLastShown}),borderRadius:h(!1),isProduction:i.isProduction||!1,loader:i.configDesignClass.getKey("settings.loader"),configDesignClass:i.configDesignClass,color:a.value.headerText,bgColor:a.value.headerFillColor,text:i.configDesignClass.getKey("texts.typingLoader")},null,8,["class","borderRadius","isProduction","loader","configDesignClass","color","bgColor","text"])):mi("",!0),$h(b.$slots,"footer")],544))}}),{defineComponent:Ph}=await B("vue"),{createVNode:Ah,normalizeStyle:Vh,openBlock:Lh,createElementBlock:Oh}=await B("vue"),{computed:_o}=await B("vue"),Ih=Ph({__name:"ChatMessagesContainer",props:{messages:{},isPreview:{type:Boolean},isEmbedded:{type:Boolean},sectionBorderRadius:{},isLoading:{type:Boolean},isStreaming:{type:Boolean},configDesignClass:{},activeMessage:{},showWelcome:{type:Boolean},isProcessError:{type:Boolean},restartChat:{type:Function},traceLastShown:{type:Boolean},isProduction:{type:Boolean},ttsUrl:{}},emits:["handleClickMessage","update:activeMessage"],setup(i,{emit:e}){const t=i,s=_o(()=>t.ttsUrl),n=e,r=_o({get:()=>t.activeMessage,set:o=>n("update:activeMessage",o)});return(o,a)=>(Lh(),Oh("div",{class:"tw:transition-all tw:flex tw:flex-col tw:justify-between tw:w-full tw:min-h-0",style:Vh([{flex:"1 1 0"},{paddingLeft:(i.configDesignClass.getKey("sections.inside.params.sidePadding")??8)+"px",paddingRight:(i.configDesignClass.getKey("sections.inside.params.sidePadding")??8)+"px",paddingTop:(i.configDesignClass.getKey("sections.inside.params.verticalPadding")??8)+"px"}])},[Ah(Eh,{messages:i.messages,isPreview:i.isPreview,isEmbedded:i.isEmbedded,configDesignClass:i.configDesignClass,isLoading:i.isLoading,isStreaming:i.isStreaming,isProduction:i.isProduction,sectionBorderRadius:i.sectionBorderRadius,showWelcome:i.showWelcome,ttsUrl:s.value,activeMessage:r.value,"onUpdate:activeMessage":a[0]||(a[0]=l=>r.value=l),traceLastShown:i.traceLastShown,onHandleClickMessage:a[1]||(a[1]=l=>o.$emit("handleClickMessage",l))},null,8,["messages","isPreview","isEmbedded","configDesignClass","isLoading","isStreaming","isProduction","sectionBorderRadius","showWelcome","ttsUrl","activeMessage","traceLastShown"])],4))}}),{defineComponent:Fh}=await B("vue"),{vShow:So,createVNode:ss,withDirectives:To,normalizeStyle:zs,createElementVNode:Ro,openBlock:Lt,createElementBlock:ns,createCommentVNode:wi,createBlock:Kh,Transition:Uh,withCtx:Nh,normalizeClass:$o}=await B("vue"),Wh={key:0,class:"chat tw:w-full tw:h-full tw:flex tw:pt-0 tw:relative",style:{overflow:"hidden"}},Hh={key:0,class:"tw:w-full tw:h-full"},jh={key:1,class:"messages tw:transition-all tw:flex tw:flex-col tw:justify-between tw:w-full"},{ref:q,shallowRef:qh,watchEffect:Zh,onMounted:Do,onUnmounted:Mo,onBeforeMount:Gh,watch:fn,computed:nt,nextTick:yi}=await B("vue"),Yh="https://hs-generator.onrender.com/api/transcribe",Xh="https://hs-generator.onrender.com/api/tts",Bs=0,Qg=Fh({__name:"ChatWrapper",props:{link:{},isEmbedded:{type:Boolean},isPreview:{type:Boolean},configWidget:{},configLink:{},scenario:{},scenarioOptions:{},widgetId:{},isProduction:{type:Boolean}},emits:["trace","choose-trace","restart-chat"],setup(i,{expose:e,emit:t}){const s=t,n=q(!1),r=q(!1),o=q(null),a=q(!1),l=q(!1),c=q(!1),u=q(!1),d=q(!0),g=q(!1),f=q(!1),m=q(!1),h=q(0),w=q(!1),b=q(null),y=i,p=async()=>{if(!(y.isPreview||y.scenario))try{s("restart-chat"),el(),await Xs()}catch(x){console.error("Failed to restart chat connection",x)}},v=nt(()=>{const x=M.value.getKey("settings.position"),k=M.value.getKey("settings.offset.x"),$=M.value.getKey("settings.offset.y"),E=N.value?M.value.getKey("settings.size.width"):M.value.getKey("sections.colapsed.width"),W=N.value?M.value.getKey("settings.size.height"):M.value.getKey("sections.colapsed.height");return{...{...x==="topLeft"?{top:$+"px",left:k+"px"}:{},...x==="topRight"?{top:$+"px",right:k+"px"}:{},...x==="bottomLeft"?{bottom:$+"px",left:k+"px"}:{},...x==="bottomRight"?{bottom:$+"px",right:k+"px"}:{},...x==="top"?{top:$+"px",left:"50%",transform:"translateX(-50%)"}:{},...x==="bottom"?{bottom:$+"px",left:"50%",transform:"translateX(-50%)"}:{},...x==="left"?{left:k+"px",top:"50%",transform:"translateY(-50%)"}:{},...x==="right"?{right:k+"px",top:"50%",transform:"translateY(-50%)"}:{}},width:N.value&&!Tt.value?E+"px":void 0,height:N.value||Tt.value?W+"px":void 0}}),C=()=>{if(y.configLink)return y.configLink;const k=new URLSearchParams(window.location.search).get("config");if(k)return k},S=q(null),_=q(null),R=q(null),T=()=>R.value?R.value:C()?_.value&&typeof _.value=="object"?_.value:V:y.configWidget?y.configWidget:V,z=qh(V);Zh(async x=>{const k=T();let $=!1;x(()=>{$=!0}),console.log("test");const E=await Vu(k,{verbose:!0});if($)return;const W=E??k,{isValid:ue,errors:Re}=Lu(W);if(console.log(W),!ue){console.warn("[HSW] Invalid widget config (after migration), falling back to DEFAULT_CONFIG:",Re),z.value=V;return}z.value=W});const D=x=>{S.value=x,s("choose-trace",{action:x.type,messages:[x]})},P=async()=>{s("choose-trace",{action:"copyAll",messages:X.value})},F=async()=>{if(X.value.length===0){s("choose-trace",{action:"copyLast",messages:[]});return}let x=-1;for(let $=X.value.length-1;$>=0;$--)if(X.value[$].isUser){x=$;break}const k=x>=0?x:0;s("choose-trace",{action:"copyLast",messages:X.value.slice(k)})},ne=async x=>{switch(x.action){case"copyLast":await F();break;case"copyIteration":await F();break;case"copyAll":await P();break}},M=nt(()=>new Ou(z.value)),K=nt(()=>Eo(M.value)),Z=nt(()=>Fs(M.value,8)),oe=nt(()=>M.value.getConfig().settings.container),L=nt(()=>{const x=oe.value;if(!x)return!1;const k=x.innerBorder,$=x.outerBorder;return(k?.width??0)>0||($?.width??0)>0?k?.width!==0||$?.width!==0:!1}),G=nt(()=>{const x=oe.value,k=M.value.getKey("settings.bgChat"),$=x?.gradient,E=$?`linear-gradient(360deg, ${k} 78.99%, ${$} 100%)`:"",W=typeof $=="string"&&$.trim()&&$!=="transparent"?E:k,ue=x?.innerBorder?.width??0,Re=x?.innerBorder?.color??"transparent",Ue=x?.innerBorder?.style??"solid",Ln=x?.outerBorder?.width??0,al=x?.outerBorder?.color??"transparent",ll=x?.outerBorder?.style??"solid",dt={background:W,borderRadius:`${String(K.value)}px`};return dt["--hsw-container-radius"]=`${String(K.value)}px`,dt["--hsw-container-inner-width"]=`${ue}px`,dt["--hsw-container-inner-color"]=Re,dt["--hsw-container-inner-style"]=Ue,dt["--hsw-container-outer-width"]=`${Ln}px`,dt["--hsw-container-outer-color"]=al,dt["--hsw-container-outer-style"]=ll,dt}),me=nt(()=>{switch(M.value.getKey("sections.bottom.params.size")){case"sm":return"tw:min-h-[25px]";case"md":return"tw:min-h-[45px]";case"lg":return"tw:min-h-[60px]"}}),N=q(!0),qt=()=>{const x=o.value;if(!x)return{width:56,height:56};const k=x.querySelector(".chat-action");if(!k)return{width:56,height:56};const $=k.getBoundingClientRect();return{width:Math.max(1,$.width),height:Math.max(1,$.height)}},ve=q(!1),Je=async x=>{if(ve.value)return;ve.value=!0;const k=o.value;if(!k||x===N.value)return;const $=k.querySelector(".chatWrapper"),E=$?.querySelector(".chat");if(x){const W=k.querySelector(".chat-collapsed");W&&(A.killTweensOf(W),A.to(W,{opacity:1,duration:.15,ease:"power2.in"}));const{height:ue,width:Re}=qt();await new Promise(Ln=>setTimeout(Ln,150)),N.value=!0,await yi();const Ue=Math.max(ue||0,Re||0)||56;A.killTweensOf(k),E&&A.killTweensOf(E),$&&A.killTweensOf($),A.set(k,{width:Ue,height:Ue,overflow:"hidden",opacity:0,willChange:"width, height, opacity"}),$&&A.set($,{opacity:0,willChange:"opacity"}),E&&A.set(E,{opacity:0,willChange:"opacity"}),A.set(k,{width:Ue,height:Ue,overflow:"hidden",opacity:0,willChange:"width, height, opacity"}),A.to(k,{width:M.value.getKey("settings.size.width"),height:M.value.getKey("settings.size.height"),opacity:1,duration:.4,ease:"power2.out",onComplete:()=>{A.set(k,{clearProps:"overflow,position,left,top,xPercent,yPercent,marginTop,willChange,opacity"}),ve.value=!1}}),$&&A.to($,{opacity:1,duration:.3,delay:.35,ease:"power2.out",onComplete:()=>{A.set($,{clearProps:"willChange,opacity"})}}),E&&A.to(E,{opacity:1,duration:.3,delay:.15,ease:"power2.out",onComplete:()=>{A.set(E,{clearProps:"willChange"})}})}else{const W=M.value.getKey("sections.colapsed.height")+M.value.getKey("sections.colapsed.borderWidth")*2;A.killTweensOf(k),E&&A.killTweensOf(E),$&&A.killTweensOf($),A.set(k,{width:M.value.getKey("settings.size.width"),height:M.value.getKey("settings.size.height"),overflow:"hidden",willChange:"width, height, opacity"}),$&&(A.set($,{willChange:"opacity"}),A.to($,{opacity:0,duration:.5,ease:"power3.inOut",onComplete:()=>{A.set($,{clearProps:"willChange,opacity"})}})),E&&(A.set(E,{willChange:"opacity"}),A.to(E,{opacity:0,duration:.2,ease:"power2.in",onComplete:()=>{A.set(E,{clearProps:"willChange"})}})),A.to(k,{width:W,height:W,opacity:0,duration:.35,marginTop:0,ease:"power2.inOut",onComplete:()=>{N.value=!1,yi().then(()=>{const ue=k.querySelector(".chat-collapsed");ue&&(A.set(ue,{opacity:0}),A.to(ue,{opacity:1,duration:.25,ease:"power2.out"})),A.set(k,{opacity:1})}),A.set(k,{clearProps:"overflow,position,left,top,xPercent,yPercent,marginTop,willChange"}),ve.value=!1}})}},ut=q(y.isPreview||!1),Tt=q(y.isEmbedded||!1);fn(()=>y.isEmbedded,x=>{Tt.value=x});const Xa=q(!!y.isPreview),Zt=q(y.widgetId||`hsw-${Math.random().toString(36).slice(2,10)}`),X=q([]),Gt=q("");let le=null,Rt=0;const Qa=nt(()=>X.value.length>0&&X.value[X.value.length-1].isUser===!0||l.value),ms=q(null),Ja=(x,k)=>{console.log("handleSnippetAction",x,k),mr({action:{sequence:k,command:x,data:{}}}),ms.value=null},Le=x=>{if(x.chunkId&&x.text){const k=X.value.find($=>$.chunkId===x.chunkId);k?(x.chunk?.start?k.text="":k.text+=x.text,k.chunk.start=!1,k.chunk.end=!!x.chunk?.end||!1):X.value.push(x)}else X.value.push(x)},ws=(()=>{if(y.link)return y.link;const k=new URLSearchParams(window.location.search).get("link");if(k)return k;const E=new URLSearchParams(window.location.hash.substring(1)).get("link");if(E)return E;try{const W="ws://localhost:8080/client/widget-chat/v1/ws/?token=zGsb5gku1VnAdz5M2O0Zzjdt-A25JVwxoRvkyBEC5N5nzI2RTcbuo0Wswdx21rXqypzBwUjGPNLy3XgMeyeDL4343ZqYZ8PRzFCneayYEoE-hgGpraSfDk0Rt1f_gd2r5sWwalZPNAtHtC2y9kelWuwWOA";if(W)return W}catch(W){console.warn("Environment variables not available:",W)}return console.log("Using fallback link: ws://localhost:3000"),"ws://localhost:3000"})(),fr=()=>{if(Rt>=Bs){Le({text:`Failed to connect after ${Bs} attempts. Please check your connection.`,isUser:!1});return}Rt++,console.log(`Reconnection attempt ${Rt}/${Bs}`),setTimeout(()=>{En()},2e3*Rt)},pr=()=>{Le({text:Ia.UserMessage,isUser:!0}),Le({text:"{Agent response message}",isUser:!1})},En=()=>{try{if(!ws||typeof ws!="string"){console.error("Invalid WebSocket link:",ws),Le({text:"Error: Invalid WebSocket URL",isUser:!1});return}if(console.log("Attempting to connect to:",ws),le=new WebSocket(ws),!le){console.error("Failed to create WebSocket instance");return}le.onmessage=x=>{try{const k=JSON.parse(x.data);if(k.snippet){ms.value={...k.snippet,data:JSON.parse(k.snippet.data||"{}")};return}if(k.error)return Le({text:k.error.message,isUser:!1,isSystem:!0,isError:!0});if(k?.textChunk?.start&&(w.value=!0,b.value=k?.textChunk?.start,Le({text:"",isUser:!1,chunkId:k?.textChunk?.start,time:k?.textChunk?.time?k?.textChunk?.time:new Date().toISOString(),chunk:k?.textChunk})),k?.textChunk?.end||k?.textChunk?.start){k?.textChunk?.end&&b.value&&k?.textChunk?.end===b.value&&(w.value=!1,b.value=null,Le({text:" ",isUser:!1,chunkId:k?.textChunk?.end,time:k?.textChunk?.time?k?.textChunk?.time:new Date().toISOString(),chunk:k?.textChunk}));return}k?.textChunk?.text&&Le({text:k.textChunk.text,isUser:!1,chunkId:k?.textChunk?.id,chunk:k?.textChunk}),k?.trace&&Le({text:k.trace.message,isUser:!1,isSystem:!0,meta:k.trace.meta,time:k.trace.time,type:k.trace.type}),k?.trace?.meta&&!y.isProduction&&s("trace",{action:k.trace.type,messages:[k.trace]})}catch(k){console.error("Error parsing WebSocket message:",k),Le({text:"Error: Failed to parse server response",isUser:!1})}},le.onopen=()=>{Rt=0},le.onclose=x=>{console.log("Connection closed",x);let k=`Connection closed (${x.code})`;switch(x.code){case 1e3:k="Connection closed normally";break;case 1001:k="Connection closed: going away";break;case 1006:if(u.value=!0,Rt<Bs&&!ut.value){fr();return}break;case 1011:k="Connection closed: server error";break;default:c.value=!0}console.log(k)},le.onerror=x=>{console.error("WebSocket connection error:",x),a.value=!0,Le({text:"Connection error: Unable to connect to chat server",isUser:!1,isSystem:!0,isError:!0}),Rt<Bs&&!ut.value&&fr()}}catch(x){console.error("Error connecting to socket server:",x),Le({text:`Connection error: ${x instanceof Error?x.message:"Unknown error"}`,isUser:!1,isSystem:!0,isError:!0})}},el=()=>{le&&le.close(),le=null};Mo(()=>{le&&le.close()});const Pn=x=>{(y.isPreview||y.scenario)&&!x||Je(!N.value)},tl=()=>{if(!(y.isPreview||y.scenario)&&Gt.value.trim()!==""){if(y.isProduction&&X.value.length>0){const x=X.value[X.value.length-1];x.isSystem===!0&&!x.isError&&!x.snippet&&X.value.pop()}X.value.push({text:Gt.value,isUser:!0,time:new Date().toISOString()}),w.value=!0,mr({message:Gt.value}),Gt.value=""}},mr=x=>{le&&le.send(JSON.stringify(x))},wr=()=>{try{const x=M.value.getKey("settings.fontFamily")||"MacPaw Fixel",k=`https://fonts.googleapis.com/css2?family=${x.replace(/\s+/g,"+")}:wght@300;400;500;600;700&display=swap`,$=document.createElement("link");$.rel="preload",$.as="style",$.href=k,document.head.appendChild($);const E=document.createElement("link");E.rel="stylesheet",E.href=k,E.setAttribute("data-google-font","true"),document.head.appendChild(E),o.value&&(o.value.style.fontFamily=`"${x}", sans-serif`)}catch(x){console.error("Error loading font:",x)}},yr=()=>{const x=M.value.getKey("settings.fontWeight")||400;o.value&&(o.value.style.fontWeight=x)};r.value=!0,fn(()=>M.value.getKey("settings.fontFamily"),()=>{wr()}),fn(()=>M.value.getKey("settings.fontWeight"),()=>{yr()});const sl=async()=>{if(C()){const k=await(await fetch(C()+"config")).json();_.value=k,n.value=!0}else n.value=!0},An=(x,k,$)=>new Promise(E=>{const W=performance.now(),ue=Re=>{const Ue=Math.min(1,(Re-W)/$);h.value=x+(k-x)*Ue,Ue<1?requestAnimationFrame(ue):E()};requestAnimationFrame(ue)}),br=async x=>{m.value=!0,h.value=0,await yi(),await An(0,.3,500),x(),await An(.3,.6,200),h.value=.6,await new Promise(k=>setTimeout(k,100)),await An(.6,0,500),m.value=!1},nl=async(x=25)=>{const k=X.value.filter(E=>!E.isUser&&!E.isSystem&&E.text);if(!k.length)return;const $=k.map(E=>E.text||"");k.forEach(E=>E.text="");for(let E=0;E<k.length;E++){const W=k[E],ue=$[E];for(let Re=0;Re<ue.length;Re++)W.text=ue.slice(0,Re+1),await new Promise(Ue=>setTimeout(Ue,x))}},il=async(x,k=2e3)=>{if(!x?.length)return;const $=Math.round(x.length*k/1e3);for(let E=0;E<x.length;E++){const W=x[E];E===x.length-1&&(W.meta={...W.meta,tracePaused:!0,traceLoadingTime:$}),X.value.push(W),await new Promise(Re=>setTimeout(Re,k))}},Vn=async(x,k)=>{if(x==="preview"){pr();return}const $=no.getState(x,M.value,k||y.scenarioOptions);await br(()=>{if(N.value=$.isChatOpen,X.value=$.messages,l.value=$.traceLastShown,a.value=$.isConnectionError,c.value=$.isProcessError,u.value=$.isReconnectError,g.value=$.isInputDisabled,d.value=$.showWelcome,f.value=$.showReconnectNotice??!1,ms.value=$.snippet??null,ut.value=!0,le){try{le.close()}catch{}le=null}}),$.useTypewriterAnimation&&await nl(),$.pendingTraces?.length&&await il($.pendingTraces,$.traceAnimationDelay??2e3)},Xs=async()=>{await br(()=>{ut.value=Xa.value,d.value=!0,g.value=!1,f.value=!1,a.value=!1,c.value=!1,u.value=!1,X.value=[],ut.value||(!le||le.readyState!==1)&&En()})};Gh(async()=>{await sl()}),Do(async()=>{wr(),yr();const x=y.scenario??no.getScenarioFromUrl();if(x){await Vn(x);return}if(y.isPreview){pr();return}En()}),fn(()=>y.scenario,async x=>{x?await Vn(x):await Xs()});const Te={id:Zt,setScenario:async(x,k)=>{await Vn(x,k)},clearScenario:async()=>{await Xs()},toggleChat:()=>{Pn(!0)},setOpen:x=>{N.value=x},setActive:x=>{x&&!N.value&&(N.value=!0)},setInputDisabled:x=>{g.value=x},setShowReconnectNotice:x=>{f.value=x},setMessages:x=>{X.value=Array.isArray(x)?x:[]},pushMessage:x=>{X.value.push(x)},setSnippet:x=>{ms.value=x??null},resetToLive:async()=>{await Xs()},setConfig:x=>{R.value=JSON.parse(JSON.stringify(x))},getConfig:()=>z.value},rl=()=>{const x=window;x.hswWidgets=x.hswWidgets||{},x.hswWidgets[Zt.value]=Te,window.dispatchEvent(new CustomEvent("hsw:ready",{detail:{widgetId:Zt.value}}))},ol=()=>{const x=window;x.hswWidgets&&x.hswWidgets[Zt.value]&&delete x.hswWidgets[Zt.value]},vr=async x=>{const k=x,$=k.detail?.widgetId;if($&&$!==Zt.value)return;const{action:E}=k.detail;switch(E){case"setScenario":await Te.setScenario(k.detail.payload.type,k.detail.payload.options);break;case"clearScenario":await Te.clearScenario();break;case"setOpen":Te.setOpen(k.detail.payload);break;case"setActive":Te.setActive(k.detail.payload);break;case"setInputDisabled":Te.setInputDisabled(k.detail.payload);break;case"setShowReconnectNotice":Te.setShowReconnectNotice(k.detail.payload);break;case"setMessages":Te.setMessages(k.detail.payload);break;case"pushMessage":Te.pushMessage(k.detail.payload);break;case"setSnippet":Te.setSnippet(k.detail.payload);break;case"resetToLive":await Te.resetToLive();break;case"setConfig":Te.setConfig(k.detail.payload);break}};return Do(()=>{rl(),window.addEventListener("hsw:control",vr)}),Mo(()=>{ol(),window.removeEventListener("hsw:control",vr)}),e(Te),(x,k)=>n.value?(Lt(),ns("div",{key:0,class:$o(["tw:z-[999] tw:flex tw:justify-end component-isolator tw:transition-all chatContainer",{"tw:fixed":!Tt.value,"tw:w-full":N.value}]),style:zs({letterSpacing:M.value.getKey("settings.letterSpacing")+"px",...v.value}),ref_key:"chatWrapperRef",ref:o},[To(ss(cu,{toggleChat:Pn,element:M.value.getKeyObject("sections.colapsed")},null,8,["element"]),[[So,!N.value]]),To(Ro("div",{class:$o(["chatWrapper tw:w-full tw:backdrop-blur-[22px] tw:flex tw:items-center tw:border-0 tw:flex-col",[{"chatWrapper--pseudoBorders":L.value,"tw:h-auto tw:shadow-2xl chat-active":N.value,"tw:shadow-lg tw:w-fit":!N.value,"chat-embedded tw:w-full tw:h-full tw:static tw:top-0 tw:left-0":Tt.value}]]),style:zs(G.value)},[ss(Gu,{isChatOpen:N.value,toggleChat:Pn,configDesignClass:M.value,sectionBorderRadius:Z.value,mainBorderRadius:K.value,isPreview:ut.value,isEmbedded:Tt.value,isProduction:i.isProduction||!1,restartChat:p},null,8,["isChatOpen","configDesignClass","sectionBorderRadius","mainBorderRadius","isPreview","isEmbedded","isProduction"]),N.value?(Lt(),ns("div",Wh,[a.value?(Lt(),ns("div",Hh,[Ro("div",{class:"tw:absolute tw:left-0 tw:top-0 tw:w-full tw:h-full",style:zs({padding:M.value.getKey("sections.warnings.launchIssue.content.sidePadding")+"px"})},[ss(kr,{type:"launchIssue",class:"tw:h-full",headlineText:M.value.getKey("texts.launchIssueTitle"),descriptionText:M.value.getKeyObject("texts.launchIssueText"),warningElement:M.value.getKeyObject("sections.warnings.launchIssue"),configDesignClass:M.value,isProcessError:c.value,restartChat:p},null,8,["headlineText","descriptionText","warningElement","configDesignClass","isProcessError"])],4)])):(Lt(),ns("div",jh,[ss(Ih,{messages:X.value,isPreview:ut.value,isEmbedded:Tt.value,configDesignClass:M.value,isLoading:Qa.value,isStreaming:w.value,isProduction:i.isProduction,sectionBorderRadius:Z.value,showWelcome:d.value,ttsUrl:Xh,activeMessage:S.value,"onUpdate:activeMessage":k[0]||(k[0]=$=>S.value=$),isProcessError:c.value,traceLastShown:l.value,onHandleClickMessage:D,restartChat:p},null,8,["messages","isPreview","isEmbedded","configDesignClass","isLoading","isStreaming","isProduction","sectionBorderRadius","showWelcome","activeMessage","isProcessError","traceLastShown"]),c.value?(Lt(),ns("div",{key:0,style:zs({padding:M.value.getKey("sections.warnings.connectionIssue.content.sidePadding")+"px"})},[ss(kr,{type:"connectionIssue",headlineText:M.value.getKey("texts.issueText"),configDesignClass:M.value,warningElement:M.value.getKeyObject("sections.warnings.connectionIssue"),restartChat:p},null,8,["headlineText","configDesignClass","warningElement"])],4)):(Lt(),Kh(Ud,{key:1,messageText:Gt.value,"onUpdate:messageText":k[1]||(k[1]=$=>Gt.value=$),isPreview:ut.value,isProduction:i.isProduction||!1,configDesignClass:M.value,sectionBorderRadius:Z.value,classSize:me.value,sendMessage:tl,isInputDisabled:g.value,showReconnectNotice:f.value,restartChat:p,isStreaming:w.value,mainBorderRadius:K.value,transcribeUrl:Yh,snippet:ms.value,onTrace:ne,onSnippetAction:Ja},null,8,["messageText","isPreview","isProduction","configDesignClass","sectionBorderRadius","classSize","isInputDisabled","showReconnectNotice","isStreaming","mainBorderRadius","snippet"]))]))])):wi("",!0),ss(Uh,{name:"fade"},{default:Nh(()=>[m.value?(Lt(),ns("div",{key:0,class:"tw:absolute tw:inset-0 tw:backdrop-blur-[40px] tw:z-[1000]",style:zs({borderRadius:`${String(K.value)}px`,backgroundColor:`rgba(0,0,0, ${h.value})`})},null,4)):wi("",!0)]),_:1})],6),[[So,r.value&&N.value]])],6)):wi("",!0)}});export{V as D,Q as S,fu as T,Qg as _};
|