@yartsun/hypershadow-widget 0.1.10 → 0.1.11

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.
@@ -0,0 +1,76 @@
1
+ import{importShared as E}from"./federation-import-CxlH6xnb.js";import{c as nl,cn as ko}from"./federation-expose-Utils-BmSDJTj0.js";const mr=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,wr=nl,il=(r,e)=>t=>{var s;if(e?.variants==null)return wr(r,t?.class,t?.className);const{variants:n,defaultVariants:i}=e,o=Object.keys(n).map(c=>{const u=t?.[c],d=i?.[c];if(u===null)return null;const p=mr(u)||mr(d);return n[c][p]}),a=t&&Object.entries(t).reduce((c,u)=>{let[d,p]=u;return p===void 0||(c[d]=p),c},{}),l=e==null||(s=e.compoundVariants)===null||s===void 0?void 0:s.reduce((c,u)=>{let{class:d,className:p,...g}=u;return Object.entries(g).every(w=>{let[h,f]=w;return Array.isArray(f)?f.includes({...i,...a}[h]):{...i,...a}[h]===f})?[...c,d,p]:c},[]);return wr(r,o,l,t?.class,t?.className)},{Fragment:rl}=await E("vue");function So(r){return r?r.flatMap(e=>e.type===rl?So(e.children):[e]):[]}const{defineComponent:ol,Comment:al,mergeProps:ll,cloneVNode:cl}=await E("vue"),ul=ol({name:"PrimitiveSlot",inheritAttrs:!1,setup(r,{attrs:e,slots:t}){return()=>{if(!t.default)return null;const s=So(t.default()),n=s.findIndex(l=>l.type!==al);if(n===-1)return s;const i=s[n];delete i.props?.ref;const o=i.props?ll(e,i.props):e,a=cl({...i,props:{}},o);return s.length===1?a:(s[n]=a,s)}}}),{defineComponent:dl,h:An}=await E("vue"),hl=["area","img","input"],pl=dl({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(r,{attrs:e,slots:t}){const s=r.asChild?"template":r.as;return typeof s=="string"&&hl.includes(s)?()=>An(s,e):s!=="template"?()=>An(r.as,e,{default:t.default}):()=>An(ul,e,{default:t.default})}}),{defineComponent:gl}=await E("vue"),{unref:Vn,renderSlot:fl,normalizeClass:ml,withCtx:wl,openBlock:yl,createBlock:bl}=await E("vue"),ht=gl({__name:"Button",props:{variant:{},size:{},class:{},asChild:{type:Boolean},as:{type:[String,Object,Function],default:"button"}},setup(r){const e=r;return(t,s)=>(yl(),bl(Vn(pl),{"data-slot":"button",as:t.as,"as-child":t.asChild,class:ml(Vn(ko)(Vn(vl)({variant:t.variant,size:t.size}),e.class))},{default:wl(()=>[fl(t.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),vl=il("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"}}),Cl={md:16};function To(r){const e=r.getKey("settings.borderRadius")??16;return typeof e!="number"?Cl.md:e}function _l(r,e=8){if(r<=0)return 0;const t=r-e;return t<=0?4:Math.max(4,t)}function Ls(r,e=8){const t=To(r);return{borderRadius:`${_l(t,e)}px`}}const hi=r=>r?r.replace(/<br>/g,"<br />").replace(/\n/g,"<br />"):"",{defineComponent:xl}=await E("vue"),{normalizeClass:fs,normalizeStyle:wt,openBlock:ms,createElementBlock:qs,createCommentVNode:Gs,unref:Ln,createElementVNode:Ys,toDisplayString:kl,withCtx:Sl,createBlock:Tl}=await E("vue"),Rl=["innerHTML"],$l=["innerHTML"],Dl=["innerHTML"],zl=["width","height"],{computed:Yt}=await E("vue"),Ml=`
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>`,pi=xl({__name:"ChatError",props:{warningElement:{},headlineText:{},descriptionText:{},resetButtonText:{},type:{},configDesignClass:{},borderOffset:{},restartChat:{type:Function}},setup(r){const e=r,t=Yt(()=>e.configDesignClass?.getKey("settings.globalRoundingRadius")?Ls(e.configDesignClass,8):{borderRadius:e.warningElement.resetButton?.borderRadius+"px"}),s=Yt(()=>{const l=e.configDesignClass?.getKey("settings.globalRoundingRadius")?Ls(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,p]=c[1].split(",").map(g=>g.trim());return{background:`linear-gradient(180deg, ${l} 0%, rgba(${u}, ${d}, ${p}, 0) 100%)`}}else if(l?.startsWith("#")){const u=l.replace("#",""),d=parseInt(u.substr(0,2),16),p=parseInt(u.substr(2,2),16),g=parseInt(u.substr(4,2),16);return{background:`linear-gradient(180deg, ${l} 0%, rgba(${d}, ${p}, ${g}, 0) 100%)`}}}else if(e.warningElement.warningStyle==="faded"){const c=l?.match(/rgba?\(([^)]+)\)/);if(c){const[u,d,p]=c[1].split(",").map(g=>g.trim());return{backgroundColor:`rgba(${u}, ${d}, ${p}, 0.2)`,border:`1px solid ${l}`}}else if(l?.startsWith("#")){const u=l.replace("#",""),d=parseInt(u.substr(0,2),16),p=parseInt(u.substr(2,2),16),g=parseInt(u.substr(4,2),16);return{backgroundColor:`rgba(${d}, ${p}, ${g}, 0.2)`,border:`1px solid ${l}`}}}return{backgroundColor:l}}),i=Yt(()=>{const l=e.warningElement?.content?.icon?.src||Ml;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(g=>{const w=g.getAttribute("fill");w&&w!=="none"&&!w.startsWith("url(")&&g.setAttribute("fill","currentColor");const h=g.getAttribute("stroke");h&&h!=="none"&&!h.startsWith("url(")&&g.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)=>(ms(),qs("div",{class:fs(["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":l.type==="connectionIssue"||l.type==="reconnecting","tw:flex-col tw:items-center tw:justify-center tw:h-full":l.type==="launchIssue","tw:p-4":l.warningElement.warningStyle==="gradient","tw:p-2":l.warningElement.warningStyle!=="gradient"}]),style:wt({...n.value,...s.value,paddingTop:(l.warningElement.content?.verticalPadding||null)+"px",paddingBottom:(l.warningElement.content?.verticalPadding||null)+"px"})},[Ys("div",{class:fs(["tw:flex tw:gap-1 tw:items-center svg-inherit",{"tw:flex-row":l.type==="connectionIssue"||l.type==="reconnecting","tw:flex-col ":l.type==="launchIssue"}]),style:wt({gap:(l.warningElement.content?.verticalSpacing||4)+"px"})},[l.warningElement.content.icon?.showIcon?(ms(),qs("div",{key:0,style:wt({color:l.warningElement.content.icon?.color||l.warningElement.content.color,fontSize:o.value,width:(l.warningElement.content.icon?.size||16)+"px",height:(l.warningElement.content.icon?.size||16)+"px"}),class:fs({"tw:w-4 tw:h-4 tw:animate-spin":l.type==="reconnecting"}),innerHTML:i.value},null,14,Rl)):Gs("",!0),Ys("div",{class:fs(["tw:transition-all tw:justify-center tw:text-center tw:leading-none",{"tw:text-left tw:text-xs":l.type==="connectionIssue"||l.type==="reconnecting","tw:text-center tw:text-sm":l.type==="launchIssue"}]),innerHTML:Ln(hi)(l.headlineText),style:wt({color:l.warningElement.content?.headlineColor||l.warningElement.content.color,fontSize:(l.warningElement.content?.headlineTextSize||l.warningElement.content.fontSize)+"px"})},null,14,$l),Ys("p",{class:"tw:text-center tw:justify-center tw:text-xs tw:leading-none",style:wt({color:l.warningElement.content.color,fontSize:(l.warningElement.content?.subTextSize||l.warningElement.content.fontSize)+"px"}),innerHTML:Ln(hi)(l.descriptionText)},null,12,Dl)],6),l.warningElement.resetButton?(ms(),Tl(Ln(ht),{key:0,size:l.warningElement.resetButton?.size,class:fs([{"tw:mt-8":l.type==="launchIssue"||l.type==="reconnecting"}]),variant:"default",style:wt([a.value,t.value]),onClick:l.restartChat},{default:Sl(()=>[l.warningElement.resetButton?.showType!=="text"?(ms(),qs("svg",{key:0,width:l.warningElement.resetButton.fontSize?l.warningElement.resetButton.fontSize+4:16,height:l.warningElement.resetButton.fontSize?l.warningElement.resetButton.fontSize+4:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:wt({fill:l.warningElement.resetButton.color||"#2F2F31"})},c[0]||(c[0]=[Ys("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,zl)):Gs("",!0),l.warningElement.resetButton?.showType!=="icon"?(ms(),qs("span",{key:1,style:wt({fontSize:l.warningElement.resetButton.fontSize+"px"})},kl(l.resetButtonText||"Restart"),5)):Gs("",!0)]),_:1},8,["size","class","style","onClick"])):Gs("",!0)],6))}});function ut(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Ro(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e}/*!
5
+ * GSAP 3.13.0
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 Ae={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},ls={duration:.5,overwrite:!1,delay:0},Ai,de,G,et=1e8,fe=1/et,gi=Math.PI*2,Bl=gi/4,El=0,$o=Math.sqrt,Pl=Math.cos,Al=Math.sin,ue=function(e){return typeof e=="string"},se=function(e){return typeof e=="function"},pt=function(e){return typeof e=="number"},Vi=function(e){return typeof e>"u"},tt=function(e){return typeof e=="object"},Se=function(e){return e!==!1},Li=function(){return typeof window<"u"},Xs=function(e){return se(e)||ue(e)},Do=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},me=Array.isArray,fi=/(?:-?\.?\d|\.)+/gi,zo=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,ss=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,On=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Mo=/[+-]=-?[.\d]+/,Bo=/[^,'"\[\]\s]+/gi,Vl=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Q,Xe,mi,Oi,Ve={},gn={},Eo,Po=function(e){return(gn=cs(e,Ve))&&De},Ii=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},Os=function(e,t){return!t&&console.warn(e)},Ao=function(e,t){return e&&(Ve[e]=t)&&gn&&(gn[e]=t)||Ve},Is=function(){return 0},Ll={suppressEvents:!0,isStart:!0,kill:!1},dn={suppressEvents:!0,kill:!1},Ol={suppressEvents:!0},Ki={},xt=[],wi={},Vo,Be={},In={},yr=30,hn=[],Fi="",Ui=function(e){var t=e[0],s,n;if(tt(t)||se(t)||(e=[e]),!(s=(t._gsap||{}).harness)){for(n=hn.length;n--&&!hn[n].targetTest(t););s=hn[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new oa(e[n],s)))||e.splice(n,1);return e},It=function(e){return e._gsap||Ui(Fe(e))[0]._gsap},Lo=function(e,t,s){return(s=e[t])&&se(s)?e[t]():Vi(s)&&e.getAttribute&&e.getAttribute(t)||s},Te=function(e,t){return(e=e.split(",")).forEach(t)||e},ne=function(e){return Math.round(e*1e5)/1e5||0},ae=function(e){return Math.round(e*1e7)/1e7||0},rs=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},Il=function(e,t){for(var s=t.length,n=0;e.indexOf(t[n])<0&&++n<s;);return n<s},fn=function(){var e=xt.length,t=xt.slice(0),s,n;for(wi={},xt.length=0,s=0;s<e;s++)n=t[s],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},Ni=function(e){return!!(e._initted||e._startAt||e.add)},Oo=function(e,t,s,n){xt.length&&!de&&fn(),e.render(t,s,!!(de&&t<0&&Ni(e))),xt.length&&!de&&fn()},Io=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(Bo).length<2?t:ue(e)?e.trim():e},Ko=function(e){return e},Le=function(e,t){for(var s in t)s in e||(e[s]=t[s]);return e},Kl=function(e){return function(t,s){for(var n in s)n in t||n==="duration"&&e||n==="ease"||(t[n]=s[n])}},cs=function(e,t){for(var s in t)e[s]=t[s];return e},br=function r(e,t){for(var s in t)s!=="__proto__"&&s!=="constructor"&&s!=="prototype"&&(e[s]=tt(t[s])?r(e[s]||(e[s]={}),t[s]):t[s]);return e},mn=function(e,t){var s={},n;for(n in e)n in t||(s[n]=e[n]);return s},Es=function(e){var t=e.parent||Q,s=e.keyframes?Kl(me(e.keyframes)):Le;if(Se(e.inherit))for(;t;)s(e,t.vars.defaults),t=t.parent||t._dp;return e},Fl=function(e,t){for(var s=e.length,n=s===t.length;n&&s--&&e[s]===t[s];);return s<0},Fo=function(e,t,s,n,i){var o=e[n],a;if(i)for(a=t[i];o&&o[i]>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},kn=function(e,t,s,n){s===void 0&&(s="_first"),n===void 0&&(n="_last");var i=t._prev,o=t._next;i?i._next=o:e[s]===t&&(e[s]=o),o?o._prev=i:e[n]===t&&(e[n]=i),t._next=t._prev=t.parent=null},St=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},Ul=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},yi=function(e,t,s,n){return e._startAt&&(de?e._startAt.revert(dn):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,n))},Nl=function r(e){return!e||e._ts&&r(e.parent)},vr=function(e){return e._repeat?us(e._tTime,e=e.duration()+e._rDelay)*e:0},us=function(e,t){var s=Math.floor(e=ae(e/t));return e&&s===e?s-1:s},wn=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Sn=function(e){return e._end=ae(e._start+(e._tDur/Math.abs(e._ts||e._rts||fe)||0))},Tn=function(e,t){var s=e._dp;return s&&s.smoothChildTiming&&e._ts&&(e._start=ae(s._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Sn(e),s._dirty||Kt(s,e)),e},Uo=function(e,t){var s;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(s=wn(e.rawTime(),t),(!t._dur||Hs(0,t.totalDuration(),s)-t._tTime>fe)&&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=-1e-8}},Qe=function(e,t,s,n){return t.parent&&St(t),t._start=ae((pt(s)?s:s||e!==Q?Ke(e,s,t):e._time)+t._delay),t._end=ae(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),Fo(e,t,"_first","_last",e._sort?"_start":0),bi(t)||(e._recent=t),n||Uo(e,t),e._ts<0&&Tn(e,e._tTime),e},No=function(e,t){return(Ve.ScrollTrigger||Ii("scrollTrigger",t))&&Ve.ScrollTrigger.create(t,e)},Wo=function(e,t,s,n,i){if(Hi(e,t,i),!e._initted)return 1;if(!s&&e._pt&&!de&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&Vo!==Ee.frame)return xt.push(e),e._lazy=[i,n],1},Wl=function r(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||r(t))},bi=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},Hl=function(e,t,s,n){var i=e.ratio,o=t<0||!t&&(!e._start&&Wl(e)&&!(!e._initted&&bi(e))||(e._ts<0||e._dp._ts<0)&&!bi(e))?0:1,a=e._rDelay,l=0,c,u,d;if(a&&e._repeat&&(l=Hs(0,e._tDur,t),u=us(l,a),e._yoyo&&u&1&&(o=1-o),u!==us(e._tTime,a)&&(i=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==i||de||n||e._zTime===fe||!t&&e._zTime){if(!e._initted&&Wo(e,t,n,s,l))return;for(d=e._zTime,e._zTime=t||(s?fe: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&&yi(e,t,s,!0),e._onUpdate&&!s&&Pe(e,"onUpdate"),l&&e._repeat&&!s&&e.parent&&Pe(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===o&&(o&&St(e,1),!s&&!de&&(Pe(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},jl=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}},ds=function(e,t,s,n){var i=e._repeat,o=ae(t)||0,a=e._tTime/e._tDur;return a&&!n&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:ae(o*(i+1)+e._rDelay*i):o,a>0&&!n&&Tn(e,e._tTime=e._tDur*a),e.parent&&Sn(e),s||Kt(e.parent,e),e},Cr=function(e){return e instanceof be?Kt(e):ds(e,e._dur)},Zl={_start:0,endTime:Is,totalDuration:Is},Ke=function r(e,t,s){var n=e.labels,i=e._recent||Zl,o=e.duration()>=et?i.endTime(!1):e._dur,a,l,c;return ue(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==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(t.substr(1))||0)*(c?(a<0?i: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*(me(s)?s[0]:s).totalDuration()),a>1?r(e,t.substr(0,a-1),s)+l:o+l)):t==null?o:+t},Ps=function(e,t,s){var n=pt(t[1]),i=(n?2:1)+(e<2?0:1),o=t[i],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=Se(l.vars.inherit)&&l.parent;o.immediateRender=Se(a.immediateRender),e<2?o.runBackwards=1:o.startAt=t[i-1]}return new oe(t[0],o,t[i+1])},Rt=function(e,t){return e||e===0?t(e):t},Hs=function(e,t,s){return s<e?e:s>t?t:s},ge=function(e,t){return!ue(e)||!(t=Vl.exec(e))?"":t[1]},ql=function(e,t,s){return Rt(s,function(n){return Hs(e,t,n)})},vi=[].slice,Ho=function(e,t){return e&&tt(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&tt(e[0]))&&!e.nodeType&&e!==Xe},Gl=function(e,t,s){return s===void 0&&(s=[]),e.forEach(function(n){var i;return ue(n)&&!t||Ho(n,1)?(i=s).push.apply(i,Fe(n)):s.push(n)})||s},Fe=function(e,t,s){return G&&!t&&G.selector?G.selector(e):ue(e)&&!s&&(mi||!hs())?vi.call((t||Oi).querySelectorAll(e),0):me(e)?Gl(e,s):Ho(e)?vi.call(e,0):e?[e]:[]},Ci=function(e){return e=Fe(e)[0]||Os("Invalid scope")||{},function(t){var s=e.current||e.nativeElement||e;return Fe(t,s.querySelectorAll?s:s===e?Os("Invalid scope")||Oi.createElement("div"):e)}},jo=function(e){return e.sort(function(){return .5-Math.random()})},Zo=function(e){if(se(e))return e;var t=tt(e)?e:{each:e},s=Ft(t.ease),n=t.from||0,i=parseFloat(t.base)||0,o={},a=n>0&&n<1,l=isNaN(n)||a,c=t.axis,u=n,d=n;return ue(n)?u=d={center:.5,edges:.5,end:1}[n]||0:!a&&l&&(u=n[0],d=n[1]),function(p,g,w){var h=(w||t).length,f=o[h],m,b,y,v,C,T,S,$,R;if(!f){if(R=t.grid==="auto"?0:(t.grid||[1,et])[1],!R){for(S=-1e8;S<(S=w[R++].getBoundingClientRect().left)&&R<h;);R<h&&R--}for(f=o[h]=[],m=l?Math.min(R,h)*u-.5:n%R,b=R===et?0:l?h*d/R-.5:n/R|0,S=0,$=et,T=0;T<h;T++)y=T%R-m,v=b-(T/R|0),f[T]=C=c?Math.abs(c==="y"?v:y):$o(y*y+v*v),C>S&&(S=C),C<$&&($=C);n==="random"&&jo(f),f.max=S-$,f.min=$,f.v=h=(parseFloat(t.amount)||parseFloat(t.each)*(R>h?h-1:c?c==="y"?h/R:R:Math.max(R,h/R))||0)*(n==="edges"?-1:1),f.b=h<0?i-h:i,f.u=ge(t.amount||t.each)||0,s=s&&h<0?na(s):s}return h=(f[p]-f.min)/f.max||0,ae(f.b+(s?s(h):h)*f.v)+f.u}},_i=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(s){var n=ae(Math.round(parseFloat(s)/e)*e*t);return(n-n%1)/t+(pt(s)?0:ge(s))}},qo=function(e,t){var s=me(e),n,i;return!s&&tt(e)&&(n=s=e.radius||et,e.values?(e=Fe(e.values),(i=!pt(e[0]))&&(n*=n)):e=_i(e.increment)),Rt(t,s?se(e)?function(o){return i=e(o),Math.abs(i-o)<=n?i:o}:function(o){for(var a=parseFloat(i?o.x:o),l=parseFloat(i?o.y:0),c=et,u=0,d=e.length,p,g;d--;)i?(p=e[d].x-a,g=e[d].y-l,p=p*p+g*g):p=Math.abs(e[d]-a),p<c&&(c=p,u=d);return u=!n||c<=n?e[u]:o,i||u===o||pt(o)?u:u+ge(o)}:_i(e))},Go=function(e,t,s,n){return Rt(me(e)?!t:s===!0?!!(s=0):!n,function(){return me(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})},Yl=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(i,o){return o(i)},n)}},Xl=function(e,t){return function(s){return e(parseFloat(s))+(t||ge(s))}},Ql=function(e,t,s){return Xo(e,t,0,1,s)},Yo=function(e,t,s){return Rt(s,function(n){return e[~~t(n)]})},Jl=function r(e,t,s){var n=t-e;return me(e)?Yo(e,r(0,e.length),t):Rt(s,function(i){return(n+(i-e)%n)%n+e})},ec=function r(e,t,s){var n=t-e,i=n*2;return me(e)?Yo(e,r(0,e.length-1),t):Rt(s,function(o){return o=(i+(o-e)%i)%i||0,e+(o>n?i-o:o)})},Ks=function(e){for(var t=0,s="",n,i,o,a;~(n=e.indexOf("random(",t));)o=e.indexOf(")",n),a=e.charAt(n+7)==="[",i=e.substr(n+7,o-n-7).match(a?Bo:fi),s+=e.substr(t,n-t)+Go(a?i:+i[0],a?0:+i[1],+i[2]||1e-5),t=o+1;return s+e.substr(t,e.length-t)},Xo=function(e,t,s,n,i){var o=t-e,a=n-s;return Rt(i,function(l){return s+((l-e)/o*a||0)})},tc=function r(e,t,s,n){var i=isNaN(e+t)?0:function(g){return(1-g)*e+g*t};if(!i){var o=ue(e),a={},l,c,u,d,p;if(s===!0&&(n=1)&&(s=null),o)e={p:e},t={p:t};else if(me(e)&&!me(t)){for(u=[],d=e.length,p=d-2,c=1;c<d;c++)u.push(r(e[c-1],e[c]));d--,i=function(w){w*=d;var h=Math.min(p,~~w);return u[h](w-h)},s=t}else n||(e=cs(me(e)?[]:{},e));if(!u){for(l in t)Wi.call(a,e,l,"get",t[l]);i=function(w){return qi(w,a)||(o?e.p:e)}}}return Rt(s,i)},_r=function(e,t,s){var n=e.labels,i=et,o,a,l;for(o in n)a=n[o]-t,a<0==!!s&&a&&i>(a=Math.abs(a))&&(l=o,i=a);return l},Pe=function(e,t,s){var n=e.vars,i=n[t],o=G,a=e._ctx,l,c,u;if(i)return l=n[t+"Params"],c=n.callbackScope||e,s&&xt.length&&fn(),a&&(G=a),u=l?i.apply(c,l):i.call(c),G=o,u},zs=function(e){return St(e),e.scrollTrigger&&e.scrollTrigger.kill(!!de),e.progress()<1&&Pe(e,"onInterrupt"),e},ns,Qo=[],Jo=function(e){if(e)if(e=!e.name&&e.default||e,Li()||e.headless){var t=e.name,s=se(e),n=t&&!s&&e.init?function(){this._props=[]}:e,i={init:Is,render:qi,add:Wi,kill:wc,modifier:mc,rawVars:0},o={targetTest:0,get:0,getSetter:Zi,aliases:{},register:0};if(hs(),e!==n){if(Be[t])return;Le(n,Le(mn(e,i),o)),cs(n.prototype,cs(i,mn(e,o))),Be[n.prop=t]=n,e.targetTest&&(hn.push(n),Ki[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}Ao(t,n),e.register&&e.register(De,n,Re)}else Qo.push(e)},H=255,Ms={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]},Kn=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},ea=function(e,t,s){var n=e?pt(e)?[e>>16,e>>8&H,e&H]:0:Ms.black,i,o,a,l,c,u,d,p,g,w;if(!n){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Ms[e])n=Ms[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),o=e.charAt(2),a=e.charAt(3),e="#"+i+i+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=w=e.match(fi),!t)l=+n[0]%360/360,c=+n[1]/100,u=+n[2]/100,o=u<=.5?u*(c+1):u+c-u*c,i=u*2-o,n.length>3&&(n[3]*=1),n[0]=Kn(l+1/3,i,o),n[1]=Kn(l,i,o),n[2]=Kn(l-1/3,i,o);else if(~e.indexOf("="))return n=e.match(zo),s&&n.length<4&&(n[3]=1),n}else n=e.match(fi)||Ms.transparent;n=n.map(Number)}return t&&!w&&(i=n[0]/H,o=n[1]/H,a=n[2]/H,d=Math.max(i,o,a),p=Math.min(i,o,a),u=(d+p)/2,d===p?l=c=0:(g=d-p,c=u>.5?g/(2-d-p):g/(d+p),l=d===i?(o-a)/g+(o<a?6:0):d===o?(a-i)/g+2:(i-o)/g+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},ta=function(e){var t=[],s=[],n=-1;return e.split(kt).forEach(function(i){var o=i.match(ss)||[];t.push.apply(t,o),s.push(n+=o.length+1)}),t.c=s,t},xr=function(e,t,s){var n="",i=(e+n).match(kt),o=t?"hsla(":"rgba(",a=0,l,c,u,d;if(!i)return e;if(i=i.map(function(p){return(p=ea(p,t,1))&&o+(t?p[0]+","+p[1]+"%,"+p[2]+"%,"+p[3]:p.join(","))+")"}),s&&(u=ta(e),l=s.c,l.join(n)!==u.c.join(n)))for(c=e.replace(kt,"1").split(ss),d=c.length-1;a<d;a++)n+=c[a]+(~l.indexOf(a)?i.shift()||o+"0,0,0,0)":(u.length?u:i.length?i:s).shift());if(!c)for(c=e.split(kt),d=c.length-1;a<d;a++)n+=c[a]+i[a];return n+c[d]},kt=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Ms)r+="|"+e+"\\b";return new RegExp(r+")","gi")}(),sc=/hsl[a]?\(/,sa=function(e){var t=e.join(" "),s;if(kt.lastIndex=0,kt.test(t))return s=sc.test(t),e[1]=xr(e[1],s),e[0]=xr(e[0],s,ta(e[1])),!0},Fs,Ee=function(){var r=Date.now,e=500,t=33,s=r(),n=s,i=1e3/240,o=i,a=[],l,c,u,d,p,g,w=function h(f){var m=r()-n,b=f===!0,y,v,C,T;if((m>e||m<0)&&(s+=m-t),n+=m,C=n-s,y=C-o,(y>0||b)&&(T=++d.frame,p=C-d.time*1e3,d.time=C=C/1e3,o+=y+(y>=i?4:i-y),v=1),b||(l=c(h)),v)for(g=0;g<a.length;g++)a[g](C,p,T,f)};return d={time:0,frame:0,tick:function(){w(!0)},deltaRatio:function(f){return p/(1e3/(f||60))},wake:function(){Eo&&(!mi&&Li()&&(Xe=mi=window,Oi=Xe.document||{},Ve.gsap=De,(Xe.gsapVersions||(Xe.gsapVersions=[])).push(De.version),Po(gn||Xe.GreenSockGlobals||!Xe.gsap&&Xe||{}),Qo.forEach(Jo)),u=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&d.sleep(),c=u||function(f){return setTimeout(f,o-d.time*1e3+1|0)},Fs=1,w(2))},sleep:function(){(u?cancelAnimationFrame:clearTimeout)(l),Fs=0,c=Is},lagSmoothing:function(f,m){e=f||1/0,t=Math.min(m||33,e)},fps:function(f){i=1e3/(f||240),o=d.time*1e3+i},add:function(f,m,b){var y=m?function(v,C,T,S){f(v,C,T,S),d.remove(y)}:f;return d.remove(f),a[b?"unshift":"push"](y),hs(),y},remove:function(f,m){~(m=a.indexOf(f))&&a.splice(m,1)&&g>=m&&g--},_listeners:a},d}(),hs=function(){return!Fs&&Ee.wake()},L={},nc=/^[\d.\-M][\d.\-,\s]/,ic=/["']/g,rc=function(e){for(var t={},s=e.substr(1,e.length-3).split(":"),n=s[0],i=1,o=s.length,a,l,c;i<o;i++)l=s[i],a=i!==o-1?l.lastIndexOf(","):l.length,c=l.substr(0,a),t[n]=isNaN(c)?c.replace(ic,"").trim():+c,n=l.substr(a+1).trim();return t},oc=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)},ac=function(e){var t=(e+"").split("("),s=L[t[0]];return s&&t.length>1&&s.config?s.config.apply(null,~e.indexOf("{")?[rc(t[1])]:oc(e).split(",").map(Io)):L._CE&&nc.test(e)?L._CE("",e):s},na=function(e){return function(t){return 1-e(1-t)}},ia=function r(e,t){for(var s=e._first,n;s;)s instanceof be?r(s,t):s.vars.yoyoEase&&(!s._yoyo||!s._repeat)&&s._yoyo!==t&&(s.timeline?r(s.timeline,t):(n=s._ease,s._ease=s._yEase,s._yEase=n,s._yoyo=t)),s=s._next},Ft=function(e,t){return e&&(se(e)?e:L[e]||ac(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 i={easeIn:t,easeOut:s,easeInOut:n},o;return Te(e,function(a){L[a]=Ve[a]=i,L[o=a.toLowerCase()]=s;for(var l in i)L[o+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=L[a+"."+l]=i[l]}),i},ra=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},Fn=function r(e,t,s){var n=t>=1?t:1,i=(s||(e?.3:.45))/(t<1?t:1),o=i/gi*(Math.asin(1/n)||0),a=function(u){return u===1?1:n*Math.pow(2,-10*u)*Al((u-o)*i)+1},l=e==="out"?a:e==="in"?function(c){return 1-a(1-c)}:ra(a);return i=gi/i,l.config=function(c,u){return r(e,c,u)},l},Un=function r(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(i){return 1-s(1-i)}:ra(s);return n.config=function(i){return r(e,i)},n};Te("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,e){var t=e<5?e+1:e;Ht(r+",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})});L.Linear.easeNone=L.none=L.Linear.easeIn;Ht("Elastic",Fn("in"),Fn("out"),Fn());(function(r,e){var t=1/e,s=2*t,n=2.5*t,i=function(a){return a<t?r*a*a:a<s?r*Math.pow(a-1.5/e,2)+.75:a<n?r*(a-=2.25/e)*a+.9375:r*Math.pow(a-2.625/e,2)+.984375};Ht("Bounce",function(o){return 1-i(1-o)},i)})(7.5625,2.75);Ht("Expo",function(r){return Math.pow(2,10*(r-1))*r+r*r*r*r*r*r*(1-r)});Ht("Circ",function(r){return-($o(1-r*r)-1)});Ht("Sine",function(r){return r===1?1:-Pl(r*Bl)+1});Ht("Back",Un("in"),Un("out"),Un());L.SteppedEase=L.steps=Ve.SteppedEase={config:function(e,t){e===void 0&&(e=1);var s=1/e,n=e+(t?0:1),i=t?1:0,o=1-fe;return function(a){return((n*Hs(0,o,a)|0)+i)*s}}};ls.ease=L["quad.out"];Te("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return Fi+=r+","+r+"Params,"});var oa=function(e,t){this.id=El++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:Lo,this.set=t?t.getSetter:Zi},Us=function(){function r(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,ds(this,+t.duration,1,1),this.data=t.data,G&&(this._ctx=G,G.data.push(this)),Fs||Ee.wake()}var e=r.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,ds(this,this._repeat<0?s:(s-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(s,n){if(hs(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(Tn(this,s),!i._dp||i.parent||Uo(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&s<this._tDur||this._ts<0&&s>0||!this._tDur&&!s)&&Qe(this._dp,this,this._start-this._delay)}return(this._tTime!==s||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===fe||!s&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=s),Oo(this,s,n)),this},e.time=function(s,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),s+vr(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)+vr(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(s,n){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(s-1)*i,n):this._repeat?us(this._tTime,i)+1:1},e.timeScale=function(s,n){if(!arguments.length)return this._rts===-1e-8?0:this._rts;if(this._rts===s)return this;var i=this.parent&&this._ts?wn(this.parent._time,this):this._tTime;return this._rts=+s||0,this._ts=this._ps||s===-1e-8?0:this._rts,this.totalTime(Hs(-Math.abs(this._delay),this.totalDuration(),i),n!==!1),Sn(this),Ul(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):(hs(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==fe&&(this._tTime-=fe)))),this):this._ps},e.startTime=function(s){if(arguments.length){this._start=s;var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&Qe(n,this,s-this._delay),this}return this._start},e.endTime=function(s){return this._start+(Se(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?wn(n.rawTime(s),this):this._tTime:this._tTime},e.revert=function(s){s===void 0&&(s=Ol);var n=de;return de=s,Ni(this)&&(this.timeline&&this.timeline.revert(s),this.totalTime(-.01,s.suppressEvents)),this.data!=="nested"&&s.kill!==!1&&this.kill(),de=n,this},e.globalTime=function(s){for(var n=this,i=arguments.length?s:n.rawTime();n;)i=n._start+i/(Math.abs(n._ts)||1),n=n._dp;return!this.parent&&this._sat?this._sat.globalTime(s):i},e.repeat=function(s){return arguments.length?(this._repeat=s===1/0?-2:s,Cr(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(s){if(arguments.length){var n=this._time;return this._rDelay=s,Cr(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(Ke(this,s),Se(n))},e.restart=function(s,n){return this.play().totalTime(s?-this._delay:0,Se(n)),this._dur||(this._zTime=-1e-8),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?-1e-8:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},e.isActive=function(){var s=this.parent||this._dp,n=this._start,i;return!!(!s||this._ts&&this._initted&&s.isActive()&&(i=s.rawTime(!0))>=n&&i<this.endTime(!0)-fe)},e.eventCallback=function(s,n,i){var o=this.vars;return arguments.length>1?(n?(o[s]=n,i&&(o[s+"Params"]=i),s==="onUpdate"&&(this._onUpdate=n)):delete o[s],this):o[s]},e.then=function(s){var n=this;return new Promise(function(i){var o=se(s)?s:Ko,a=function(){var c=n.then;n.then=null,se(o)&&(o=o(n))&&(o.then||o===n)&&(n.then=c),i(o),n.then=c};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?a():n._prom=a})},e.kill=function(){zs(this)},r}();Le(Us.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:-1e-8,_prom:0,_ps:!1,_rts:1});var be=function(r){Ro(e,r);function e(s,n){var i;return s===void 0&&(s={}),i=r.call(this,s)||this,i.labels={},i.smoothChildTiming=!!s.smoothChildTiming,i.autoRemoveChildren=!!s.autoRemoveChildren,i._sort=Se(s.sortChildren),Q&&Qe(s.parent||Q,ut(i),n),s.reversed&&i.reverse(),s.paused&&i.paused(!0),s.scrollTrigger&&No(ut(i),s.scrollTrigger),i}var t=e.prototype;return t.to=function(n,i,o){return Ps(0,arguments,this),this},t.from=function(n,i,o){return Ps(1,arguments,this),this},t.fromTo=function(n,i,o,a){return Ps(2,arguments,this),this},t.set=function(n,i,o){return i.duration=0,i.parent=this,Es(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new oe(n,i,Ke(this,o),1),this},t.call=function(n,i,o){return Qe(this,oe.delayedCall(0,n,i),o)},t.staggerTo=function(n,i,o,a,l,c,u){return o.duration=i,o.stagger=o.stagger||a,o.onComplete=c,o.onCompleteParams=u,o.parent=this,new oe(n,o,Ke(this,l)),this},t.staggerFrom=function(n,i,o,a,l,c,u){return o.runBackwards=1,Es(o).immediateRender=Se(o.immediateRender),this.staggerTo(n,i,o,a,l,c,u)},t.staggerFromTo=function(n,i,o,a,l,c,u,d){return a.startAt=o,Es(a).immediateRender=Se(a.immediateRender),this.staggerTo(n,i,a,l,c,u,d)},t.render=function(n,i,o){var a=this._time,l=this._dirty?this.totalDuration():this._tDur,c=this._dur,u=n<=0?0:ae(n),d=this._zTime<0!=n<0&&(this._initted||!c),p,g,w,h,f,m,b,y,v,C,T,S;if(this!==Q&&u>l&&n>=0&&(u=l),u!==this._tTime||o||d){if(a!==this._time&&c&&(u+=this._time-a,n+=this._time-a),p=u,v=this._start,y=this._ts,m=!y,d&&(c||(a=this._zTime),(n||!i)&&(this._zTime=n)),this._repeat){if(T=this._yoyo,f=c+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(f*100+n,i,o);if(p=ae(u%f),u===l?(h=this._repeat,p=c):(C=ae(u/f),h=~~C,h&&h===C&&(p=c,h--),p>c&&(p=c)),C=us(this._tTime,f),!a&&this._tTime&&C!==h&&this._tTime-C*f-this._dur<=0&&(C=h),T&&h&1&&(p=c-p,S=1),h!==C&&!this._lock){var $=T&&C&1,R=$===(T&&h&1);if(h<C&&($=!$),a=$?0:u%c?c:u,this._lock=1,this.render(a||(S?0:ae(h*f)),i,!c)._lock=0,this._tTime=u,!i&&this.parent&&Pe(this,"onRepeat"),this.vars.repeatRefresh&&!S&&(this.invalidate()._lock=1),a&&a!==this._time||m!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(c=this._dur,l=this._tDur,R&&(this._lock=2,a=$?c:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!S&&this.invalidate()),this._lock=0,!this._ts&&!m)return this;ia(this,S)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(b=jl(this,ae(a),ae(p)),b&&(u-=p-(p=b._start))),this._tTime=u,this._time=p,this._act=!y,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,a=0),!a&&u&&!i&&!C&&(Pe(this,"onStart"),this._tTime!==u))return this;if(p>=a&&n>=0)for(g=this._first;g;){if(w=g._next,(g._act||p>=g._start)&&g._ts&&b!==g){if(g.parent!==this)return this.render(n,i,o);if(g.render(g._ts>0?(p-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(p-g._start)*g._ts,i,o),p!==this._time||!this._ts&&!m){b=0,w&&(u+=this._zTime=-1e-8);break}}g=w}else{g=this._last;for(var M=n<0?n:p;g;){if(w=g._prev,(g._act||M<=g._end)&&g._ts&&b!==g){if(g.parent!==this)return this.render(n,i,o);if(g.render(g._ts>0?(M-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(M-g._start)*g._ts,i,o||de&&Ni(g)),p!==this._time||!this._ts&&!m){b=0,w&&(u+=this._zTime=M?-1e-8:fe);break}}g=w}}if(b&&!i&&(this.pause(),b.render(p>=a?0:-1e-8)._zTime=p>=a?1:-1,this._ts))return this._start=v,Sn(this),this.render(n,i,o);this._onUpdate&&!i&&Pe(this,"onUpdate",!0),(u===l&&this._tTime>=this.totalDuration()||!u&&a)&&(v===this._start||Math.abs(y)!==Math.abs(this._ts))&&(this._lock||((n||!c)&&(u===l&&this._ts>0||!u&&this._ts<0)&&St(this,1),!i&&!(n<0&&!a)&&(u||a||!l)&&(Pe(this,u===l&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u<l&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(n,i){var o=this;if(pt(i)||(i=Ke(this,i,n)),!(n instanceof Us)){if(me(n))return n.forEach(function(a){return o.add(a,i)}),this;if(ue(n))return this.addLabel(n,i);if(se(n))n=oe.delayedCall(0,n);else return this}return this!==n?Qe(this,n,i):this},t.getChildren=function(n,i,o,a){n===void 0&&(n=!0),i===void 0&&(i=!0),o===void 0&&(o=!0),a===void 0&&(a=-1e8);for(var l=[],c=this._first;c;)c._start>=a&&(c instanceof oe?i&&l.push(c):(o&&l.push(c),n&&l.push.apply(l,c.getChildren(!0,i,o)))),c=c._next;return l},t.getById=function(n){for(var i=this.getChildren(1,1,1),o=i.length;o--;)if(i[o].vars.id===n)return i[o]},t.remove=function(n){return ue(n)?this.removeLabel(n):se(n)?this.killTweensOf(n):(n.parent===this&&kn(this,n),n===this._recent&&(this._recent=this._last),Kt(this))},t.totalTime=function(n,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=ae(Ee.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),r.prototype.totalTime.call(this,n,i),this._forcing=0,this):this._tTime},t.addLabel=function(n,i){return this.labels[n]=Ke(this,i),this},t.removeLabel=function(n){return delete this.labels[n],this},t.addPause=function(n,i,o){var a=oe.delayedCall(0,i||Is,o);return a.data="isPause",this._hasPause=1,Qe(this,a,Ke(this,n))},t.removePause=function(n){var i=this._first;for(n=Ke(this,n);i;)i._start===n&&i.data==="isPause"&&St(i),i=i._next},t.killTweensOf=function(n,i,o){for(var a=this.getTweensOf(n,o),l=a.length;l--;)vt!==a[l]&&a[l].kill(n,i);return this},t.getTweensOf=function(n,i){for(var o=[],a=Fe(n),l=this._first,c=pt(i),u;l;)l instanceof oe?Il(l._targets,a)&&(c?(!vt||l._initted&&l._ts)&&l.globalTime(0)<=i&&l.globalTime(l.totalDuration())>i:!i||l.isActive())&&o.push(l):(u=l.getTweensOf(a,i)).length&&o.push.apply(o,u),l=l._next;return o},t.tweenTo=function(n,i){i=i||{};var o=this,a=Ke(o,n),l=i,c=l.startAt,u=l.onStart,d=l.onStartParams,p=l.immediateRender,g,w=oe.to(o,Le({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:i.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale())||fe,onStart:function(){if(o.pause(),!g){var f=i.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale());w._dur!==f&&ds(w,f,0,1).render(w._time,!0,!0),g=1}u&&u.apply(w,d||[])}},i));return p?w.render(0):w},t.tweenFromTo=function(n,i,o){return this.tweenTo(i,Le({startAt:{time:Ke(this,n)}},o))},t.recent=function(){return this._recent},t.nextLabel=function(n){return n===void 0&&(n=this._time),_r(this,Ke(this,n))},t.previousLabel=function(n){return n===void 0&&(n=this._time),_r(this,Ke(this,n),1)},t.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+fe)},t.shiftChildren=function(n,i,o){o===void 0&&(o=0);for(var a=this._first,l=this.labels,c;a;)a._start>=o&&(a._start+=n,a._end+=n),a=a._next;if(i)for(c in l)l[c]>=o&&(l[c]+=n);return Kt(this)},t.invalidate=function(n){var i=this._first;for(this._lock=0;i;)i.invalidate(n),i=i._next;return r.prototype.invalidate.call(this,n)},t.clear=function(n){n===void 0&&(n=!0);for(var i=this._first,o;i;)o=i._next,this.remove(i),i=o;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),Kt(this)},t.totalDuration=function(n){var i=0,o=this,a=o._last,l=et,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,Qe(o,a,u-a._delay,1)._lock=0):l=u,u<0&&a._ts&&(i-=u,(!d&&!o._dp||d&&d.smoothChildTiming)&&(o._start+=u/o._ts,o._time-=u,o._tTime-=u),o.shiftChildren(-u,!1,-1/0),l=0),a._end>i&&a._ts&&(i=a._end),a=c;ds(o,o===Q&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(n){if(Q._ts&&(Oo(Q,wn(n,Q)),Vo=Ee.frame),Ee.frame>=yr){yr+=Ae.autoSleep||120;var i=Q._first;if((!i||!i._ts)&&Ae.autoSleep&&Ee._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||Ee.sleep()}}},e}(Us);Le(be.prototype,{_lock:0,_hasPause:0,_forcing:0});var lc=function(e,t,s,n,i,o,a){var l=new Re(this._pt,e,t,0,1,ha,null,i),c=0,u=0,d,p,g,w,h,f,m,b;for(l.b=s,l.e=n,s+="",n+="",(m=~n.indexOf("random("))&&(n=Ks(n)),o&&(b=[s,n],o(b,e,t),s=b[0],n=b[1]),p=s.match(On)||[];d=On.exec(n);)w=d[0],h=n.substring(c,d.index),g?g=(g+1)%5:h.substr(-5)==="rgba("&&(g=1),w!==p[u++]&&(f=parseFloat(p[u-1])||0,l._pt={_next:l._pt,p:h||u===1?h:",",s:f,c:w.charAt(1)==="="?rs(f,w)-f:parseFloat(w)-f,m:g&&g<4?Math.round:0},c=On.lastIndex);return l.c=c<n.length?n.substring(c,n.length):"",l.fp=a,(Mo.test(n)||m)&&(l.e=0),this._pt=l,l},Wi=function(e,t,s,n,i,o,a,l,c,u){se(n)&&(n=n(i||0,e,o));var d=e[t],p=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,g=se(d)?c?pc:ua:ji,w;if(ue(n)&&(~n.indexOf("random(")&&(n=Ks(n)),n.charAt(1)==="="&&(w=rs(p,n)+(ge(p)||0),(w||w===0)&&(n=w))),!u||p!==n||xi)return!isNaN(p*n)&&n!==""?(w=new Re(this._pt,e,t,+p||0,n-(p||0),typeof d=="boolean"?fc:da,0,g),c&&(w.fp=c),a&&w.modifier(a,this,e),this._pt=w):(!d&&!(t in e)&&Ii(t,n),lc.call(this,e,t,p,n,g,l||Ae.stringFilter,c))},cc=function(e,t,s,n,i){if(se(e)&&(e=As(e,i,t,s,n)),!tt(e)||e.style&&e.nodeType||me(e)||Do(e))return ue(e)?As(e,i,t,s,n):e;var o={},a;for(a in e)o[a]=As(e[a],i,t,s,n);return o},aa=function(e,t,s,n,i,o){var a,l,c,u;if(Be[e]&&(a=new Be[e]).init(i,a.rawVars?t[e]:cc(t[e],n,i,o,s),s,n,o)!==!1&&(s._pt=l=new Re(s._pt,i,e,0,1,a.render,a,0,a.priority),s!==ns))for(c=s._ptLookup[s._targets.indexOf(i)],u=a._props.length;u--;)c[a._props[u]]=l;return a},vt,xi,Hi=function r(e,t,s){var n=e.vars,i=n.ease,o=n.startAt,a=n.immediateRender,l=n.lazy,c=n.onUpdate,u=n.runBackwards,d=n.yoyoEase,p=n.keyframes,g=n.autoRevert,w=e._dur,h=e._startAt,f=e._targets,m=e.parent,b=m&&m.data==="nested"?m.vars.targets:f,y=e._overwrite==="auto"&&!Ai,v=e.timeline,C,T,S,$,R,M,D,A,O,ee,B,N,Z;if(v&&(!p||!i)&&(i="none"),e._ease=Ft(i,ls.ease),e._yEase=d?na(Ft(d===!0?i:d,ls.ease)):0,d&&e._yoyo&&!e._repeat&&(d=e._yEase,e._yEase=e._ease,e._ease=d),e._from=!v&&!!n.runBackwards,!v||p&&!n.stagger){if(A=f[0]?It(f[0]).harness:0,N=A&&n[A.prop],C=mn(n,Ki),h&&(h._zTime<0&&h.progress(1),t<0&&u&&a&&!g?h.render(-1,!0):h.revert(u&&w?dn:Ll),h._lazy=0),o){if(St(e._startAt=oe.set(f,Le({data:"isStart",overwrite:!1,parent:m,immediateRender:!0,lazy:!h&&Se(l),startAt:null,delay:0,onUpdate:c&&function(){return Pe(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(de||!a&&!g)&&e._startAt.revert(dn),a&&w&&t<=0&&s<=0){t&&(e._zTime=t);return}}else if(u&&w&&!h){if(t&&(a=!1),S=Le({overwrite:!1,data:"isFromStart",lazy:a&&!h&&Se(l),immediateRender:a,stagger:0,parent:m},C),N&&(S[A.prop]=N),St(e._startAt=oe.set(f,S)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(de?e._startAt.revert(dn):e._startAt.render(-1,!0)),e._zTime=t,!a)r(e._startAt,fe,fe);else if(!t)return}for(e._pt=e._ptCache=0,l=w&&Se(l)||l&&!w,T=0;T<f.length;T++){if(R=f[T],D=R._gsap||Ui(f)[T]._gsap,e._ptLookup[T]=ee={},wi[D.id]&&xt.length&&fn(),B=b===f?T:b.indexOf(R),A&&(O=new A).init(R,N||C,e,B,b)!==!1&&(e._pt=$=new Re(e._pt,R,O.name,0,1,O.render,O,0,O.priority),O._props.forEach(function(le){ee[le]=$}),O.priority&&(M=1)),!A||N)for(S in C)Be[S]&&(O=aa(S,C,e,B,R,b))?O.priority&&(M=1):ee[S]=$=Wi.call(e,R,S,"get",C[S],B,b,0,n.stringFilter);e._op&&e._op[T]&&e.kill(R,e._op[T]),y&&e._pt&&(vt=e,Q.killTweensOf(R,ee,e.globalTime(t)),Z=!e.parent,vt=0),e._pt&&l&&(wi[D.id]=1)}M&&pa(e),e._onInit&&e._onInit(e)}e._onUpdate=c,e._initted=(!e._op||e._pt)&&!Z,p&&t<=0&&v.render(et,!0,!0)},uc=function(e,t,s,n,i,o,a,l){var c=(e._pt&&e._ptCache||(e._ptCache={}))[t],u,d,p,g;if(!c)for(c=e._ptCache[t]=[],p=e._ptLookup,g=e._targets.length;g--;){if(u=p[g][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 xi=1,e.vars[t]="+=0",Hi(e,a),xi=0,l?Os(t+" not eligible for reset"):1;c.push(u)}for(g=c.length;g--;)d=c[g],u=d._pt||d,u.s=(n||n===0)&&!i?n:u.s+(n||0)+o*u.c,u.c=s-u.s,d.e&&(d.e=ne(s)+ge(d.e)),d.b&&(d.b=u.s+ge(d.b))},dc=function(e,t){var s=e[0]?It(e[0]).harness:0,n=s&&s.aliases,i,o,a,l;if(!n)return t;i=cs({},t);for(o in n)if(o in i)for(l=n[o].split(","),a=l.length;a--;)i[l[a]]=i[o];return i},hc=function(e,t,s,n){var i=t.ease||n||"power1.inOut",o,a;if(me(t))a=s[e]||(s[e]=[]),t.forEach(function(l,c){return a.push({t:c/(t.length-1)*100,v:l,e:i})});else for(o in t)a=s[o]||(s[o]=[]),o==="ease"||a.push({t:parseFloat(e),v:t[o],e:i})},As=function(e,t,s,n,i){return se(e)?e.call(t,s,n,i):ue(e)&&~e.indexOf("random(")?Ks(e):e},la=Fi+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",ca={};Te(la+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return ca[r]=1});var oe=function(r){Ro(e,r);function e(s,n,i,o){var a;typeof n=="number"&&(i.duration=n,n=i,i=null),a=r.call(this,o?n:Es(n))||this;var l=a.vars,c=l.duration,u=l.delay,d=l.immediateRender,p=l.stagger,g=l.overwrite,w=l.keyframes,h=l.defaults,f=l.scrollTrigger,m=l.yoyoEase,b=n.parent||Q,y=(me(s)||Do(s)?pt(s[0]):"length"in n)?[s]:Fe(s),v,C,T,S,$,R,M,D;if(a._targets=y.length?Ui(y):Os("GSAP target "+s+" not found. https://gsap.com",!Ae.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=g,w||p||Xs(c)||Xs(u)){if(n=a.vars,v=a.timeline=new be({data:"nested",defaults:h||{},targets:b&&b.data==="nested"?b.vars.targets:y}),v.kill(),v.parent=v._dp=ut(a),v._start=0,p||Xs(c)||Xs(u)){if(S=y.length,M=p&&Zo(p),tt(p))for($ in p)~la.indexOf($)&&(D||(D={}),D[$]=p[$]);for(C=0;C<S;C++)T=mn(n,ca),T.stagger=0,m&&(T.yoyoEase=m),D&&cs(T,D),R=y[C],T.duration=+As(c,ut(a),C,R,y),T.delay=(+As(u,ut(a),C,R,y)||0)-a._delay,!p&&S===1&&T.delay&&(a._delay=u=T.delay,a._start+=u,T.delay=0),v.to(R,T,M?M(C,R,y):0),v._ease=L.none;v.duration()?c=u=0:a.timeline=0}else if(w){Es(Le(v.vars.defaults,{ease:"none"})),v._ease=Ft(w.ease||n.ease||"none");var A=0,O,ee,B;if(me(w))w.forEach(function(N){return v.to(y,N,">")}),v.duration();else{T={};for($ in w)$==="ease"||$==="easeEach"||hc($,w[$],T,w.easeEach);for($ in T)for(O=T[$].sort(function(N,Z){return N.t-Z.t}),A=0,C=0;C<O.length;C++)ee=O[C],B={ease:ee.e,duration:(ee.t-(C?O[C-1].t:0))/100*c},B[$]=ee.v,v.to(y,B,A),A+=B.duration;v.duration()<c&&v.to({},{duration:c-v.duration()})}}c||a.duration(c=v.duration())}else a.timeline=0;return g===!0&&!Ai&&(vt=ut(a),Q.killTweensOf(y),vt=0),Qe(b,ut(a),i),n.reversed&&a.reverse(),n.paused&&a.paused(!0),(d||!c&&!w&&a._start===ae(b._time)&&Se(d)&&Nl(ut(a))&&b.data!=="nested")&&(a._tTime=-1e-8,a.render(Math.max(0,-u)||0)),f&&No(ut(a),f),a}var t=e.prototype;return t.render=function(n,i,o){var a=this._time,l=this._tDur,c=this._dur,u=n<0,d=n>l-fe&&!u?l:n<fe?0:n,p,g,w,h,f,m,b,y,v;if(!c)Hl(this,n,i,o);else if(d!==this._tTime||!n||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==u||this._lazy){if(p=d,y=this.timeline,this._repeat){if(h=c+this._rDelay,this._repeat<-1&&u)return this.totalTime(h*100+n,i,o);if(p=ae(d%h),d===l?(w=this._repeat,p=c):(f=ae(d/h),w=~~f,w&&w===f?(p=c,w--):p>c&&(p=c)),m=this._yoyo&&w&1,m&&(v=this._yEase,p=c-p),f=us(this._tTime,h),p===a&&!o&&this._initted&&w===f)return this._tTime=d,this;w!==f&&(y&&this._yEase&&ia(y,m),this.vars.repeatRefresh&&!m&&!this._lock&&p!==h&&this._initted&&(this._lock=o=1,this.render(ae(h*w),!0).invalidate()._lock=0))}if(!this._initted){if(Wo(this,u?n:p,o,i,d))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&w!==f))return this;if(c!==this._dur)return this.render(n,i,o)}if(this._tTime=d,this._time=p,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=b=(v||this._ease)(p/c),this._from&&(this.ratio=b=1-b),!a&&d&&!i&&!f&&(Pe(this,"onStart"),this._tTime!==d))return this;for(g=this._pt;g;)g.r(b,g.d),g=g._next;y&&y.render(n<0?n:y._dur*y._ease(p/this._dur),i,o)||this._startAt&&(this._zTime=n),this._onUpdate&&!i&&(u&&yi(this,n,i,o),Pe(this,"onUpdate")),this._repeat&&w!==f&&this.vars.onRepeat&&!i&&this.parent&&Pe(this,"onRepeat"),(d===this._tDur||!d)&&this._tTime===d&&(u&&!this._onUpdate&&yi(this,n,!0,!0),(n||!c)&&(d===this._tDur&&this._ts>0||!d&&this._ts<0)&&St(this,1),!i&&!(u&&!a)&&(d||a||m)&&(Pe(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),r.prototype.invalidate.call(this,n)},t.resetTo=function(n,i,o,a,l){Fs||Ee.wake(),this._ts||this.play();var c=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||Hi(this,c),u=this._ease(c/this._dur),uc(this,n,i,o,a,u,c,l)?this.resetTo(n,i,o,a,1):(Tn(this,0),this.parent||Fo(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(n,i){if(i===void 0&&(i="all"),!n&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?zs(this):this.scrollTrigger&&this.scrollTrigger.kill(!!de),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(n,i,vt&&vt.vars.overwrite!==!0)._first||zs(this),this.parent&&o!==this.timeline.totalDuration()&&ds(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,l=n?Fe(n):a,c=this._ptLookup,u=this._pt,d,p,g,w,h,f,m;if((!i||i==="all")&&Fl(a,l))return i==="all"&&(this._pt=0),zs(this);for(d=this._op=this._op||[],i!=="all"&&(ue(i)&&(h={},Te(i,function(b){return h[b]=1}),i=h),i=dc(a,i)),m=a.length;m--;)if(~l.indexOf(a[m])){p=c[m],i==="all"?(d[m]=i,w=p,g={}):(g=d[m]=d[m]||{},w=i);for(h in w)f=p&&p[h],f&&((!("kill"in f.d)||f.d.kill(h)===!0)&&kn(this,f,"_pt"),delete p[h]),g!=="all"&&(g[h]=1)}return this._initted&&!this._pt&&u&&zs(this),this},e.to=function(n,i){return new e(n,i,arguments[2])},e.from=function(n,i){return Ps(1,arguments)},e.delayedCall=function(n,i,o,a){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:i,onReverseComplete:i,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},e.fromTo=function(n,i,o){return Ps(2,arguments)},e.set=function(n,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(n,i)},e.killTweensOf=function(n,i,o){return Q.killTweensOf(n,i,o)},e}(Us);Le(oe.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Te("staggerTo,staggerFrom,staggerFromTo",function(r){oe[r]=function(){var e=new be,t=vi.call(arguments,0);return t.splice(r==="staggerFromTo"?5:4,0,0),e[r].apply(e,t)}});var ji=function(e,t,s){return e[t]=s},ua=function(e,t,s){return e[t](s)},pc=function(e,t,s,n){return e[t](n.fp,s)},gc=function(e,t,s){return e.setAttribute(t,s)},Zi=function(e,t){return se(e[t])?ua:Vi(e[t])&&e.setAttribute?gc:ji},da=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},fc=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},ha=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},mc=function(e,t,s,n){for(var i=this._pt,o;i;)o=i._next,i.p===n&&i.modifier(e,t,s),i=o},wc=function(e){for(var t=this._pt,s,n;t;)n=t._next,t.p===e&&!t.op||t.op===e?kn(this,t,"_pt"):t.dep||(s=1),t=n;return!s},yc=function(e,t,s,n){n.mSet(e,t,n.m.call(n.tween,s,n.mt),n)},pa=function(e){for(var t=e._pt,s,n,i,o;t;){for(s=t._next,n=i;n&&n.pr>t.pr;)n=n._next;(t._prev=n?n._prev:o)?t._prev._next=t:i=t,(t._next=n)?n._prev=t:o=t,t=s}e._pt=i},Re=function(){function r(t,s,n,i,o,a,l,c,u){this.t=s,this.s=i,this.c=o,this.p=n,this.r=a||da,this.d=l||this,this.set=c||ji,this.pr=u||0,this._next=t,t&&(t._prev=this)}var e=r.prototype;return e.modifier=function(s,n,i){this.mSet=this.mSet||this.set,this.set=yc,this.m=s,this.mt=i,this.tween=n},r}();Te(Fi+"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(r){return Ki[r]=1});Ve.TweenMax=Ve.TweenLite=oe;Ve.TimelineLite=Ve.TimelineMax=be;Q=new be({sortChildren:!1,defaults:ls,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Ae.stringFilter=sa;var Ut=[],pn={},bc=[],kr=0,vc=0,Nn=function(e){return(pn[e]||bc).map(function(t){return t()})},ki=function(){var e=Date.now(),t=[];e-kr>2&&(Nn("matchMediaInit"),Ut.forEach(function(s){var n=s.queries,i=s.conditions,o,a,l,c;for(a in n)o=Xe.matchMedia(n[a]).matches,o&&(l=1),o!==i[a]&&(i[a]=o,c=1);c&&(s.revert(),l&&t.push(s))}),Nn("matchMediaRevert"),t.forEach(function(s){return s.onMatch(s,function(n){return s.add(null,n)})}),kr=e,Nn("matchMedia"))},ga=function(){function r(t,s){this.selector=s&&Ci(s),this.data=[],this._r=[],this.isReverted=!1,this.id=vc++,t&&this.add(t)}var e=r.prototype;return e.add=function(s,n,i){se(s)&&(i=n,n=s,s=se);var o=this,a=function(){var c=G,u=o.selector,d;return c&&c!==o&&c.data.push(o),i&&(o.selector=Ci(i)),G=o,d=n.apply(o,arguments),se(d)&&o._r.push(d),G=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=G;G=null,s(this),G=n},e.getTweens=function(){var s=[];return this.data.forEach(function(n){return n instanceof r?s.push.apply(s,n.getTweens()):n instanceof oe&&!(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 i=this;if(s?function(){for(var a=i.getTweens(),l=i.data.length,c;l--;)c=i.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=i.data.length;l--;)c=i.data[l],c instanceof be?c.data!=="nested"&&(c.scrollTrigger&&c.scrollTrigger.revert(),c.kill()):!(c instanceof oe)&&c.revert&&c.revert(s);i._r.forEach(function(u){return u(s,i)}),i.isReverted=!0}():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),n)for(var o=Ut.length;o--;)Ut[o].id===this.id&&Ut.splice(o,1)},e.revert=function(s){this.kill(s||{})},r}(),Cc=function(){function r(t){this.contexts=[],this.scope=t,G&&G.data.push(this)}var e=r.prototype;return e.add=function(s,n,i){tt(s)||(s={matches:s});var o=new ga(0,i||this.scope),a=o.conditions={},l,c,u;G&&!o.selector&&(o.selector=G.selector),this.contexts.push(o),n=o.add("onMatch",n),o.queries=s;for(c in s)c==="all"?u=1:(l=Xe.matchMedia(s[c]),l&&(Ut.indexOf(o)<0&&Ut.push(o),(a[c]=l.matches)&&(u=1),l.addListener?l.addListener(ki):l.addEventListener("change",ki)));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)})},r}(),yn={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 Jo(n)})},timeline:function(e){return new be(e)},getTweensOf:function(e,t){return Q.getTweensOf(e,t)},getProperty:function(e,t,s,n){ue(e)&&(e=Fe(e)[0]);var i=It(e||{}).get,o=s?Ko:Io;return s==="native"&&(s=""),e&&(t?o((Be[t]&&Be[t].get||i)(e,t,s,n)):function(a,l,c){return o((Be[a]&&Be[a].get||i)(e,a,l,c))})},quickSetter:function(e,t,s){if(e=Fe(e),e.length>1){var n=e.map(function(u){return De.quickSetter(u,t,s)}),i=n.length;return function(u){for(var d=i;d--;)n[d](u)}}e=e[0]||{};var o=Be[t],a=It(e),l=a.harness&&(a.harness.aliases||{})[t]||t,c=o?function(u){var d=new o;ns._pt=0,d.init(e,s?u+s:u,ns,0,[e]),d.render(1,d),ns._pt&&qi(1,ns)}: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,i=De.to(e,Le((n={},n[t]="+=0.1",n.paused=!0,n.stagger=0,n),s||{})),o=function(l,c,u){return i.resetTo(t,l,c,u)};return o.tween=i,o},isTweening:function(e){return Q.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Ft(e.ease,ls.ease)),br(ls,e||{})},config:function(e){return br(Ae,e||{})},registerEffect:function(e){var t=e.name,s=e.effect,n=e.plugins,i=e.defaults,o=e.extendTimeline;(n||"").split(",").forEach(function(a){return a&&!Be[a]&&!Ve[a]&&Os(t+" effect requires "+a+" plugin.")}),In[t]=function(a,l,c){return s(Fe(a),Le(l||{},i),c)},o&&(be.prototype[t]=function(a,l,c){return this.add(In[t](a,tt(l)?l:(c=l)&&{},this),c)})},registerEase:function(e,t){L[e]=Ft(t)},parseEase:function(e,t){return arguments.length?Ft(e,t):L},getById:function(e){return Q.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var s=new be(e),n,i;for(s.smoothChildTiming=Se(e.smoothChildTiming),Q.remove(s),s._dp=0,s._time=s._tTime=Q._time,n=Q._first;n;)i=n._next,(t||!(!n._dur&&n instanceof oe&&n.vars.onComplete===n._targets[0]))&&Qe(s,n,n._start-n._delay),n=i;return Qe(Q,s,0),s},context:function(e,t){return e?new ga(e,t):G},matchMedia:function(e){return new Cc(e)},matchMediaRefresh:function(){return Ut.forEach(function(e){var t=e.conditions,s,n;for(n in t)t[n]&&(t[n]=!1,s=1);s&&e.revert()})||ki()},addEventListener:function(e,t){var s=pn[e]||(pn[e]=[]);~s.indexOf(t)||s.push(t)},removeEventListener:function(e,t){var s=pn[e],n=s&&s.indexOf(t);n>=0&&s.splice(n,1)},utils:{wrap:Jl,wrapYoyo:ec,distribute:Zo,random:Go,snap:qo,normalize:Ql,getUnit:ge,clamp:ql,splitColor:ea,toArray:Fe,selector:Ci,mapRange:Xo,pipe:Yl,unitize:Xl,interpolate:tc,shuffle:jo},install:Po,effects:In,ticker:Ee,updateRoot:be.updateRoot,plugins:Be,globalTimeline:Q,core:{PropTween:Re,globals:Ao,Tween:oe,Timeline:be,Animation:Us,getCache:It,_removeLinkedListItem:kn,reverting:function(){return de},context:function(e){return e&&G&&(G.data.push(e),e._ctx=G),G},suppressOverwrites:function(e){return Ai=e}}};Te("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return yn[r]=oe[r]});Ee.add(be.updateRoot);ns=yn.to({},{duration:0});var _c=function(e,t){for(var s=e._pt;s&&s.p!==t&&s.op!==t&&s.fp!==t;)s=s._next;return s},xc=function(e,t){var s=e._targets,n,i,o;for(n in t)for(i=s.length;i--;)o=e._ptLookup[i][n],o&&(o=o.d)&&(o._pt&&(o=_c(o,n)),o&&o.modifier&&o.modifier(t[n],e,s[i],n))},Wn=function(e,t){return{name:e,headless:1,rawVars:1,init:function(n,i,o){o._onInit=function(a){var l,c;if(ue(i)&&(l={},Te(i,function(u){return l[u]=1}),i=l),t){l={};for(c in i)l[c]=t(i[c]);i=l}xc(a,i)}}}},De=yn.registerPlugin({name:"attr",init:function(e,t,s,n,i){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,i,0,0,o),a.op=o,a.b=l,this._props.push(o)},render:function(e,t){for(var s=t._pt;s;)de?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)}},Wn("roundProps",_i),Wn("modifiers"),Wn("snap",qo))||yn;oe.version=be.version=De.version="3.13.0";Eo=1;Li()&&hs();L.Power0;L.Power1;L.Power2;L.Power3;L.Power4;L.Linear;L.Quad;L.Cubic;L.Quart;L.Quint;L.Strong;L.Elastic;L.Back;L.SteppedEase;L.Bounce;L.Sine;L.Expo;L.Circ;/*!
12
+ * CSSPlugin 3.13.0
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 Sr,Ct,os,Gi,Ot,Tr,Yi,kc=function(){return typeof window<"u"},gt={},Lt=180/Math.PI,as=Math.PI/180,Xt=Math.atan2,Rr=1e8,Xi=/([A-Z])/g,Sc=/(left|right|width|margin|padding|x)/i,Tc=/[\s,\(]\S/,Je={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Si=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},Rc=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)},$c=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)},Dc=function(e,t){var s=t.s+t.c*e;t.set(t.t,t.p,~~(s+(s<0?-.5:.5))+t.u,t)},fa=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},ma=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},zc=function(e,t,s){return e.style[t]=s},Mc=function(e,t,s){return e.style.setProperty(t,s)},Bc=function(e,t,s){return e._gsap[t]=s},Ec=function(e,t,s){return e._gsap.scaleX=e._gsap.scaleY=s},Pc=function(e,t,s,n,i){var o=e._gsap;o.scaleX=o.scaleY=s,o.renderTransform(i,o)},Ac=function(e,t,s,n,i){var o=e._gsap;o[t]=s,o.renderTransform(i,o)},J="transform",$e=J+"Origin",Vc=function r(e,t){var s=this,n=this.target,i=n.style,o=n._gsap;if(e in gt&&i){if(this.tfm=this.tfm||{},e!=="transform")e=Je[e]||e,~e.indexOf(",")?e.split(",").forEach(function(a){return s.tfm[a]=dt(n,a)}):this.tfm[e]=o.x?o[e]:dt(n,e),e===$e&&(this.tfm.zOrigin=o.zOrigin);else return Je.transform.split(",").forEach(function(a){return r.call(s,a,t)});if(this.props.indexOf(J)>=0)return;o.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push($e,t,"")),e=J}(i||t)&&this.props.push(e,t,i[e])},wa=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},Lc=function(){var e=this.props,t=this.target,s=t.style,n=t._gsap,i,o;for(i=0;i<e.length;i+=3)e[i+1]?e[i+1]===2?t[e[i]](e[i+2]):t[e[i]]=e[i+2]:e[i+2]?s[e[i]]=e[i+2]:s.removeProperty(e[i].substr(0,2)==="--"?e[i]:e[i].replace(Xi,"-$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||"")),i=Yi(),(!i||!i.isStart)&&!s[J]&&(wa(s),n.zOrigin&&s[$e]&&(s[$e]+=" "+n.zOrigin+"px",n.zOrigin=0,n.renderTransform()),n.uncache=1)}},ya=function(e,t){var s={target:e,props:[],revert:Lc,save:Vc};return e._gsap||De.core.getCache(e),t&&e.style&&e.nodeType&&t.split(",").forEach(function(n){return s.save(n)}),s},ba,Ti=function(e,t){var s=Ct.createElementNS?Ct.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Ct.createElement(e);return s&&s.style?s:Ct.createElement(e)},Ue=function r(e,t,s){var n=getComputedStyle(e);return n[t]||n.getPropertyValue(t.replace(Xi,"-$1").toLowerCase())||n.getPropertyValue(t)||!s&&r(e,ps(t)||t,1)||""},$r="O,Moz,ms,Ms,Webkit".split(","),ps=function(e,t,s){var n=t||Ot,i=n.style,o=5;if(e in i&&!s)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!($r[o]+e in i););return o<0?null:(o===3?"ms":o>=0?$r[o]:"")+e},Ri=function(){kc()&&window.document&&(Sr=window,Ct=Sr.document,os=Ct.documentElement,Ot=Ti("div")||{style:{}},Ti("div"),J=ps(J),$e=J+"Origin",Ot.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",ba=!!ps("perspective"),Yi=De.core.reverting,Gi=1)},Dr=function(e){var t=e.ownerSVGElement,s=Ti("svg",t&&t.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=e.cloneNode(!0),i;n.style.display="block",s.appendChild(n),os.appendChild(s);try{i=n.getBBox()}catch{}return s.removeChild(n),os.removeChild(s),i},zr=function(e,t){for(var s=t.length;s--;)if(e.hasAttribute(t[s]))return e.getAttribute(t[s])},va=function(e){var t,s;try{t=e.getBBox()}catch{t=Dr(e),s=1}return t&&(t.width||t.height)||s||(t=Dr(e)),t&&!t.width&&!t.x&&!t.y?{x:+zr(e,["x","cx","x1"])||0,y:+zr(e,["y","cy","y1"])||0,width:0,height:0}:t},Ca=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&va(e))},Nt=function(e,t){if(t){var s=e.style,n;t in gt&&t!==$e&&(t=J),s.removeProperty?(n=t.substr(0,2),(n==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),s.removeProperty(n==="--"?t:t.replace(Xi,"-$1").toLowerCase())):s.removeAttribute(t)}},_t=function(e,t,s,n,i,o){var a=new Re(e._pt,t,s,0,1,o?ma:fa);return e._pt=a,a.b=n,a.e=i,e._props.push(s),a},Mr={deg:1,rad:1,turn:1},Oc={grid:1,flex:1},Tt=function r(e,t,s,n){var i=parseFloat(s)||0,o=(s+"").trim().substr((i+"").length)||"px",a=Ot.style,l=Sc.test(t),c=e.tagName.toLowerCase()==="svg",u=(c?"client":"offset")+(l?"Width":"Height"),d=100,p=n==="px",g=n==="%",w,h,f,m;if(n===o||!i||Mr[n]||Mr[o])return i;if(o!=="px"&&!p&&(i=r(e,t,s,"px")),m=e.getCTM&&Ca(e),(g||o==="%")&&(gt[t]||~t.indexOf("adius")))return w=m?e.getBBox()[l?"width":"height"]:e[u],ne(g?i/w*d:i/100*w);if(a[l?"width":"height"]=d+(p?o:n),h=n!=="rem"&&~t.indexOf("adius")||n==="em"&&e.appendChild&&!c?e:e.parentNode,m&&(h=(e.ownerSVGElement||{}).parentNode),(!h||h===Ct||!h.appendChild)&&(h=Ct.body),f=h._gsap,f&&g&&f.width&&l&&f.time===Ee.time&&!f.uncache)return ne(i/f.width*d);if(g&&(t==="height"||t==="width")){var b=e.style[t];e.style[t]=d+n,w=e[u],b?e.style[t]=b:Nt(e,t)}else(g||o==="%")&&!Oc[Ue(h,"display")]&&(a.position=Ue(e,"position")),h===e&&(a.position="static"),h.appendChild(Ot),w=Ot[u],h.removeChild(Ot),a.position="absolute";return l&&g&&(f=It(h),f.time=Ee.time,f.width=h[u]),ne(p?w*i/d:w&&i?d/w*i:0)},dt=function(e,t,s,n){var i;return Gi||Ri(),t in Je&&t!=="transform"&&(t=Je[t],~t.indexOf(",")&&(t=t.split(",")[0])),gt[t]&&t!=="transform"?(i=Ws(e,n),i=t!=="transformOrigin"?i[t]:i.svg?i.origin:vn(Ue(e,$e))+" "+i.zOrigin+"px"):(i=e.style[t],(!i||i==="auto"||n||~(i+"").indexOf("calc("))&&(i=bn[t]&&bn[t](e,t,s)||Ue(e,t)||Lo(e,t)||(t==="opacity"?1:0))),s&&!~(i+"").trim().indexOf(" ")?Tt(e,t,i,s)+s:i},Ic=function(e,t,s,n){if(!s||s==="none"){var i=ps(t,e,1),o=i&&Ue(e,i,1);o&&o!==s?(t=i,s=o):t==="borderColor"&&(s=Ue(e,"borderTopColor"))}var a=new Re(this._pt,e.style,t,0,1,ha),l=0,c=0,u,d,p,g,w,h,f,m,b,y,v,C;if(a.b=s,a.e=n,s+="",n+="",n.substring(0,6)==="var(--"&&(n=Ue(e,n.substring(4,n.indexOf(")")))),n==="auto"&&(h=e.style[t],e.style[t]=n,n=Ue(e,t)||n,h?e.style[t]=h:Nt(e,t)),u=[s,n],sa(u),s=u[0],n=u[1],p=s.match(ss)||[],C=n.match(ss)||[],C.length){for(;d=ss.exec(n);)f=d[0],b=n.substring(l,d.index),w?w=(w+1)%5:(b.substr(-5)==="rgba("||b.substr(-5)==="hsla(")&&(w=1),f!==(h=p[c++]||"")&&(g=parseFloat(h)||0,v=h.substr((g+"").length),f.charAt(1)==="="&&(f=rs(g,f)+v),m=parseFloat(f),y=f.substr((m+"").length),l=ss.lastIndex-y.length,y||(y=y||Ae.units[t]||v,l===n.length&&(n+=y,a.e+=y)),v!==y&&(g=Tt(e,t,h,y)||0),a._pt={_next:a._pt,p:b||c===1?b:",",s:g,c:m-g,m:w&&w<4||t==="zIndex"?Math.round:0});a.c=l<n.length?n.substring(l,n.length):""}else a.r=t==="display"&&n==="none"?ma:fa;return Mo.test(n)&&(a.e=0),this._pt=a,a},Br={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Kc=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]=Br[s]||s,t[1]=Br[n]||n,t.join(" ")},Fc=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var s=t.t,n=s.style,i=t.u,o=s._gsap,a,l,c;if(i==="all"||i===!0)n.cssText="",l=1;else for(i=i.split(","),c=i.length;--c>-1;)a=i[c],gt[a]&&(l=1,a=a==="transformOrigin"?$e:J),Nt(s,a);l&&(Nt(s,J),o&&(o.svg&&s.removeAttribute("transform"),n.scale=n.rotate=n.translate="none",Ws(s,1),o.uncache=1,wa(n)))}},bn={clearProps:function(e,t,s,n,i){if(i.data!=="isFromStart"){var o=e._pt=new Re(e._pt,t,s,0,0,Fc);return o.u=n,o.pr=-10,o.tween=i,e._props.push(s),1}}},Ns=[1,0,0,1,0,0],_a={},xa=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},Er=function(e){var t=Ue(e,J);return xa(t)?Ns:t.substr(7).match(zo).map(ne)},Qi=function(e,t){var s=e._gsap||It(e),n=e.style,i=Er(e),o,a,l,c;return s.svg&&e.getAttribute("transform")?(l=e.transform.baseVal.consolidate().matrix,i=[l.a,l.b,l.c,l.d,l.e,l.f],i.join(",")==="1,0,0,1,0,0"?Ns:i):(i===Ns&&!e.offsetParent&&e!==os&&!s.svg&&(l=n.display,n.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(c=1,a=e.nextElementSibling,os.appendChild(e)),i=Er(e),l?n.display=l:Nt(e,"display"),c&&(a?o.insertBefore(e,a):o?o.appendChild(e):os.removeChild(e))),t&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},$i=function(e,t,s,n,i,o){var a=e._gsap,l=i||Qi(e,!0),c=a.xOrigin||0,u=a.yOrigin||0,d=a.xOffset||0,p=a.yOffset||0,g=l[0],w=l[1],h=l[2],f=l[3],m=l[4],b=l[5],y=t.split(" "),v=parseFloat(y[0])||0,C=parseFloat(y[1])||0,T,S,$,R;s?l!==Ns&&(S=g*f-w*h)&&($=v*(f/S)+C*(-h/S)+(h*b-f*m)/S,R=v*(-w/S)+C*(g/S)-(g*b-w*m)/S,v=$,C=R):(T=va(e),v=T.x+(~y[0].indexOf("%")?v/100*T.width:v),C=T.y+(~(y[1]||y[0]).indexOf("%")?C/100*T.height:C)),n||n!==!1&&a.smooth?(m=v-c,b=C-u,a.xOffset=d+(m*g+b*h)-m,a.yOffset=p+(m*w+b*f)-b):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&&(_t(o,a,"xOrigin",c,v),_t(o,a,"yOrigin",u,C),_t(o,a,"xOffset",d,a.xOffset),_t(o,a,"yOffset",p,a.yOffset)),e.setAttribute("data-svg-origin",v+" "+C)},Ws=function(e,t){var s=e._gsap||new oa(e);if("x"in s&&!t&&!s.uncache)return s;var n=e.style,i=s.scaleX<0,o="px",a="deg",l=getComputedStyle(e),c=Ue(e,$e)||"0",u,d,p,g,w,h,f,m,b,y,v,C,T,S,$,R,M,D,A,O,ee,B,N,Z,le,x,K,we,W,Zt,Ce,st;return u=d=p=h=f=m=b=y=v=0,g=w=1,s.svg=!!(e.getCTM&&Ca(e)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(n[J]=(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[J]!=="none"?l[J]:"")),n.scale=n.rotate=n.translate="none"),S=Qi(e,s.svg),s.svg&&(s.uncache?(le=e.getBBox(),c=s.xOrigin-le.x+"px "+(s.yOrigin-le.y)+"px",Z=""):Z=!t&&e.getAttribute("data-svg-origin"),$i(e,Z||c,!!Z||s.originIsAbsolute,s.smooth!==!1,S)),C=s.xOrigin||0,T=s.yOrigin||0,S!==Ns&&(D=S[0],A=S[1],O=S[2],ee=S[3],u=B=S[4],d=N=S[5],S.length===6?(g=Math.sqrt(D*D+A*A),w=Math.sqrt(ee*ee+O*O),h=D||A?Xt(A,D)*Lt:0,b=O||ee?Xt(O,ee)*Lt+h:0,b&&(w*=Math.abs(Math.cos(b*as))),s.svg&&(u-=C-(C*D+T*O),d-=T-(C*A+T*ee))):(st=S[6],Zt=S[7],K=S[8],we=S[9],W=S[10],Ce=S[11],u=S[12],d=S[13],p=S[14],$=Xt(st,W),f=$*Lt,$&&(R=Math.cos(-$),M=Math.sin(-$),Z=B*R+K*M,le=N*R+we*M,x=st*R+W*M,K=B*-M+K*R,we=N*-M+we*R,W=st*-M+W*R,Ce=Zt*-M+Ce*R,B=Z,N=le,st=x),$=Xt(-O,W),m=$*Lt,$&&(R=Math.cos(-$),M=Math.sin(-$),Z=D*R-K*M,le=A*R-we*M,x=O*R-W*M,Ce=ee*M+Ce*R,D=Z,A=le,O=x),$=Xt(A,D),h=$*Lt,$&&(R=Math.cos($),M=Math.sin($),Z=D*R+A*M,le=B*R+N*M,A=A*R-D*M,N=N*R-B*M,D=Z,B=le),f&&Math.abs(f)+Math.abs(h)>359.9&&(f=h=0,m=180-m),g=ne(Math.sqrt(D*D+A*A+O*O)),w=ne(Math.sqrt(N*N+st*st)),$=Xt(B,N),b=Math.abs($)>2e-4?$*Lt:0,v=Ce?1/(Ce<0?-Ce:Ce):0),s.svg&&(Z=e.getAttribute("transform"),s.forceCSS=e.setAttribute("transform","")||!xa(Ue(e,J)),Z&&e.setAttribute("transform",Z))),Math.abs(b)>90&&Math.abs(b)<270&&(i?(g*=-1,b+=h<=0?180:-180,h+=h<=0?180:-180):(w*=-1,b+=b<=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=p+o,s.scaleX=ne(g),s.scaleY=ne(w),s.rotation=ne(h)+a,s.rotationX=ne(f)+a,s.rotationY=ne(m)+a,s.skewX=b+a,s.skewY=y+a,s.transformPerspective=v+o,(s.zOrigin=parseFloat(c.split(" ")[2])||!t&&s.zOrigin||0)&&(n[$e]=vn(c)),s.xOffset=s.yOffset=0,s.force3D=Ae.force3D,s.renderTransform=s.svg?Nc:ba?ka:Uc,s.uncache=0,s},vn=function(e){return(e=e.split(" "))[0]+" "+e[1]},Hn=function(e,t,s){var n=ge(t);return ne(parseFloat(t)+parseFloat(Tt(e,"x",s+"px",n)))+n},Uc=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,ka(e,t)},zt="0deg",ws="0px",Mt=") ",ka=function(e,t){var s=t||this,n=s.xPercent,i=s.yPercent,o=s.x,a=s.y,l=s.z,c=s.rotation,u=s.rotationY,d=s.rotationX,p=s.skewX,g=s.skewY,w=s.scaleX,h=s.scaleY,f=s.transformPerspective,m=s.force3D,b=s.target,y=s.zOrigin,v="",C=m==="auto"&&e&&e!==1||m===!0;if(y&&(d!==zt||u!==zt)){var T=parseFloat(u)*as,S=Math.sin(T),$=Math.cos(T),R;T=parseFloat(d)*as,R=Math.cos(T),o=Hn(b,o,S*R*-y),a=Hn(b,a,-Math.sin(T)*-y),l=Hn(b,l,$*R*-y+y)}f!==ws&&(v+="perspective("+f+Mt),(n||i)&&(v+="translate("+n+"%, "+i+"%) "),(C||o!==ws||a!==ws||l!==ws)&&(v+=l!==ws||C?"translate3d("+o+", "+a+", "+l+") ":"translate("+o+", "+a+Mt),c!==zt&&(v+="rotate("+c+Mt),u!==zt&&(v+="rotateY("+u+Mt),d!==zt&&(v+="rotateX("+d+Mt),(p!==zt||g!==zt)&&(v+="skew("+p+", "+g+Mt),(w!==1||h!==1)&&(v+="scale("+w+", "+h+Mt),b.style[J]=v||"translate(0, 0)"},Nc=function(e,t){var s=t||this,n=s.xPercent,i=s.yPercent,o=s.x,a=s.y,l=s.rotation,c=s.skewX,u=s.skewY,d=s.scaleX,p=s.scaleY,g=s.target,w=s.xOrigin,h=s.yOrigin,f=s.xOffset,m=s.yOffset,b=s.forceCSS,y=parseFloat(o),v=parseFloat(a),C,T,S,$,R;l=parseFloat(l),c=parseFloat(c),u=parseFloat(u),u&&(u=parseFloat(u),c+=u,l+=u),l||c?(l*=as,c*=as,C=Math.cos(l)*d,T=Math.sin(l)*d,S=Math.sin(l-c)*-p,$=Math.cos(l-c)*p,c&&(u*=as,R=Math.tan(c-u),R=Math.sqrt(1+R*R),S*=R,$*=R,u&&(R=Math.tan(u),R=Math.sqrt(1+R*R),C*=R,T*=R)),C=ne(C),T=ne(T),S=ne(S),$=ne($)):(C=d,$=p,T=S=0),(y&&!~(o+"").indexOf("px")||v&&!~(a+"").indexOf("px"))&&(y=Tt(g,"x",o,"px"),v=Tt(g,"y",a,"px")),(w||h||f||m)&&(y=ne(y+w-(w*C+h*S)+f),v=ne(v+h-(w*T+h*$)+m)),(n||i)&&(R=g.getBBox(),y=ne(y+n/100*R.width),v=ne(v+i/100*R.height)),R="matrix("+C+","+T+","+S+","+$+","+y+","+v+")",g.setAttribute("transform",R),b&&(g.style[J]=R)},Wc=function(e,t,s,n,i){var o=360,a=ue(i),l=parseFloat(i)*(a&&~i.indexOf("rad")?Lt:1),c=l-n,u=n+c+"deg",d,p;return a&&(d=i.split("_")[1],d==="short"&&(c%=o,c!==c%(o/2)&&(c+=c<0?o:-360)),d==="cw"&&c<0?c=(c+o*Rr)%o-~~(c/o)*o:d==="ccw"&&c>0&&(c=(c-o*Rr)%o-~~(c/o)*o)),e._pt=p=new Re(e._pt,t,s,n,c,Rc),p.e=u,p.u="deg",e._props.push(s),p},Pr=function(e,t){for(var s in t)e[s]=t[s];return e},Hc=function(e,t,s){var n=Pr({},s._gsap),i="perspective,force3D,transformOrigin,svgOrigin",o=s.style,a,l,c,u,d,p,g,w;n.svg?(c=s.getAttribute("transform"),s.setAttribute("transform",""),o[J]=t,a=Ws(s,1),Nt(s,J),s.setAttribute("transform",c)):(c=getComputedStyle(s)[J],o[J]=t,a=Ws(s,1),o[J]=c);for(l in gt)c=n[l],u=a[l],c!==u&&i.indexOf(l)<0&&(g=ge(c),w=ge(u),d=g!==w?Tt(s,l,c,w):parseFloat(c),p=parseFloat(u),e._pt=new Re(e._pt,a,l,d,p-d,Si),e._pt.u=w||0,e._props.push(l));Pr(a,n)};Te("padding,margin,Width,Radius",function(r,e){var t="Top",s="Right",n="Bottom",i="Left",o=(e<3?[t,s,n,i]:[t+i,t+s,n+s,n+i]).map(function(a){return e<2?r+a:"border"+a+r});bn[e>1?"border"+r:r]=function(a,l,c,u,d){var p,g;if(arguments.length<4)return p=o.map(function(w){return dt(a,w,c)}),g=p.join(" "),g.split(p[0]).length===5?p[0]:g;p=(u+"").split(" "),g={},o.forEach(function(w,h){return g[w]=p[h]=p[h]||p[(h-1)/2|0]}),a.init(l,g,d)}});var Sa={name:"css",register:Ri,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,s,n,i){var o=this._props,a=e.style,l=s.vars.startAt,c,u,d,p,g,w,h,f,m,b,y,v,C,T,S,$;Gi||Ri(),this.styles=this.styles||ya(e),$=this.styles.props,this.tween=s;for(h in t)if(h!=="autoRound"&&(u=t[h],!(Be[h]&&aa(h,t,s,n,e,i)))){if(g=typeof u,w=bn[h],g==="function"&&(u=u.call(s,n,e,i),g=typeof u),g==="string"&&~u.indexOf("random(")&&(u=Ks(u)),w)w(this,e,h,u,s)&&(S=1);else if(h.substr(0,2)==="--")c=(getComputedStyle(e).getPropertyValue(h)+"").trim(),u+="",kt.lastIndex=0,kt.test(c)||(f=ge(c),m=ge(u)),m?f!==m&&(c=Tt(e,h,c,m)+m):f&&(u+=f),this.add(a,"setProperty",c,u,n,i,0,0,h),o.push(h),$.push(h,0,a[h]);else if(g!=="undefined"){if(l&&h in l?(c=typeof l[h]=="function"?l[h].call(s,n,e,i):l[h],ue(c)&&~c.indexOf("random(")&&(c=Ks(c)),ge(c+"")||c==="auto"||(c+=Ae.units[h]||ge(dt(e,h))||""),(c+"").charAt(1)==="="&&(c=dt(e,h))):c=dt(e,h),p=parseFloat(c),b=g==="string"&&u.charAt(1)==="="&&u.substr(0,2),b&&(u=u.substr(2)),d=parseFloat(u),h in Je&&(h==="autoAlpha"&&(p===1&&dt(e,"visibility")==="hidden"&&d&&(p=0),$.push("visibility",0,a.visibility),_t(this,a,"visibility",p?"inherit":"hidden",d?"inherit":"hidden",!d)),h!=="scale"&&h!=="transform"&&(h=Je[h],~h.indexOf(",")&&(h=h.split(",")[0]))),y=h in gt,y){if(this.styles.save(h),g==="string"&&u.substring(0,6)==="var(--"&&(u=Ue(e,u.substring(4,u.indexOf(")"))),d=parseFloat(u)),v||(C=e._gsap,C.renderTransform&&!t.parseTransform||Ws(e,t.parseTransform),T=t.smoothOrigin!==!1&&C.smooth,v=this._pt=new Re(this._pt,a,J,0,1,C.renderTransform,C,0,-1),v.dep=1),h==="scale")this._pt=new Re(this._pt,C,"scaleY",C.scaleY,(b?rs(C.scaleY,b+d):d)-C.scaleY||0,Si),this._pt.u=0,o.push("scaleY",h),h+="X";else if(h==="transformOrigin"){$.push($e,0,a[$e]),u=Kc(u),C.svg?$i(e,u,0,T,0,this):(m=parseFloat(u.split(" ")[2])||0,m!==C.zOrigin&&_t(this,C,"zOrigin",C.zOrigin,m),_t(this,a,h,vn(c),vn(u)));continue}else if(h==="svgOrigin"){$i(e,u,1,T,0,this);continue}else if(h in _a){Wc(this,C,h,p,b?rs(p,b+u):u);continue}else if(h==="smoothOrigin"){_t(this,C,"smooth",C.smooth,u);continue}else if(h==="force3D"){C[h]=u;continue}else if(h==="transform"){Hc(this,u,e);continue}}else h in a||(h=ps(h)||h);if(y||(d||d===0)&&(p||p===0)&&!Tc.test(u)&&h in a)f=(c+"").substr((p+"").length),d||(d=0),m=ge(u)||(h in Ae.units?Ae.units[h]:f),f!==m&&(p=Tt(e,h,c,m)),this._pt=new Re(this._pt,y?C:a,h,p,(b?rs(p,b+d):d)-p,!y&&(m==="px"||h==="zIndex")&&t.autoRound!==!1?Dc:Si),this._pt.u=m||0,f!==m&&m!=="%"&&(this._pt.b=c,this._pt.r=$c);else if(h in a)Ic.call(this,e,h,c,b?b+u:u);else if(h in e)this.add(e,h,c||e[h],b?b+u:u,n,i);else if(h!=="parseTransform"){Ii(h,u);continue}y||(h in a?$.push(h,0,a[h]):typeof e[h]=="function"?$.push(h,2,e[h]()):$.push(h,1,c||e[h])),o.push(h)}}S&&pa(this)},render:function(e,t){if(t.tween._time||!Yi())for(var s=t._pt;s;)s.r(e,s.d),s=s._next;else t.styles.revert()},get:dt,aliases:Je,getSetter:function(e,t,s){var n=Je[t];return n&&n.indexOf(",")<0&&(t=n),t in gt&&t!==$e&&(e._gsap.x||dt(e,"x"))?s&&Tr===s?t==="scale"?Ec:Bc:(Tr=s||{})&&(t==="scale"?Pc:Ac):e.style&&!Vi(e.style[t])?zc:~t.indexOf("-")?Mc:Zi(e,t)},core:{_removeProperty:Nt,_getMatrix:Qi}};De.utils.checkPrefix=ps;De.core.getStyleSaver=ya;(function(r,e,t,s){var n=Te(r+","+e+","+t,function(i){gt[i]=1});Te(e,function(i){Ae.units[i]="deg",_a[i]=1}),Je[n[13]]=r+","+e,Te(s,function(i){var o=i.split(":");Je[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");Te("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Ae.units[r]="px"});De.registerPlugin(Sa);var F=De.registerPlugin(Sa)||De;F.core.Tween;const Ar={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(r){if(r!=null)return`${r}px`}function Ta(r){return Math.max(0,Math.min(1,r))}function Ra(r){if(!r)return;const e=r.trim();if(/^#([0-9a-fA-F]{3}){1,2}$/.test(e)){let s=0,n=0,i=0;return e.length===4?(s=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16)):(s=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16)),{r:s,g:n,b:i}}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 jn(r){const t=Math.max(0,Math.min(255,Math.round(r))).toString(16);return t.length===1?`0${t}`:t}function $a(r){if(r)return`#${jn(r.r)}${jn(r.g)}${jn(r.b)}`}function Di(r,e=.12){const t=Ra(r);if(!t)return r;const s=Ta(e);return $a({r:t.r+(255-t.r)*s,g:t.g+(255-t.g)*s,b:t.b+(255-t.b)*s})}function Da(r,e=.12){const t=Ra(r);if(!t)return r;const s=Ta(e);return $a({r:t.r*(1-s),g:t.g*(1-s),b:t.b*(1-s)})}function jc(r,e){if(r)switch(e){case"gradient":{const t=Di(r,.08)||r,s=Da(r,.12)||r;return`linear-gradient(180deg, ${t} 0%, ${s} 100%)`}case"bubble":return`radial-gradient(120% 120% at 10% 0%, ${Di(r,.14)||r} 0%, ${r} 60%)`;default:return r}}function Zc(r,e){return{...r?Ar[r]:Ar.md,...void 0}}function qc(r,e){const t=Zc(r.size),s=r.color,n=jc(r.bgColor??e?.fallbackColor,r.bgType),i=Qt(r.fontSize??t.fontSize),o=Qt(r.borderRadius??t.borderRadius),a=Qt(r.verticalPadding),l=Qt(r.sidePadding);let c;r.borderWidth&&r.borderWidth>0?c=`${r.borderWidth}px solid ${r.borderColor||e?.fallbackColor||"currentColor"}`:r.borderColor&&!r.borderWidth&&(c=`1px solid ${r.borderColor}`);const u=r.width?r.width+(r.borderWidth??0):void 0,d=r.height?r.height+(r.borderWidth??0):void 0,p={color:s,background:n,fontSize:i,borderRadius:o,width:Qt(u),height:Qt(d),padding:a&&l?`${a} ${l}`:void 0,border:c},g={};for(const w in p){const h=p[w];h!=null&&h!==""&&(g[w]=String(h))}return g}const{defineComponent:Gc}=await E("vue"),{normalizeStyle:Zn,openBlock:qn,createElementBlock:Gn,createCommentVNode:Yc}=await E("vue"),Xc=["innerHTML"],Qc=["src"],{computed:ys}=await E("vue"),Jc=Gc({__name:"ChatCollapsed",props:{element:{},toggleChat:{type:Function}},setup(r){const e=r,t=ys(()=>e.element),s=ys(()=>qc(t.value)),n=ys(()=>{const a=e.element.logo;return a?a.includes("<svg"):!1}),i=ys(()=>{const a=e.element.logo;return a&&a.replace('width="',"").replace('height="',"").replace('"',""),a}),o=ys(()=>{const a=e.element.icon?.size;return a?a+"px":void 0});return(a,l)=>(qn(),Gn("div",{style:Zn([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)=>a.toggleChat&&a.toggleChat(...c))},[n.value?(qn(),Gn("span",{key:0,class:"hs-collapsed-logo tw:transition-all",innerHTML:i.value,style:Zn({width:o.value,height:o.value})},null,12,Xc)):i.value?(qn(),Gn("img",{key:1,class:"tw:transition-all",src:i.value,alt:"logo",style:Zn({width:o.value,height:o.value})},null,12,Qc)):Yc("",!0)],4))}}),eu={required:["settings","texts","sections"],version:"1.0"},tu=JSON.parse('{"bottom":{"btnSend":{"bgColor":"#5E4AC6","borderColor":"#595959","borderRadius":50,"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":50,"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":"#373739","borderColor":"#595959","borderRadius":12,"borderWidth":1,"color":"#fff","fontSize":12,"sidePadding":8,"verticalSpacing":8},"headerChip":{"bgColor":"#69696A","bgType":"filled","borderRadius":12,"color":"#fff","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":"#595959","headerFillColor":"#fff","headerText":"#12D8D8","pastStepColor":"#515151","strokeColor":"#aaa","strokeWidth":0,"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":"#fff","showType":"both"},"params":{"bgColor":"#5E4AC6","bgStyle":"invisible","border":{"color":"#991717","width":0},"borderRadius":12,"buttonStyle":"invisible","chipStyle":"filled","paddingHorizontal":0,"paddingVertical":1,"sideMargin":8,"size":"md"}},"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":8,"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"}}}'),su={bgChat:"#212121",borderRadius:25,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:0,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:450,width:435},theme:"light"},nu={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"},iu={schema:eu,sections:tu,settings:su,texts:nu},V=iu;class Ze{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 ru extends Ze{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 ou extends Ze{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 au extends Ze{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 lu extends Ze{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 cu extends Ze{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 uu extends Ze{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 du=[new ru,new ou,new au,new lu,new cu,new uu];class hu extends Ze{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 pu extends Ze{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 gu extends Ze{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,i=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(i)),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 fu extends Ze{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,i=V.sections.inside.welcomeMessage;return!n.borderColor&&i.borderColor&&(n.borderColor=i.borderColor,s.push("Добавлено поле borderColor для welcomeMessage")),!n.bgType&&i.bgType&&(n.bgType=i.bgType,s.push(`Добавлено поле bgType для welcomeMessage: '${n.bgType}'`)),!n.bgColor&&i.bgColor&&(n.bgColor=i.bgColor,s.push("Добавлено поле bgColor для welcomeMessage")),n.borderWidth===void 0&&i.borderWidth!==void 0&&(n.borderWidth=i.borderWidth,s.push("Добавлено поле borderWidth для welcomeMessage")),!n.fontSize&&i.fontSize&&(n.fontSize=i.fontSize,s.push("Добавлено поле fontSize для welcomeMessage")),!n.size&&i.size&&(n.size=i.size,s.push("Добавлено поле size для welcomeMessage")),!n.borderRadius&&i.borderRadius&&(n.borderRadius=i.borderRadius,s.push("Добавлено поле borderRadius для welcomeMessage")),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при расширении welcomeMessage: ${t}`])}}}class mu extends Ze{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 Vr=[new hu,new pu,new gu,new fu,new mu];function Lr(r,e){return r==="3.0"&&e==="3.1"?Vr.map(s=>{const n=Object.create(s);return n.appliesTo={from:"3.0",to:"3.1"},n}):[...du,...Vr].filter(s=>s.appliesTo.from===r&&s.appliesTo.to===e)}class wu{constructor(){this.name="DetectVersion",this.description="Определяет версию конфигурации"}execute(e){try{const s=new Ji().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 yu{constructor(){this.name="ValidateConfig",this.description="Валидирует конфигурацию для указанной версии"}execute(e,t){try{const n=new Cu().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 bu{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 vu{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 Ji().detect(e)},config:e},errors:[],warnings:[],modified:!1}}catch(s){return{success:!1,errors:[`Ошибка при создании резервной копии: ${s}`],warnings:[],modified:!1}}}}class Ji{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 Cu{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(i){return s.push(`Ошибка при валидации: ${i}`),{isValid:!1,errors:s,warnings:n}}}validateV1(e,t,s){const n=["settings.widgetTitle","settings.welcomeMessage","settings.bgChat"];for(const i of n)this.getNestedValue(e,i)||t.push(`Отсутствует обязательное поле: ${i}`)}validateV2(e,t,s){this.validateV1(e,t,s);const n=["settings.loader","settings.buttonStyle","sections.inside.aprooveButton","sections.bottom.warningAlert"];for(const i of n)this.getNestedValue(e,i)||s.push(`Рекомендуется добавить поле V2: ${i}`)}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 i of n)this.getNestedValue(e,i)||s.push(`Рекомендуется добавить поле V3: ${i}`);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 za{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)}}za.commands=new Map([["DetectVersion",()=>new wu],["ValidateConfig",()=>new yu],["CleanConfig",()=>new bu],["BackupConfig",()=>new vu]]);const is=["1.0","2.0","3.0","3.1"],_u=is[is.length-1];class Ma{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 xu{constructor(e){this.logger=e||new Ma,this.versionDetector=new Ji}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 i=this.versionDetector.detect(e);if(!i)return this.createErrorResult("Не удалось определить версию исходной конфигурации",n);if(this.logger.info(`Определена исходная версия: ${i}`),i===t)return this.logger.info("Конфигурация уже соответствует целевой версии"),this.createSuccessResult(e,i,t,[],n);const o=this.buildMigrationPath(i,t);if(o.length===0)return this.createErrorResult(`Не найден путь миграции с ${i} на ${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 p=await this.executeStep(a,d.from,d.to,s);if(!p.success)return this.createErrorResult(`Ошибка на шаге ${d.from} -> ${d.to}: ${p.errors.join(", ")}`,n,p.errors);a=p.data,l.push(...p.appliedStrategies),c.push(...p.warnings)}this.setSchemaVersion(a,t);const u=za.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,i,t,l,n,c)}catch(i){return this.logger.error("Критическая ошибка при миграции",i),this.createErrorResult(`Критическая ошибка: ${i}`,n)}}async dryRun(e,t,s={}){const n=Date.now();try{const i=this.versionDetector.detect(e);if(!i)return this.createFailedReport(n,"unknown",t,"Не удалось определить версию");const a=this.buildMigrationPath(i,t).flatMap(l=>Lr(l.from,l.to));return{timestamp:new Date,fromVersion:i,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} стратегий для миграции с ${i} на ${t}`}}catch(i){return this.createFailedReport(n,"unknown",t,`Ошибка: ${i}`)}}async executeStep(e,t,s,n){const i=Date.now();this.logger.info(`Выполняем шаг: ${t} -> ${s}`);let o=Lr(t,s);if(n.onlyStrategies?.length&&(o=o.filter(p=>n.onlyStrategies.includes(p.name))),n.excludeStrategies?.length&&(o=o.filter(p=>!n.excludeStrategies.includes(p.name))),o.length===0)return this.createErrorResult(`Не найдено стратегий для миграции ${t} -> ${s}`,i);const a={fromVersion:t,toVersion:s,config:e,options:n};let l={...e};const c=[],u=[],d=[];for(const p of o){if(this.logger.debug(`Применяем стратегию: ${p.name}`),!p.canApply({...a,config:l})){this.logger.debug(`Стратегия ${p.name} не применима, пропускаем`);continue}const g=p.apply({...a,config:l});if(g.success)g.modified&&g.data&&(l=g.data),c.push(p.name),d.push(...g.warnings),this.logger.debug(`Стратегия ${p.name} успешно применена`);else if(this.logger.error(`Стратегия ${p.name} завершилась с ошибкой`,g.errors),u.push(...g.errors),n.strict)return this.createErrorResult(`Стратегия ${p.name} завершилась с ошибкой: ${g.errors.join(", ")}`,i,u)}return this.createSuccessResult(l,t,s,c,i,d,u)}buildMigrationPath(e,t){const s=is.indexOf(e),n=is.indexOf(t);if(s===-1||n===-1)return[];const i=[];if(s<n)for(let o=s;o<n;o++)i.push({from:is[o],to:is[o+1]});else if(s>n)return[];return i}createSuccessResult(e,t,s,n,i,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 ku{constructor(e=!0){const t=new Ma(e);this.migrator=new xu(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,_u,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 Su=new ku;async function Tu(r,e){try{const t=await Su.migrateToLatest(r,e);return t.success?t.data:null}catch{return null}}const Ge=r=>typeof r=="string"&&r.length>=0,Or=r=>typeof r=="number"&&!Number.isNaN(r),bs=(r,e)=>typeof r=="string"&&e.includes(r);function Ru(r){const e=[];if(!r||typeof r!="object")return{isValid:!1,errors:["config: must be an object"]};const t=r.settings||{};Or(t.letterSpacing)||t.letterSpacing===void 0||e.push("settings.letterSpacing: number"),Ge(t.bgChat)||t.bgChat===void 0||e.push("settings.bgChat: string"),Ge(t.fontFamily)||t.fontFamily===void 0||e.push("settings.fontFamily: string"),Or(t.fontWeight)||t.fontWeight===void 0||e.push("settings.fontWeight: number"),t.logo===void 0||Ge(t.logo)||e.push("settings.logo: string (svg or url)"),t.widgetTitle===void 0||Ge(t.widgetTitle)||e.push("settings.widgetTitle: string"),t.position===void 0&&e.push("settings.position: undefined");const s=r.texts||{};s.launchIssueTitle===void 0||Ge(s.launchIssueTitle)||e.push("texts.launchIssueTitle: string"),s.issueText===void 0||Ge(s.issueText)||e.push("texts.issueText: string"),s.widgetTitle===void 0||Ge(s.widgetTitle)||e.push("texts.widgetTitle: string"),s.hideText===void 0||Ge(s.hideText)||e.push("texts.hideText: string");const n=r.sections?.top||{},i=n.params||{};i.size===void 0||bs(i.size,["sm","md","lg"])||e.push("sections.top.params.size: sm|md|lg"),i.chipStyle===void 0||bs(i.chipStyle,["filled","outlined","invisible"])||e.push("sections.top.params.chipStyle: filled|outlined|invisible"),i.buttonStyle===void 0||bs(i.buttonStyle,["filled","outlined","invisible"])||e.push("sections.top.params.buttonStyle: filled|outlined|invisible"),i.buttonType===void 0||bs(i.buttonType,["icon","text","both"])||e.push("sections.top.params.buttonType: icon|text|both"),n?.chipWidgetTitle?.color===void 0||Ge(n?.chipWidgetTitle?.color)||e.push("sections.top.chipWidgetTitle.color: string"),n?.chipWidgetTitle?.bgColor===void 0||Ge(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=(r.sections?.bottom||{}).params||{};a.size===void 0||bs(a.size,["sm","md","lg"])||e.push("sections.bottom.params.size: sm|md|lg");const l=r.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 $u{config;constructor(e){this.config=e}getFlatRecursiveConfig(e,t="",s={}){for(const n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;const i=e[n],o=t?`${t}.${n}`:n;i!==null&&typeof i=="object"&&!Array.isArray(i)?this.getFlatRecursiveConfig(i,o,s):s[o]=i}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 zi={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 Mi(r){return r==="sm"||r==="md"||r==="lg"?zi[r]:zi.md}function er(r,e){try{const s={top:"sections.top.params.size",inside:"sections.inside.params.size",bottom:"sections.bottom.params.size"}[e],n=r?.getKey(s);return Mi(n)}catch{return zi.md}}const{defineComponent:Du}=await E("vue"),{normalizeClass:vs,openBlock:nt,createElementBlock:it,createCommentVNode:Bt,toDisplayString:Ir,unref:Yn,normalizeStyle:Qs,withCtx:Xn,createVNode:Qn,createElementVNode:Kr,withModifiers:Fr}=await E("vue"),zu=["aria-expanded"],Mu=["innerHTML"],Bu=["src","alt"],Eu={key:2},Pu={key:0,class:"tw:flex tw:items-center tw:w-full tw:justify-end tw:gap-1.5 header-buttons"},Au=["width","height"],Vu={key:1},Lu=["width","height"],Ou={key:1},{computed:Me}=await E("vue"),Iu=Du({__name:"ChatHeader",props:{isChatOpen:{type:Boolean},toggleChat:{type:Function},configDesignClass:{},sectionBorderRadius:{},mainBorderRadius:{},isPreview:{type:Boolean},isEmbedded:{type:Boolean},restartChat:{type:Function}},setup(r){const e=r,t=Me(()=>e.configDesignClass.getKeyObject("sections.top.params")),s=Me(()=>er(e.configDesignClass,"top")),n=(f,m="px")=>typeof f=="number"?`${f}${m}`:f,i=Me(()=>{let f="";switch(t.value.bgStyle){case"gradient":f=`linear-gradient(180deg, ${t.value.bgColor} 0%, ${e.configDesignClass.getKey("settings.bgChat")} 100%)`;break;case"filled":f=t.value.bgColor;break;case"invisible":f="transparent";break;default:f="transparent";break}const b=!!e.configDesignClass.getKey("settings.globalRoundingRadius")?`${e.mainBorderRadius}px`:n(t.value.borderRadius),y=e.configDesignClass.getKey("settings.container.gradient"),v=t.value.border,C=v?.width>0?`${v.width}px solid ${v.color}`:"none",T=`${t.value.sideMargin}px`;return{borderTopLeftRadius:t.value.bgStyle==="invisible"?0:b,borderTopRightRadius:t.value.bgStyle==="invisible"?0:b,borderBottomLeftRadius:t.value.bgStyle==="invisible"?0:y&&y!=="transparent"?b:0,borderBottomRightRadius:t.value.bgStyle==="invisible"?0:y&&y!=="transparent"?b:0,background:f,padding:`${t.value.paddingVertical}px ${t.value.paddingHorizontal}px`,margin:T,maxWidth:`calc(100% - ${T} * 2)`,borderBottom:C}}),o=Me(()=>{const f=e.configDesignClass.getKey("texts.widgetTitle"),m=e.configDesignClass.getKey("settings.widgetTitle");return f&&f!=="undefined"?f:m&&m!=="undefined"?m:""}),a=Me(()=>e.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")),l=Me(()=>{const f=e.configDesignClass.getKey("sections.top.params.chipStyle"),m=e.configDesignClass.getKey("sections.top.chipWidgetTitle.color"),b=e.configDesignClass.getKey("sections.top.chipWidgetTitle.bgColor"),y=f==="outlined",v=f==="filled",C=f==="invisible";return{borderRadius:e.configDesignClass.getKey("settings.globalRoundingRadius")?e.sectionBorderRadius.borderRadius:e.configDesignClass.getKey("sections.top.chipWidgetTitle.borderRadius")+"px",color:m,border:y?`1px solid ${b}`:"none",padding:C?"0px":null,"background-color":v?b:"transparent"}}),c=Me(()=>e.configDesignClass.getKey("sections.top.buttons.showType")),u=Me(()=>{const f=e.configDesignClass.getKey("sections.top.buttons.showType");return f&&f!=="undefined"?f:"icon"}),d=Me(()=>{const f=e.configDesignClass.getKeyObject("sections.top.buttons");return{color:f?.color??"#fff",bgColor:f?.bgColor??"#000"}}),p=Me(()=>{const f=e.configDesignClass.getKey("sections.top.params.buttonStyle"),m=f==="outlined",b=f==="invisible",y=d.value;return{borderRadius:e.configDesignClass.getKey("settings.globalRoundingRadius")?e.sectionBorderRadius.borderRadius:e.configDesignClass.getKey("sections.top.buttons.borderRadius")+"px",color:y.color,border:m?`1px solid ${y.bgColor}`:"none",padding:b?"0px":null,"background-color":b?"transparent":f==="filled"?y.bgColor:"transparent"}}),g=Me(()=>{const f=e.configDesignClass.getKey("texts.hideText");return f&&f!=="undefined"?f:"Hide"}),w=Me(()=>e.configDesignClass.getKey("settings.logo").includes("<svg")),h=Me(()=>e.configDesignClass.getKey("settings.logo"));return(f,m)=>(nt(),it("div",{onClick:m[0]||(m[0]=(...b)=>f.toggleChat&&f.toggleChat(...b)),class:"chat-action tw:transition-all tw:cursor-pointer tw:flex tw:items-center tw:w-full tw:justify-start tw:overflow-hidden",style:Qs(i.value),role:"button","aria-expanded":f.isChatOpen},[Qn(Yn(ht),{class:vs(["tw:transition-all tw:flex tw:items-center tw:shadow-none header-title",s.value]),variant:a.value,size:f.configDesignClass.getKey("sections.top.params.size"),style:Qs(l.value),type:"button","aria-label":o.value,title:o.value},{default:Xn(()=>[w.value&&f.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")!=="text"?(nt(),it("div",{key:0,class:vs(["header-logo",f.configDesignClass.getKey("sections.top.params.size")]),innerHTML:h.value},null,10,Mu)):h.value&&f.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")!=="text"?(nt(),it("img",{key:1,src:h.value,alt:f.configDesignClass.getKey("sections.top.iconWidget.alt"),class:vs(f.configDesignClass.getKey("sections.top.params.size")==="sm"?"tw:w-3 tw:h-3":"tw:w-4 tw:h-4")},null,10,Bu)):Bt("",!0),f.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")!=="icon"?(nt(),it("span",Eu,Ir(o.value),1)):Bt("",!0)]),_:1},8,["class","variant","size","style","aria-label","title"]),f.isChatOpen?(nt(),it("div",Pu,[Qn(Yn(ht),{variant:c.value,class:vs(["tw:transition-all",[s.value]]),size:f.configDesignClass.getKey("sections.top.params.size"),style:Qs(p.value),type:"button","aria-label":g.value,title:g.value,onClick:Fr(f.restartChat,["stop"])},{default:Xn(()=>[u.value!=="text"?(nt(),it("svg",{key:0,width:f.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",height:f.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m[1]||(m[1]=[Kr("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,Au)):Bt("",!0),u.value!=="icon"?(nt(),it("span",Vu," Restart ")):Bt("",!0)]),_:1},8,["variant","class","size","style","aria-label","title","onClick"]),Qn(Yn(ht),{variant:c.value,class:vs(["tw:transition-all",[s.value]]),size:f.configDesignClass.getKey("sections.top.params.size"),style:Qs(p.value),type:"button","aria-label":g.value,title:g.value,onClick:Fr(f.toggleChat,["stop"])},{default:Xn(()=>[u.value!=="text"?(nt(),it("svg",{key:0,width:f.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",height:f.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m[2]||(m[2]=[Kr("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,Lu)):Bt("",!0),u.value!=="icon"?(nt(),it("span",Ou,Ir(g.value),1)):Bt("",!0)]),_:1},8,["variant","class","size","style","aria-label","title","onClick"])])):Bt("",!0)],12,zu))}}),{shallowRef:Ih,watchEffect:Kh,readonly:Fh,watch:Uh,customRef:Nh,getCurrentScope:Wh,onScopeDispose:Hh,effectScope:jh,getCurrentInstance:Zh,hasInjectionContext:qh,inject:Gh,provide:Yh,ref:Xh,isRef:Qh,unref:Jh,toValue:ep,computed:tp,reactive:sp,toRefs:np,toRef:ip,shallowReadonly:rp,onBeforeMount:op,nextTick:ap,onBeforeUnmount:lp,onMounted:cp,onUnmounted:up,isReactive:dp}=await E("vue");typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ku=r=>typeof r<"u",{isRef:hp,shallowRef:pp,ref:Fu,watchEffect:gp,computed:Uu,inject:fp,defineComponent:mp,h:wp,TransitionGroup:yp,Fragment:bp,shallowReactive:vp,toValue:Cp,unref:_p,getCurrentInstance:Nu,onMounted:xp,watch:Ur,customRef:kp,onUpdated:Sp,readonly:Tp,reactive:Rp,hasInjectionContext:$p,toRaw:Dp,nextTick:Wu,markRaw:zp,getCurrentScope:Mp,isReadonly:Bp,onBeforeUpdate:Ep}=await E("vue");function Hu(r){return JSON.parse(JSON.stringify(r))}function Ba(r,e,t,s={}){var n,i,o;const{clone:a=!1,passive:l=!1,eventName:c,deep:u=!1,defaultValue:d,shouldEmit:p}=s,g=Nu(),w=t||g?.emit||((n=g?.$emit)==null?void 0:n.bind(g))||((o=(i=g?.proxy)==null?void 0:i.$emit)==null?void 0:o.bind(g?.proxy));let h=c;e||(e="modelValue"),h=h||`update:${e.toString()}`;const f=y=>a?typeof a=="function"?a(y):Hu(y):y,m=()=>Ku(r[e])?f(r[e]):d,b=y=>{p?p(y)&&w(h,y):w(h,y)};if(l){const y=m(),v=Fu(y);let C=!1;return Ur(()=>r[e],T=>{C||(C=!0,v.value=f(T),Wu(()=>C=!1))}),Ur(v,T=>{!C&&(T!==r[e]||u)&&b(T)},{deep:u}),v}else return Uu({get(){return m()},set(y){b(y)}})}const{defineComponent:ju}=await E("vue"),{unref:Nr,isRef:Zu,vModelText:qu,normalizeClass:Gu,withDirectives:Yu,openBlock:Xu,createElementBlock:Qu}=await E("vue"),Ju=ju({__name:"Textarea",props:{class:{},defaultValue:{},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=Ba(t,"modelValue",e,{passive:!0,defaultValue:t.defaultValue});return(i,o)=>Yu((Xu(),Qu("textarea",{"onUpdate:modelValue":o[0]||(o[0]=a=>Zu(n)?n.value=a:null),style:{resize:"none"},"data-slot":"textarea",class:Gu(Nr(ko)("tw:md:text-sm",t.class))},null,2)),[[qu,Nr(n)]])}}),{ref:Cs,computed:Wr,unref:ed}=await E("vue");function td(r){const e=()=>ed(r.transcribeUrl),t=Cs(!1),s=Cs(!1),n=Cs(!0),i=Cs(null),o=Cs(0);let a=null,l=[],c=null,u=null;const d=r.maxDuration;(typeof navigator>"u"||!navigator.mediaDevices?.getUserMedia)&&(n.value=!1);const p=()=>{const y=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg"];for(const v of y)if(MediaRecorder.isTypeSupported(v))return v;return"audio/webm"},g=async()=>{if(!(!n.value||t.value))try{i.value=null,l=[],o.value=0,c=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,sampleRate:16e3}});const y=p();a=new MediaRecorder(c,{mimeType:y}),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:y});c&&(c.getTracks().forEach(C=>C.stop()),c=null),await f(v)},a.onerror=()=>{i.value="Recording error",w()},a.start(250),t.value=!0,u=setInterval(()=>{o.value++,o.value>=d&&w()},1e3)}catch(y){y.name==="NotAllowedError"?i.value="Microphone access denied":y.name==="NotFoundError"?i.value="No microphone found":i.value=y.message||"Failed to start recording",i.value&&r.onError?.(i.value)}},w=()=>{a&&t.value&&(a.stop(),t.value=!1)},h=()=>{t.value?w():g()},f=async y=>{s.value=!0,i.value=null;const v=e();if(!v){i.value="Transcribe URL not configured",r.onError?.(i.value),s.value=!1;return}try{const C=new FormData;C.append("audio",y,"recording.webm");const T=await fetch(v,{method:"POST",body:C});if(!T.ok)throw new Error(`HTTP ${T.status}`);const S=await T.json();if(S.success&&S.text)r.onTranscript?.(S.text);else throw new Error(S.error||"Transcription failed")}catch(C){i.value=C.message||"Transcription failed",i.value&&r.onError?.(i.value)}finally{s.value=!1}},m=Wr(()=>{const y=Math.floor(o.value/60),v=o.value%60;return`${y}:${v.toString().padStart(2,"0")}`}),b=Wr(()=>t.value||s.value);return{isRecording:t,isTranscribing:s,isSupported:n,isBusy:b,error:i,recordingDuration:o,formattedDuration:m,startRecording:g,stopRecording:w,toggleRecording:h}}const{defineComponent:sd}=await E("vue"),{createElementVNode:ie,openBlock:_e,createElementBlock:Ie,createTextVNode:Hr,unref:te,withModifiers:Jn,normalizeStyle:xe,withCtx:Js,createVNode:en,createCommentVNode:yt,isRef:nd,withKeys:id,normalizeClass:_s,createBlock:jr,toDisplayString:tn}=await E("vue"),rd={key:0,class:"tw:transition-all tw:w-full"},od=["innerHTML"],ad=["width","height"],ld=["width","height"],cd=["width","height"],ud={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"},dd={key:0,class:"svg-icon"},hd=["innerHTML"],pd={key:1},{computed:re,nextTick:gd,onMounted:fd,ref:md,watch:wd}=await E("vue"),ei=120,yd=sd({__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:{}},emits:["update:messageText","trace"],setup(r,{emit:e}){const t=r,s=re(()=>t.transcribeUrl||t.configDesignClass?.getKey("settings.transcribeUrl")||""),n=re(()=>!!s.value),i=re(()=>t.configDesignClass?.getKey("sections.bottom.btnVoice.color")||t.configDesignClass?.getKey("sections.bottom.inputSend.color")||"#fff"),o=re(()=>t.configDesignClass?.getKey("sections.bottom.btnVoice.bgColor")),a=re(()=>t.configDesignClass?.getKey("sections.bottom.btnVoice.icon.src")||null),l=re(()=>{const x=t.configDesignClass?.getKey("sections.bottom.btnVoice.icon.size");return typeof x=="number"&&Number.isFinite(x)?Math.max(1,x):x==="sm"?16:x==="lg"?24:20}),c=re(()=>`${l.value}px`),u=re(()=>{if(!!t.configDesignClass?.getKey("settings.globalRoundingRadius"))return t.sectionBorderRadius?.borderRadius;const K=t.configDesignClass?.getKey("sections.bottom.btnVoice.borderRadius");return typeof K=="number"?`${K}px`:"9999px"}),d=re(()=>t.configDesignClass?.getKey("sections.bottom.btnVoice.type")),p=re(()=>t.configDesignClass?.getKey("sections.bottom.btnVoice.showType")),{isRecording:g,isTranscribing:w,isSupported:h,formattedDuration:f,toggleRecording:m}=td({transcribeUrl:s,maxDuration:60,onTranscript:x=>{v.value=x},onError:x=>{console.error("Voice recording error:",x)}}),b=()=>{t.sendMessage()},v=Ba(t,"messageText",e,{passive:!0}),C=re(()=>{const x=t.configDesignClass?.getKey("sections.bottom.inputSend.inputStyle");return x==="stacked"||x==="elastic"||x==="inside"?x:"inside"}),T=re(()=>C.value==="stacked"),S=re(()=>C.value==="elastic"),$=md(null),R=()=>{const x=$.value?.$el;return x instanceof HTMLTextAreaElement?x:null},M=()=>{if(!S.value)return;const x=R();if(!x)return;x.style.height="auto";const K=Math.min(x.scrollHeight,ei);x.style.height=`${K}px`,x.style.overflowY=x.scrollHeight>ei?"auto":"hidden"},D=()=>{M()};wd([v,S],async()=>{await gd(),requestAnimationFrame(M)},{immediate:!0});const A=re(()=>er(t.configDesignClass,"bottom")),O=re(()=>{const x=t.configDesignClass.getKey("texts.topWarningText");return x&&x!=="undefined"?x:""}),ee=re(()=>{const x=t.configDesignClass.getKey("texts.disableInputText");return x&&x!=="undefined"?x:""}),B=re(()=>t.configDesignClass.getKey("sections.bottom.inputSend.size")),N=re(()=>t.isInputDisabled&&ee.value?ee.value:O.value||t.configDesignClass.getKey("texts.reconnectText")||"Reconnecting..."),Z=re(()=>t.configDesignClass.getKey("sections.bottom.btnSend.icon.showIcon")?t.configDesignClass.getKey("sections.bottom.btnSend.icon.src"):null),le=re(()=>{const x=t.configDesignClass.getKey("texts.disclaimerText"),K=t.configDesignClass.getKey("texts.disclaimer"),we=x&&x!=="undefined"?x:K,Zt=!!t.configDesignClass.getKey("sections.bottom.params.disclaimerShow");return we&&we!=="undefined"&&Zt?we:""});return fd(()=>{}),(x,K)=>(_e(),Ie("div",null,[x.isProduction?yt("",!0):(_e(),Ie("div",{key:0,class:"tw:flex tw:flex-row tw:gap-2",style:xe({padding:"0 "+x.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px"})},[en(te(ht),{type:"button",style:xe({backgroundColor:"#27272A",borderRadius:x.configDesignClass.getKey("settings.globalRoundingRadius")?x.sectionBorderRadius.borderRadius:x.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:K[0]||(K[0]=Jn(we=>x.$emit("trace",{action:"copyLast"}),["stop"]))},{default:Js(()=>K[3]||(K[3]=[ie("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[ie("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"}),ie("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"}),ie("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),Hr(" Log last function call ")])),_:1,__:[3]},8,["style"]),en(te(ht),{type:"button",class:"tw:flex-shrink-1 tw:flex-grow-1 tw:text-white",style:xe({backgroundColor:"#27272A",borderRadius:x.configDesignClass.getKey("settings.globalRoundingRadius")?x.sectionBorderRadius.borderRadius:x.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px"}),"aria-label":"Copy all",title:"Copy all",onClick:K[1]||(K[1]=Jn(we=>x.$emit("trace",{action:"copyAll"}),["stop"]))},{default:Js(()=>K[4]||(K[4]=[ie("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[ie("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"}),ie("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"}),ie("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"}),ie("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),Hr(" Log all function calls ")])),_:1,__:[4]},8,["style"])],4)),ie("div",{class:"tw:transition-all tw:flex tw:flex-col tw:items-center tw:relative tw:mt-2",style:xe({padding:T.value?"0":"0 "+x.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px"})},[x.showReconnectNotice||O.value||x.isInputDisabled?(_e(),Ie("div",rd,[en(pi,{class:"tw:rounded-b-none tw:mx-0 tw:flex tw:justify-center tw:item s-center tw:px-2 tw:py-2",type:"reconnecting",configDesignClass:x.configDesignClass,headlineText:N.value,restartChat:x.restartChat,warningElement:x.isInputDisabled?x.configDesignClass.getKeyObject("sections.warnings.disableInputIssue"):x.configDesignClass.getKeyObject("sections.warnings.reconnectIssue")},null,8,["configDesignClass","headlineText","restartChat","warningElement"])])):yt("",!0),ie("div",{class:_s(["message-input tw:transition-all tw:flex-1 tw:w-full tw:p-0 tw:gap-[10px] tw:flex",[S.value?"tw:flex-1 tw:min-h-[42px] tw:items-center":x.classSize,T.value?"tw:flex-col tw:items-stretch tw:justify-between":S.value?"":" tw:items-end",B.value==="sm"?"tw:items-center":""]]),style:xe({order:S.value?"1":void 0,...T.value?{borderRadius:x.configDesignClass.getKey("settings.globalRoundingRadius")?x.mainBorderRadius+"px":x.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}:{borderRadius:x.configDesignClass.getKey("settings.globalRoundingRadius")?x.sectionBorderRadius.borderRadius:x.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px"},"background-color":x.configDesignClass.getKey("sections.bottom.inputSend.bgColor"),"margin-bottom":T.value?"0px":x.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px",border:T.value?"none":`${x.configDesignClass.getKey("sections.bottom.inputSend.borderWidth")}px solid ${x.configDesignClass.getKey("sections.bottom.inputSend.borderColor")}`,borderTop:`${x.configDesignClass.getKey("sections.bottom.inputSend.borderWidth")}px solid ${x.configDesignClass.getKey("sections.bottom.inputSend.borderColor")}`})},[(_e(),jr(te(Ju),{class:_s(["tw:transition-all",["tw:w-full tw:outline-none tw:border-0 focus:tw:outline-none",T.value?"tw:h-auto rounded-none":"h-full"]]),placeholder:x.configDesignClass.getKey("texts.inputPlaceholder")||"Type question",rows:S.value?1:B.value==="sm"?2:B.value==="md"?3:4,key:x.configDesignClass.getKey("sections.bottom.inputSend.color"),ref_key:"messageTextareaRef",ref:$,modelValue:te(v),"onUpdate:modelValue":K[2]||(K[2]=we=>nd(v)?v.value=we:null),onKeyup:id(Jn(b,["exact"]),["enter"]),onInput:D,style:xe({alignSelf:T.value?"flex-start":"auto",color:x.configDesignClass.getKey("sections.bottom.inputSend.color"),fontSize:x.configDesignClass.getKey("sections.bottom.inputSend.fontSize")+"px",lineHeight:x.configDesignClass.getKey("settings.lineHeight"),padding:x.configDesignClass.getKey("sections.bottom.inputSend.paddingVertical")+"px "+x.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px",...S.value?{minHeight:x.configDesignClass.getKey("sections.bottom.inputSend.height")+"px",maxHeight:ei+"px",overflowY:"hidden"}:{height:x.configDesignClass.getKey("sections.bottom.inputSend.height")+"px"}})},null,8,["placeholder","rows","modelValue","onKeyup","class","style"])),ie("div",{class:_s([T.value?"tw:flex tw:justify-end tw:items-center tw:gap-2":"tw:flex tw:ml-auto tw:items-center tw:gap-2",S.value?"tw:self-end":""]),style:xe({marginBottom:x.configDesignClass.getKey("sections.bottom.inputSend.paddingVertical")+"px",marginLeft:T.value?x.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px":"0",marginTop:S.value?x.configDesignClass.getKey("sections.bottom.inputSend.paddingVertical")+"px":"0",marginRight:x.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px"})},[n.value&&te(h)?(_e(),jr(te(ht),{key:0,type:"button","data-voice-type":d.value,"data-voice-show-type":p.value,class:_s(["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":te(g)},{"tw:opacity-50 tw:cursor-not-allowed":(te(w)||x.isInputDisabled)&&!x.isPreview}]),size:"icon",style:xe({backgroundColor:te(g)?"#ef4444":o.value,color:te(g)?"#fff":i.value,borderRadius:u.value}),disabled:te(w)||x.isInputDisabled,onClick:te(m),title:te(g)?"Stop recording":"Start voice input"},{default:Js(()=>[!te(g)&&!te(w)&&a.value?(_e(),Ie("div",{key:0,class:"svg-icon",style:xe({width:c.value,height:c.value})},[ie("div",{innerHTML:a.value,style:xe({width:c.value,height:c.value})},null,12,od)],4)):!te(g)&&!te(w)?(_e(),Ie("svg",{key:1,width:l.value,height:l.value,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},K[5]||(K[5]=[ie("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"},null,-1),ie("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"},null,-1),ie("line",{x1:"12",x2:"12",y1:"19",y2:"22"},null,-1)]),8,ad)):te(g)?(_e(),Ie("svg",{key:2,width:l.value,height:l.value,viewBox:"0 0 24 24",fill:"currentColor"},K[6]||(K[6]=[ie("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"},null,-1)]),8,ld)):(_e(),Ie("svg",{key:3,width:l.value,height:l.value,viewBox:"0 0 24 24",fill:"none",class:"tw:animate-spin"},K[7]||(K[7]=[ie("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"2",opacity:"0.25"},null,-1),ie("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1)]),8,cd)),te(g)?(_e(),Ie("span",ud,tn(te(f)),1)):yt("",!0)]),_:1},8,["data-voice-type","data-voice-show-type","class","style","disabled","onClick","title"])):yt("",!0),T.value&&le.value?(_e(),Ie("div",{key:1,class:"tw:text-[11px] tw:flex tw:items-center tw:text-center tw:w-full tw:justify-center",style:xe({...x.sectionBorderRadius,fontSize:x.configDesignClass.getKey("sections.bottom.disclaimer.fontSize")+"px",height:x.configDesignClass.getKey("sections.bottom.disclaimer.height")+"px",color:x.configDesignClass.getKey("sections.bottom.disclaimer.color")})},tn(le.value),5)):yt("",!0),en(te(ht),{class:_s(["tw:transition-all",["btn-send tw:bg-transparent tw:shadow-none tw:flex-shrink-0 tw:items-center tw:gap-1",x.configDesignClass.getKey("sections.bottom.btnSend.showType")==="icon"?"tw:rounded-full":A.value,T.value?"":"tw:ml-auto",{"tw:opacity-50":(te(v).trim()===""||x.isInputDisabled)&&!x.isPreview},{"tw:px-3 tw:py-2":x.configDesignClass.getKey("sections.bottom.btnSend.size")==="md"},{"tw:px-2 tw:py-1":x.configDesignClass.getKey("sections.bottom.btnSend.size")==="sm"},{"tw:px-4 tw:py-3":x.configDesignClass.getKey("sections.bottom.btnSend.size")==="lg"}]]),size:x.configDesignClass.getKey("sections.bottom.btnSend.showType")==="icon"?"icon":x.configDesignClass.getKey("sections.bottom.params.size"),onClick:b,style:xe({...x.configDesignClass.getKey("sections.bottom.btnSend.type")==="icon"?{borderRadius:x.configDesignClass.getKey("settings.globalRoundingRadius")?x.sectionBorderRadius.borderRadius:x.configDesignClass.getKey("sections.bottom.btnSend.borderRadius")+"px"}:{borderRadius:x.configDesignClass.getKey("settings.globalRoundingRadius")?x.sectionBorderRadius.borderRadius:x.configDesignClass.getKey("sections.bottom.btnSend.borderRadius")+"px"},color:x.configDesignClass.getKey("sections.bottom.btnSend.color"),"background-color":x.configDesignClass.getKey("sections.bottom.btnSend.bgColor"),fontSize:x.configDesignClass.getKey("sections.bottom.btnSend.fontSize")+"px",border:x.configDesignClass.getKey("sections.bottom.btnSend.borderWidth")+"px solid "+x.configDesignClass.getKey("sections.bottom.btnSend.borderColor")}),disabled:x.isInputDisabled},{default:Js(()=>[Z.value?(_e(),Ie("div",dd,[ie("div",{innerHTML:Z.value,style:xe({color:x.configDesignClass.getKey("sections.bottom.btnSend.color"),width:x.configDesignClass.getKey("sections.bottom.btnSend.icon.size")+"px",height:x.configDesignClass.getKey("sections.bottom.btnSend.icon.size")+"px"})},null,12,hd)])):yt("",!0),x.configDesignClass.getKey("sections.bottom.btnSend.showType")==="text"||x.configDesignClass.getKey("sections.bottom.btnSend.showType")==="both"?(_e(),Ie("span",pd,tn(x.configDesignClass.getKey("texts.sendButton")),1)):yt("",!0)]),_:1},8,["size","class","style","disabled"])],6)],6),!T.value&&le.value?(_e(),Ie("div",{key:1,class:"tw:px-2 tw:mb-2 tw:flex tw:items-center tw:justify-center",style:xe({...x.sectionBorderRadius,fontSize:x.configDesignClass.getKey("sections.bottom.disclaimer.fontSize")+"px",order:2,height:x.configDesignClass.getKey("sections.bottom.disclaimer.height")+"px",color:x.configDesignClass.getKey("sections.bottom.disclaimer.color")})},tn(le.value),5)):yt("",!0)],4)]))}});var X=(r=>(r.Collapsed="collapsed",r.EmptyChat="empty",r.Messages="messages",r.ActionSnippet="action_snippet",r.LaunchIssue="launch_issue",r.ConnectionIssue="connection_issue",r.ReconnectingAttempt="reconnecting_attempt",r.InputBlocked="input_blocked",r.ActionLoader="action_loader",r.TracesMessage="traces_message",r.TracesWithMeta="traces_with_meta",r))(X||{}),Ea=(r=>(r.UserMessage="Give me some action",r))(Ea||{});class qe{base(e){return{isChatOpen:!0,isChatActive:!0,messages:[],isConnectionError:!1,isProcessError:!1,isReconnectError:!1,isInputDisabled:!1,showWelcome:!1,blockSocket:!0,traceLastShown:!1,...e}}}class bd extends qe{type=X.Collapsed;getState(){return this.base({isChatOpen:!1})}}class Zr extends qe{type=X.EmptyChat;getState(){return this.base({showWelcome:!0,messages:[]})}}class vd extends qe{type=X.Messages;getState(e,t){const s=t?.userMessageText??"Give me some action",n=t?.botMessageText??"What sort of action do you want?";return this.base({showWelcome:!0,messages:[{text:s,isUser:!0},{text:n,isUser:!1},{text:"Sort of action",isUser:!0}]})}}class Cd extends qe{type=X.ActionSnippet;getState(e,t){const s=t?.userMessageText??"Give me some action";return this.base({showWelcome:!1,messages:[{text:s,isUser:!0},{snippet:{sequence:"38952101547613990",id:"38496103561174822",data:{actionCancel:{text:"Cancel"},actionConfirm:{text:"Confirm"},title:{text:"Do you really want to get the available contacts list?"}}},isUser:!1}]})}}class _d extends qe{type=X.LaunchIssue;getState(){return this.base({isConnectionError:!0})}}class xd extends qe{type=X.ConnectionIssue;getState(e,t){const s=t?.userMessageText??"Give me some action",n=!0,i=t?.traceSteps??["Step One","Step Two","Step three"];return this.base({isProcessError:!0,showWelcome:n,messages:[{text:s,isUser:!0},{text:i[0],isUser:!1,isSystem:!0,type:"trace"},{text:i[1],isUser:!1,isSystem:!0,type:"trace"},{text:i[2],isUser:!1,isSystem:!0,type:"trace"}]})}}class kd extends qe{type=X.ReconnectingAttempt;getState(e,t){const s=t?.userMessageText??"Give me some action",n=!0,i=t?.traceSteps??["Step One","Step Two","Step three"];return this.base({isReconnectError:!0,showReconnectNotice:!0,showWelcome:n,messages:[{text:s,isUser:!0},{text:i[0],isUser:!1,isSystem:!0,type:"trace"},{text:i[1],isUser:!1,isSystem:!0,type:"trace"},{text:i[2],isUser:!1,isSystem:!0,type:"trace"}]})}}class Sd extends qe{type=X.InputBlocked;getState(e,t){const s=t?.userMessageText??"Give me some action",n=!0,i=t?.traceSteps??["Step One","Step Two","Step three"];return this.base({isReconnectError:!0,showReconnectNotice:!0,isInputDisabled:!0,showWelcome:n,messages:[{text:s,isUser:!0},{text:i[0],isUser:!1,isSystem:!0,type:"trace"},{text:i[1],isUser:!1,isSystem:!0,type:"trace"},{text:i[2],isUser:!1,isSystem:!0,type:"trace"}]})}}class Td extends qe{type=X.ActionLoader;getState(e,t){const s=t?.userMessageText??"Give me some action";return this.base({showWelcome:!0,messages:[{text:s,isUser:!0}]})}}class Rd extends qe{type=X.TracesMessage;getState(e,t){const s=t?.userMessageText??"Give me some action",n=t?.traceSteps??["Step One","Step Two","Step three"],i=[{text:s,isUser:!0},{text:n[0],isUser:!1,isSystem:!0,type:"trace"},{text:n[1],isUser:!1,isSystem:!0,type:"trace"},{text:n[2],isUser:!1,isSystem:!0,type:"trace"}];return this.base({showWelcome:!0,messages:i})}}class $d extends qe{type=X.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"],i=[{text:s,isUser:!0},{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 this.base({showWelcome:!0,messages:i})}}class Dd{static create(e){switch(e){case X.Collapsed:case"collapsed":return new bd;case X.EmptyChat:case"empty":return new Zr;case X.Messages:case"messages":return new vd;case X.ActionSnippet:case"action_snippet":return new Cd;case X.LaunchIssue:case"launch_issue":return new _d;case X.ConnectionIssue:case"connection_issue":return new xd;case X.ReconnectingAttempt:case"reconnecting_attempt":return new kd;case X.InputBlocked:case"input_blocked":return new Sd;case X.ActionLoader:case"action_loader":return new Td;case X.TracesMessage:case"traces_message":return new Rd;case X.TracesWithMeta:case"traces_with_meta":return new $d;default:return new Zr}}}class qr{static getScenarioFromUrl(){try{return new URLSearchParams(window.location.search).get("scenario")??void 0}catch{return}}static getState(e,t,s){return{...Dd.create(e).getState(t,s),...s??{}}}}const{ref:ti,unref:zd,onUnmounted:Md}=await E("vue");function Bd(r){const e=ti(!1),t=ti(!1),s=ti(null);let n=null,i=null;const o=()=>zd(r.ttsUrl),a=()=>{n&&(n.pause(),n.src="",n=null),i&&(URL.revokeObjectURL(i),i=null)},l=async g=>{const w=o();if(!w)throw s.value="TTS URL not configured",new Error(s.value);if(!g?.trim())throw s.value="No text to speak",new Error(s.value);d(),t.value=!0,s.value=null;try{const h=await fetch(w,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:g.trim(),voice:r.voice||"nova"})});if(!h.ok){const m=await h.json().catch(()=>({}));throw new Error(m.error||`TTS request failed: ${h.status}`)}const f=await h.blob();return i=URL.createObjectURL(f),new Promise((m,b)=>{n=new Audio(i),n.onplay=()=>{e.value=!0,t.value=!1},n.onended=()=>{e.value=!1,a(),m()},n.onerror=()=>{e.value=!1,t.value=!1,s.value="Audio playback failed",a(),b(s.value)},n.play().catch(y=>{t.value=!1,s.value=y.message,b(y)})})}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()},p=g=>{e.value?c():n&&n.paused&&n.currentTime>0?u():g&&l(g)};return Md(()=>{d()}),{isSpeaking:e,isLoading:t,error:s,speak:l,pause:c,resume:u,stop:d,toggle:p}}function tr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var jt=tr();function Pa(r){jt=r}var Vs={exec:()=>null};function I(r,e=""){let t=typeof r=="string"?r:r.source,s={replace:(n,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(ve.caret,"$1"),t=t.replace(n,o),s},getRegex:()=>new RegExp(t,e)};return s}var Ed=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ve={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:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i")},Pd=/^(?:[ \t]*(?:\n|$))+/,Ad=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Vd=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,js=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ld=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,sr=/(?:[*+-]|\d{1,9}[.)])/,Aa=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Va=I(Aa).replace(/bull/g,sr).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(),Od=I(Aa).replace(/bull/g,sr).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(),nr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Id=/^[^\n]+/,ir=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Kd=I(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ir).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Fd=I(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,sr).getRegex(),Rn="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",rr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ud=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",rr).replace("tag",Rn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),La=I(nr).replace("hr",js).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",Rn).getRegex(),Nd=I(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",La).getRegex(),or={blockquote:Nd,code:Ad,def:Kd,fences:Vd,heading:Ld,hr:js,html:Ud,lheading:Va,list:Fd,newline:Pd,paragraph:La,table:Vs,text:Id},Gr=I("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",js).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",Rn).getRegex(),Wd={...or,lheading:Od,table:Gr,paragraph:I(nr).replace("hr",js).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Gr).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",Rn).getRegex()},Hd={...or,html:I(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",rr).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:Vs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:I(nr).replace("hr",js).replace("heading",` *#{1,6} *[^
19
+ ]`).replace("lheading",Va).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},jd=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Zd=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Oa=/^( {2,}|\\)\n(?!\s*$)/,qd=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,$n=/[\p{P}\p{S}]/u,ar=/[\s\p{P}\p{S}]/u,Ia=/[^\s\p{P}\p{S}]/u,Gd=I(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ar).getRegex(),Ka=/(?!~)[\p{P}\p{S}]/u,Yd=/(?!~)[\s\p{P}\p{S}]/u,Xd=/(?:[^\s\p{P}\p{S}]|~)/u,Qd=I(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ed?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Fa=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Jd=I(Fa,"u").replace(/punct/g,$n).getRegex(),e1=I(Fa,"u").replace(/punct/g,Ka).getRegex(),Ua="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",t1=I(Ua,"gu").replace(/notPunctSpace/g,Ia).replace(/punctSpace/g,ar).replace(/punct/g,$n).getRegex(),s1=I(Ua,"gu").replace(/notPunctSpace/g,Xd).replace(/punctSpace/g,Yd).replace(/punct/g,Ka).getRegex(),n1=I("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ia).replace(/punctSpace/g,ar).replace(/punct/g,$n).getRegex(),i1=I(/\\(punct)/,"gu").replace(/punct/g,$n).getRegex(),r1=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(),o1=I(rr).replace("(?:-->|$)","-->").getRegex(),a1=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",o1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Cn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,l1=I(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Cn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Na=I(/^!?\[(label)\]\[(ref)\]/).replace("label",Cn).replace("ref",ir).getRegex(),Wa=I(/^!?\[(ref)\](?:\[\])?/).replace("ref",ir).getRegex(),c1=I("reflink|nolink(?!\\()","g").replace("reflink",Na).replace("nolink",Wa).getRegex(),Yr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,lr={_backpedal:Vs,anyPunctuation:i1,autolink:r1,blockSkip:Qd,br:Oa,code:Zd,del:Vs,emStrongLDelim:Jd,emStrongRDelimAst:t1,emStrongRDelimUnd:n1,escape:jd,link:l1,nolink:Wa,punctuation:Gd,reflink:Na,reflinkSearch:c1,tag:a1,text:qd,url:Vs},u1={...lr,link:I(/^!?\[(label)\]\((.*?)\)/).replace("label",Cn).getRegex(),reflink:I(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Cn).getRegex()},Bi={...lr,emStrongRDelimAst:s1,emStrongLDelim:e1,url:I(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Yr).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",Yr).getRegex()},d1={...Bi,br:I(Oa).replace("{2,}","*").getRegex(),text:I(Bi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},sn={normal:or,gfm:Wd,pedantic:Hd},xs={normal:lr,gfm:Bi,breaks:d1,pedantic:u1},h1={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Xr=r=>h1[r];function ct(r,e){if(e){if(ve.escapeTest.test(r))return r.replace(ve.escapeReplace,Xr)}else if(ve.escapeTestNoEncode.test(r))return r.replace(ve.escapeReplaceNoEncode,Xr);return r}function Qr(r){try{r=encodeURI(r).replace(ve.percentDecode,"%")}catch{return null}return r}function Jr(r,e){let t=r.replace(ve.findPipe,(i,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),s=t.split(ve.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(ve.slashPipe,"|");return s}function ks(r,e,t){let s=r.length;if(s===0)return"";let n=0;for(;n<s&&r.charAt(s-n-1)===e;)n++;return r.slice(0,s-n)}function p1(r,e){if(r.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<r.length;s++)if(r[s]==="\\")s++;else if(r[s]===e[0])t++;else if(r[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function eo(r,e,t,s,n){let i=e.href,o=e.title||null,a=r[1].replace(n.other.outputLinkReplace,"$1");s.state.inLink=!0;let l={type:r[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:o,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,l}function g1(r,e,t){let s=r.match(t.other.indentCodeCompensation);if(s===null)return e;let n=s[1];return e.split(`
20
+ `).map(i=>{let o=i.match(t.other.beginningSpace);if(o===null)return i;let[a]=o;return a.length>=n.length?i.slice(n.length):i}).join(`
21
+ `)}var _n=class{options;rules;lexer;constructor(r){this.options=r||jt}space(r){let e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){let e=this.rules.block.code.exec(r);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:ks(t,`
22
+ `)}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let t=e[0],s=g1(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(r){let e=this.rules.block.heading.exec(r);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=ks(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(r){let e=this.rules.block.hr.exec(r);if(e)return{type:"hr",raw:ks(e[0],`
23
+ `)}}blockquote(r){let e=this.rules.block.blockquote.exec(r);if(e){let t=ks(e[0],`
24
+ `).split(`
25
+ `),s="",n="",i=[];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(`
26
+ `),u=c.replace(this.rules.other.blockquoteSetextReplace,`
27
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
28
+ ${c}`:c,n=n?`${n}
29
+ ${u}`:u;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,i,!0),this.lexer.state.top=d,t.length===0)break;let p=i.at(-1);if(p?.type==="code")break;if(p?.type==="blockquote"){let g=p,w=g.raw+`
30
+ `+t.join(`
31
+ `),h=this.blockquote(w);i[i.length-1]=h,s=s.substring(0,s.length-g.raw.length)+h.raw,n=n.substring(0,n.length-g.text.length)+h.text;break}else if(p?.type==="list"){let g=p,w=g.raw+`
32
+ `+t.join(`
33
+ `),h=this.list(w);i[i.length-1]=h,s=s.substring(0,s.length-p.raw.length)+h.raw,n=n.substring(0,n.length-g.raw.length)+h.raw,t=w.substring(i.at(-1).raw.length).split(`
34
+ `);continue}}return{type:"blockquote",raw:s,tokens:i,text:n}}}list(r){let e=this.rules.block.list.exec(r);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 i=this.rules.other.listItemRegex(t),o=!1;for(;r;){let l=!1,c="",u="";if(!(e=i.exec(r))||this.rules.block.hr.test(r))break;c=e[0],r=r.substring(c.length);let d=e[2].split(`
35
+ `,1)[0].replace(this.rules.other.listReplaceTabs,h=>" ".repeat(3*h.length)),p=r.split(`
36
+ `,1)[0],g=!d.trim(),w=0;if(this.options.pedantic?(w=2,u=d.trimStart()):g?w=e[1].length+1:(w=e[2].search(this.rules.other.nonSpaceChar),w=w>4?1:w,u=d.slice(w),w+=e[1].length),g&&this.rules.other.blankLine.test(p)&&(c+=p+`
37
+ `,r=r.substring(p.length+1),l=!0),!l){let h=this.rules.other.nextBulletRegex(w),f=this.rules.other.hrRegex(w),m=this.rules.other.fencesBeginRegex(w),b=this.rules.other.headingBeginRegex(w),y=this.rules.other.htmlBeginRegex(w);for(;r;){let v=r.split(`
38
+ `,1)[0],C;if(p=v,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),C=p):C=p.replace(this.rules.other.tabCharGlobal," "),m.test(p)||b.test(p)||y.test(p)||h.test(p)||f.test(p))break;if(C.search(this.rules.other.nonSpaceChar)>=w||!p.trim())u+=`
39
+ `+C.slice(w);else{if(g||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||m.test(d)||b.test(d)||f.test(d))break;u+=`
40
+ `+p}!g&&!p.trim()&&(g=!0),c+=v+`
41
+ `,r=r.substring(v.length+1),d=C.slice(w)}}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(r){let e=this.rules.block.html.exec(r);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(r){let e=this.rules.block.def.exec(r);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(r){let e=this.rules.block.table.exec(r);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=Jr(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
42
+ `):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?i.align.push("right"):this.rules.other.tableAlignCenter.test(o)?i.align.push("center"):this.rules.other.tableAlignLeft.test(o)?i.align.push("left"):i.align.push(null);for(let o=0;o<t.length;o++)i.header.push({text:t[o],tokens:this.lexer.inline(t[o]),header:!0,align:i.align[o]});for(let o of n)i.rows.push(Jr(o,i.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[l]})));return i}}lheading(r){let e=this.rules.block.lheading.exec(r);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(r){let e=this.rules.block.paragraph.exec(r);if(e){let t=e[1].charAt(e[1].length-1)===`
43
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);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(r){let e=this.rules.inline.link.exec(r);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 i=ks(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{let i=p1(e[2],"()");if(i===-2)return;if(i>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let s=e[2],n="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],n=i[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)),eo(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(r,e){let t;if((t=this.rules.inline.reflink.exec(r))||(t=this.rules.inline.nolink.exec(r))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[s.toLowerCase()];if(!n){let i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return eo(t,n,t[0],this.lexer,this.rules)}}emStrong(r,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(r);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,i,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*r.length+n);(s=c.exec(e))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(o=[...i].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=r.slice(0,n+s.index+u+o);if(Math.min(n,o)%2){let g=d.slice(1,-1);return{type:"em",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}let p=d.slice(2,-2);return{type:"strong",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(r){let e=this.rules.inline.code.exec(r);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(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r){let e=this.rules.inline.del.exec(r);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(r){let e=this.rules.inline.autolink.exec(r);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(r){let e;if(e=this.rules.inline.url.exec(r)){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(r){let e=this.rules.inline.text.exec(r);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},He=class Ei{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 _n,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:ve,block:sn.normal,inline:xs.normal};this.options.pedantic?(t.block=sn.pedantic,t.inline=xs.pedantic):this.options.gfm&&(t.block=sn.gfm,this.options.breaks?t.inline=xs.breaks:t.inline=xs.gfm),this.tokenizer.rules=t}static get rules(){return{block:sn,inline:xs}}static lex(e,t){return new Ei(t).lex(e)}static lexInline(e,t){return new Ei(t).inlineTokens(e)}lex(e){e=e.replace(ve.carriageReturn,`
44
+ `),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(ve.tabCharGlobal," ").replace(ve.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+=`
45
+ `: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(`
46
+ `)?"":`
47
+ `)+n.raw,o.text+=`
48
+ `+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(`
49
+ `)?"":`
50
+ `)+n.raw,o.text+=`
51
+ `+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 i=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&&(i=e.substring(0,o+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i))){let o=t.at(-1);s&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
52
+ `)?"":`
53
+ `)+n.raw,o.text+=`
54
+ `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(n),s=i.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(`
55
+ `)?"":`
56
+ `)+n.raw,o.text+=`
57
+ `+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 i;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)i=n[2]?n[2].length:0,s=s.slice(0,n.index+i)+"["+"a".repeat(n[0].length-i-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),p;this.options.extensions.startInline.forEach(g=>{p=g.call({lexer:this},d),typeof p=="number"&&p>=0&&(u=Math.min(u,p))}),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}},xn=class{options;parser;constructor(r){this.options=r||jt}space(r){return""}code({text:r,lang:e,escaped:t}){let s=(e||"").match(ve.notSpaceStart)?.[0],n=r.replace(ve.endingNewline,"")+`
58
+ `;return s?'<pre><code class="language-'+ct(s)+'">'+(t?n:ct(n,!0))+`</code></pre>
59
+ `:"<pre><code>"+(t?n:ct(n,!0))+`</code></pre>
60
+ `}blockquote({tokens:r}){return`<blockquote>
61
+ ${this.parser.parse(r)}</blockquote>
62
+ `}html({text:r}){return r}def(r){return""}heading({tokens:r,depth:e}){return`<h${e}>${this.parser.parseInline(r)}</h${e}>
63
+ `}hr(r){return`<hr>
64
+ `}list(r){let e=r.ordered,t=r.start,s="";for(let o=0;o<r.items.length;o++){let a=r.items[o];s+=this.listitem(a)}let n=e?"ol":"ul",i=e&&t!==1?' start="'+t+'"':"";return"<"+n+i+`>
65
+ `+s+"</"+n+`>
66
+ `}listitem(r){return`<li>${this.parser.parse(r.tokens)}</li>
67
+ `}checkbox({checked:r}){return"<input "+(r?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:r}){return`<p>${this.parser.parseInline(r)}</p>
68
+ `}table(r){let e="",t="";for(let n=0;n<r.header.length;n++)t+=this.tablecell(r.header[n]);e+=this.tablerow({text:t});let s="";for(let n=0;n<r.rows.length;n++){let i=r.rows[n];t="";for(let o=0;o<i.length;o++)t+=this.tablecell(i[o]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
69
+ <thead>
70
+ `+e+`</thead>
71
+ `+s+`</table>
72
+ `}tablerow({text:r}){return`<tr>
73
+ ${r}</tr>
74
+ `}tablecell(r){let e=this.parser.parseInline(r.tokens),t=r.header?"th":"td";return(r.align?`<${t} align="${r.align}">`:`<${t}>`)+e+`</${t}>
75
+ `}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${ct(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,tokens:t}){let s=this.parser.parseInline(t),n=Qr(r);if(n===null)return s;r=n;let i='<a href="'+r+'"';return e&&(i+=' title="'+ct(e)+'"'),i+=">"+s+"</a>",i}image({href:r,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let n=Qr(r);if(n===null)return ct(t);r=n;let i=`<img src="${r}" alt="${t}"`;return e&&(i+=` title="${ct(e)}"`),i+=">",i}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:ct(r.text)}},cr=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}checkbox({raw:r}){return r}},je=class Pi{options;renderer;textRenderer;constructor(e){this.options=e||jt,this.options.renderer=this.options.renderer||new xn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new cr}static parse(e,t){return new Pi(t).parse(e)}static parseInline(e,t){return new Pi(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 i=n;switch(i.type){case"space":{t+=this.renderer.space(i);break}case"hr":{t+=this.renderer.hr(i);break}case"heading":{t+=this.renderer.heading(i);break}case"code":{t+=this.renderer.code(i);break}case"table":{t+=this.renderer.table(i);break}case"blockquote":{t+=this.renderer.blockquote(i);break}case"list":{t+=this.renderer.list(i);break}case"checkbox":{t+=this.renderer.checkbox(i);break}case"html":{t+=this.renderer.html(i);break}case"def":{t+=this.renderer.def(i);break}case"paragraph":{t+=this.renderer.paragraph(i);break}case"text":{t+=this.renderer.text(i);break}default:{let o='Token with "'+i.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 i=e[n];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=a||"";continue}}let o=i;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}},Bs=class{options;block;constructor(r){this.options=r||jt}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(){return this.block?He.lex:He.lexInline}provideParser(){return this.block?je.parse:je.parseInline}},f1=class{defaults=tr();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=je;Renderer=xn;TextRenderer=cr;Lexer=He;Tokenizer=_n;Hooks=Bs;constructor(...r){this.use(...r)}walkTokens(r,e){let t=[];for(let s of r)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let n=s;for(let i of n.header)t=t.concat(this.walkTokens(i.tokens,e));for(let i of n.rows)for(let o of i)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(i=>{let o=n[i].flat(1/0);t=t.concat(this.walkTokens(o,e))}):n.tokens&&(t=t.concat(this.walkTokens(n.tokens,e)))}}return t}use(...r){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return r.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 i=e.renderers[n.name];i?e.renderers[n.name]=function(...o){let a=n.renderer.apply(this,o);return a===!1&&(a=i.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 i=e[n.level];i?i.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 xn(this.defaults);for(let i in t.renderer){if(!(i in n))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,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 _n(this.defaults);for(let i in t.tokenizer){if(!(i in n))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,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 Bs;for(let i in t.hooks){if(!(i in n))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,a=t.hooks[o],l=n[o];Bs.passThroughHooks.has(i)?n[o]=c=>{if(this.defaults.async&&Bs.passThroughHooksRespectAsync.has(i))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,i=t.walkTokens;s.walkTokens=function(o){let a=[];return a.push(i.call(this,o)),n&&(a=a.concat(n.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return He.lex(r,e??this.defaults)}parser(r,e){return je.parse(r,e??this.defaults)}parseMarkdown(r){return(e,t)=>{let s={...t},n={...this.defaults,...s},i=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&s.async===!1)return i(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 i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(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=r),n.async)return(async()=>{let o=n.hooks?await n.hooks.preprocess(e):e,a=await(n.hooks?await n.hooks.provideLexer():r?He.lex:He.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():r?je.parse:je.parseInline)(l,n);return n.hooks?await n.hooks.postprocess(c):c})().catch(i);try{n.hooks&&(e=n.hooks.preprocess(e));let o=(n.hooks?n.hooks.provideLexer():r?He.lex:He.lexInline)(e,n);n.hooks&&(o=n.hooks.processAllTokens(o)),n.walkTokens&&this.walkTokens(o,n.walkTokens);let a=(n.hooks?n.hooks.provideParser():r?je.parse:je.parseInline)(o,n);return n.hooks&&(a=n.hooks.postprocess(a)),a}catch(o){return i(o)}}}onError(r,e){return t=>{if(t.message+=`
76
+ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+ct(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},Wt=new f1;function U(r,e){return Wt.parse(r,e)}U.options=U.setOptions=function(r){return Wt.setOptions(r),U.defaults=Wt.defaults,Pa(U.defaults),U};U.getDefaults=tr;U.defaults=jt;U.use=function(...r){return Wt.use(...r),U.defaults=Wt.defaults,Pa(U.defaults),U};U.walkTokens=function(r,e){return Wt.walkTokens(r,e)};U.parseInline=Wt.parseInline;U.Parser=je;U.parser=je.parse;U.Renderer=xn;U.TextRenderer=cr;U.Lexer=He;U.lexer=He.lex;U.Tokenizer=_n;U.Hooks=Bs;U.parse=U;U.options;U.setOptions;U.use;U.walkTokens;U.parseInline;je.parse;He.lex;const{defineComponent:m1}=await E("vue"),{createElementVNode:ye,toDisplayString:to,normalizeClass:nn,normalizeStyle:si,openBlock:Et,createElementBlock:Pt,createCommentVNode:so,withModifiers:no,unref:Jt}=await E("vue"),w1={key:"message",class:"message-text tw:flex tw:items-end tw:gap-1 tw:transition-all"},y1=["innerHTML"],b1=["aria-label"],v1={key:1,width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C1=["aria-label","disabled"],_1={key:1,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{computed:rt,onBeforeUnmount:x1,ref:rn}=await E("vue"),k1=m1({__name:"MessageBot",props:{message:{},welcomeColor:{},color:{},bgColor:{},size:{},bgType:{},fontSize:{},borderWidth:{},borderColor:{},configDesignClass:{},ttsUrl:{}},setup(r){U.setOptions({breaks:!0,gfm:!0});const e=r,t=rt(()=>e.ttsUrl||e.configDesignClass?.getKey("settings.ttsUrl")||""),s=rt(()=>!!t.value),{speak:n,stop:i,isSpeaking:o,isLoading:a}=Bd({ttsUrl:t,voice:"nova"}),l=rn(null),c=rn("idle"),u=rn(!1);let d;const p=()=>{d&&(window.clearTimeout(d),d=void 0)},g=(M=1500)=>{p(),d=window.setTimeout(()=>{c.value="idle"},M)},w=rt(()=>{const M=e.message.chunk?.start?"#2F2F31":e.color,D=e.message.chunk?.start?"transparent":e.bgType==="bubble"?e.bgColor:"transparent";return{color:M,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"?Di(D,.5):D}}),h=()=>{const M=l.value?.innerText?.trim();return M||(e.message.text||"").trim()},f=M=>{const D=document.createElement("textarea");D.value=M,D.setAttribute("readonly",""),D.style.position="fixed",D.style.top="-9999px",D.style.left="-9999px",document.body.appendChild(D),D.select();const A=document.execCommand("copy");return document.body.removeChild(D),A},m=async()=>{const M=h();if(M)try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(M);else if(!f(M))throw new Error("execCommand(copy) failed");c.value="copied",g()}catch(D){console.warn("Copy failed",D),c.value="error",g(2e3)}},b=rt(()=>c.value==="copied"?"Copied":c.value==="error"?"Copy failed":"Copy"),y=rt(()=>u.value||c.value!=="idle"),v=rn(!1),C=rt(()=>a.value?"Loading...":o.value?"Stop":"Speak"),T=rt(()=>v.value||o.value||a.value);x1(()=>{p()});const S=()=>{o.value?i():e.message.text&&n(e.message.text)},$=rt(()=>{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":""}}),R=rt(()=>e.message.text?U.parse(e.message.text):"");return(M,D)=>(Et(),Pt("li",{class:nn(["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]",[$.value,{"item-primary":!M.message.chunk?.start}]]),style:si(w.value)},[ye("div",w1,[ye("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:R.value},null,8,y1),M.message.text&&!M.message.chunk?.start?(Et(),Pt("div",{key:0,class:"tw:relative tw:flex-shrink-0 tw:self-end tw:flex",onMouseenter:D[2]||(D[2]=A=>u.value=!0),onMouseleave:D[3]||(D[3]=A=>u.value=!1)},[ye("span",{class:nn(["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":y.value}]),role:"tooltip"},to(b.value),3),ye("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:no(m,["stop"]),onFocus:D[0]||(D[0]=A=>u.value=!0),onBlur:D[1]||(D[1]=A=>u.value=!1),"aria-label":b.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:si({color:M.color,opacity:.7})},D[8]||(D[8]=[ye("polyline",{points:"20 6 9 17 4 12"},null,-1)]),4)):(Et(),Pt("svg",v1,D[9]||(D[9]=[ye("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),ye("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,b1)],32)):so("",!0),s.value&&M.message.text&&!M.message.chunk?.start?(Et(),Pt("div",{key:1,class:"tw:relative tw:flex-shrink-0 tw:self-end tw:flex",onMouseenter:D[6]||(D[6]=A=>v.value=!0),onMouseleave:D[7]||(D[7]=A=>v.value=!1)},[ye("span",{class:nn(["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":T.value}]),role:"tooltip"},to(C.value),3),ye("button",{class:nn(["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":Jt(o)||Jt(a),"tts-speaking":Jt(o),"tts-loading":Jt(a)}]),onClick:no(S,["stop"]),onFocus:D[4]||(D[4]=A=>v.value=!0),onBlur:D[5]||(D[5]=A=>v.value=!1),"aria-label":C.value,disabled:Jt(a),type:"button"},[Jt(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:si({color:M.color,opacity:.6})},D[10]||(D[10]=[ye("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"},null,-1),ye("line",{x1:"23",y1:"9",x2:"17",y2:"15"},null,-1),ye("line",{x1:"17",y1:"9",x2:"23",y2:"15"},null,-1)]),4)):(Et(),Pt("svg",_1,D[11]||(D[11]=[ye("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),ye("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),ye("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,C1)],32)):so("",!0)])],6))}}),{defineComponent:S1}=await E("vue"),{toDisplayString:T1,normalizeClass:R1,normalizeStyle:$1,openBlock:D1,createElementBlock:z1}=await E("vue"),{computed:io}=await E("vue"),M1=S1({__name:"MessageUser",props:{message:{},isFirst:{type:Boolean},color:{},bgColor:{},borderWidth:{},borderColor:{},fontSize:{},size:{},bgType:{},configDesignClass:{}},setup(r){const e=r,t=io(()=>{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=io(()=>e.bgType==="bubble"?e.borderWidth+"px solid "+e.borderColor:"none");return(n,i)=>(D1(),z1("li",{class:R1(["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":n.isFirst}]]),style:$1({color:n.color,"background-color":n.bgType==="bubble"?n.bgColor:"transparent",border:s.value,"font-size":n.fontSize+"px"})},T1(n.message.text),7))}}),{defineComponent:B1}=await E("vue"),{normalizeStyle:ot,createElementVNode:ke,toDisplayString:ni,openBlock:Ye,createElementBlock:at,createCommentVNode:on,Transition:ro,withCtx:oo,createBlock:E1,unref:P1,normalizeClass:ii,createVNode:A1}=await E("vue"),V1=["innerHTML"],L1={class:"tw:text-sm"},O1=["innerHTML"],I1={key:"dots",class:"tw:flex tw:items-center tw:justify-start tw:gap-1 tw:h-4"},K1={key:"dots-pulse",class:"tw:flex tw:items-center tw:justify-start tw:gap-1 tw:h-4"},F1={key:"circle-pulse",class:"circle-pulse"},U1={key:"circle-pulse-1",class:"circle-pulse-1"},N1=["data-text"],{ref:ao,computed:ri,onMounted:W1,onBeforeUnmount:H1,watch:j1,nextTick:lo}=await E("vue"),co=B1({__name:"LoadingMessage",props:{isProduction:{type:Boolean},loader:{},text:{},message:{},configDesignClass:{},paused:{type:Boolean},color:{},bgColor:{},loadingTime:{}},setup(r){const e=r,t=ao(null),s=ao(!1);let n=null;const i=()=>{const c=t.value;if(!c)return;const u=c.closest("li");if(!u)return;const d=u.nextElementSibling;if(!d){s.value=!1;return}const p=d.getAttribute("data-component")==="MessageBot"||typeof d.matches=="function"&&d.matches('[data-component="MessageBot"]')||!!d.querySelector('[data-component="MessageBot"]');s.value=p},o=ri(()=>e.configDesignClass.getKey("sections.inside.dataAction.type")),a=ri(()=>e.configDesignClass.getKeyObject("sections.inside.dataAction"));W1(()=>{lo(i);const u=t.value?.closest("ul");u&&(n=new MutationObserver(()=>i()),n.observe(u,{childList:!0,subtree:!0}))}),H1(()=>{n&&n.disconnect()}),j1(()=>e.text,()=>lo(i));const l=ri(()=>!!e.paused||s.value);return(c,u)=>(Ye(),at("li",{key:"loading",ref_key:"rootRef",ref:t,class:ii(["message-text-loading tw:flex tw:justify-start tw:max-w-xs tw:overflow-hidden tw:flex-wrap",{"tw:flex-col tw:border":o.value==="box","tw:border tw:px-3 tw:py-2.5":o.value==="outline","tw:!rounded-none":o.value==="compact","tw:items-center tw:gap-3":o.value!=="box"}]),style:ot({borderColor:a.value.strokeColor,borderWidth:a.value.strokeWidth+"px"})},[o.value==="box"?(Ye(),at("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:ot({backgroundColor:a.value.headerFillColor,color:a.value.pastStepColor,borderColor:a.value.strokeColor})},[ke("div",{key:"complete-step-icon",innerHTML:c.configDesignClass.getKey("sections.loader.activeStep.icon.src"),class:"svg-inherit",style:ot({color:c.configDesignClass.getKey("sections.loader.activeStep.icon.color"),height:c.configDesignClass.getKey("sections.loader.activeStep.icon.size")+"px",width:c.configDesignClass.getKey("sections.loader.activeStep.icon.size")+"px"})},null,12,V1),ke("span",L1,ni(a.value.headerText),1)],4)):on("",!0),o.value!=="box"?(Ye(),E1(ro,{key:1,name:"fade",mode:"out-in"},{default:oo(()=>[l.value?(Ye(),at("div",{key:"complete-step-icon",innerHTML:c.configDesignClass.getKey("sections.loader.completeStep.icon.src"),class:"svg-inherit",style:ot({color:c.configDesignClass.getKey("sections.loader.completeStep.icon.color"),height:c.configDesignClass.getKey("sections.loader.completeStep.icon.size")+"px",width:c.configDesignClass.getKey("sections.loader.completeStep.icon.size")+"px"})},null,12,O1)):!c.loader||c.loader==="dots"?(Ye(),at("div",I1,[u[0]||(u[0]=ke("div",{class:"loading-dot tw:rounded-full"},null,-1)),ke("div",{style:ot({backgroundColor:a.value.activeStepColor}),class:"loading-dot loading-dot-delay-1 tw:rounded-full"},null,4),ke("div",{style:ot({backgroundColor:a.value.activeStepColor}),class:"loading-dot loading-dot-delay-2 tw:rounded-full"},null,4),ke("div",{style:ot({backgroundColor:a.value.activeStepColor}),class:"loading-dot loading-dot-delay-3 tw:rounded-full"},null,4)])):c.loader==="dots-pulse"?(Ye(),at("div",K1,u[1]||(u[1]=[ke("span",{class:"dot-pulse dot-1"},null,-1),ke("span",{class:"dot-pulse dot-2"},null,-1),ke("span",{class:"dot-pulse dot-3"},null,-1)]))):c.loader==="circle-pulse"?(Ye(),at("div",F1,u[2]||(u[2]=[ke("span",{class:"ring ring-1"},null,-1),ke("span",{class:"ring ring-2"},null,-1)]))):c.loader==="circle-pulse-1"?(Ye(),at("div",U1,u[3]||(u[3]=[ke("span",{class:"ripple r1"},null,-1),ke("span",{class:"ripple r2"},null,-1),ke("span",{class:"center"},null,-1)]))):on("",!0)]),_:1})):on("",!0),A1(ro,{name:"fade-text",mode:"out-in"},{default:oo(()=>[(Ye(),at("span",{class:ii(["tw:transition-all tw:text-sm",{"typing-shimmer":!l.value,"tw:px-3 tw:py-3":o.value==="box"}]),key:c.text,"data-text":c.message?.text?c.message?.text:c.text,style:ot({color:a.value.activeStepColor,background:o.value==="box"?`linear-gradient(0deg, ${a.value.headerFillColor} 0%, ${P1(Da)(a.value.bodyFillColor,.4)} 100%)`:"transparent"})},ni(l.value?"Thinking completed":c.message?.text?c.message?.text:c.text),15,N1))]),_:1}),c.loadingTime&&l.value&&o.value==="outline"||o.value==="compact"?(Ye(),at("div",{key:2,class:ii(["tw:text-xs",{"tw:w-full tw:-mt-2":o.value==="compact","tw:ml-auto":o.value==="outline"}]),style:ot({color:a.value.pastStepColor})},ni(c.loadingTime)+" seconds total",7)):on("",!0)],6))}}),{defineComponent:Z1}=await E("vue"),{normalizeStyle:Ss,createElementVNode:bt,normalizeClass:an,openBlock:oi,createElementBlock:uo,toDisplayString:ho,unref:q1,withCtx:G1,createBlock:Y1,createCommentVNode:Pp}=await E("vue"),X1=["data-height"],Q1={class:"tw:transition-all tw:relative tw:w-[16px] tw:flex tw:flex-col tw:items-center tw:gap-1 tw:px-1"},J1={class:"tw:transition-all tw:flex tw:items-center tw:gap-2 tw:leading-none"},{computed:Ts}=await E("vue"),eh=Z1({__name:"MessageSystem",props:{isProduction:{type:Boolean},message:{},welcomeColor:{},color:{},bgColor:{},size:{},configDesignClass:{},activeMessage:{type:Boolean},bgType:{},isLast:{type:Boolean},traceLastShown:{type:Boolean},index:{}},setup(r){const e=r,t=Ts(()=>e.index===3&&e.traceLastShown||e.isLast),s=Ts(()=>{switch(e.size){case"sm":return"tw:text-xs";case"md":return"tw:text-xs";case"lg":return"tw:text-base"}}),n=Ts(()=>e.configDesignClass.getKeyObject("sections.inside.dataAction")),i=Ts(()=>t.value?n.value.activeStepColor:n.value.pastStepColor),o=Ts(()=>er(e.configDesignClass,"inside"));return(a,l)=>(oi(),uo("li",{class:an(["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:Ss([{"margin-bottom":"0px !important"},{"padding-top":a.configDesignClass.getKey("sections.loader.completeStep.verticalSpacing")+"px"}]),"data-height":a.configDesignClass.getKey("sections.loader.completeStep.verticalSpacing")},[bt("div",{key:"message",class:an(["message-text flex tw:transition-all tw:space-between tw:gap-3 tw:flex tw:items-center tw:align-center",{"tw:mb-0":a.isLast}])},[bt("div",Q1,[bt("hr",{class:"tw:w-[1px] tw:bg-white tw:opacity-20 tw:absolute",style:Ss([{display:"none"},{height:a.configDesignClass.getKey("sections.loader.completeStep.verticalSpacing")+6+"px",left:"50%",transform:"translateX(-50%)",bottom:"100%"}])},null,4),bt("span",{class:an(["tw:w-[8px] tw:h-[8px] tw:rounded-full",{"tw:bg-white":t.value}]),style:Ss({backgroundColor:i.value})},null,6)]),bt("div",J1,[a.message.meta&&!a.isProduction?(oi(),Y1(q1(ht),{key:0,style:Ss({color:e.activeMessage?"rgba(255, 255, 255, 0.60)":"#3F3F46",background:e.activeMessage?"#2F2F31":"#ECEDEE",border:e.activeMessage?"none":"1px solid #fff"}),class:an(["tw:flex tw:items-center tw:gap-1 tw:rounded-md tw:shadow-xs",o.value])},{default:G1(()=>[l[0]||(l[0]=bt("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[bt("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)),bt("span",null,ho(a.message.text),1)]),_:1,__:[0]},8,["style","class"])):(oi(),uo("p",{key:1,style:Ss({color:i.value,"font-size":a.configDesignClass.getKey("sections.loader.completeStep.fontSize")+"px"})},ho(a.message.text),5))])],2)],14,X1))}});class th{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=new RegExp(`data-visual="${this.escapeRegExp(t)}"`,"g"),i=Object.entries(s.style).map(([o,a])=>`${o}: ${a};`).join("");this.html=this.html.replace(n,`class="${s.class}" style="${i}"`)}),this}result(){return this.html}renderLayout(e,t,s){let n=e;return t&&(Object.entries(t).forEach(([i,o])=>{const a=new RegExp(`\\{${this.escapeRegExp(i)}\\}`,"g");if(o.type==="text"){const l=s?.[i]?.text;n=n.replace(a,this.safeText(typeof l=="string"||typeof l=="number"?String(l):""));return}if(o.type==="button"){const l=s?.[i]?.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?.[i])?s[i]:[],c=o.layout||"",u=o.bindings||{},d=l.map(p=>this.renderLayout(c,u,p)).join("");n=n.replace(a,d);return}}),n=n.replace(/style=\"([^\"]*)\"/g,(i,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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;").replace(/'/g,"&#39;"):e}safeAttr(e){return this.safeText(e)}escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}}const sh={layout:'<div class="tw:flex tw:flex-col" data-visual="container"><div><span data-visual="headerChip">Action</span></div><div class="tw:flex tw:mb-2 tw:mt-2 tw:text-xs"><div data-visual="title">{title}</div></div><div class="tw:flex tw:gap-1"><button data-cb="confirm" data-visual="actionConfirm" class="tw:flex-1">{actionConfirm}</button><button data-cb="cancel" data-visual="actionCancel" class="tw:flex-1">{actionCancel}</button></div></div>',bindings:{title:{type:"text"},actionConfirm:{type:"button"},actionCancel:{type:"button"}}},{computed:pe}=await E("vue");function nh(r){const e=pe(()=>{const y=r?.getKeyObject("sections.inside.activeSnippet"),v=r?.getKeyObject("sections.activeSnippet"),C=y&&y!=="undefined"?y:v;return C&&C!=="undefined"?C:{}}),t=(y,v)=>{if(!v)return y;switch(v){case"outlined":return{color:y.background,background:"transparent",border:`1px solid ${y.borderColor||y.background}`};case"invisible":return{color:y.background,background:"transparent"};default:return y}},s=pe(()=>r?.getKey("sections.inside.activeSnippet.element.bgColor")),n=pe(()=>r?.getKey("sections.inside.activeSnippet.element.color")),i=pe(()=>r?.getKey("sections.inside.activeSnippet.element.sidePadding")),o=pe(()=>r?.getKey("sections.inside.activeSnippet.element.verticalSpacing")),a=pe(()=>r?.getKey("sections.inside.activeSnippet.element.borderWidth")+"px solid "+r?.getKey("sections.inside.activeSnippet.element.borderColor")),l=pe(()=>({color:e.value?.headerChip?.color,background:e.value?.headerChip?.bgColor,borderColor:e.value?.headerChip?.borderColor,bgColor:e.value?.headerChip?.bgColor})),c=pe(()=>t(l.value,e.value?.headerChip?.bgType)),u=pe(()=>({...c.value,"border-radius":r?.getKey("settings.globalRoundingRadius")?Ls(r,2).borderRadius:e.value?.headerChip?.borderRadius+"px","font-size":e.value?.headerChip?.fontSize+"px"})),d=pe(()=>e.value?.propertyColor),p=pe(()=>e.value?.valueColor),g=pe(()=>({color:e.value?.yesButton?.color,background:e.value?.yesButton?.bgColor})),w=pe(()=>({color:e.value?.noButton?.color,background:e.value?.noButton?.bgColor})),h=pe(()=>{const y=r?.getKey("sections.inside.activeSnippet.params.size"),v=r?.getKey("sections.inside.params.size");return Mi(y!=="undefined"?y:v)}),f=pe(()=>{const y=r?.getKey("sections.inside.activeSnippet.headerChip.size");return Mi(y)}),m=y=>{const v=(y.id||"").toLowerCase(),T=v==="confirm"||v==="yes"?g.value:w.value,S=r?.getKey("sections.inside.activeSnippet.params.buttonStyle");return t(T,S)},b=pe(()=>r?.getKey("settings.globalRoundingRadius")?Ls(r,8):{borderRadius:r?.getKey("sections.inside.activeSnippet.element.borderRadius")+"px"});return{containerBg:s,containerColor:n,sidePadding:i,verticalSpacing:o,headerChip:u,propertyColor:d,border:a,valueColor:p,yesButton:g,noButton:w,buttonStyle:m,getButtonStyle:t,actionBtnSizeClass:h,buttonRadiusStyle:b,chipSizeClass:f}}const{defineComponent:ih}=await E("vue"),{openBlock:rh,createElementBlock:oh}=await E("vue"),ah=["innerHTML"],{computed:ln}=await E("vue"),lh=ih({__name:"DynamicSnippet",props:{structure:{},data:{},message:{},configDesignClass:{}},emits:["action"],setup(r,{emit:e}){const t=r,{containerBg:s,containerColor:n,headerChip:i,yesButton:o,noButton:a,actionBtnSizeClass:l,buttonRadiusStyle:c,verticalSpacing:u,sidePadding:d,valueColor:p,getButtonStyle:g,border:w,chipSizeClass:h}=nh(t.configDesignClass),f=ln(()=>t.configDesignClass?.getKey("sections.inside.activeSnippet.params.buttonStyle")),m=ln(()=>({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:w.value,padding:`${d.value}px`,gap:`${u.value}px`})),b=ln(()=>({container:{style:m.value},headerChip:{style:i.value,class:h.value},actionConfirm:{class:l.value,style:{...g(o.value,f.value),flex:"1","line-height":"1","border-radius":t.configDesignClass?.getKey("settings.globalRoundingRadius")?c.value.borderRadius:t.configDesignClass?.getKey("sections.inside.activeSnippet.yesButton.borderRadius")+"px","font-size":t.configDesignClass?.getKey("sections.inside.activeSnippet.yesButton.fontSize")+"px"}},title:{style:{color:p.value,"font-size":t.configDesignClass?.getKey("sections.inside.activeSnippet.element.fontSize")+"px"}},actionCancel:{class:l.value,style:{...g(a.value,f.value),flex:"1","line-height":"1","border-radius":t.configDesignClass?.getKey("settings.globalRoundingRadius")?c.value.borderRadius:t.configDesignClass?.getKey("sections.inside.activeSnippet.yesButton.borderRadius")+"px","font-size":t.configDesignClass?.getKey("sections.inside.activeSnippet.yesButton.fontSize")+"px"}}})),y=e,v=ln(()=>new th(t.structure).build(t.data).buildStyle(b.value).result()),C=T=>{const S=T.target;if(!S)return;const R=S.closest("[data-cb]")?.getAttribute("data-cb");R&&t.message.snippet?.sequence&&y("action",R,t.message.snippet.sequence)};return(T,S)=>(rh(),oh("div",{class:"tw:mt-1 tw:mb-1 tw:max-w-[65%]",onClick:C,innerHTML:v.value},null,8,ah))}}),{defineComponent:ch}=await E("vue"),{unref:po,createElementVNode:go,normalizeClass:ai,normalizeStyle:li,openBlock:At,createElementBlock:cn,createCommentVNode:fo,renderList:uh,Fragment:mo,createBlock:ci,resolveDynamicComponent:dh,renderSlot:hh}=await E("vue"),ph=["innerHTML"],{ref:gh,watch:fh,nextTick:mh,computed:Rs}=await E("vue"),wh=ch({__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","handleSnippetAction"],setup(r,{emit:e}){const t=gh(null),s=r,n=e,i=m=>{m.meta&&n("handleClickMessage",m)},o=Rs(()=>s.configDesignClass.getKey("sections.inside.dataAction.type")),a=Rs(()=>s.configDesignClass.getKeyObject("sections.inside.dataAction")),l=Rs(()=>s.messages.filter((m,b,y)=>!s.isProduction||o.value==="steps"?!0:!(m.type==="usageTokensByAI"&&b===y.length-1||m.isSystem&&y[b+1]?.isSystem)));fh(s.messages,()=>{u()&&c()},{deep:!0});const c=()=>{mh(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})},u=()=>{if(!t.value)return!0;const m=t.value;return m.scrollHeight-m.scrollTop-m.clientHeight<=24},d=()=>{},p=m=>{const b=m.replace("#",""),y=parseInt(b.substr(0,2),16),v=parseInt(b.substr(2,2),16),C=parseInt(b.substr(4,2),16),T=Math.max(0,y-12),S=Math.max(0,v-12),$=Math.max(0,C-12);return`linear-gradient(180deg, rgba(${T}, ${S}, ${$}, 0.95) 0%, rgba(0,0,0, 0) 100%)`},g=Rs(()=>{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"}}),w=Rs(()=>s.configDesignClass.getKey("sections.inside.welcomeMessage.bgType")==="gradient"?p(s.configDesignClass.getKey("sections.inside.welcomeMessage.bgColor")):s.configDesignClass.getKey("sections.inside.welcomeMessage.bgType")==="bubble"?s.configDesignClass.getKey("sections.inside.welcomeMessage.bgColor"):"transparent"),h=m=>s.configDesignClass.getKey("settings.globalRoundingRadius")?s.sectionBorderRadius.borderRadius:s.configDesignClass.getKey(m?"sections.inside.messageUser.borderRadius":"sections.inside.messageBot.borderRadius")+"px",f=m=>{const b=s.messages.findIndex(S=>S===m);let y=null;if(!m.time)return 0;for(let S=b+1;S<s.messages.length;S++)if(s.messages[S]?.chunkId&&!s.messages[S]?.isUser){y=s.messages[S];break}if(!y?.time)return 0;const v=S=>S?Date.parse(S):NaN,C=m.time&&y?.time?v(y.time)-v(m.time):null;return C?Number((S=>S/1e3)(C).toFixed(1)):null};return(m,b)=>(At(),cn("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},[m.showWelcome?(At(),cn("li",{key:0,class:ai(["tw:transition-all",["tw:text-"+(m.configDesignClass.getKey("sections.inside.params.size")==="sm"?"xs":m.configDesignClass.getKey("sections.inside.params.size")==="md"?"sm":"base")]]),style:li({color:m.configDesignClass.getKey("sections.inside.welcomeMessage.color"),"margin-bottom":`${m.configDesignClass.getKey("settings.gapMessageLine")}px`})},[go("div",{key:"message",class:ai(["tw:transition-all",g.value]),style:li({borderRadius:m.configDesignClass.getKey("settings.globalRoundingRadius")?m.sectionBorderRadius.borderRadius:m.configDesignClass.getKey("sections.inside.welcomeMessage.borderRadius")+"px",color:m.configDesignClass.getKey("sections.inside.welcomeMessage.color"),background:w.value,lineHeight:m.configDesignClass.getKey("settings.lineHeight"),fontSize:m.configDesignClass.getKey("sections.inside.welcomeMessage.fontSize")+"px",letterSpacing:m.configDesignClass.getKey("settings.letterSpacing")+"px",border:`${m.configDesignClass.getKey("sections.inside.welcomeMessage.borderWidth")}px solid ${m.configDesignClass.getKey("sections.inside.welcomeMessage.borderColor")}`})},[go("div",{innerHTML:po(hi)(m.configDesignClass.getKey("texts.welcomeMessage"))},null,8,ph)],6)],6)):fo("",!0),(At(!0),cn(mo,null,uh(l.value,(y,v)=>(At(),cn(mo,{key:v},[y.snippet?(At(),ci(lh,{key:0,structure:po(sh),data:y.snippet.data,message:y,configDesignClass:m.configDesignClass,onAction:b[0]||(b[0]=(C,T)=>n("handleSnippetAction",C,T))},null,8,["structure","data","message","configDesignClass"])):(At(),ci(dh(y.isUser?M1:y.isSystem?m.isProduction&&o.value!=="steps"?co:eh:k1),{key:1,message:y,"data-component":y.isSystem?m.isProduction&&o.value!=="steps"?"LoadingMessage":"MessageSystem":"MessageBot",style:li({borderRadius:h(y.isUser),"margin-top":`${l.value[v-1]?.isSystem&&!y.isSystem?"12px":"0px"}`,"margin-bottom":`${y.isSystem?"2px":m.configDesignClass.getKey("settings.gapMessageLine")+"px"}`,lineHeight:m.configDesignClass.getKey("settings.lineHeight"),letterSpacing:m.configDesignClass.getKey("settings.letterSpacing")+"px"}),loader:m.configDesignClass.getKey("settings.loader"),color:y.isUser?m.configDesignClass.getKey("sections.inside.messageUser.color"):m.configDesignClass.getKey("sections.inside.messageBot.color"),welcomeColor:m.configDesignClass.getKey("sections.inside.messageUser.color"),bgType:y.isUser?m.configDesignClass.getKey("sections.inside.messageUser.bgType"):m.configDesignClass.getKey("sections.inside.messageBot.bgType"),bgColor:y.isUser?m.configDesignClass.getKey("sections.inside.messageUser.bgColor"):m.configDesignClass.getKey("sections.inside.messageBot.bgColor"),size:y.isUser?m.configDesignClass.getKey("sections.inside.messageUser.size"):m.configDesignClass.getKey("sections.inside.messageBot.size"),fontSize:y.isUser?m.configDesignClass.getKey("sections.inside.messageUser.fontSize"):m.configDesignClass.getKey("sections.inside.messageBot.fontSize"),borderWidth:y.isUser?m.configDesignClass.getKey("sections.inside.messageUser.borderWidth"):m.configDesignClass.getKey("sections.inside.messageBot.borderWidth"),borderColor:y.isUser?m.configDesignClass.getKey("sections.inside.messageUser.borderColor"):m.configDesignClass.getKey("sections.inside.messageBot.borderColor"),index:v,isProduction:m.isProduction||!1,loadingTime:y.isUser?0:f(y),traceLastShown:m.traceLastShown,configDesignClass:m.configDesignClass,ttsUrl:m.ttsUrl,activeMessage:m.activeMessage===y,isLast:v===l.value.length-1,onClick:C=>i(y)},null,8,["message","data-component","style","loader","color","welcomeColor","bgType","bgColor","size","fontSize","borderWidth","borderColor","index","isProduction","loadingTime","traceLastShown","configDesignClass","ttsUrl","activeMessage","isLast","onClick"]))],64))),128)),m.isLoading?(At(),ci(co,{key:1,class:ai({"tw:mt-8":m.traceLastShown}),isProduction:m.isProduction||!1,loader:m.configDesignClass.getKey("settings.loader"),configDesignClass:m.configDesignClass,color:a.value.headerText,bgColor:a.value.headerFillColor,text:m.configDesignClass.getKey("texts.typingLoader")},null,8,["class","isProduction","loader","configDesignClass","color","bgColor","text"])):fo("",!0),hh(m.$slots,"footer")],544))}}),{defineComponent:yh}=await E("vue"),{createVNode:bh,normalizeStyle:vh,openBlock:Ch,createElementBlock:_h}=await E("vue"),{computed:wo}=await E("vue"),xh=yh({__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","handleSnippetAction"],setup(r,{emit:e}){const t=r,s=wo(()=>t.ttsUrl),n=e,i=wo({get:()=>t.activeMessage,set:o=>n("update:activeMessage",o)});return(o,a)=>(Ch(),_h("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:(o.configDesignClass.getKey("sections.inside.params.sidePadding")??8)+"px",paddingRight:(o.configDesignClass.getKey("sections.inside.params.sidePadding")??8)+"px",paddingTop:(o.configDesignClass.getKey("sections.inside.params.verticalPadding")??8)/2+"px"}])},[bh(wh,{messages:o.messages,isPreview:o.isPreview,isEmbedded:o.isEmbedded,configDesignClass:o.configDesignClass,isLoading:o.isLoading,isStreaming:o.isStreaming,isProduction:o.isProduction,sectionBorderRadius:o.sectionBorderRadius,showWelcome:o.showWelcome,ttsUrl:s.value,activeMessage:i.value,"onUpdate:activeMessage":a[0]||(a[0]=l=>i.value=l),traceLastShown:o.traceLastShown,onHandleClickMessage:a[1]||(a[1]=l=>o.$emit("handleClickMessage",l)),onHandleSnippetAction:a[2]||(a[2]=(l,c)=>n("handleSnippetAction",l,c))},null,8,["messages","isPreview","isEmbedded","configDesignClass","isLoading","isStreaming","isProduction","sectionBorderRadius","showWelcome","ttsUrl","activeMessage","traceLastShown"])],4))}}),{defineComponent:kh}=await E("vue"),{vShow:yo,createVNode:es,withDirectives:bo,normalizeStyle:$s,createElementVNode:vo,openBlock:Vt,createElementBlock:ts,createCommentVNode:ui,createBlock:Sh,Transition:Th,withCtx:Rh,normalizeClass:Co}=await E("vue"),$h={key:0,class:"chat tw:w-full tw:h-full tw:flex tw:pt-0 tw:relative",style:{overflow:"hidden"}},Dh={key:0,class:"tw:w-full tw:h-full"},zh={key:1,class:"messages tw:transition-all tw:flex tw:flex-col tw:justify-between tw:w-full"},{ref:j,shallowRef:Mh,watchEffect:Bh,onMounted:_o,onUnmounted:xo,onBeforeMount:Eh,watch:un,computed:lt,nextTick:di}=await E("vue"),Ph="https://hs-generator.onrender.com/api/transcribe",Ah="https://hs-generator.onrender.com/api/tts",Ds=0,Ap=kh({__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(r,{expose:e,emit:t}){const s=t,n=j(!1),i=j(!1),o=j(null),a=j(!1),l=j(!1),c=j(!1),u=j(!1),d=j(!0),p=j(!1),g=j(!1),w=j(!1),h=j(0),f=j(!1),m=j(null),b=r,y=async()=>{if(!(b.isPreview||b.scenario))try{s("restart-chat"),Ga(),await Zs()}catch(_){console.error("Failed to restart chat connection",_)}},v=lt(()=>{const _=B.value.getKey("settings.position"),k=B.value.getKey("settings.offset.x"),z=B.value.getKey("settings.offset.y"),P=W.value?B.value.getKey("settings.size.width"):B.value.getKey("sections.colapsed.width"),q=W.value?B.value.getKey("settings.size.height"):B.value.getKey("sections.colapsed.height");return{...{..._==="topLeft"?{top:z+"px",left:k+"px"}:{},..._==="topRight"?{top:z+"px",right:k+"px"}:{},..._==="bottomLeft"?{bottom:z+"px",left:k+"px"}:{},..._==="bottomRight"?{bottom:z+"px",right:k+"px"}:{},..._==="top"?{top:z+"px",left:"50%",transform:"translateX(-50%)"}:{},..._==="bottom"?{bottom:z+"px",left:"50%",transform:"translateX(-50%)"}:{},..._==="left"?{left:k+"px",top:"50%",transform:"translateY(-50%)"}:{},..._==="right"?{right:k+"px",top:"50%",transform:"translateY(-50%)"}:{}},width:W.value&&!$t.value?P+"px":void 0,height:W.value||$t.value?q+"px":void 0}}),C=()=>{if(b.configLink)return b.configLink;const k=new URLSearchParams(window.location.search).get("config");if(k)return k},T=j(null),S=j(null),$=j(null),R=()=>$.value?$.value:C()?S.value&&typeof S.value=="object"?S.value:V:b.configWidget?b.configWidget:V,M=Mh(V);Bh(async _=>{const k=R();let z=!1;_(()=>{z=!0}),console.log("test");const P=await Tu(k,{verbose:!0});if(z)return;const q=P??k,{isValid:he,errors:Ne}=Ru(q);if(console.log(q),!he){console.warn("[HSW] Invalid widget config (after migration), falling back to DEFAULT_CONFIG:",Ne),M.value=V;return}M.value=q});const D=_=>{T.value=_,s("choose-trace",{action:_.type,messages:[_]})},A=async()=>{s("choose-trace",{action:"copyAll",messages:Y.value})},O=async()=>{if(Y.value.length===0){s("choose-trace",{action:"copyLast",messages:[]});return}let _=-1;for(let z=Y.value.length-1;z>=0;z--)if(Y.value[z].isUser){_=z;break}const k=_>=0?_:0;s("choose-trace",{action:"copyLast",messages:Y.value.slice(k)})},ee=async _=>{switch(_.action){case"copyLast":await O();break;case"copyIteration":await O();break;case"copyAll":await A();break}},B=lt(()=>new $u(M.value)),N=lt(()=>To(B.value)),Z=lt(()=>Ls(B.value,8)),le=lt(()=>B.value.getConfig().settings.container),x=lt(()=>{const _=le.value;if(!_)return!1;const k=_.innerBorder,z=_.outerBorder;return(k?.width??0)>0||(z?.width??0)>0?k?.width!==0||z?.width!==0:!1}),K=lt(()=>{const _=le.value,k=B.value.getKey("settings.bgChat"),z=_?.gradient,P=z?`linear-gradient(360deg, ${k} 78.99%, ${z} 100%)`:"",q=typeof z=="string"&&z.trim()&&z!=="transparent"?P:k,he=_?.innerBorder?.width??0,Ne=_?.innerBorder?.color??"transparent",We=_?.innerBorder?.style??"solid",Pn=_?.outerBorder?.width??0,tl=_?.outerBorder?.color??"transparent",sl=_?.outerBorder?.style??"solid",mt={background:q,borderRadius:`${String(N.value)}px`};return mt["--hsw-container-radius"]=`${String(N.value)}px`,mt["--hsw-container-inner-width"]=`${he}px`,mt["--hsw-container-inner-color"]=Ne,mt["--hsw-container-inner-style"]=We,mt["--hsw-container-outer-width"]=`${Pn}px`,mt["--hsw-container-outer-color"]=tl,mt["--hsw-container-outer-style"]=sl,mt}),we=lt(()=>{switch(B.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]"}}),W=j(!0),Zt=()=>{const _=o.value;if(!_)return{width:56,height:56};const k=_.querySelector(".chat-action");if(!k)return{width:56,height:56};const z=k.getBoundingClientRect();return{width:Math.max(1,z.width),height:Math.max(1,z.height)}},Ce=j(!1),st=async _=>{if(Ce.value)return;Ce.value=!0;const k=o.value;if(!k||_===W.value)return;const z=k.querySelector(".chatWrapper"),P=z?.querySelector(".chat");if(_){const q=k.querySelector(".chat-collapsed");q&&(F.killTweensOf(q),F.to(q,{opacity:1,duration:.15,ease:"power2.in"}));const{height:he,width:Ne}=Zt();await new Promise(Pn=>setTimeout(Pn,150)),W.value=!0,await di();const We=Math.max(he||0,Ne||0)||56;F.killTweensOf(k),P&&F.killTweensOf(P),z&&F.killTweensOf(z),F.set(k,{width:We,height:We,overflow:"hidden",opacity:0,willChange:"width, height, opacity"}),z&&F.set(z,{opacity:0,willChange:"opacity"}),P&&F.set(P,{opacity:0,willChange:"opacity"}),F.set(k,{width:We,height:We,overflow:"hidden",opacity:0,willChange:"width, height, opacity"}),F.to(k,{width:B.value.getKey("settings.size.width"),height:B.value.getKey("settings.size.height"),opacity:1,duration:.4,ease:"power2.out",onComplete:()=>{F.set(k,{clearProps:"overflow,position,left,top,xPercent,yPercent,marginTop,willChange,opacity"}),Ce.value=!1}}),z&&F.to(z,{opacity:1,duration:.3,delay:.35,ease:"power2.out",onComplete:()=>{F.set(z,{clearProps:"willChange,opacity"})}}),P&&F.to(P,{opacity:1,duration:.3,delay:.15,ease:"power2.out",onComplete:()=>{F.set(P,{clearProps:"willChange"})}})}else{const q=B.value.getKey("sections.colapsed.height")+B.value.getKey("sections.colapsed.borderWidth")*2;F.killTweensOf(k),P&&F.killTweensOf(P),z&&F.killTweensOf(z),F.set(k,{width:B.value.getKey("settings.size.width"),height:B.value.getKey("settings.size.height"),overflow:"hidden",willChange:"width, height, opacity"}),z&&(F.set(z,{willChange:"opacity"}),F.to(z,{opacity:0,duration:.5,ease:"power3.inOut",onComplete:()=>{F.set(z,{clearProps:"willChange,opacity"})}})),P&&(F.set(P,{willChange:"opacity"}),F.to(P,{opacity:0,duration:.2,ease:"power2.in",onComplete:()=>{F.set(P,{clearProps:"willChange"})}})),F.to(k,{width:q,height:q,opacity:0,duration:.35,marginTop:0,ease:"power2.inOut",onComplete:()=>{W.value=!1,di().then(()=>{const he=k.querySelector(".chat-collapsed");he&&(F.set(he,{opacity:0}),F.to(he,{opacity:1,duration:.25,ease:"power2.out"})),F.set(k,{opacity:1})}),F.set(k,{clearProps:"overflow,position,left,top,xPercent,yPercent,marginTop,willChange"}),Ce.value=!1}})}},ft=j(b.isPreview||!1),$t=j(b.isEmbedded||!1);un(()=>b.isEmbedded,_=>{$t.value=_});const Ha=j(!!b.isPreview),qt=j(b.widgetId||`hsw-${Math.random().toString(36).slice(2,10)}`),Y=j([]),Gt=j("");let ce=null,Dt=0;const ja=lt(()=>Y.value.length>0&&Y.value[Y.value.length-1].isUser===!0||l.value),Dn=j(null),Za=(_,k)=>{console.log("handleSnippetAction",_,k),dr({action:{sequence:k,command:_,data:{}}})},Oe=_=>{if(_.chunkId&&_.text){const k=Y.value[Y.value.length-1];k.chunkId===_.chunkId?(_.chunk?.start?k.text="":k.text+=_.text,k.chunk.start=!1):Y.value.push(_)}else Y.value.push(_)},gs=(()=>{if(b.link)return b.link;const k=new URLSearchParams(window.location.search).get("link");if(k)return k;const P=new URLSearchParams(window.location.hash.substring(1)).get("link");if(P)return P;try{const q="ws://localhost:8080/client/widget-chat/v1/ws/?token=T5JFw1oz4SNp6XVjv3nc8CU6X3oQ3wi-WZpRmCeWIQ7n8aLwLF_Om6bGDAP1DKr3Qzfu3r6z1IsNIg19cO0yl9rZQeW9ZlHGztdcUKTnukc-QFGJaHk7yEE0K7P4ofUqKaQZLnHqAGA7c4MLizAQpHM2KWo";if(q)return q}catch(q){console.warn("Environment variables not available:",q)}return console.log("Using fallback link: ws://localhost:3000"),"ws://localhost:3000"})(),ur=()=>{if(Dt>=Ds){Oe({text:`Failed to connect after ${Ds} attempts. Please check your connection.`,isUser:!1});return}Dt++,console.log(`Reconnection attempt ${Dt}/${Ds}`),setTimeout(()=>{zn()},2e3*Dt)},qa=()=>{Oe({text:Ea.UserMessage,isUser:!0}),Oe({text:"{Agent response message}",isUser:!1})},zn=()=>{try{if(!gs||typeof gs!="string"){console.error("Invalid WebSocket link:",gs),Oe({text:"Error: Invalid WebSocket URL",isUser:!1});return}if(console.log("Attempting to connect to:",gs),ce=new WebSocket(gs),!ce){console.error("Failed to create WebSocket instance");return}ce.onmessage=_=>{try{const k=JSON.parse(_.data);if(k.snippet)return Oe({snippet:{...k.snippet,data:JSON.parse(k.snippet.data||"{}")},isUser:!1,isSystem:!0,isError:!1});if(k.error)return Oe({text:k.error.message,isUser:!1,isSystem:!0,isError:!0});if(k?.textChunk?.start&&(f.value=!0,m.value=k?.textChunk?.start,Oe({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&&m.value&&k?.textChunk?.end===m.value&&(f.value=!1,m.value=null);return}k?.textChunk?.text&&Oe({text:k.textChunk.text,isUser:!1,chunkId:k?.textChunk?.id}),k?.trace&&Oe({text:k.trace.message,isUser:!1,isSystem:!0,meta:k.trace.meta,time:k.trace.time,type:k.trace.type}),k?.trace?.meta&&!b.isProduction&&s("trace",{action:k.trace.type,messages:[k.trace]})}catch(k){console.error("Error parsing WebSocket message:",k),Oe({text:"Error: Failed to parse server response",isUser:!1})}},ce.onopen=()=>{Dt=0},ce.onclose=_=>{console.log("Connection closed",_);let k=`Connection closed (${_.code})`;switch(_.code){case 1e3:k="Connection closed normally";break;case 1001:k="Connection closed: going away";break;case 1006:if(u.value=!0,Dt<Ds&&!ft.value){ur();return}break;case 1011:k="Connection closed: server error";break;default:c.value=!0}console.log(k)},ce.onerror=_=>{console.error("WebSocket connection error:",_),a.value=!0,Oe({text:"Connection error: Unable to connect to chat server",isUser:!1,isSystem:!0,isError:!0}),Dt<Ds&&!ft.value&&ur()}}catch(_){console.error("Error connecting to socket server:",_),Oe({text:`Connection error: ${_ instanceof Error?_.message:"Unknown error"}`,isUser:!1,isSystem:!0,isError:!0})}},Ga=()=>{ce&&ce.close(),ce=null};xo(()=>{ce&&ce.close()});const Mn=_=>{(b.isPreview||b.scenario)&&!_||st(!W.value)},Ya=()=>{if(!(b.isPreview||b.scenario)&&Gt.value.trim()!==""){if(b.isProduction&&Y.value.length>0){const _=Y.value[Y.value.length-1];_.isSystem===!0&&!_.isError&&!_.snippet&&Y.value.pop()}Y.value.push({text:Gt.value,isUser:!0,time:new Date().toISOString()}),f.value=!0,dr({message:Gt.value}),Gt.value=""}},dr=_=>{ce&&ce.send(JSON.stringify(_))},hr=()=>{try{const _=B.value.getKey("settings.fontFamily")||"MacPaw Fixel",k=`https://fonts.googleapis.com/css2?family=${_.replace(/\s+/g,"+")}:wght@300;400;500;600;700&display=swap`,z=document.createElement("link");z.rel="preload",z.as="style",z.href=k,document.head.appendChild(z);const P=document.createElement("link");P.rel="stylesheet",P.href=k,P.setAttribute("data-google-font","true"),document.head.appendChild(P),o.value&&(o.value.style.fontFamily=`"${_}", sans-serif`)}catch(_){console.error("Error loading font:",_)}},pr=()=>{const _=B.value.getKey("settings.fontWeight")||400;o.value&&(o.value.style.fontWeight=_)};i.value=!0,un(()=>B.value.getKey("settings.fontFamily"),()=>{hr()}),un(()=>B.value.getKey("settings.fontWeight"),()=>{pr()});const Xa=async()=>{if(C()){const k=await(await fetch(C()+"config")).json();S.value=k,n.value=!0}else n.value=!0},Bn=(_,k,z)=>new Promise(P=>{const q=performance.now(),he=Ne=>{const We=Math.min(1,(Ne-q)/z);h.value=_+(k-_)*We,We<1?requestAnimationFrame(he):P()};requestAnimationFrame(he)}),gr=async _=>{w.value=!0,h.value=0,await di(),await Bn(0,.3,500),_(),await Bn(.3,.6,200),h.value=.6,await new Promise(k=>setTimeout(k,100)),await Bn(.6,0,500),w.value=!1},Qa=async(_=25)=>{const k=Y.value.filter(P=>!P.isUser&&!P.isSystem&&P.text);if(!k.length)return;const z=k.map(P=>P.text||"");k.forEach(P=>P.text="");for(let P=0;P<k.length;P++){const q=k[P],he=z[P];for(let Ne=0;Ne<he.length;Ne++)q.text=he.slice(0,Ne+1),await new Promise(We=>setTimeout(We,_))}},En=async(_,k)=>{await gr(()=>{const z=qr.getState(_,B.value,k||b.scenarioOptions);if(W.value=z.isChatOpen,Y.value=z.messages,l.value=z.traceLastShown,a.value=z.isConnectionError,c.value=z.isProcessError,u.value=z.isReconnectError,p.value=z.isInputDisabled,d.value=z.showWelcome,g.value=z.showReconnectNotice??!1,Dn.value=z.snippet??null,ft.value=!0,ce){try{ce.close()}catch{}ce=null}}),Qa()},Zs=async()=>{await gr(()=>{ft.value=Ha.value,d.value=!0,p.value=!1,g.value=!1,a.value=!1,c.value=!1,u.value=!1,Y.value=[],ft.value||(!ce||ce.readyState!==1)&&zn()})};Eh(async()=>{await Xa()}),_o(async()=>{hr(),pr();const _=b.scenario??qr.getScenarioFromUrl();if(_){await En(_);return}if(b.isPreview){qa();return}zn()}),un(()=>b.scenario,async _=>{_?await En(_):await Zs()});const ze={id:qt,setScenario:async(_,k)=>{await En(_,k)},clearScenario:async()=>{await Zs()},toggleChat:()=>{Mn(!0)},setOpen:_=>{W.value=_},setActive:_=>{_&&!W.value&&(W.value=!0)},setInputDisabled:_=>{p.value=_},setShowReconnectNotice:_=>{g.value=_},setMessages:_=>{Y.value=Array.isArray(_)?_:[]},pushMessage:_=>{Y.value.push(_)},setSnippet:_=>{Dn.value=_??null},resetToLive:async()=>{await Zs()},setConfig:_=>{$.value=JSON.parse(JSON.stringify(_))},getConfig:()=>M.value},Ja=()=>{const _=window;_.hswWidgets=_.hswWidgets||{},_.hswWidgets[qt.value]=ze,window.dispatchEvent(new CustomEvent("hsw:ready",{detail:{widgetId:qt.value}}))},el=()=>{const _=window;_.hswWidgets&&_.hswWidgets[qt.value]&&delete _.hswWidgets[qt.value]},fr=async _=>{const k=_,z=k.detail?.widgetId;if(z&&z!==qt.value)return;const{action:P}=k.detail;switch(P){case"setScenario":await ze.setScenario(k.detail.payload.type,k.detail.payload.options);break;case"clearScenario":await ze.clearScenario();break;case"setOpen":ze.setOpen(k.detail.payload);break;case"setActive":ze.setActive(k.detail.payload);break;case"setInputDisabled":ze.setInputDisabled(k.detail.payload);break;case"setShowReconnectNotice":ze.setShowReconnectNotice(k.detail.payload);break;case"setMessages":ze.setMessages(k.detail.payload);break;case"pushMessage":ze.pushMessage(k.detail.payload);break;case"setSnippet":ze.setSnippet(k.detail.payload);break;case"resetToLive":await ze.resetToLive();break;case"setConfig":ze.setConfig(k.detail.payload);break}};return _o(()=>{Ja(),window.addEventListener("hsw:control",fr)}),xo(()=>{el(),window.removeEventListener("hsw:control",fr)}),e(ze),(_,k)=>n.value?(Vt(),ts("div",{key:0,class:Co(["tw:z-[999] tw:flex tw:justify-end component-isolator tw:transition-all chatContainer",{"tw:fixed":!$t.value,"tw:w-full":W.value}]),style:$s({letterSpacing:B.value.getKey("settings.letterSpacing")+"px",...v.value}),ref_key:"chatWrapperRef",ref:o},[bo(es(Jc,{toggleChat:Mn,element:B.value.getKeyObject("sections.colapsed")},null,8,["element"]),[[yo,!W.value]]),bo(vo("div",{class:Co(["chatWrapper tw:w-full tw:backdrop-blur-[22px] tw:flex tw:items-center tw:border-0 tw:flex-col",[{"chatWrapper--pseudoBorders":x.value,"tw:h-auto tw:shadow-2xl chat-active":W.value,"tw:shadow-lg tw:w-fit":!W.value,"chat-embedded tw:w-full tw:h-full tw:static tw:top-0 tw:left-0":$t.value}]]),style:$s(K.value)},[es(Iu,{isChatOpen:W.value,toggleChat:Mn,configDesignClass:B.value,sectionBorderRadius:Z.value,mainBorderRadius:N.value,isPreview:ft.value,isEmbedded:$t.value,isProduction:_.isProduction||!1,restartChat:y},null,8,["isChatOpen","configDesignClass","sectionBorderRadius","mainBorderRadius","isPreview","isEmbedded","isProduction"]),W.value?(Vt(),ts("div",$h,[a.value?(Vt(),ts("div",Dh,[vo("div",{class:"tw:absolute tw:left-0 tw:top-0 tw:w-full tw:h-full",style:$s({padding:B.value.getKey("sections.warnings.launchIssue.content.sidePadding")+"px"})},[es(pi,{type:"launchIssue",class:"tw:h-full",headlineText:B.value.getKey("texts.launchIssueTitle"),descriptionText:B.value.getKeyObject("texts.launchIssueText"),warningElement:B.value.getKeyObject("sections.warnings.launchIssue"),configDesignClass:B.value,isProcessError:c.value,restartChat:y},null,8,["headlineText","descriptionText","warningElement","configDesignClass","isProcessError"])],4)])):(Vt(),ts("div",zh,[es(xh,{messages:Y.value,isPreview:ft.value,isEmbedded:$t.value,configDesignClass:B.value,isLoading:ja.value,isStreaming:f.value,isProduction:_.isProduction,sectionBorderRadius:Z.value,showWelcome:d.value,ttsUrl:Ah,activeMessage:T.value,"onUpdate:activeMessage":k[0]||(k[0]=z=>T.value=z),isProcessError:c.value,snippet:Dn.value,traceLastShown:l.value,onHandleClickMessage:D,onHandleSnippetAction:Za,restartChat:y},null,8,["messages","isPreview","isEmbedded","configDesignClass","isLoading","isStreaming","isProduction","sectionBorderRadius","showWelcome","activeMessage","isProcessError","snippet","traceLastShown"]),c.value?(Vt(),ts("div",{key:0,style:$s({padding:B.value.getKey("sections.warnings.connectionIssue.content.sidePadding")+"px"})},[es(pi,{type:"connectionIssue",headlineText:B.value.getKey("texts.issueText"),configDesignClass:B.value,warningElement:B.value.getKeyObject("sections.warnings.connectionIssue"),restartChat:y},null,8,["headlineText","configDesignClass","warningElement"])],4)):(Vt(),Sh(yd,{key:1,messageText:Gt.value,"onUpdate:messageText":k[1]||(k[1]=z=>Gt.value=z),isPreview:ft.value,isProduction:_.isProduction||!1,configDesignClass:B.value,sectionBorderRadius:Z.value,classSize:we.value,sendMessage:Ya,isInputDisabled:p.value,showReconnectNotice:g.value,restartChat:y,isStreaming:f.value,mainBorderRadius:N.value,transcribeUrl:Ph,onTrace:ee},null,8,["messageText","isPreview","isProduction","configDesignClass","sectionBorderRadius","classSize","isInputDisabled","showReconnectNotice","isStreaming","mainBorderRadius"]))]))])):ui("",!0),es(Th,{name:"fade"},{default:Rh(()=>[w.value?(Vt(),ts("div",{key:0,class:"tw:absolute tw:inset-0 tw:backdrop-blur-[40px] tw:z-[1000]",style:$s({borderRadius:`${String(N.value)}px`,backgroundColor:`rgba(0,0,0, ${h.value})`})},null,4)):ui("",!0)]),_:1})],6),[[yo,i.value&&W.value]])],6)):ui("",!0)}});export{V as D,X as S,Ap as _};