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