@botpress/webchat 4.0.4 → 4.1.0

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,221 +1,226 @@
1
- (function(ie,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],S):(ie=typeof globalThis<"u"?globalThis:ie||self,S(ie.Webchat={},ie.ReactJsxRuntime,ie.React,ie.ReactDOM))})(this,function(ie,S,O,Cs){"use strict";var ST=Object.defineProperty;var ET=(ie,S,O)=>S in ie?ST(ie,S,{enumerable:!0,configurable:!0,writable:!0,value:O}):ie[S]=O;var Li=(ie,S,O)=>ET(ie,typeof S!="symbol"?S+"":S,O);var Lh,Fh,Rh;var Fi=typeof document<"u"?document.currentScript:null;function As(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const A=As(O),Is=As(Cs);function xt(){return xt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xt.apply(null,arguments)}function Bh(e,t=[]){let n=[];function r(o,a){const s=O.createContext(a),l=n.length;n=[...n,a];function c(u){const{scope:p,children:d,...m}=u,h=(p==null?void 0:p[e][l])||s,g=O.useMemo(()=>m,Object.values(m));return O.createElement(h.Provider,{value:g},d)}function f(u,p){const d=(p==null?void 0:p[e][l])||s,m=O.useContext(d);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,f]}const i=()=>{const o=n.map(a=>O.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return O.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,$h(i,...t)]}function $h(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const u=l(o)[`__scope${c}`];return{...s,...u}},{});return O.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function zh(e){const t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const jh=globalThis!=null&&globalThis.document?O.useLayoutEffect:()=>{};function Uh(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Hh(...e){return t=>e.forEach(n=>Uh(n,t))}const Ts=O.forwardRef((e,t)=>{const{children:n,...r}=e,i=O.Children.toArray(n),o=i.find(Vh);if(o){const a=o.props.children,s=i.map(l=>l===o?O.Children.count(a)>1?O.Children.only(null):O.isValidElement(a)?a.props.children:null:l);return O.createElement(Ri,xt({},r,{ref:t}),O.isValidElement(a)?O.cloneElement(a,void 0,s):null)}return O.createElement(Ri,xt({},r,{ref:t}),n)});Ts.displayName="Slot";const Ri=O.forwardRef((e,t)=>{const{children:n,...r}=e;return O.isValidElement(n)?O.cloneElement(n,{...qh(r,n.props),ref:t?Hh(t,n.ref):n.ref}):O.Children.count(n)>1?O.Children.only(null):null});Ri.displayName="SlotClone";const Wh=({children:e})=>O.createElement(O.Fragment,null,e);function Vh(e){return O.isValidElement(e)&&e.type===Wh}function qh(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const Bi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=O.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?Ts:t;return O.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),O.createElement(s,xt({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Os="Avatar",[Kh]=Bh(Os),[Yh,Ds]=Kh(Os),Ms=O.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=O.useState("idle");return O.createElement(Yh,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o},O.createElement(Bi.span,xt({},r,{ref:t})))}),Gh="AvatarImage",Ps=O.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,a=Ds(Gh,n),s=Jh(r),l=zh(c=>{i(c),a.onImageLoadingStatusChange(c)});return jh(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?O.createElement(Bi.img,xt({},o,{ref:t,src:r})):null}),Qh="AvatarFallback",Ns=O.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=Ds(Qh,n),[a,s]=O.useState(r===void 0);return O.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&o.imageLoadingStatus!=="loaded"?O.createElement(Bi.span,xt({},i,{ref:t})):null});function Jh(e){const[t,n]=O.useState("idle");return O.useEffect(()=>{if(!e){n("error");return}let r=!0;const i=new window.Image,o=a=>()=>{r&&n(a)};return n("loading"),i.onload=o("loaded"),i.onerror=o("error"),i.src=e,()=>{r=!1}},[e]),t}const _s=e=>{const t=e.split("_"),n=t[0]??"";return isNaN(Date.parse(n))?e:t.slice(2).join("_")??e},Ls=e=>{const t=_s(e),n=/\s*\(\d+\)(?=\.[^.]+$|$)/;return t.replace(n,"")};function Fs(e,t){let n=`${e} {`;for(const[r,i]of Object.entries(t))n+=`${r}: ${i}; `;return n+="}",n}function Rs(e,t){let n=0;if(e.length==0)return n;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);n=(n<<5)-n+i,n=n&n}return Math.abs(n)%t}const Zh=(e,t={})=>new Promise((n,r)=>{if(typeof window>"u")return r("Window is not defined");if(!e)return r("Url is not defined");let i=null;const o=new Image;o.addEventListener("load",()=>{i&&clearTimeout(i),n({width:o.naturalWidth,height:o.naturalHeight})}),o.addEventListener("error",a=>{i&&clearTimeout(i),r(`${a.type}: ${a.message}`)}),o.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))}),Bs=["audio","file","image","video"],$s=e=>Bs.includes(e),zs="The Client ID is required to initialize the webchat.",Xh="The API url is required to initialize the webchat.",em="The Bot ID is required to initialize the webchat.",tm="No config URL provided.",js=`Invalid API URL.
2
- Please use a valid API URL.`,Us=`Invalid Client ID.
3
- Please use a valid Botpress Client ID.`,Hs=`Invalid URL.
4
- Please make sure your client ID and API URL are valid`,nm=`Invalid config URL.
5
- Please make sure your config URL is valid`,rm=`Invalid webchat configuration.
6
- Please make sure your config file is valid`,im="Access denied to configuration file. Please check your credentials or your configuration URL and try again.",Ws=`This bot has temporarily paused.
7
- Please check back later.`,Vs=`This bot has temporarily paused.
8
- Please check back later.`,$i="Something went wrong. To fix it, please clear your browser's local and session storage and then refresh the page",Nn="Please check your internet connection and refresh the page.",qs=`You've been disconnected from the conversation.
9
- Please refresh the page.`,Ks=`Unable to process the message.
10
- Please start a new conversation.`,zi={ResourceNotFound:{type:"configuration",message:Us},Forbidden:{type:"bot",message:Ws}},ji={MethodNotFound:{type:"configuration",message:Hs},QuotaExceeded:{type:"bot",message:Vs},Forbidden:{type:"bot",message:$i}};function Ys(e){return e in zi}function Gs(e){return e in ji}function Qs(e){return e!==null&&typeof e=="object"&&"id"in e&&"code"in e&&"type"in e}function Js(e){return e!==null&&typeof e=="object"&&"type"in e&&e.type==="error"&&"message"in e&&typeof e.message=="string"}const Zs=async(e,t=3,n=1e3)=>{let r;for(let i=1;i<=t;i++)try{return await e()}catch(o){if(r=o,i===t)throw r;const a=n*Math.pow(2,i-1);await new Promise(s=>setTimeout(s,a))}throw new Error("Unreachable: retry loop should always return or throw")},om=["networkerror","failedtofetch","errorininputstream"],br=e=>{var n;console.error("An error occurred:",e);let t={type:"unknown",message:"An unexpected error occurred"};if(Qs(e))e.type==="network"?t={id:e.id,type:"network",message:Nn}:(n=e.message)!=null&&n.includes("[Webhook Handler]")&&Ys(e.type)?t={id:e.id,...zi[e.type]}:Gs(e.type)?t={id:e.id,...ji[e.type]}:t={id:e.id,type:e.type,message:e.message||"An error occurred"};else if(Js(e))Xs(e.message)?t={type:"disconnected",message:qs}:el(e.message).includes("invalidcontenttype")?t={type:"bot",message:Ks}:t={type:"event",message:e.message};else if(e instanceof Error&&Xs(e.message))t={type:"network",message:Nn};else if(e&&typeof e=="object"&&"type"in e&&"message"in e){const r=e;r.type==="network"?t={type:"network",message:Nn}:t={type:r.type,message:r.message}}return t};function Xs(e){return om.some(t=>el(e).includes(t))}function el(e){return e.replaceAll(" ","").toLowerCase()}var zt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tl={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(zt,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",s="minute",l="hour",c="day",f="week",u="month",p="quarter",d="year",m="date",h="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(R){var P=["th","st","nd","rd"],L=R%100;return"["+R+(P[(L-20)%10]||P[L]||P[0])+"]"}},w=function(R,P,L){var U=String(R);return!U||U.length>=P?R:""+Array(P+1-U.length).join(L)+R},E={s:w,z:function(R){var P=-R.utcOffset(),L=Math.abs(P),U=Math.floor(L/60),z=L%60;return(P<=0?"+":"-")+w(U,2,"0")+":"+w(z,2,"0")},m:function R(P,L){if(P.date()<L.date())return-R(L,P);var U=12*(L.year()-P.year())+(L.month()-P.month()),z=P.clone().add(U,u),q=L-z<0,v=P.clone().add(U+(q?-1:1),u);return+(-(U+(L-z)/(q?z-v:v-z))||0)},a:function(R){return R<0?Math.ceil(R)||0:Math.floor(R)},p:function(R){return{M:u,y:d,w:f,d:c,D:m,h:l,m:s,s:a,ms:o,Q:p}[R]||String(R||"").toLowerCase().replace(/s$/,"")},u:function(R){return R===void 0}},x="en",C={};C[x]=b;var T="$isDayjsObject",N=function(R){return R instanceof F||!(!R||!R[T])},$=function R(P,L,U){var z;if(!P)return x;if(typeof P=="string"){var q=P.toLowerCase();C[q]&&(z=q),L&&(C[q]=L,z=q);var v=P.split("-");if(!z&&v.length>1)return R(v[0])}else{var M=P.name;C[M]=P,z=M}return!U&&z&&(x=z),z||!U&&x},I=function(R,P){if(N(R))return R.clone();var L=typeof P=="object"?P:{};return L.date=R,L.args=arguments,new F(L)},D=E;D.l=$,D.i=N,D.w=function(R,P){return I(R,{locale:P.$L,utc:P.$u,x:P.$x,$offset:P.$offset})};var F=function(){function R(L){this.$L=$(L.locale,null,!0),this.parse(L),this.$x=this.$x||L.x||{},this[T]=!0}var P=R.prototype;return P.parse=function(L){this.$d=function(U){var z=U.date,q=U.utc;if(z===null)return new Date(NaN);if(D.u(z))return new Date;if(z instanceof Date)return new Date(z);if(typeof z=="string"&&!/Z$/i.test(z)){var v=z.match(g);if(v){var M=v[2]-1||0,H=(v[7]||"0").substring(0,3);return q?new Date(Date.UTC(v[1],M,v[3]||1,v[4]||0,v[5]||0,v[6]||0,H)):new Date(v[1],M,v[3]||1,v[4]||0,v[5]||0,v[6]||0,H)}}return new Date(z)}(L),this.init()},P.init=function(){var L=this.$d;this.$y=L.getFullYear(),this.$M=L.getMonth(),this.$D=L.getDate(),this.$W=L.getDay(),this.$H=L.getHours(),this.$m=L.getMinutes(),this.$s=L.getSeconds(),this.$ms=L.getMilliseconds()},P.$utils=function(){return D},P.isValid=function(){return this.$d.toString()!==h},P.isSame=function(L,U){var z=I(L);return this.startOf(U)<=z&&z<=this.endOf(U)},P.isAfter=function(L,U){return I(L)<this.startOf(U)},P.isBefore=function(L,U){return this.endOf(U)<I(L)},P.$g=function(L,U,z){return D.u(L)?this[U]:this.set(z,L)},P.unix=function(){return Math.floor(this.valueOf()/1e3)},P.valueOf=function(){return this.$d.getTime()},P.startOf=function(L,U){var z=this,q=!!D.u(U)||U,v=D.p(L),M=function(ae,J){var Q=D.w(z.$u?Date.UTC(z.$y,J,ae):new Date(z.$y,J,ae),z);return q?Q:Q.endOf(c)},H=function(ae,J){return D.w(z.toDate()[ae].apply(z.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(J)),z)},k=this.$W,W=this.$M,te=this.$D,Y="set"+(this.$u?"UTC":"");switch(v){case d:return q?M(1,0):M(31,11);case u:return q?M(1,W):M(0,W+1);case f:var X=this.$locale().weekStart||0,oe=(k<X?k+7:k)-X;return M(q?te-oe:te+(6-oe),W);case c:case m:return H(Y+"Hours",0);case l:return H(Y+"Minutes",1);case s:return H(Y+"Seconds",2);case a:return H(Y+"Milliseconds",3);default:return this.clone()}},P.endOf=function(L){return this.startOf(L,!1)},P.$set=function(L,U){var z,q=D.p(L),v="set"+(this.$u?"UTC":""),M=(z={},z[c]=v+"Date",z[m]=v+"Date",z[u]=v+"Month",z[d]=v+"FullYear",z[l]=v+"Hours",z[s]=v+"Minutes",z[a]=v+"Seconds",z[o]=v+"Milliseconds",z)[q],H=q===c?this.$D+(U-this.$W):U;if(q===u||q===d){var k=this.clone().set(m,1);k.$d[M](H),k.init(),this.$d=k.set(m,Math.min(this.$D,k.daysInMonth())).$d}else M&&this.$d[M](H);return this.init(),this},P.set=function(L,U){return this.clone().$set(L,U)},P.get=function(L){return this[D.p(L)]()},P.add=function(L,U){var z,q=this;L=Number(L);var v=D.p(U),M=function(W){var te=I(q);return D.w(te.date(te.date()+Math.round(W*L)),q)};if(v===u)return this.set(u,this.$M+L);if(v===d)return this.set(d,this.$y+L);if(v===c)return M(1);if(v===f)return M(7);var H=(z={},z[s]=r,z[l]=i,z[a]=n,z)[v]||1,k=this.$d.getTime()+L*H;return D.w(k,this)},P.subtract=function(L,U){return this.add(-1*L,U)},P.format=function(L){var U=this,z=this.$locale();if(!this.isValid())return z.invalidDate||h;var q=L||"YYYY-MM-DDTHH:mm:ssZ",v=D.z(this),M=this.$H,H=this.$m,k=this.$M,W=z.weekdays,te=z.months,Y=z.meridiem,X=function(J,Q,j,ne){return J&&(J[Q]||J(U,q))||j[Q].slice(0,ne)},oe=function(J){return D.s(M%12||12,J,"0")},ae=Y||function(J,Q,j){var ne=J<12?"AM":"PM";return j?ne.toLowerCase():ne};return q.replace(y,function(J,Q){return Q||function(j){switch(j){case"YY":return String(U.$y).slice(-2);case"YYYY":return D.s(U.$y,4,"0");case"M":return k+1;case"MM":return D.s(k+1,2,"0");case"MMM":return X(z.monthsShort,k,te,3);case"MMMM":return X(te,k);case"D":return U.$D;case"DD":return D.s(U.$D,2,"0");case"d":return String(U.$W);case"dd":return X(z.weekdaysMin,U.$W,W,2);case"ddd":return X(z.weekdaysShort,U.$W,W,3);case"dddd":return W[U.$W];case"H":return String(M);case"HH":return D.s(M,2,"0");case"h":return oe(1);case"hh":return oe(2);case"a":return ae(M,H,!0);case"A":return ae(M,H,!1);case"m":return String(H);case"mm":return D.s(H,2,"0");case"s":return String(U.$s);case"ss":return D.s(U.$s,2,"0");case"SSS":return D.s(U.$ms,3,"0");case"Z":return v}return null}(J)||v.replace(":","")})},P.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},P.diff=function(L,U,z){var q,v=this,M=D.p(U),H=I(L),k=(H.utcOffset()-this.utcOffset())*r,W=this-H,te=function(){return D.m(v,H)};switch(M){case d:q=te()/12;break;case u:q=te();break;case p:q=te()/3;break;case f:q=(W-k)/6048e5;break;case c:q=(W-k)/864e5;break;case l:q=W/i;break;case s:q=W/r;break;case a:q=W/n;break;default:q=W}return z?q:D.a(q)},P.daysInMonth=function(){return this.endOf(u).$D},P.$locale=function(){return C[this.$L]},P.locale=function(L,U){if(!L)return this.$L;var z=this.clone(),q=$(L,U,!0);return q&&(z.$L=q),z},P.clone=function(){return D.w(this.$d,this)},P.toDate=function(){return new Date(this.valueOf())},P.toJSON=function(){return this.isValid()?this.toISOString():null},P.toISOString=function(){return this.$d.toISOString()},P.toString=function(){return this.$d.toUTCString()},R}(),_=F.prototype;return I.prototype=_,[["$ms",o],["$s",a],["$m",s],["$H",l],["$W",c],["$M",u],["$y",d],["$D",m]].forEach(function(R){_[R[1]]=function(P){return this.$g(P,R[0],R[1])}}),I.extend=function(R,P){return R.$i||(R(P,F,I),R.$i=!0),I},I.locale=$,I.isDayjs=N,I.unix=function(R){return I(1e3*R)},I.en=C[x],I.Ls=C,I.p={},I})})(tl);var am=tl.exports;const vr=jt(am);var nl={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(zt,function(){return function(n,r,i){r.prototype.isToday=function(){var o="YYYY-MM-DD",a=i();return this.format(o)===a.format(o)}}})})(nl);var sm=nl.exports;const lm=jt(sm);var rl={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(zt,function(){return function(n,r,i){r.prototype.isYesterday=function(){var o="YYYY-MM-DD",a=i().subtract(1,"day");return this.format(o)===a.format(o)}}})})(rl);var cm=rl.exports;const um=jt(cm);vr.extend(lm),vr.extend(um);function il(e,t,n,r,i){return e.map(o=>{const{authorId:a}=o,s=a===n?"outgoing":"incoming",l=t.find(f=>f.id===a);let c;return l&&l.id===n?c={name:l.name||"You",avatar:l.pictureUrl}:l?c={name:l.name||"Agent",avatar:l.pictureUrl}:c={name:r||"Bot",avatar:i},{...o,direction:s,sender:c}})}function fm(e,t="day"){var r,i,o;if(!e||e.length===0)return[];const n=[];(r=e[0])!=null&&r.timestamp&&n.push(ol(e[0].timestamp));for(let a=0;a<e.length;a++)if(e[a]&&n.push(e[a]),a+1<e.length){const s=(i=e[a])==null?void 0:i.timestamp,l=(o=e[a+1])==null?void 0:o.timestamp;!vr(s).isSame(l,t)&&l&&n.push(ol(l))}return n}function ol(e){return{id:al(e),direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:al(e)}}}function al(e,t=!1){const n=vr(e),r="h:mma";return n.isToday()?t?`Today • ${n.format(r)}`:"Today":n.isYesterday()?t?`Yesterday • ${n.format(r)}`:"Yesterday":t?n.format(`YYYY-MM-DD • ${r}`):n.format("YYYY-MM-DD")}function dm(e=""){if(typeof e!="string")throw new TypeError("Color should be string!");const t=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(e);if(t)return t.splice(1).map(r=>Number.parseInt(r,16));const n=/^#?([\da-f])([\da-f])([\da-f])$/i.exec(e);if(n)return n.splice(1).map(r=>Number.parseInt(r+r,16));if(e.includes(","))return e.split(",").map(r=>Number.parseInt(r));throw new Error("Invalid color format! Use #ABC or #AABBCC or r,g,b")}function pm(e){return"#"+e.map(t=>`0${t.toString(16).toUpperCase()}`.slice(-2)).join("")}function hm(e,t){return e.map(n=>Math.round(n+(255-n)*t))}function mm(e,t){return e.map(n=>Math.round(n*t))}const _n=e=>t=>hm(t,e),Ln=e=>t=>mm(t,e),gm={50:_n(.95),100:_n(.9),200:_n(.75),300:_n(.6),400:_n(.3),500:e=>e,600:Ln(.9),700:Ln(.6),800:Ln(.45),900:Ln(.3),950:Ln(.2)};function sl(e,t=gm){const n={},r=dm(e);for(const[i,o]of Object.entries(t))n[i]=pm(o(r));return n}const ll=()=>{const e={};return{on:(i,o)=>{var a;return e[i]||(e[i]=new Set),(a=e[i])==null||a.add(o),()=>{var s;return(s=e[i])==null?void 0:s.delete(o)}},emit:(i,o)=>{var a,s;(a=e[i])==null||a.forEach(l=>l(o)),(s=e["*"])==null||s.forEach(l=>l({type:i,payload:o}))},removeAllListeners:i=>{var o;i?(o=e[i])==null||o.clear():Object.keys(e).forEach(a=>{var s;(s=e[a])==null||s.clear()})}}};function Ui(e){if(!/^#?([a-fA-F\d]{6}|[a-fA-F\d]{3})$/.test(e))return{r:0,g:0,b:0};const n=e.replace(/^#/,"");let r=n;n.length===3&&(r=n.split("").map(l=>l+l).join(""));const i=parseInt(r,16),o=i>>16&255,a=i>>8&255,s=i&255;return{r:o,g:a,b:s}}function ym(e){return`#${((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}`}const bm=(e,t=30)=>{const n=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b,n+1);return{r:Math.floor((e.r-n)/(r-n)*t*(1-.299)+120-t/2),g:Math.floor((e.g-n)/(r-n)*t*(1-.587)+120-t/2),b:Math.floor((e.b-n)/(r-n)*t*(1-.114)+120-t/2)}};function cl(e){return Object.entries(e).reduce((t,[n,r])=>{const i=n.replace(/(\d+)/,o=>(1e3-parseInt(o)).toString());return{...t,[i]:r}},{})}const vm=2.4,wm=.2126729,xm=.7151522,km=.072175,Sm=.56,Em=.57,Cm=.62,Am=.65,wr=.022,ul=1.414,Im=1.14,Tm=1.14,Om=.035991,Dm=27.7847239587675,Mm=27.7847239587675,fl=.027,dl=.027,pl=.001,Pm=5e-4;function hl(e){const{r:t,g:n,b:r}=e,i=o=>(o/255)**vm;return wm*i(t)+xm*i(n)+km*i(r)}function ml(e,t){if(!e||!t)return 0;let n=hl(Ui(e)),r=hl(Ui(t)),i=0,o=0;return n=n>wr?n:n+(wr-n)**ul,r=r>wr?r:r+(wr-r)**ul,Math.abs(r-n)<Pm?0:(r>n?(i=(r**Sm-n**Em)*Im,o=i<pl?0:i<Om?i-i*Dm*fl:i-fl):(i=(r**Am-n**Cm)*Tm,o=i>-pl?0:i>-.035991?i-i*Mm*dl:i+dl),Math.abs(o*100))}function gl(e){const{fontFamily:t,...n}=e,r=yl(n);return Fs(".bpReset, :host",r)+Fs(".bpReset",{"font-family":`'${t}', sans-serif`})}function yl(e){const{radius:t,themeMode:n,color:r,variant:i,headerVariant:o}=e;let a={},s={};if(r){const p=sl(r),d=n==="dark"?cl(p):p,m=sl(ym(bm(Ui(r)))),h=n==="dark"?cl(m):m,g=n==="dark"?"#101010":"#fdfdfd";s=Object.entries({...d,1:g}).reduce((b,[w,E])=>({...b,[`--bpPrimary-${w}`]:E}),{});const y=Object.entries({...h,1:g}).reduce((b,[w,E])=>({...b,[`--bpGray-${w}`]:E}),{});a={...s,...y}}t&&(a={...a,"--bpRadius-scale":t.toString()});const l=n==="dark"?{bg:"var(--transparent-dark)",bgHover:"var(--transparent-dark-hover)"}:{bg:"var(--transparent-light)",bgHover:"var(--transparent-light-hover)"},c=s?ml(s["--bpPrimary-600"],s["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)",f=i==="solid"?{"--message-bg":"var(--bpPrimary-600)","--message-bg-hover":"var(--bpPrimary-700)","--message-text":c,"--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-200)","--button-bg-hover":"var(--bpPrimary-300)","--button-text":"var(--bpPrimary-800)","--fab-bg":"var(--bpPrimary-600)","--fab-bg-hover":"var(--bpPrimary-700)","--fab-icon":c,"--modal-submit-bg":"var(--bpPrimary-600)","--modal-submit-bg-hover":"var(--bpPrimary-700)"}:{"--message-bg":"var(--bpPrimary-100)","--message-bg-hover":"var(--bpPrimary-200)","--message-text":"var(--bpPrimary-900)","--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-500)","--button-bg-hover":"var(--bpPrimary-600)","--button-text":s?ml(s["--bpPrimary-500"],s["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)","--fab-bg":"var(--bpPrimary-100)","--fab-bg-hover":"var(--bpPrimary-200)","--fab-icon":"var(--bpPrimary-700)","--scrollbar":"var(--bpGray-500)","--scrollbar-hover":"var(--bpGray-400)","--modal-submit-bg":"var(--bpPrimary-200)","--modal-submit-bg-hover":"var(--bpPrimary-300)"},u=o==="solid"?{"--header-bg":"var(--bpPrimary-600)","--header-bg-hover":"var(--bpPrimary-700)","--header-hover-dark":"var(--bpPrimary-800)","--header-title":c,"--header-description":c,"--header-description-icon":c,"--header-description-link":c,"--header-avatar-bg":"var(--bpPrimary-300)","--header-avatar-text":"var(--bpPrimary-700)"}:{"--header-bg":l.bg,"--header-bg-hover":l.bgHover,"--header-hover-dark":"var(--bpGray-200)","--header-title":"var(--bpGray-900)","--header-description":"var(--bpGray-600)","--header-description-icon":"var(--bpPrimary-700)","--header-description-link":"var(--bpPrimary-800)","--header-avatar-bg":"var(--bpPrimary-600)","--header-avatar-text":"var(--bpPrimary-50)"};return{...a,...f,...u}}const Fn=O.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...o},a)=>{const s=Rs(e??"",15);return S.jsxs(Ms,{ref:a,"data-color":s,...n,...o,children:[S.jsx(Ps,{src:t,...r}),S.jsx(Ns,{...i,children:typeof o.children=="string"?o.children[0]:o.children})]})});Fn.displayName="Avatar";function AT(){}function IT(){}function Nm(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const _m=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Lm=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Fm={};function bl(e,t){return(Fm.jsx?Lm:_m).test(e)}const Rm=/[ \t\n\f\r]/g;function Bm(e){return typeof e=="object"?e.type==="text"?vl(e.value):!1:vl(e)}function vl(e){return e.replace(Rm,"")===""}class Rn{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Rn.prototype.normal={},Rn.prototype.property={},Rn.prototype.space=void 0;function wl(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Rn(n,r,t)}function Hi(e){return e.toLowerCase()}class Ke{constructor(t,n){this.attribute=n,this.property=t}}Ke.prototype.attribute="",Ke.prototype.booleanish=!1,Ke.prototype.boolean=!1,Ke.prototype.commaOrSpaceSeparated=!1,Ke.prototype.commaSeparated=!1,Ke.prototype.defined=!1,Ke.prototype.mustUseProperty=!1,Ke.prototype.number=!1,Ke.prototype.overloadedBoolean=!1,Ke.prototype.property="",Ke.prototype.spaceSeparated=!1,Ke.prototype.space=void 0;let $m=0;const he=Ut(),Ne=Ut(),Wi=Ut(),Z=Ut(),Ce=Ut(),Xt=Ut(),Je=Ut();function Ut(){return 2**++$m}const Vi=Object.freeze(Object.defineProperty({__proto__:null,boolean:he,booleanish:Ne,commaOrSpaceSeparated:Je,commaSeparated:Xt,number:Z,overloadedBoolean:Wi,spaceSeparated:Ce},Symbol.toStringTag,{value:"Module"})),qi=Object.keys(Vi);class Ki extends Ke{constructor(t,n,r,i){let o=-1;if(super(t,n),xl(this,"space",i),typeof r=="number")for(;++o<qi.length;){const a=qi[o];xl(this,qi[o],(r&Vi[a])===Vi[a])}}}Ki.prototype.defined=!0;function xl(e,t,n){n&&(e[t]=n)}function en(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Ki(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Hi(r)]=r,n[Hi(o.attribute)]=r}return new Rn(t,n,e.space)}const kl=en({properties:{ariaActiveDescendant:null,ariaAtomic:Ne,ariaAutoComplete:null,ariaBusy:Ne,ariaChecked:Ne,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:Ce,ariaCurrent:null,ariaDescribedBy:Ce,ariaDetails:null,ariaDisabled:Ne,ariaDropEffect:Ce,ariaErrorMessage:null,ariaExpanded:Ne,ariaFlowTo:Ce,ariaGrabbed:Ne,ariaHasPopup:null,ariaHidden:Ne,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ce,ariaLevel:Z,ariaLive:null,ariaModal:Ne,ariaMultiLine:Ne,ariaMultiSelectable:Ne,ariaOrientation:null,ariaOwns:Ce,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:Ne,ariaReadOnly:Ne,ariaRelevant:null,ariaRequired:Ne,ariaRoleDescription:Ce,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:Ne,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Sl(e,t){return t in e?e[t]:t}function El(e,t){return Sl(e,t.toLowerCase())}const zm=en({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Xt,acceptCharset:Ce,accessKey:Ce,action:null,allow:null,allowFullScreen:he,allowPaymentRequest:he,allowUserMedia:he,alt:null,as:null,async:he,autoCapitalize:null,autoComplete:Ce,autoFocus:he,autoPlay:he,blocking:Ce,capture:null,charSet:null,checked:he,cite:null,className:Ce,cols:Z,colSpan:null,content:null,contentEditable:Ne,controls:he,controlsList:Ce,coords:Z|Xt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:he,defer:he,dir:null,dirName:null,disabled:he,download:Wi,draggable:Ne,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:he,formTarget:null,headers:Ce,height:Z,hidden:Wi,high:Z,href:null,hrefLang:null,htmlFor:Ce,httpEquiv:Ce,id:null,imageSizes:null,imageSrcSet:null,inert:he,inputMode:null,integrity:null,is:null,isMap:he,itemId:null,itemProp:Ce,itemRef:Ce,itemScope:he,itemType:Ce,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:he,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:he,muted:he,name:null,nonce:null,noModule:he,noValidate:he,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:he,optimum:Z,pattern:null,ping:Ce,placeholder:null,playsInline:he,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:he,referrerPolicy:null,rel:Ce,required:he,reversed:he,rows:Z,rowSpan:Z,sandbox:Ce,scope:null,scoped:he,seamless:he,selected:he,shadowRootClonable:he,shadowRootDelegatesFocus:he,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:Ne,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:he,useMap:null,value:Ne,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ce,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:he,declare:he,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:he,noHref:he,noShade:he,noWrap:he,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:Ne,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:he,disableRemotePlayback:he,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:El}),jm=en({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Je,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:Ce,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:he,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Xt,g2:Xt,glyphName:Xt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:Je,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ce,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Je,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Je,rev:Je,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Je,requiredFeatures:Je,requiredFonts:Je,requiredFormats:Je,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:Je,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Je,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Je,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Sl}),Cl=en({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Al=en({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:El}),Il=en({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Um={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Hm=/[A-Z]/g,Tl=/-[a-z]/g,Wm=/^data[-\w.:]+$/i;function Vm(e,t){const n=Hi(t);let r=t,i=Ke;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Wm.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Tl,Km);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Tl.test(o)){let a=o.replace(Hm,qm);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Ki}return new i(r,t)}function qm(e){return"-"+e.toLowerCase()}function Km(e){return e.charAt(1).toUpperCase()}const Ym=wl([kl,zm,Cl,Al,Il],"html"),Yi=wl([kl,jm,Cl,Al,Il],"svg");function Gm(e){return e.join(" ").trim()}var Gi={},Ol=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Qm=/\n/g,Jm=/^\s*/,Zm=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Xm=/^:\s*/,eg=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,tg=/^[;\s]*/,ng=/^\s+|\s+$/g,rg=`
11
- `,Dl="/",Ml="*",Ht="",ig="comment",og="declaration";function ag(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var h=m.match(Qm);h&&(n+=h.length);var g=m.lastIndexOf(rg);r=~g?m.length-g:r+m.length}function o(){var m={line:n,column:r};return function(h){return h.position=new a(m),c(),h}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function s(m){var h=new Error(t.source+":"+n+":"+r+": "+m);if(h.reason=m,h.filename=t.source,h.line=n,h.column=r,h.source=e,!t.silent)throw h}function l(m){var h=m.exec(e);if(h){var g=h[0];return i(g),e=e.slice(g.length),h}}function c(){l(Jm)}function f(m){var h;for(m=m||[];h=u();)h!==!1&&m.push(h);return m}function u(){var m=o();if(!(Dl!=e.charAt(0)||Ml!=e.charAt(1))){for(var h=2;Ht!=e.charAt(h)&&(Ml!=e.charAt(h)||Dl!=e.charAt(h+1));)++h;if(h+=2,Ht===e.charAt(h-1))return s("End of comment missing");var g=e.slice(2,h-2);return r+=2,i(g),e=e.slice(h),r+=2,m({type:ig,comment:g})}}function p(){var m=o(),h=l(Zm);if(h){if(u(),!l(Xm))return s("property missing ':'");var g=l(eg),y=m({type:og,property:Pl(h[0].replace(Ol,Ht)),value:g?Pl(g[0].replace(Ol,Ht)):Ht});return l(tg),y}}function d(){var m=[];f(m);for(var h;h=p();)h!==!1&&(m.push(h),f(m));return m}return c(),d()}function Pl(e){return e?e.replace(ng,Ht):Ht}var sg=ag,lg=zt&&zt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.default=ug;const cg=lg(sg);function ug(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,cg.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:a,value:s}=o;i?t(a,s,o):s&&(n=n||{},n[a]=s)}),n}var xr={};Object.defineProperty(xr,"__esModule",{value:!0}),xr.camelCase=void 0;var fg=/^--[a-zA-Z0-9_-]+$/,dg=/-([a-z])/g,pg=/^[^-]+$/,hg=/^-(webkit|moz|ms|o|khtml)-/,mg=/^-(ms)-/,gg=function(e){return!e||pg.test(e)||fg.test(e)},yg=function(e,t){return t.toUpperCase()},Nl=function(e,t){return"".concat(t,"-")},bg=function(e,t){return t===void 0&&(t={}),gg(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(mg,Nl):e=e.replace(hg,Nl),e.replace(dg,yg))};xr.camelCase=bg;var vg=zt&&zt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},wg=vg(Gi),xg=xr;function Qi(e,t){var n={};return!e||typeof e!="string"||(0,wg.default)(e,function(r,i){r&&i&&(n[(0,xg.camelCase)(r,t)]=i)}),n}Qi.default=Qi;var kg=Qi;const Sg=jt(kg),_l=Ll("end"),Ji=Ll("start");function Ll(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Eg(e){const t=Ji(e),n=_l(e);if(t&&n)return{start:t,end:n}}function Bn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Fl(e.position):"start"in e||"end"in e?Fl(e):"line"in e||"column"in e?Zi(e):""}function Zi(e){return Rl(e&&e.line)+":"+Rl(e&&e.column)}function Fl(e){return Zi(e&&e.start)+"-"+Zi(e&&e.end)}function Rl(e){return e&&typeof e=="number"?e:1}class $e extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=Bn(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}$e.prototype.file="",$e.prototype.name="",$e.prototype.reason="",$e.prototype.message="",$e.prototype.stack="",$e.prototype.column=void 0,$e.prototype.line=void 0,$e.prototype.ancestors=void 0,$e.prototype.cause=void 0,$e.prototype.fatal=void 0,$e.prototype.place=void 0,$e.prototype.ruleId=void 0,$e.prototype.source=void 0;const Xi={}.hasOwnProperty,Cg=new Map,Ag=/[A-Z]/g,Ig=new Set(["table","tbody","thead","tfoot","tr"]),Tg=new Set(["td","th"]),Bl="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Og(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Rg(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Fg(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Yi:Ym,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=$l(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function $l(e,t,n){if(t.type==="element")return Dg(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Mg(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Ng(e,t,n);if(t.type==="mdxjsEsm")return Pg(e,t);if(t.type==="root")return _g(e,t,n);if(t.type==="text")return Lg(e,t)}function Dg(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Yi,e.schema=i),e.ancestors.push(t);const o=jl(e,t.tagName,!1),a=Bg(e,t);let s=to(e,t);return Ig.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!Bm(l):!0})),zl(e,a,o,t),eo(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function Mg(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}$n(e,t.position)}function Pg(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$n(e,t.position)}function Ng(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Yi,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:jl(e,t.name,!0),a=$g(e,t),s=to(e,t);return zl(e,a,o,t),eo(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function _g(e,t,n){const r={};return eo(r,to(e,t)),e.create(t,e.Fragment,r,n)}function Lg(e,t){return t.value}function zl(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function eo(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Fg(e,t,n){return r;function r(i,o,a,s){const c=Array.isArray(a.children)?n:t;return s?c(o,a,s):c(o,a)}}function Rg(e,t){return n;function n(r,i,o,a){const s=Array.isArray(o.children),l=Ji(r);return t(i,o,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Bg(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Xi.call(t.properties,i)){const o=zg(e,i,t.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&Tg.has(t.tagName)?r=s:n[a]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function $g(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const s=a.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else $n(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else $n(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function to(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Cg;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;a=l+"-"+c,i.set(l,c+1)}}const s=$l(e,o,a);s!==void 0&&n.push(s)}return n}function zg(e,t,n){const r=Vm(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Nm(n):Gm(n)),r.property==="style"){let i=typeof n=="object"?n:jg(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Ug(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Um[r.property]||r.property:r.attribute,n]}}function jg(e,t){try{return Sg(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new $e("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Bl+"#cannot-parse-style-attribute",i}}function jl(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const s=bl(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}r=a}else r=bl(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Xi.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);$n(e)}function $n(e,t){const n=new $e("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Bl+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Ug(e){const t={};let n;for(n in e)Xi.call(e,n)&&(t[Hg(n)]=e[n]);return t}function Hg(e){let t=e.replace(Ag,Wg);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Wg(e){return"-"+e.toLowerCase()}const no={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Vg={};function ro(e,t){const n=Vg,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ul(e,r,i)}function Ul(e,t,n){if(qg(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Hl(e.children,t,n)}return Array.isArray(e)?Hl(e,t,n):""}function Hl(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Ul(e[i],t,n);return r.join("")}function qg(e){return!!(e&&typeof e=="object")}const Wl=document.createElement("i");function io(e){const t="&"+e+";";Wl.innerHTML=t;const n=Wl.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ze(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function rt(e,t){return e.length>0?(Ze(e,e.length,0,t),e):t}const Vl={}.hasOwnProperty;function ql(e){const t={};let n=-1;for(;++n<e.length;)Kg(t,e[n]);return t}function Kg(e,t){let n;for(n in t){const i=(Vl.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){Vl.call(i,a)||(i[a]=[]);const s=o[a];Yg(i[a],Array.isArray(s)?s:s?[s]:[])}}}function Yg(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ze(e,0,0,r)}function Kl(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function at(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const We=It(/[A-Za-z]/),ze=It(/[\dA-Za-z]/),Gg=It(/[#-'*+\--9=?A-Z^-~]/);function kr(e){return e!==null&&(e<32||e===127)}const oo=It(/\d/),Qg=It(/[\dA-Fa-f]/),Jg=It(/[!-/:-@[-`{-~]/);function fe(e){return e!==null&&e<-2}function Se(e){return e!==null&&(e<0||e===32)}function ye(e){return e===-2||e===-1||e===32}const Sr=It(new RegExp("\\p{P}|\\p{S}","u")),Wt=It(/\s/);function It(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function tn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&ze(e.charCodeAt(n+1))&&ze(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ve(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return ye(l)?(e.enter(n),s(l)):t(l)}function s(l){return ye(l)&&o++<i?(e.consume(l),s):(e.exit(n),t(l))}}const Zg={tokenize:Xg};function Xg(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ve(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return fe(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}const ey={tokenize:ty},Yl={tokenize:ny};function ty(e){const t=this,n=[];let r=0,i,o,a;return s;function s(w){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const E=t.events.length;let x=E,C;for(;x--;)if(t.events[x][0]==="exit"&&t.events[x][1].type==="chunkFlow"){C=t.events[x][1].end;break}y(r);let T=E;for(;T<t.events.length;)t.events[T][1].end={...C},T++;return Ze(t.events,x+1,0,t.events.slice(E)),t.events.length=T,c(w)}return s(w)}function c(w){if(r===n.length){if(!i)return p(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Yl,f,u)(w)}function f(w){return i&&b(),y(r),p(w)}function u(w){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,m(w)}function p(w){return t.containerState={},e.attempt(Yl,d,m)(w)}function d(w){return r++,n.push([t.currentConstruct,t.containerState]),p(w)}function m(w){if(w===null){i&&b(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),h(w)}function h(w){if(w===null){g(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return fe(w)?(e.consume(w),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(w),h)}function g(w,E){const x=t.sliceStream(w);if(E&&x.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(x),t.parser.lazy[w.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<a&&(!i.events[C][1].end||i.events[C][1].end.offset>a))return;const T=t.events.length;let N=T,$,I;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if($){I=t.events[N][1].end;break}$=!0}for(y(r),C=T;C<t.events.length;)t.events[C][1].end={...I},C++;Ze(t.events,N+1,0,t.events.slice(T)),t.events.length=C}}function y(w){let E=n.length;for(;E-- >w;){const x=n[E];t.containerState=x[1],x[0].exit.call(t,e)}n.length=w}function b(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ny(e,t,n){return ve(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function nn(e){if(e===null||Se(e)||Wt(e))return 1;if(Sr(e))return 2}function Er(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const ao={name:"attention",resolveAll:ry,tokenize:iy};function ry(e,t){let n=-1,r,i,o,a,s,l,c,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const u={...e[r][1].end},p={...e[n][1].start};Gl(u,-l),Gl(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:u,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[n][1].start={...s.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=rt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=rt(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),c=rt(c,Er(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=rt(c,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,c=rt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,Ze(e,r-1,n-r+3,c),n=r+c.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function iy(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=nn(r);let o;return a;function a(l){return o=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===o)return e.consume(l),s;const c=e.exit("attentionSequence"),f=nn(l),u=!f||f===2&&i||n.includes(l),p=!i||i===2&&f||n.includes(r);return c._open=!!(o===42?u:u&&(i||!p)),c._close=!!(o===42?p:p&&(f||!u)),t(l)}}function Gl(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const oy={name:"autolink",tokenize:ay};function ay(e,t,n){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(d){return We(d)?(e.consume(d),a):d===64?n(d):c(d)}function a(d){return d===43||d===45||d===46||ze(d)?(r=1,s(d)):c(d)}function s(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||ze(d))&&r++<32?(e.consume(d),s):(r=0,c(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||kr(d)?n(d):(e.consume(d),l)}function c(d){return d===64?(e.consume(d),f):Gg(d)?(e.consume(d),c):n(d)}function f(d){return ze(d)?u(d):n(d)}function u(d){return d===46?(e.consume(d),r=0,f):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):p(d)}function p(d){if((d===45||ze(d))&&r++<63){const m=d===45?p:u;return e.consume(d),m}return n(d)}}const zn={partial:!0,tokenize:sy};function sy(e,t,n){return r;function r(o){return ye(o)?ve(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||fe(o)?t(o):n(o)}}const Ql={continuation:{tokenize:cy},exit:uy,name:"blockQuote",tokenize:ly};function ly(e,t,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return ye(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function cy(e,t,n){const r=this;return i;function i(a){return ye(a)?ve(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(Ql,t,n)(a)}}function uy(e){e.exit("blockQuote")}const Jl={name:"characterEscape",tokenize:fy};function fy(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Jg(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Zl={name:"characterReference",tokenize:dy};function dy(e,t,n){const r=this;let i=0,o,a;return s;function s(u){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),l}function l(u){return u===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(u),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,a=ze,f(u))}function c(u){return u===88||u===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(u),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=Qg,f):(e.enter("characterReferenceValue"),o=7,a=oo,f(u))}function f(u){if(u===59&&i){const p=e.exit("characterReferenceValue");return a===ze&&!io(r.sliceSerialize(p))?n(u):(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(u)&&i++<o?(e.consume(u),f):n(u)}}const Xl={partial:!0,tokenize:hy},ec={concrete:!0,name:"codeFenced",tokenize:py};function py(e,t,n){const r=this,i={partial:!0,tokenize:x};let o=0,a=0,s;return l;function l(C){return c(C)}function c(C){const T=r.events[r.events.length-1];return o=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,s=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(C)}function f(C){return C===s?(a++,e.consume(C),f):a<3?n(C):(e.exit("codeFencedFenceSequence"),ye(C)?ve(e,u,"whitespace")(C):u(C))}function u(C){return C===null||fe(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(Xl,h,E)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||fe(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(C)):ye(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ve(e,d,"whitespace")(C)):C===96&&C===s?n(C):(e.consume(C),p)}function d(C){return C===null||fe(C)?u(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||fe(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(C)):C===96&&C===s?n(C):(e.consume(C),m)}function h(C){return e.attempt(i,E,g)(C)}function g(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),y}function y(C){return o>0&&ye(C)?ve(e,b,"linePrefix",o+1)(C):b(C)}function b(C){return C===null||fe(C)?e.check(Xl,h,E)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||fe(C)?(e.exit("codeFlowValue"),b(C)):(e.consume(C),w)}function E(C){return e.exit("codeFenced"),t(C)}function x(C,T,N){let $=0;return I;function I(P){return C.enter("lineEnding"),C.consume(P),C.exit("lineEnding"),D}function D(P){return C.enter("codeFencedFence"),ye(P)?ve(C,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):F(P)}function F(P){return P===s?(C.enter("codeFencedFenceSequence"),_(P)):N(P)}function _(P){return P===s?($++,C.consume(P),_):$>=a?(C.exit("codeFencedFenceSequence"),ye(P)?ve(C,R,"whitespace")(P):R(P)):N(P)}function R(P){return P===null||fe(P)?(C.exit("codeFencedFence"),T(P)):N(P)}}}function hy(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const so={name:"codeIndented",tokenize:gy},my={partial:!0,tokenize:yy};function gy(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ve(e,o,"linePrefix",5)(c)}function o(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):fe(c)?e.attempt(my,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||fe(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function yy(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):fe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):ve(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):fe(a)?i(a):n(a)}}const by={name:"codeText",previous:wy,resolve:vy,tokenize:xy};function vy(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function wy(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function xy(e,t,n){let r=0,i,o;return a;function a(u){return e.enter("codeText"),e.enter("codeTextSequence"),s(u)}function s(u){return u===96?(e.consume(u),r++,s):(e.exit("codeTextSequence"),l(u))}function l(u){return u===null?n(u):u===32?(e.enter("space"),e.consume(u),e.exit("space"),l):u===96?(o=e.enter("codeTextSequence"),i=0,f(u)):fe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(u))}function c(u){return u===null||u===32||u===96||fe(u)?(e.exit("codeTextData"),l(u)):(e.consume(u),c)}function f(u){return u===96?(e.consume(u),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(u)):(o.type="codeTextData",c(u))}}class ky{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&jn(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),jn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),jn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);jn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);jn(this.left,n.reverse())}}}function jn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function tc(e){const t={};let n=-1,r,i,o,a,s,l,c;const f=new ky(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Sy(f,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=f.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},s=f.slice(i,n),s.unshift(r),f.splice(i,n-i+1,s))}}return Ze(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!c}function Sy(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let f,u,p=-1,d=n,m=0,h=0;const g=[h];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(f=r.sliceStream(d),d.next||f.push(null),u&&a.defineSkip(d.start),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(f),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),u=d,d=d.next}for(d=n;++p<s.length;)s[p][0]==="exit"&&s[p-1][0]==="enter"&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(h=p+1,g.push(h),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(a.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),p=g.length;p--;){const y=s.slice(g[p],g[p+1]),b=o.pop();l.push([b,b+y.length-1]),e.splice(b,2,y)}for(l.reverse(),p=-1;++p<l.length;)c[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return c}const Ey={resolve:Ay,tokenize:Iy},Cy={partial:!0,tokenize:Ty};function Ay(e){return tc(e),e}function Iy(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):fe(s)?e.check(Cy,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Ty(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ve(e,o,"linePrefix")}function o(a){if(a===null||fe(a))return n(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function nc(e,t,n,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let f=0;return u;function u(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||kr(y)?n(y):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===62?(e.exit("chunkString"),e.exit(s),p(y)):y===null||y===60||fe(y)?n(y):(e.consume(y),y===92?m:d)}function m(y){return y===60||y===62||y===92?(e.consume(y),d):d(y)}function h(y){return!f&&(y===null||y===41||Se(y))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(y)):f<c&&y===40?(e.consume(y),f++,h):y===41?(e.consume(y),f--,h):y===null||y===32||y===40||kr(y)?n(y):(e.consume(y),y===92?g:h)}function g(y){return y===40||y===41||y===92?(e.consume(y),h):h(y)}}function rc(e,t,n,r,i,o){const a=this;let s=0,l;return c;function c(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(o),f}function f(d){return s>999||d===null||d===91||d===93&&!l||d===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):d===93?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):fe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===null||d===91||d===93||fe(d)||s++>999?(e.exit("chunkString"),f(d)):(e.consume(d),l||(l=!ye(d)),d===92?p:u)}function p(d){return d===91||d===92||d===93?(e.consume(d),s++,u):u(d)}}function ic(e,t,n,r,i,o){let a;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),a=p===40?41:p,l):n(p)}function l(p){return p===a?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),c(p))}function c(p){return p===a?(e.exit(o),l(a)):p===null?n(p):fe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),ve(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===a||p===null||fe(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?u:f)}function u(p){return p===a||p===92?(e.consume(p),f):f(p)}}function Un(e,t){let n;return r;function r(i){return fe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ye(i)?ve(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Oy={name:"definition",tokenize:My},Dy={partial:!0,tokenize:Py};function My(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),a(d)}function a(d){return rc.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function s(d){return i=at(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return Se(d)?Un(e,c)(d):c(d)}function c(d){return nc(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function f(d){return e.attempt(Dy,u,u)(d)}function u(d){return ye(d)?ve(e,p,"whitespace")(d):p(d)}function p(d){return d===null||fe(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function Py(e,t,n){return r;function r(s){return Se(s)?Un(e,i)(s):n(s)}function i(s){return ic(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return ye(s)?ve(e,a,"whitespace")(s):a(s)}function a(s){return s===null||fe(s)?t(s):n(s)}}const Ny={name:"hardBreakEscape",tokenize:_y};function _y(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return fe(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Ly={name:"headingAtx",resolve:Fy,tokenize:Ry};function Fy(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ze(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Ry(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),a(f)}function a(f){return f===35&&r++<6?(e.consume(f),a):f===null||Se(f)?(e.exit("atxHeadingSequence"),s(f)):n(f)}function s(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||fe(f)?(e.exit("atxHeading"),t(f)):ye(f)?ve(e,s,"whitespace")(f):(e.enter("atxHeadingText"),c(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),s(f))}function c(f){return f===null||f===35||Se(f)?(e.exit("atxHeadingText"),s(f)):(e.consume(f),c)}}const By=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],oc=["pre","script","style","textarea"],$y={concrete:!0,name:"htmlFlow",resolveTo:Uy,tokenize:Hy},zy={partial:!0,tokenize:Vy},jy={partial:!0,tokenize:Wy};function Uy(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Hy(e,t,n){const r=this;let i,o,a,s,l;return c;function c(k){return f(k)}function f(k){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(k),u}function u(k){return k===33?(e.consume(k),p):k===47?(e.consume(k),o=!0,h):k===63?(e.consume(k),i=3,r.interrupt?t:v):We(k)?(e.consume(k),a=String.fromCharCode(k),g):n(k)}function p(k){return k===45?(e.consume(k),i=2,d):k===91?(e.consume(k),i=5,s=0,m):We(k)?(e.consume(k),i=4,r.interrupt?t:v):n(k)}function d(k){return k===45?(e.consume(k),r.interrupt?t:v):n(k)}function m(k){const W="CDATA[";return k===W.charCodeAt(s++)?(e.consume(k),s===W.length?r.interrupt?t:F:m):n(k)}function h(k){return We(k)?(e.consume(k),a=String.fromCharCode(k),g):n(k)}function g(k){if(k===null||k===47||k===62||Se(k)){const W=k===47,te=a.toLowerCase();return!W&&!o&&oc.includes(te)?(i=1,r.interrupt?t(k):F(k)):By.includes(a.toLowerCase())?(i=6,W?(e.consume(k),y):r.interrupt?t(k):F(k)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(k):o?b(k):w(k))}return k===45||ze(k)?(e.consume(k),a+=String.fromCharCode(k),g):n(k)}function y(k){return k===62?(e.consume(k),r.interrupt?t:F):n(k)}function b(k){return ye(k)?(e.consume(k),b):I(k)}function w(k){return k===47?(e.consume(k),I):k===58||k===95||We(k)?(e.consume(k),E):ye(k)?(e.consume(k),w):I(k)}function E(k){return k===45||k===46||k===58||k===95||ze(k)?(e.consume(k),E):x(k)}function x(k){return k===61?(e.consume(k),C):ye(k)?(e.consume(k),x):w(k)}function C(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),l=k,T):ye(k)?(e.consume(k),C):N(k)}function T(k){return k===l?(e.consume(k),l=null,$):k===null||fe(k)?n(k):(e.consume(k),T)}function N(k){return k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||Se(k)?x(k):(e.consume(k),N)}function $(k){return k===47||k===62||ye(k)?w(k):n(k)}function I(k){return k===62?(e.consume(k),D):n(k)}function D(k){return k===null||fe(k)?F(k):ye(k)?(e.consume(k),D):n(k)}function F(k){return k===45&&i===2?(e.consume(k),L):k===60&&i===1?(e.consume(k),U):k===62&&i===4?(e.consume(k),M):k===63&&i===3?(e.consume(k),v):k===93&&i===5?(e.consume(k),q):fe(k)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(zy,H,_)(k)):k===null||fe(k)?(e.exit("htmlFlowData"),_(k)):(e.consume(k),F)}function _(k){return e.check(jy,R,H)(k)}function R(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),P}function P(k){return k===null||fe(k)?_(k):(e.enter("htmlFlowData"),F(k))}function L(k){return k===45?(e.consume(k),v):F(k)}function U(k){return k===47?(e.consume(k),a="",z):F(k)}function z(k){if(k===62){const W=a.toLowerCase();return oc.includes(W)?(e.consume(k),M):F(k)}return We(k)&&a.length<8?(e.consume(k),a+=String.fromCharCode(k),z):F(k)}function q(k){return k===93?(e.consume(k),v):F(k)}function v(k){return k===62?(e.consume(k),M):k===45&&i===2?(e.consume(k),v):F(k)}function M(k){return k===null||fe(k)?(e.exit("htmlFlowData"),H(k)):(e.consume(k),M)}function H(k){return e.exit("htmlFlow"),t(k)}}function Wy(e,t,n){const r=this;return i;function i(a){return fe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function Vy(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(zn,t,n)}}const qy={name:"htmlText",tokenize:Ky};function Ky(e,t,n){const r=this;let i,o,a;return s;function s(v){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(v),l}function l(v){return v===33?(e.consume(v),c):v===47?(e.consume(v),x):v===63?(e.consume(v),w):We(v)?(e.consume(v),N):n(v)}function c(v){return v===45?(e.consume(v),f):v===91?(e.consume(v),o=0,m):We(v)?(e.consume(v),b):n(v)}function f(v){return v===45?(e.consume(v),d):n(v)}function u(v){return v===null?n(v):v===45?(e.consume(v),p):fe(v)?(a=u,U(v)):(e.consume(v),u)}function p(v){return v===45?(e.consume(v),d):u(v)}function d(v){return v===62?L(v):v===45?p(v):u(v)}function m(v){const M="CDATA[";return v===M.charCodeAt(o++)?(e.consume(v),o===M.length?h:m):n(v)}function h(v){return v===null?n(v):v===93?(e.consume(v),g):fe(v)?(a=h,U(v)):(e.consume(v),h)}function g(v){return v===93?(e.consume(v),y):h(v)}function y(v){return v===62?L(v):v===93?(e.consume(v),y):h(v)}function b(v){return v===null||v===62?L(v):fe(v)?(a=b,U(v)):(e.consume(v),b)}function w(v){return v===null?n(v):v===63?(e.consume(v),E):fe(v)?(a=w,U(v)):(e.consume(v),w)}function E(v){return v===62?L(v):w(v)}function x(v){return We(v)?(e.consume(v),C):n(v)}function C(v){return v===45||ze(v)?(e.consume(v),C):T(v)}function T(v){return fe(v)?(a=T,U(v)):ye(v)?(e.consume(v),T):L(v)}function N(v){return v===45||ze(v)?(e.consume(v),N):v===47||v===62||Se(v)?$(v):n(v)}function $(v){return v===47?(e.consume(v),L):v===58||v===95||We(v)?(e.consume(v),I):fe(v)?(a=$,U(v)):ye(v)?(e.consume(v),$):L(v)}function I(v){return v===45||v===46||v===58||v===95||ze(v)?(e.consume(v),I):D(v)}function D(v){return v===61?(e.consume(v),F):fe(v)?(a=D,U(v)):ye(v)?(e.consume(v),D):$(v)}function F(v){return v===null||v===60||v===61||v===62||v===96?n(v):v===34||v===39?(e.consume(v),i=v,_):fe(v)?(a=F,U(v)):ye(v)?(e.consume(v),F):(e.consume(v),R)}function _(v){return v===i?(e.consume(v),i=void 0,P):v===null?n(v):fe(v)?(a=_,U(v)):(e.consume(v),_)}function R(v){return v===null||v===34||v===39||v===60||v===61||v===96?n(v):v===47||v===62||Se(v)?$(v):(e.consume(v),R)}function P(v){return v===47||v===62||Se(v)?$(v):n(v)}function L(v){return v===62?(e.consume(v),e.exit("htmlTextData"),e.exit("htmlText"),t):n(v)}function U(v){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),z}function z(v){return ye(v)?ve(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):q(v)}function q(v){return e.enter("htmlTextData"),a(v)}}const lo={name:"labelEnd",resolveAll:Jy,resolveTo:Zy,tokenize:Xy},Yy={tokenize:eb},Gy={tokenize:tb},Qy={tokenize:nb};function Jy(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Ze(e,0,e.length,n),e}function Zy(e,t){let n=e.length,r=0,i,o,a,s;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",l,t],["enter",c,t]],s=rt(s,e.slice(o+1,o+r+3)),s=rt(s,[["enter",f,t]]),s=rt(s,Er(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),s=rt(s,[["exit",f,t],e[a-2],e[a-1],["exit",c,t]]),s=rt(s,e.slice(a+1)),s=rt(s,[["exit",l,t]]),Ze(e,o,e.length,s),e}function Xy(e,t,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(p){return o?o._inactive?u(p):(a=r.parser.defined.includes(at(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(Yy,f,a?f:u)(p):p===91?e.attempt(Gy,f,a?c:u)(p):a?f(p):u(p)}function c(p){return e.attempt(Qy,f,u)(p)}function f(p){return t(p)}function u(p){return o._balanced=!0,n(p)}}function eb(e,t,n){return r;function r(u){return e.enter("resource"),e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),i}function i(u){return Se(u)?Un(e,o)(u):o(u)}function o(u){return u===41?f(u):nc(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function a(u){return Se(u)?Un(e,l)(u):f(u)}function s(u){return n(u)}function l(u){return u===34||u===39||u===40?ic(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):f(u)}function c(u){return Se(u)?Un(e,f)(u):f(u)}function f(u){return u===41?(e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),e.exit("resource"),t):n(u)}}function tb(e,t,n){const r=this;return i;function i(s){return rc.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(at(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function nb(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const rb={name:"labelStartImage",resolveAll:lo.resolveAll,tokenize:ib};function ib(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const ob={name:"labelStartLink",resolveAll:lo.resolveAll,tokenize:ab};function ab(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const co={name:"lineEnding",tokenize:sb};function sb(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ve(e,t,"linePrefix")}}const Cr={name:"thematicBreak",tokenize:lb};function lb(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,s(c)}function s(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||fe(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),ye(c)?ve(e,s,"whitespace")(c):s(c))}}const Ye={continuation:{tokenize:db},exit:hb,name:"list",tokenize:fb},cb={partial:!0,tokenize:mb},ub={partial:!0,tokenize:pb};function fb(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(d){const m=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:oo(d)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(Cr,n,c)(d):c(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return oo(d)&&++a<10?(e.consume(d),l):(!r.interrupt||a<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),c(d)):n(d)}function c(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(zn,r.interrupt?n:f,e.attempt(cb,p,u))}function f(d){return r.containerState.initialBlankLine=!0,o++,p(d)}function u(d){return ye(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function db(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(zn,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ve(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!ye(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ub,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,ve(e,e.attempt(Ye,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function pb(e,t,n){const r=this;return ve(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function hb(e){e.exit(this.containerState.type)}function mb(e,t,n){const r=this;return ve(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!ye(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const ac={name:"setextUnderline",resolveTo:gb,tokenize:yb};function gb(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function yb(e,t,n){const r=this;let i;return o;function o(c){let f=r.events.length,u;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){u=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||u)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),ye(c)?ve(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||fe(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const bb={tokenize:vb};function vb(e){const t=this,n=e.attempt(zn,r,e.attempt(this.parser.constructs.flowInitial,i,ve(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ey,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const wb={resolveAll:lc()},xb=sc("string"),kb=sc("text");function sc(e){return{resolveAll:lc(e==="text"?Sb:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(f){return c(f)?o(f):s(f)}function s(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),l}function l(f){return c(f)?(n.exit("data"),o(f)):(n.consume(f),l)}function c(f){if(f===null)return!0;const u=i[f];let p=-1;if(u)for(;++p<u.length;){const d=u[p];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function lc(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Sb(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,a=-1,s=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(c===-2)l=!0,s++;else if(c!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const c={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const Eb=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:Oy},disable:{null:[]},document:{42:Ye,43:Ye,45:Ye,48:Ye,49:Ye,50:Ye,51:Ye,52:Ye,53:Ye,54:Ye,55:Ye,56:Ye,57:Ye,62:Ql},flow:{35:Ly,42:Cr,45:[ac,Cr],60:$y,61:ac,95:Cr,96:ec,126:ec},flowInitial:{[-2]:so,[-1]:so,32:so},insideSpan:{null:[ao,wb]},string:{38:Zl,92:Jl},text:{[-5]:co,[-4]:co,[-3]:co,33:rb,38:Zl,42:ao,60:[oy,qy],91:ob,92:[Ny,Jl],93:lo,95:ao,96:by}},Symbol.toStringTag,{value:"Module"}));function Cb(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],s=[];const l={attempt:T(x),check:T(C),consume:b,enter:w,exit:E,interrupt:T(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:d,write:u};let f=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function u(D){return a=rt(a,D),g(),a[a.length-1]!==null?[]:(N(t,0),c.events=Er(o,c.events,c),c.events)}function p(D,F){return Ib(d(D),F)}function d(D){return Ab(a,D)}function m(){const{_bufferIndex:D,_index:F,line:_,column:R,offset:P}=r;return{_bufferIndex:D,_index:F,line:_,column:R,offset:P}}function h(D){i[D.line]=D.column,I()}function g(){let D;for(;r._index<a.length;){const F=a[r._index];if(typeof F=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<F.length;)y(F.charCodeAt(r._bufferIndex));else y(F)}}function y(D){f=f(D)}function b(D){fe(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,I()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=D}function w(D,F){const _=F||{};return _.type=D,_.start=m(),c.events.push(["enter",_,c]),s.push(_),_}function E(D){const F=s.pop();return F.end=m(),c.events.push(["exit",F,c]),F}function x(D,F){N(D,F.from)}function C(D,F){F.restore()}function T(D,F){return _;function _(R,P,L){let U,z,q,v;return Array.isArray(R)?H(R):"tokenize"in R?H([R]):M(R);function M(Y){return X;function X(oe){const ae=oe!==null&&Y[oe],J=oe!==null&&Y.null,Q=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(J)?J:J?[J]:[]];return H(Q)(oe)}}function H(Y){return U=Y,z=0,Y.length===0?L:k(Y[z])}function k(Y){return X;function X(oe){return v=$(),q=Y,Y.partial||(c.currentConstruct=Y),Y.name&&c.parser.constructs.disable.null.includes(Y.name)?te():Y.tokenize.call(F?Object.assign(Object.create(c),F):c,l,W,te)(oe)}}function W(Y){return D(q,v),P}function te(Y){return v.restore(),++z<U.length?k(U[z]):L}}}function N(D,F){D.resolveAll&&!o.includes(D)&&o.push(D),D.resolve&&Ze(c.events,F,c.events.length-F,D.resolve(c.events.slice(F),c)),D.resolveTo&&(c.events=D.resolveTo(c.events,c))}function $(){const D=m(),F=c.previous,_=c.currentConstruct,R=c.events.length,P=Array.from(s);return{from:R,restore:L};function L(){r=D,c.previous=F,c.currentConstruct=_,c.events.length=R,s=P,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ab(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function Ib(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
1
+ (function(ne,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],S):(ne=typeof globalThis<"u"?globalThis:ne||self,S(ne.Webchat={},ne.ReactJsxRuntime,ne.React,ne.ReactDOM))})(this,function(ne,S,O,As){"use strict";var ET=Object.defineProperty;var CT=(ne,S,O)=>S in ne?ET(ne,S,{enumerable:!0,configurable:!0,writable:!0,value:O}):ne[S]=O;var Li=(ne,S,O)=>CT(ne,typeof S!="symbol"?S+"":S,O);var Nh,_h,Lh;var Fi=typeof document<"u"?document.currentScript:null;function Is(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const A=Is(O),Ts=Is(As);function xt(){return xt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xt.apply(null,arguments)}function Fh(e,t=[]){let n=[];function r(o,a){const s=O.createContext(a),l=n.length;n=[...n,a];function c(u){const{scope:p,children:d,...m}=u,h=(p==null?void 0:p[e][l])||s,g=O.useMemo(()=>m,Object.values(m));return O.createElement(h.Provider,{value:g},d)}function f(u,p){const d=(p==null?void 0:p[e][l])||s,m=O.useContext(d);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,f]}const i=()=>{const o=n.map(a=>O.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return O.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,Rh(i,...t)]}function Rh(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const u=l(o)[`__scope${c}`];return{...s,...u}},{});return O.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Bh(e){const t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const $h=globalThis!=null&&globalThis.document?O.useLayoutEffect:()=>{};function zh(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function jh(...e){return t=>e.forEach(n=>zh(n,t))}const Os=O.forwardRef((e,t)=>{const{children:n,...r}=e,i=O.Children.toArray(n),o=i.find(Hh);if(o){const a=o.props.children,s=i.map(l=>l===o?O.Children.count(a)>1?O.Children.only(null):O.isValidElement(a)?a.props.children:null:l);return O.createElement(Ri,xt({},r,{ref:t}),O.isValidElement(a)?O.cloneElement(a,void 0,s):null)}return O.createElement(Ri,xt({},r,{ref:t}),n)});Os.displayName="Slot";const Ri=O.forwardRef((e,t)=>{const{children:n,...r}=e;return O.isValidElement(n)?O.cloneElement(n,{...Wh(r,n.props),ref:t?jh(t,n.ref):n.ref}):O.Children.count(n)>1?O.Children.only(null):null});Ri.displayName="SlotClone";const Uh=({children:e})=>O.createElement(O.Fragment,null,e);function Hh(e){return O.isValidElement(e)&&e.type===Uh}function Wh(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const Bi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=O.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?Os:t;return O.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),O.createElement(s,xt({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ds="Avatar",[Vh]=Fh(Ds),[qh,Ms]=Vh(Ds),Ps=O.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=O.useState("idle");return O.createElement(qh,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o},O.createElement(Bi.span,xt({},r,{ref:t})))}),Kh="AvatarImage",Ns=O.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,a=Ms(Kh,n),s=Gh(r),l=Bh(c=>{i(c),a.onImageLoadingStatusChange(c)});return $h(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?O.createElement(Bi.img,xt({},o,{ref:t,src:r})):null}),Yh="AvatarFallback",_s=O.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=Ms(Yh,n),[a,s]=O.useState(r===void 0);return O.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&o.imageLoadingStatus!=="loaded"?O.createElement(Bi.span,xt({},i,{ref:t})):null});function Gh(e){const[t,n]=O.useState("idle");return O.useEffect(()=>{if(!e){n("error");return}let r=!0;const i=new window.Image,o=a=>()=>{r&&n(a)};return n("loading"),i.onload=o("loaded"),i.onerror=o("error"),i.src=e,()=>{r=!1}},[e]),t}function Qh(e,t){let n=`${e} {`;for(const[r,i]of Object.entries(t))n+=`${r}: ${i}; `;return n+="}",n}function Ls(e,t){let n=0;if(e.length==0)return n;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);n=(n<<5)-n+i,n=n&n}return Math.abs(n)%t}const Jh=(e,t={})=>new Promise((n,r)=>{if(typeof window>"u")return r("Window is not defined");if(!e)return r("Url is not defined");let i=null;const o=new Image;o.addEventListener("load",()=>{i&&clearTimeout(i),n({width:o.naturalWidth,height:o.naturalHeight})}),o.addEventListener("error",a=>{i&&clearTimeout(i),r(`${a.type}: ${a.message}`)}),o.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});var zt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fs={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(zt,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",s="minute",l="hour",c="day",f="week",u="month",p="quarter",d="year",m="date",h="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(L){var M=["th","st","nd","rd"],R=L%100;return"["+L+(M[(R-20)%10]||M[R]||M[0])+"]"}},w=function(L,M,R){var U=String(L);return!U||U.length>=M?L:""+Array(M+1-U.length).join(R)+L},C={s:w,z:function(L){var M=-L.utcOffset(),R=Math.abs(M),U=Math.floor(R/60),B=R%60;return(M<=0?"+":"-")+w(U,2,"0")+":"+w(B,2,"0")},m:function L(M,R){if(M.date()<R.date())return-L(R,M);var U=12*(R.year()-M.year())+(R.month()-M.month()),B=M.clone().add(U,u),V=R-B<0,v=M.clone().add(U+(V?-1:1),u);return+(-(U+(R-B)/(V?B-v:v-B))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:u,y:d,w:f,d:c,D:m,h:l,m:s,s:a,ms:o,Q:p}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},x="en",E={};E[x]=b;var T="$isDayjsObject",_=function(L){return L instanceof z||!(!L||!L[T])},$=function L(M,R,U){var B;if(!M)return x;if(typeof M=="string"){var V=M.toLowerCase();E[V]&&(B=V),R&&(E[V]=R,B=V);var v=M.split("-");if(!B&&v.length>1)return L(v[0])}else{var N=M.name;E[N]=M,B=N}return!U&&B&&(x=B),B||!U&&x},I=function(L,M){if(_(L))return L.clone();var R=typeof M=="object"?M:{};return R.date=L,R.args=arguments,new z(R)},D=C;D.l=$,D.i=_,D.w=function(L,M){return I(L,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var z=function(){function L(R){this.$L=$(R.locale,null,!0),this.parse(R),this.$x=this.$x||R.x||{},this[T]=!0}var M=L.prototype;return M.parse=function(R){this.$d=function(U){var B=U.date,V=U.utc;if(B===null)return new Date(NaN);if(D.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var v=B.match(g);if(v){var N=v[2]-1||0,H=(v[7]||"0").substring(0,3);return V?new Date(Date.UTC(v[1],N,v[3]||1,v[4]||0,v[5]||0,v[6]||0,H)):new Date(v[1],N,v[3]||1,v[4]||0,v[5]||0,v[6]||0,H)}}return new Date(B)}(R),this.init()},M.init=function(){var R=this.$d;this.$y=R.getFullYear(),this.$M=R.getMonth(),this.$D=R.getDate(),this.$W=R.getDay(),this.$H=R.getHours(),this.$m=R.getMinutes(),this.$s=R.getSeconds(),this.$ms=R.getMilliseconds()},M.$utils=function(){return D},M.isValid=function(){return this.$d.toString()!==h},M.isSame=function(R,U){var B=I(R);return this.startOf(U)<=B&&B<=this.endOf(U)},M.isAfter=function(R,U){return I(R)<this.startOf(U)},M.isBefore=function(R,U){return this.endOf(U)<I(R)},M.$g=function(R,U,B){return D.u(R)?this[U]:this.set(B,R)},M.unix=function(){return Math.floor(this.valueOf()/1e3)},M.valueOf=function(){return this.$d.getTime()},M.startOf=function(R,U){var B=this,V=!!D.u(U)||U,v=D.p(R),N=function(oe,G){var Q=D.w(B.$u?Date.UTC(B.$y,G,oe):new Date(B.$y,G,oe),B);return V?Q:Q.endOf(c)},H=function(oe,G){return D.w(B.toDate()[oe].apply(B.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(G)),B)},k=this.$W,W=this.$M,te=this.$D,Y="set"+(this.$u?"UTC":"");switch(v){case d:return V?N(1,0):N(31,11);case u:return V?N(1,W):N(0,W+1);case f:var Z=this.$locale().weekStart||0,re=(k<Z?k+7:k)-Z;return N(V?te-re:te+(6-re),W);case c:case m:return H(Y+"Hours",0);case l:return H(Y+"Minutes",1);case s:return H(Y+"Seconds",2);case a:return H(Y+"Milliseconds",3);default:return this.clone()}},M.endOf=function(R){return this.startOf(R,!1)},M.$set=function(R,U){var B,V=D.p(R),v="set"+(this.$u?"UTC":""),N=(B={},B[c]=v+"Date",B[m]=v+"Date",B[u]=v+"Month",B[d]=v+"FullYear",B[l]=v+"Hours",B[s]=v+"Minutes",B[a]=v+"Seconds",B[o]=v+"Milliseconds",B)[V],H=V===c?this.$D+(U-this.$W):U;if(V===u||V===d){var k=this.clone().set(m,1);k.$d[N](H),k.init(),this.$d=k.set(m,Math.min(this.$D,k.daysInMonth())).$d}else N&&this.$d[N](H);return this.init(),this},M.set=function(R,U){return this.clone().$set(R,U)},M.get=function(R){return this[D.p(R)]()},M.add=function(R,U){var B,V=this;R=Number(R);var v=D.p(U),N=function(W){var te=I(V);return D.w(te.date(te.date()+Math.round(W*R)),V)};if(v===u)return this.set(u,this.$M+R);if(v===d)return this.set(d,this.$y+R);if(v===c)return N(1);if(v===f)return N(7);var H=(B={},B[s]=r,B[l]=i,B[a]=n,B)[v]||1,k=this.$d.getTime()+R*H;return D.w(k,this)},M.subtract=function(R,U){return this.add(-1*R,U)},M.format=function(R){var U=this,B=this.$locale();if(!this.isValid())return B.invalidDate||h;var V=R||"YYYY-MM-DDTHH:mm:ssZ",v=D.z(this),N=this.$H,H=this.$m,k=this.$M,W=B.weekdays,te=B.months,Y=B.meridiem,Z=function(G,Q,j,X){return G&&(G[Q]||G(U,V))||j[Q].slice(0,X)},re=function(G){return D.s(N%12||12,G,"0")},oe=Y||function(G,Q,j){var X=G<12?"AM":"PM";return j?X.toLowerCase():X};return V.replace(y,function(G,Q){return Q||function(j){switch(j){case"YY":return String(U.$y).slice(-2);case"YYYY":return D.s(U.$y,4,"0");case"M":return k+1;case"MM":return D.s(k+1,2,"0");case"MMM":return Z(B.monthsShort,k,te,3);case"MMMM":return Z(te,k);case"D":return U.$D;case"DD":return D.s(U.$D,2,"0");case"d":return String(U.$W);case"dd":return Z(B.weekdaysMin,U.$W,W,2);case"ddd":return Z(B.weekdaysShort,U.$W,W,3);case"dddd":return W[U.$W];case"H":return String(N);case"HH":return D.s(N,2,"0");case"h":return re(1);case"hh":return re(2);case"a":return oe(N,H,!0);case"A":return oe(N,H,!1);case"m":return String(H);case"mm":return D.s(H,2,"0");case"s":return String(U.$s);case"ss":return D.s(U.$s,2,"0");case"SSS":return D.s(U.$ms,3,"0");case"Z":return v}return null}(G)||v.replace(":","")})},M.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},M.diff=function(R,U,B){var V,v=this,N=D.p(U),H=I(R),k=(H.utcOffset()-this.utcOffset())*r,W=this-H,te=function(){return D.m(v,H)};switch(N){case d:V=te()/12;break;case u:V=te();break;case p:V=te()/3;break;case f:V=(W-k)/6048e5;break;case c:V=(W-k)/864e5;break;case l:V=W/i;break;case s:V=W/r;break;case a:V=W/n;break;default:V=W}return B?V:D.a(V)},M.daysInMonth=function(){return this.endOf(u).$D},M.$locale=function(){return E[this.$L]},M.locale=function(R,U){if(!R)return this.$L;var B=this.clone(),V=$(R,U,!0);return V&&(B.$L=V),B},M.clone=function(){return D.w(this.$d,this)},M.toDate=function(){return new Date(this.valueOf())},M.toJSON=function(){return this.isValid()?this.toISOString():null},M.toISOString=function(){return this.$d.toISOString()},M.toString=function(){return this.$d.toUTCString()},L}(),P=z.prototype;return I.prototype=P,[["$ms",o],["$s",a],["$m",s],["$H",l],["$W",c],["$M",u],["$y",d],["$D",m]].forEach(function(L){P[L[1]]=function(M){return this.$g(M,L[0],L[1])}}),I.extend=function(L,M){return L.$i||(L(M,z,I),L.$i=!0),I},I.locale=$,I.isDayjs=_,I.unix=function(L){return I(1e3*L)},I.en=E[x],I.Ls=E,I.p={},I})})(Fs);var Zh=Fs.exports;const br=jt(Zh);var Rs={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(zt,function(){return function(n,r,i){r.prototype.isToday=function(){var o="YYYY-MM-DD",a=i();return this.format(o)===a.format(o)}}})})(Rs);var Xh=Rs.exports;const em=jt(Xh);var Bs={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(zt,function(){return function(n,r,i){r.prototype.isYesterday=function(){var o="YYYY-MM-DD",a=i().subtract(1,"day");return this.format(o)===a.format(o)}}})})(Bs);var tm=Bs.exports;const nm=jt(tm);br.extend(em),br.extend(nm);function $s(e,t,n,r,i){return e.map(o=>{const{authorId:a}=o,s=a===n?"outgoing":"incoming",l=t.find(f=>f.id===a);let c;return l&&l.id===n?c={name:l.name||"You",avatar:l.pictureUrl}:l?c={name:l.name||"Agent",avatar:l.pictureUrl}:c={name:r||"Bot",avatar:i},{...o,direction:s,sender:c}})}function rm(e,t="day"){var r,i,o;if(!e||e.length===0)return[];const n=[];(r=e[0])!=null&&r.timestamp&&n.push(zs(e[0].timestamp));for(let a=0;a<e.length;a++)if(e[a]&&n.push(e[a]),a+1<e.length){const s=(i=e[a])==null?void 0:i.timestamp,l=(o=e[a+1])==null?void 0:o.timestamp;!br(s).isSame(l,t)&&l&&n.push(zs(l))}return n}function zs(e){return{id:js(e),direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:js(e)}}}function js(e,t=!1){const n=br(e),r="h:mma";return n.isToday()?t?`Today • ${n.format(r)}`:"Today":n.isYesterday()?t?`Yesterday • ${n.format(r)}`:"Yesterday":t?n.format(`YYYY-MM-DD • ${r}`):n.format("YYYY-MM-DD")}function im(e=""){if(typeof e!="string")throw new TypeError("Color should be string!");const t=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(e);if(t)return t.splice(1).map(r=>Number.parseInt(r,16));const n=/^#?([\da-f])([\da-f])([\da-f])$/i.exec(e);if(n)return n.splice(1).map(r=>Number.parseInt(r+r,16));if(e.includes(","))return e.split(",").map(r=>Number.parseInt(r));throw new Error("Invalid color format! Use #ABC or #AABBCC or r,g,b")}function om(e){return"#"+e.map(t=>`0${t.toString(16).toUpperCase()}`.slice(-2)).join("")}function am(e,t){return e.map(n=>Math.round(n+(255-n)*t))}function sm(e,t){return e.map(n=>Math.round(n*t))}const Nn=e=>t=>am(t,e),_n=e=>t=>sm(t,e),lm={50:Nn(.95),100:Nn(.9),200:Nn(.75),300:Nn(.6),400:Nn(.3),500:e=>e,600:_n(.9),700:_n(.6),800:_n(.45),900:_n(.3),950:_n(.2)};function Us(e,t=lm){const n={},r=im(e);for(const[i,o]of Object.entries(t))n[i]=om(o(r));return n}const Hs=()=>{const e={};return{on:(i,o)=>{var a;return e[i]||(e[i]=new Set),(a=e[i])==null||a.add(o),()=>{var s;return(s=e[i])==null?void 0:s.delete(o)}},emit:(i,o)=>{var a,s;(a=e[i])==null||a.forEach(l=>l(o)),(s=e["*"])==null||s.forEach(l=>l({type:i,payload:o}))},removeAllListeners:i=>{var o;i?(o=e[i])==null||o.clear():Object.keys(e).forEach(a=>{var s;(s=e[a])==null||s.clear()})}}};function $i(e){if(!/^#?([a-fA-F\d]{6}|[a-fA-F\d]{3})$/.test(e))return{r:0,g:0,b:0};const n=e.replace(/^#/,"");let r=n;n.length===3&&(r=n.split("").map(l=>l+l).join(""));const i=parseInt(r,16),o=i>>16&255,a=i>>8&255,s=i&255;return{r:o,g:a,b:s}}function cm(e){return`#${((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}`}const um=(e,t=30)=>{const n=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b,n+1);return{r:Math.floor((e.r-n)/(r-n)*t*(1-.299)+120-t/2),g:Math.floor((e.g-n)/(r-n)*t*(1-.587)+120-t/2),b:Math.floor((e.b-n)/(r-n)*t*(1-.114)+120-t/2)}};function Ws(e){return Object.entries(e).reduce((t,[n,r])=>{const i=n.replace(/(\d+)/,o=>(1e3-parseInt(o)).toString());return{...t,[i]:r}},{})}const fm=2.4,dm=.2126729,pm=.7151522,hm=.072175,mm=.56,gm=.57,ym=.62,bm=.65,vr=.022,Vs=1.414,vm=1.14,wm=1.14,xm=.035991,km=27.7847239587675,Sm=27.7847239587675,qs=.027,Ks=.027,Ys=.001,Em=5e-4;function Gs(e){const{r:t,g:n,b:r}=e,i=o=>(o/255)**fm;return dm*i(t)+pm*i(n)+hm*i(r)}function Qs(e,t){if(!e||!t)return 0;let n=Gs($i(e)),r=Gs($i(t)),i=0,o=0;return n=n>vr?n:n+(vr-n)**Vs,r=r>vr?r:r+(vr-r)**Vs,Math.abs(r-n)<Em?0:(r>n?(i=(r**mm-n**gm)*vm,o=i<Ys?0:i<xm?i-i*km*qs:i-qs):(i=(r**bm-n**ym)*wm,o=i>-Ys?0:i>-.035991?i-i*Sm*Ks:i+Ks),Math.abs(o*100))}const Cm=(e,t,n)=>{const r=e;let i=0;for(;t.some(o=>n(o)===e);)i+=1,e=`${r} (${i})`;return e};function Js(e){const{fontFamily:t,...n}=e,r=Zs(n);return Qh(".bpReset",{...r,"font-family":`'${t}', sans-serif`})}function Zs(e){const{radius:t,themeMode:n,color:r,variant:i,headerVariant:o}=e;let a={},s={};if(r){const p=Us(r),d=n==="dark"?Ws(p):p,m=Us(cm(um($i(r)))),h=n==="dark"?Ws(m):m,g=n==="dark"?"#101010":"#fdfdfd";s=Object.entries({...d,1:g}).reduce((b,[w,C])=>({...b,[`--bpPrimary-${w}`]:C}),{});const y=Object.entries({...h,1:g}).reduce((b,[w,C])=>({...b,[`--bpGray-${w}`]:C}),{});a={...s,...y}}t&&(a={...a,"--bpRadius-scale":t.toString()});const l=n==="dark"?{bg:"var(--transparent-dark)",bgHover:"var(--transparent-dark-hover)"}:{bg:"var(--transparent-light)",bgHover:"var(--transparent-light-hover)"},c=s?Qs(s["--bpPrimary-600"],s["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)",f=i==="solid"?{"--message-bg":"var(--bpPrimary-600)","--message-bg-hover":"var(--bpPrimary-700)","--message-text":c,"--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-200)","--button-bg-hover":"var(--bpPrimary-300)","--button-text":"var(--bpPrimary-800)","--fab-bg":"var(--bpPrimary-600)","--fab-bg-hover":"var(--bpPrimary-700)","--fab-icon":c,"--modal-submit-bg":"var(--bpPrimary-600)","--modal-submit-bg-hover":"var(--bpPrimary-700)"}:{"--message-bg":"var(--bpPrimary-100)","--message-bg-hover":"var(--bpPrimary-200)","--message-text":"var(--bpPrimary-900)","--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-500)","--button-bg-hover":"var(--bpPrimary-600)","--button-text":s?Qs(s["--bpPrimary-500"],s["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)","--fab-bg":"var(--bpPrimary-100)","--fab-bg-hover":"var(--bpPrimary-200)","--fab-icon":"var(--bpPrimary-700)","--scrollbar":"var(--bpGray-500)","--scrollbar-hover":"var(--bpGray-400)","--modal-submit-bg":"var(--bpPrimary-200)","--modal-submit-bg-hover":"var(--bpPrimary-300)"},u=o==="solid"?{"--header-bg":"var(--bpPrimary-600)","--header-bg-hover":"var(--bpPrimary-700)","--header-hover-dark":"var(--bpPrimary-800)","--header-title":c,"--header-description":c,"--header-description-icon":c,"--header-description-link":c,"--header-avatar-bg":"var(--bpPrimary-300)","--header-avatar-text":"var(--bpPrimary-700)"}:{"--header-bg":l.bg,"--header-bg-hover":l.bgHover,"--header-hover-dark":"var(--bpGray-200)","--header-title":"var(--bpGray-900)","--header-description":"var(--bpGray-600)","--header-description-icon":"var(--bpPrimary-700)","--header-description-link":"var(--bpPrimary-800)","--header-avatar-bg":"var(--bpPrimary-600)","--header-avatar-text":"var(--bpPrimary-50)"};return{...a,...f,...u}}const Am=e=>{if(typeof URL.canParse=="function")return URL.canParse(e);try{return new URL(e),!0}catch{return!1}},Xs=["audio","file","image","video"],el=e=>Xs.includes(e),tl="The Client ID is required to initialize the webchat.",Im="The API url is required to initialize the webchat.",Tm="The Bot ID is required to initialize the webchat.",Om="No config URL provided.",nl=`Invalid API URL.
2
+ Please use a valid API URL.`,rl=`Invalid Client ID.
3
+ Please use a valid Botpress Client ID.`,il=`Invalid URL.
4
+ Please make sure your client ID and API URL are valid`,Dm=`Invalid config URL.
5
+ Please make sure your config URL is valid`,Mm=`Invalid webchat configuration.
6
+ Please make sure your config file is valid`,Pm="Access denied to configuration file. Please check your credentials or your configuration URL and try again.",ol=`This bot has temporarily paused.
7
+ Please check back later.`,al=`This bot has temporarily paused.
8
+ Please check back later.`,zi="Something went wrong. To fix it, please clear your browser's local and session storage and then refresh the page",Ln="Please check your internet connection and refresh the page.",sl=`You've been disconnected from the conversation.
9
+ Please refresh the page.`,ll=`Unable to process the message.
10
+ Please start a new conversation.`,ji={ResourceNotFound:{type:"configuration",message:rl},Forbidden:{type:"bot",message:ol}},Ui={MethodNotFound:{type:"configuration",message:il},QuotaExceeded:{type:"bot",message:al},Forbidden:{type:"bot",message:zi}};function cl(e){return e in ji}function ul(e){return e in Ui}function fl(e){return e!==null&&typeof e=="object"&&"id"in e&&"code"in e&&"type"in e}function dl(e){return e!==null&&typeof e=="object"&&"type"in e&&e.type==="error"&&"message"in e&&typeof e.message=="string"}const pl=async(e,t=3,n=1e3)=>{let r;for(let i=1;i<=t;i++)try{return await e()}catch(o){if(r=o,i===t)throw r;const a=n*Math.pow(2,i-1);await new Promise(s=>setTimeout(s,a))}throw new Error("Unreachable: retry loop should always return or throw")},Nm=["networkerror","failedtofetch","errorininputstream"],wr=e=>{var n;console.error("An error occurred:",e);let t={type:"unknown",message:"An unexpected error occurred"};if(fl(e))e.type==="network"?t={id:e.id,type:"network",message:Ln}:(n=e.message)!=null&&n.includes("[Webhook Handler]")&&cl(e.type)?t={id:e.id,...ji[e.type]}:ul(e.type)?t={id:e.id,...Ui[e.type]}:t={id:e.id,type:e.type,message:e.message||"An error occurred"};else if(dl(e))hl(e.message)?t={type:"disconnected",message:sl}:ml(e.message).includes("invalidcontenttype")?t={type:"bot",message:ll}:t={type:"event",message:e.message};else if(e instanceof Error&&hl(e.message))t={type:"network",message:Ln};else if(e&&typeof e=="object"&&"type"in e&&"message"in e){const r=e;r.type==="network"?t={type:"network",message:Ln}:t={type:r.type,message:r.message}}return t};function hl(e){return Nm.some(t=>ml(e).includes(t))}function ml(e){return e.replaceAll(" ","").toLowerCase()}const Fn=O.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...o},a)=>{const s=Ls(e??"",15);return S.jsxs(Ps,{ref:a,"data-color":s,...n,...o,children:[S.jsx(Ns,{src:t,...r}),S.jsx(_s,{...i,children:typeof o.children=="string"?o.children[0]:o.children})]})});Fn.displayName="Avatar";function IT(){}function TT(){}function _m(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Lm=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Fm=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Rm={};function gl(e,t){return(Rm.jsx?Fm:Lm).test(e)}const Bm=/[ \t\n\f\r]/g;function $m(e){return typeof e=="object"?e.type==="text"?yl(e.value):!1:yl(e)}function yl(e){return e.replace(Bm,"")===""}class Rn{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Rn.prototype.normal={},Rn.prototype.property={},Rn.prototype.space=void 0;function bl(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Rn(n,r,t)}function Hi(e){return e.toLowerCase()}class Ge{constructor(t,n){this.attribute=n,this.property=t}}Ge.prototype.attribute="",Ge.prototype.booleanish=!1,Ge.prototype.boolean=!1,Ge.prototype.commaOrSpaceSeparated=!1,Ge.prototype.commaSeparated=!1,Ge.prototype.defined=!1,Ge.prototype.mustUseProperty=!1,Ge.prototype.number=!1,Ge.prototype.overloadedBoolean=!1,Ge.prototype.property="",Ge.prototype.spaceSeparated=!1,Ge.prototype.space=void 0;let zm=0;const me=Ut(),Fe=Ut(),Wi=Ut(),J=Ut(),Oe=Ut(),Xt=Ut(),Xe=Ut();function Ut(){return 2**++zm}const Vi=Object.freeze(Object.defineProperty({__proto__:null,boolean:me,booleanish:Fe,commaOrSpaceSeparated:Xe,commaSeparated:Xt,number:J,overloadedBoolean:Wi,spaceSeparated:Oe},Symbol.toStringTag,{value:"Module"})),qi=Object.keys(Vi);class Ki extends Ge{constructor(t,n,r,i){let o=-1;if(super(t,n),vl(this,"space",i),typeof r=="number")for(;++o<qi.length;){const a=qi[o];vl(this,qi[o],(r&Vi[a])===Vi[a])}}}Ki.prototype.defined=!0;function vl(e,t,n){n&&(e[t]=n)}function en(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Ki(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Hi(r)]=r,n[Hi(o.attribute)]=r}return new Rn(t,n,e.space)}const wl=en({properties:{ariaActiveDescendant:null,ariaAtomic:Fe,ariaAutoComplete:null,ariaBusy:Fe,ariaChecked:Fe,ariaColCount:J,ariaColIndex:J,ariaColSpan:J,ariaControls:Oe,ariaCurrent:null,ariaDescribedBy:Oe,ariaDetails:null,ariaDisabled:Fe,ariaDropEffect:Oe,ariaErrorMessage:null,ariaExpanded:Fe,ariaFlowTo:Oe,ariaGrabbed:Fe,ariaHasPopup:null,ariaHidden:Fe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Oe,ariaLevel:J,ariaLive:null,ariaModal:Fe,ariaMultiLine:Fe,ariaMultiSelectable:Fe,ariaOrientation:null,ariaOwns:Oe,ariaPlaceholder:null,ariaPosInSet:J,ariaPressed:Fe,ariaReadOnly:Fe,ariaRelevant:null,ariaRequired:Fe,ariaRoleDescription:Oe,ariaRowCount:J,ariaRowIndex:J,ariaRowSpan:J,ariaSelected:Fe,ariaSetSize:J,ariaSort:null,ariaValueMax:J,ariaValueMin:J,ariaValueNow:J,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function xl(e,t){return t in e?e[t]:t}function kl(e,t){return xl(e,t.toLowerCase())}const jm=en({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Xt,acceptCharset:Oe,accessKey:Oe,action:null,allow:null,allowFullScreen:me,allowPaymentRequest:me,allowUserMedia:me,alt:null,as:null,async:me,autoCapitalize:null,autoComplete:Oe,autoFocus:me,autoPlay:me,blocking:Oe,capture:null,charSet:null,checked:me,cite:null,className:Oe,cols:J,colSpan:null,content:null,contentEditable:Fe,controls:me,controlsList:Oe,coords:J|Xt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:me,defer:me,dir:null,dirName:null,disabled:me,download:Wi,draggable:Fe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:me,formTarget:null,headers:Oe,height:J,hidden:Wi,high:J,href:null,hrefLang:null,htmlFor:Oe,httpEquiv:Oe,id:null,imageSizes:null,imageSrcSet:null,inert:me,inputMode:null,integrity:null,is:null,isMap:me,itemId:null,itemProp:Oe,itemRef:Oe,itemScope:me,itemType:Oe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:me,low:J,manifest:null,max:null,maxLength:J,media:null,method:null,min:null,minLength:J,multiple:me,muted:me,name:null,nonce:null,noModule:me,noValidate:me,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:me,optimum:J,pattern:null,ping:Oe,placeholder:null,playsInline:me,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:me,referrerPolicy:null,rel:Oe,required:me,reversed:me,rows:J,rowSpan:J,sandbox:Oe,scope:null,scoped:me,seamless:me,selected:me,shadowRootClonable:me,shadowRootDelegatesFocus:me,shadowRootMode:null,shape:null,size:J,sizes:null,slot:null,span:J,spellCheck:Fe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:J,step:null,style:null,tabIndex:J,target:null,title:null,translate:null,type:null,typeMustMatch:me,useMap:null,value:Fe,width:J,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Oe,axis:null,background:null,bgColor:null,border:J,borderColor:null,bottomMargin:J,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:me,declare:me,event:null,face:null,frame:null,frameBorder:null,hSpace:J,leftMargin:J,link:null,longDesc:null,lowSrc:null,marginHeight:J,marginWidth:J,noResize:me,noHref:me,noShade:me,noWrap:me,object:null,profile:null,prompt:null,rev:null,rightMargin:J,rules:null,scheme:null,scrolling:Fe,standby:null,summary:null,text:null,topMargin:J,valueType:null,version:null,vAlign:null,vLink:null,vSpace:J,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:me,disableRemotePlayback:me,prefix:null,property:null,results:J,security:null,unselectable:null},space:"html",transform:kl}),Um=en({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Xe,accentHeight:J,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:J,amplitude:J,arabicForm:null,ascent:J,attributeName:null,attributeType:null,azimuth:J,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:J,by:null,calcMode:null,capHeight:J,className:Oe,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:J,diffuseConstant:J,direction:null,display:null,dur:null,divisor:J,dominantBaseline:null,download:me,dx:null,dy:null,edgeMode:null,editable:null,elevation:J,enableBackground:null,end:null,event:null,exponent:J,externalResourcesRequired:null,fill:null,fillOpacity:J,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Xt,g2:Xt,glyphName:Xt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:J,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:J,horizOriginX:J,horizOriginY:J,id:null,ideographic:J,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:J,k:J,k1:J,k2:J,k3:J,k4:J,kernelMatrix:Xe,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:J,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:J,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:J,overlineThickness:J,paintOrder:null,panose1:null,path:null,pathLength:J,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Oe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:J,pointsAtY:J,pointsAtZ:J,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xe,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xe,rev:Xe,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xe,requiredFeatures:Xe,requiredFonts:Xe,requiredFormats:Xe,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:J,specularExponent:J,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:J,strikethroughThickness:J,string:null,stroke:null,strokeDashArray:Xe,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:J,strokeOpacity:J,strokeWidth:null,style:null,surfaceScale:J,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xe,tabIndex:J,tableValues:null,target:null,targetX:J,targetY:J,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xe,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:J,underlineThickness:J,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:J,values:null,vAlphabetic:J,vMathematical:J,vectorEffect:null,vHanging:J,vIdeographic:J,version:null,vertAdvY:J,vertOriginX:J,vertOriginY:J,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:J,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:xl}),Sl=en({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),El=en({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:kl}),Cl=en({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Hm={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Wm=/[A-Z]/g,Al=/-[a-z]/g,Vm=/^data[-\w.:]+$/i;function qm(e,t){const n=Hi(t);let r=t,i=Ge;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Vm.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Al,Ym);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Al.test(o)){let a=o.replace(Wm,Km);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Ki}return new i(r,t)}function Km(e){return"-"+e.toLowerCase()}function Ym(e){return e.charAt(1).toUpperCase()}const Gm=bl([wl,jm,Sl,El,Cl],"html"),Yi=bl([wl,Um,Sl,El,Cl],"svg");function Qm(e){return e.join(" ").trim()}var Gi={},Il=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Jm=/\n/g,Zm=/^\s*/,Xm=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,eg=/^:\s*/,tg=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ng=/^[;\s]*/,rg=/^\s+|\s+$/g,ig=`
11
+ `,Tl="/",Ol="*",Ht="",og="comment",ag="declaration";function sg(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var h=m.match(Jm);h&&(n+=h.length);var g=m.lastIndexOf(ig);r=~g?m.length-g:r+m.length}function o(){var m={line:n,column:r};return function(h){return h.position=new a(m),c(),h}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function s(m){var h=new Error(t.source+":"+n+":"+r+": "+m);if(h.reason=m,h.filename=t.source,h.line=n,h.column=r,h.source=e,!t.silent)throw h}function l(m){var h=m.exec(e);if(h){var g=h[0];return i(g),e=e.slice(g.length),h}}function c(){l(Zm)}function f(m){var h;for(m=m||[];h=u();)h!==!1&&m.push(h);return m}function u(){var m=o();if(!(Tl!=e.charAt(0)||Ol!=e.charAt(1))){for(var h=2;Ht!=e.charAt(h)&&(Ol!=e.charAt(h)||Tl!=e.charAt(h+1));)++h;if(h+=2,Ht===e.charAt(h-1))return s("End of comment missing");var g=e.slice(2,h-2);return r+=2,i(g),e=e.slice(h),r+=2,m({type:og,comment:g})}}function p(){var m=o(),h=l(Xm);if(h){if(u(),!l(eg))return s("property missing ':'");var g=l(tg),y=m({type:ag,property:Dl(h[0].replace(Il,Ht)),value:g?Dl(g[0].replace(Il,Ht)):Ht});return l(ng),y}}function d(){var m=[];f(m);for(var h;h=p();)h!==!1&&(m.push(h),f(m));return m}return c(),d()}function Dl(e){return e?e.replace(rg,Ht):Ht}var lg=sg,cg=zt&&zt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.default=fg;const ug=cg(lg);function fg(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,ug.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:a,value:s}=o;i?t(a,s,o):s&&(n=n||{},n[a]=s)}),n}var xr={};Object.defineProperty(xr,"__esModule",{value:!0}),xr.camelCase=void 0;var dg=/^--[a-zA-Z0-9_-]+$/,pg=/-([a-z])/g,hg=/^[^-]+$/,mg=/^-(webkit|moz|ms|o|khtml)-/,gg=/^-(ms)-/,yg=function(e){return!e||hg.test(e)||dg.test(e)},bg=function(e,t){return t.toUpperCase()},Ml=function(e,t){return"".concat(t,"-")},vg=function(e,t){return t===void 0&&(t={}),yg(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(gg,Ml):e=e.replace(mg,Ml),e.replace(pg,bg))};xr.camelCase=vg;var wg=zt&&zt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},xg=wg(Gi),kg=xr;function Qi(e,t){var n={};return!e||typeof e!="string"||(0,xg.default)(e,function(r,i){r&&i&&(n[(0,kg.camelCase)(r,t)]=i)}),n}Qi.default=Qi;var Sg=Qi;const Eg=jt(Sg),Pl=Nl("end"),Ji=Nl("start");function Nl(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Cg(e){const t=Ji(e),n=Pl(e);if(t&&n)return{start:t,end:n}}function Bn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?_l(e.position):"start"in e||"end"in e?_l(e):"line"in e||"column"in e?Zi(e):""}function Zi(e){return Ll(e&&e.line)+":"+Ll(e&&e.column)}function _l(e){return Zi(e&&e.start)+"-"+Zi(e&&e.end)}function Ll(e){return e&&typeof e=="number"?e:1}class He extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=Bn(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}He.prototype.file="",He.prototype.name="",He.prototype.reason="",He.prototype.message="",He.prototype.stack="",He.prototype.column=void 0,He.prototype.line=void 0,He.prototype.ancestors=void 0,He.prototype.cause=void 0,He.prototype.fatal=void 0,He.prototype.place=void 0,He.prototype.ruleId=void 0,He.prototype.source=void 0;const Xi={}.hasOwnProperty,Ag=new Map,Ig=/[A-Z]/g,Tg=new Set(["table","tbody","thead","tfoot","tr"]),Og=new Set(["td","th"]),Fl="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Dg(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Bg(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Rg(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Yi:Gm,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Rl(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Rl(e,t,n){if(t.type==="element")return Mg(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Pg(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return _g(e,t,n);if(t.type==="mdxjsEsm")return Ng(e,t);if(t.type==="root")return Lg(e,t,n);if(t.type==="text")return Fg(e,t)}function Mg(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Yi,e.schema=i),e.ancestors.push(t);const o=$l(e,t.tagName,!1),a=$g(e,t);let s=to(e,t);return Tg.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!$m(l):!0})),Bl(e,a,o,t),eo(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function Pg(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}$n(e,t.position)}function Ng(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$n(e,t.position)}function _g(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Yi,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:$l(e,t.name,!0),a=zg(e,t),s=to(e,t);return Bl(e,a,o,t),eo(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function Lg(e,t,n){const r={};return eo(r,to(e,t)),e.create(t,e.Fragment,r,n)}function Fg(e,t){return t.value}function Bl(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function eo(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Rg(e,t,n){return r;function r(i,o,a,s){const c=Array.isArray(a.children)?n:t;return s?c(o,a,s):c(o,a)}}function Bg(e,t){return n;function n(r,i,o,a){const s=Array.isArray(o.children),l=Ji(r);return t(i,o,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function $g(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Xi.call(t.properties,i)){const o=jg(e,i,t.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&Og.has(t.tagName)?r=s:n[a]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function zg(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const s=a.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else $n(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else $n(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function to(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Ag;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;a=l+"-"+c,i.set(l,c+1)}}const s=Rl(e,o,a);s!==void 0&&n.push(s)}return n}function jg(e,t,n){const r=qm(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?_m(n):Qm(n)),r.property==="style"){let i=typeof n=="object"?n:Ug(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Hg(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Hm[r.property]||r.property:r.attribute,n]}}function Ug(e,t){try{return Eg(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new He("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Fl+"#cannot-parse-style-attribute",i}}function $l(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const s=gl(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}r=a}else r=gl(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Xi.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);$n(e)}function $n(e,t){const n=new He("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Fl+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Hg(e){const t={};let n;for(n in e)Xi.call(e,n)&&(t[Wg(n)]=e[n]);return t}function Wg(e){let t=e.replace(Ig,Vg);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Vg(e){return"-"+e.toLowerCase()}const no={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},qg={};function ro(e,t){const n=qg,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return zl(e,r,i)}function zl(e,t,n){if(Kg(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return jl(e.children,t,n)}return Array.isArray(e)?jl(e,t,n):""}function jl(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=zl(e[i],t,n);return r.join("")}function Kg(e){return!!(e&&typeof e=="object")}const Ul=document.createElement("i");function io(e){const t="&"+e+";";Ul.innerHTML=t;const n=Ul.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function et(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function it(e,t){return e.length>0?(et(e,e.length,0,t),e):t}const Hl={}.hasOwnProperty;function Wl(e){const t={};let n=-1;for(;++n<e.length;)Yg(t,e[n]);return t}function Yg(e,t){let n;for(n in t){const i=(Hl.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){Hl.call(i,a)||(i[a]=[]);const s=o[a];Gg(i[a],Array.isArray(s)?s:s?[s]:[])}}}function Gg(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);et(e,0,0,r)}function Vl(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function st(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const qe=It(/[A-Za-z]/),We=It(/[\dA-Za-z]/),Qg=It(/[#-'*+\--9=?A-Z^-~]/);function kr(e){return e!==null&&(e<32||e===127)}const oo=It(/\d/),Jg=It(/[\dA-Fa-f]/),Zg=It(/[!-/:-@[-`{-~]/);function fe(e){return e!==null&&e<-2}function Ae(e){return e!==null&&(e<0||e===32)}function be(e){return e===-2||e===-1||e===32}const Sr=It(new RegExp("\\p{P}|\\p{S}","u")),Wt=It(/\s/);function It(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function tn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&We(e.charCodeAt(n+1))&&We(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function we(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return be(l)?(e.enter(n),s(l)):t(l)}function s(l){return be(l)&&o++<i?(e.consume(l),s):(e.exit(n),t(l))}}const Xg={tokenize:ey};function ey(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),we(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return fe(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}const ty={tokenize:ny},ql={tokenize:ry};function ny(e){const t=this,n=[];let r=0,i,o,a;return s;function s(w){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const C=t.events.length;let x=C,E;for(;x--;)if(t.events[x][0]==="exit"&&t.events[x][1].type==="chunkFlow"){E=t.events[x][1].end;break}y(r);let T=C;for(;T<t.events.length;)t.events[T][1].end={...E},T++;return et(t.events,x+1,0,t.events.slice(C)),t.events.length=T,c(w)}return s(w)}function c(w){if(r===n.length){if(!i)return p(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ql,f,u)(w)}function f(w){return i&&b(),y(r),p(w)}function u(w){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,m(w)}function p(w){return t.containerState={},e.attempt(ql,d,m)(w)}function d(w){return r++,n.push([t.currentConstruct,t.containerState]),p(w)}function m(w){if(w===null){i&&b(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),h(w)}function h(w){if(w===null){g(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return fe(w)?(e.consume(w),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(w),h)}function g(w,C){const x=t.sliceStream(w);if(C&&x.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(x),t.parser.lazy[w.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<a&&(!i.events[E][1].end||i.events[E][1].end.offset>a))return;const T=t.events.length;let _=T,$,I;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if($){I=t.events[_][1].end;break}$=!0}for(y(r),E=T;E<t.events.length;)t.events[E][1].end={...I},E++;et(t.events,_+1,0,t.events.slice(T)),t.events.length=E}}function y(w){let C=n.length;for(;C-- >w;){const x=n[C];t.containerState=x[1],x[0].exit.call(t,e)}n.length=w}function b(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ry(e,t,n){return we(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function nn(e){if(e===null||Ae(e)||Wt(e))return 1;if(Sr(e))return 2}function Er(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const ao={name:"attention",resolveAll:iy,tokenize:oy};function iy(e,t){let n=-1,r,i,o,a,s,l,c,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const u={...e[r][1].end},p={...e[n][1].start};Kl(u,-l),Kl(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:u,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[n][1].start={...s.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=it(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=it(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),c=it(c,Er(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=it(c,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,c=it(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,et(e,r-1,n-r+3,c),n=r+c.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function oy(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=nn(r);let o;return a;function a(l){return o=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===o)return e.consume(l),s;const c=e.exit("attentionSequence"),f=nn(l),u=!f||f===2&&i||n.includes(l),p=!i||i===2&&f||n.includes(r);return c._open=!!(o===42?u:u&&(i||!p)),c._close=!!(o===42?p:p&&(f||!u)),t(l)}}function Kl(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const ay={name:"autolink",tokenize:sy};function sy(e,t,n){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(d){return qe(d)?(e.consume(d),a):d===64?n(d):c(d)}function a(d){return d===43||d===45||d===46||We(d)?(r=1,s(d)):c(d)}function s(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||We(d))&&r++<32?(e.consume(d),s):(r=0,c(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||kr(d)?n(d):(e.consume(d),l)}function c(d){return d===64?(e.consume(d),f):Qg(d)?(e.consume(d),c):n(d)}function f(d){return We(d)?u(d):n(d)}function u(d){return d===46?(e.consume(d),r=0,f):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):p(d)}function p(d){if((d===45||We(d))&&r++<63){const m=d===45?p:u;return e.consume(d),m}return n(d)}}const zn={partial:!0,tokenize:ly};function ly(e,t,n){return r;function r(o){return be(o)?we(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||fe(o)?t(o):n(o)}}const Yl={continuation:{tokenize:uy},exit:fy,name:"blockQuote",tokenize:cy};function cy(e,t,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return be(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function uy(e,t,n){const r=this;return i;function i(a){return be(a)?we(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(Yl,t,n)(a)}}function fy(e){e.exit("blockQuote")}const Gl={name:"characterEscape",tokenize:dy};function dy(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Zg(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Ql={name:"characterReference",tokenize:py};function py(e,t,n){const r=this;let i=0,o,a;return s;function s(u){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),l}function l(u){return u===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(u),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,a=We,f(u))}function c(u){return u===88||u===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(u),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=Jg,f):(e.enter("characterReferenceValue"),o=7,a=oo,f(u))}function f(u){if(u===59&&i){const p=e.exit("characterReferenceValue");return a===We&&!io(r.sliceSerialize(p))?n(u):(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(u)&&i++<o?(e.consume(u),f):n(u)}}const Jl={partial:!0,tokenize:my},Zl={concrete:!0,name:"codeFenced",tokenize:hy};function hy(e,t,n){const r=this,i={partial:!0,tokenize:x};let o=0,a=0,s;return l;function l(E){return c(E)}function c(E){const T=r.events[r.events.length-1];return o=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,s=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(E)}function f(E){return E===s?(a++,e.consume(E),f):a<3?n(E):(e.exit("codeFencedFenceSequence"),be(E)?we(e,u,"whitespace")(E):u(E))}function u(E){return E===null||fe(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(Jl,h,C)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===null||fe(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(E)):be(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),we(e,d,"whitespace")(E)):E===96&&E===s?n(E):(e.consume(E),p)}function d(E){return E===null||fe(E)?u(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===null||fe(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(E)):E===96&&E===s?n(E):(e.consume(E),m)}function h(E){return e.attempt(i,C,g)(E)}function g(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),y}function y(E){return o>0&&be(E)?we(e,b,"linePrefix",o+1)(E):b(E)}function b(E){return E===null||fe(E)?e.check(Jl,h,C)(E):(e.enter("codeFlowValue"),w(E))}function w(E){return E===null||fe(E)?(e.exit("codeFlowValue"),b(E)):(e.consume(E),w)}function C(E){return e.exit("codeFenced"),t(E)}function x(E,T,_){let $=0;return I;function I(M){return E.enter("lineEnding"),E.consume(M),E.exit("lineEnding"),D}function D(M){return E.enter("codeFencedFence"),be(M)?we(E,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):z(M)}function z(M){return M===s?(E.enter("codeFencedFenceSequence"),P(M)):_(M)}function P(M){return M===s?($++,E.consume(M),P):$>=a?(E.exit("codeFencedFenceSequence"),be(M)?we(E,L,"whitespace")(M):L(M)):_(M)}function L(M){return M===null||fe(M)?(E.exit("codeFencedFence"),T(M)):_(M)}}}function my(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const so={name:"codeIndented",tokenize:yy},gy={partial:!0,tokenize:by};function yy(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),we(e,o,"linePrefix",5)(c)}function o(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):fe(c)?e.attempt(gy,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||fe(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function by(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):fe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):we(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):fe(a)?i(a):n(a)}}const vy={name:"codeText",previous:xy,resolve:wy,tokenize:ky};function wy(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function xy(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ky(e,t,n){let r=0,i,o;return a;function a(u){return e.enter("codeText"),e.enter("codeTextSequence"),s(u)}function s(u){return u===96?(e.consume(u),r++,s):(e.exit("codeTextSequence"),l(u))}function l(u){return u===null?n(u):u===32?(e.enter("space"),e.consume(u),e.exit("space"),l):u===96?(o=e.enter("codeTextSequence"),i=0,f(u)):fe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(u))}function c(u){return u===null||u===32||u===96||fe(u)?(e.exit("codeTextData"),l(u)):(e.consume(u),c)}function f(u){return u===96?(e.consume(u),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(u)):(o.type="codeTextData",c(u))}}class Sy{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&jn(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),jn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),jn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);jn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);jn(this.left,n.reverse())}}}function jn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Xl(e){const t={};let n=-1,r,i,o,a,s,l,c;const f=new Sy(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Ey(f,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=f.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},s=f.slice(i,n),s.unshift(r),f.splice(i,n-i+1,s))}}return et(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!c}function Ey(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let f,u,p=-1,d=n,m=0,h=0;const g=[h];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(f=r.sliceStream(d),d.next||f.push(null),u&&a.defineSkip(d.start),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(f),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),u=d,d=d.next}for(d=n;++p<s.length;)s[p][0]==="exit"&&s[p-1][0]==="enter"&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(h=p+1,g.push(h),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(a.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),p=g.length;p--;){const y=s.slice(g[p],g[p+1]),b=o.pop();l.push([b,b+y.length-1]),e.splice(b,2,y)}for(l.reverse(),p=-1;++p<l.length;)c[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return c}const Cy={resolve:Iy,tokenize:Ty},Ay={partial:!0,tokenize:Oy};function Iy(e){return Xl(e),e}function Ty(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):fe(s)?e.check(Ay,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Oy(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),we(e,o,"linePrefix")}function o(a){if(a===null||fe(a))return n(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function ec(e,t,n,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let f=0;return u;function u(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||kr(y)?n(y):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===62?(e.exit("chunkString"),e.exit(s),p(y)):y===null||y===60||fe(y)?n(y):(e.consume(y),y===92?m:d)}function m(y){return y===60||y===62||y===92?(e.consume(y),d):d(y)}function h(y){return!f&&(y===null||y===41||Ae(y))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(y)):f<c&&y===40?(e.consume(y),f++,h):y===41?(e.consume(y),f--,h):y===null||y===32||y===40||kr(y)?n(y):(e.consume(y),y===92?g:h)}function g(y){return y===40||y===41||y===92?(e.consume(y),h):h(y)}}function tc(e,t,n,r,i,o){const a=this;let s=0,l;return c;function c(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(o),f}function f(d){return s>999||d===null||d===91||d===93&&!l||d===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):d===93?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):fe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===null||d===91||d===93||fe(d)||s++>999?(e.exit("chunkString"),f(d)):(e.consume(d),l||(l=!be(d)),d===92?p:u)}function p(d){return d===91||d===92||d===93?(e.consume(d),s++,u):u(d)}}function nc(e,t,n,r,i,o){let a;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),a=p===40?41:p,l):n(p)}function l(p){return p===a?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),c(p))}function c(p){return p===a?(e.exit(o),l(a)):p===null?n(p):fe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),we(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===a||p===null||fe(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?u:f)}function u(p){return p===a||p===92?(e.consume(p),f):f(p)}}function Un(e,t){let n;return r;function r(i){return fe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):be(i)?we(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Dy={name:"definition",tokenize:Py},My={partial:!0,tokenize:Ny};function Py(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),a(d)}function a(d){return tc.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function s(d){return i=st(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return Ae(d)?Un(e,c)(d):c(d)}function c(d){return ec(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function f(d){return e.attempt(My,u,u)(d)}function u(d){return be(d)?we(e,p,"whitespace")(d):p(d)}function p(d){return d===null||fe(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function Ny(e,t,n){return r;function r(s){return Ae(s)?Un(e,i)(s):n(s)}function i(s){return nc(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return be(s)?we(e,a,"whitespace")(s):a(s)}function a(s){return s===null||fe(s)?t(s):n(s)}}const _y={name:"hardBreakEscape",tokenize:Ly};function Ly(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return fe(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Fy={name:"headingAtx",resolve:Ry,tokenize:By};function Ry(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},et(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function By(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),a(f)}function a(f){return f===35&&r++<6?(e.consume(f),a):f===null||Ae(f)?(e.exit("atxHeadingSequence"),s(f)):n(f)}function s(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||fe(f)?(e.exit("atxHeading"),t(f)):be(f)?we(e,s,"whitespace")(f):(e.enter("atxHeadingText"),c(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),s(f))}function c(f){return f===null||f===35||Ae(f)?(e.exit("atxHeadingText"),s(f)):(e.consume(f),c)}}const $y=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],rc=["pre","script","style","textarea"],zy={concrete:!0,name:"htmlFlow",resolveTo:Hy,tokenize:Wy},jy={partial:!0,tokenize:qy},Uy={partial:!0,tokenize:Vy};function Hy(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Wy(e,t,n){const r=this;let i,o,a,s,l;return c;function c(k){return f(k)}function f(k){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(k),u}function u(k){return k===33?(e.consume(k),p):k===47?(e.consume(k),o=!0,h):k===63?(e.consume(k),i=3,r.interrupt?t:v):qe(k)?(e.consume(k),a=String.fromCharCode(k),g):n(k)}function p(k){return k===45?(e.consume(k),i=2,d):k===91?(e.consume(k),i=5,s=0,m):qe(k)?(e.consume(k),i=4,r.interrupt?t:v):n(k)}function d(k){return k===45?(e.consume(k),r.interrupt?t:v):n(k)}function m(k){const W="CDATA[";return k===W.charCodeAt(s++)?(e.consume(k),s===W.length?r.interrupt?t:z:m):n(k)}function h(k){return qe(k)?(e.consume(k),a=String.fromCharCode(k),g):n(k)}function g(k){if(k===null||k===47||k===62||Ae(k)){const W=k===47,te=a.toLowerCase();return!W&&!o&&rc.includes(te)?(i=1,r.interrupt?t(k):z(k)):$y.includes(a.toLowerCase())?(i=6,W?(e.consume(k),y):r.interrupt?t(k):z(k)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(k):o?b(k):w(k))}return k===45||We(k)?(e.consume(k),a+=String.fromCharCode(k),g):n(k)}function y(k){return k===62?(e.consume(k),r.interrupt?t:z):n(k)}function b(k){return be(k)?(e.consume(k),b):I(k)}function w(k){return k===47?(e.consume(k),I):k===58||k===95||qe(k)?(e.consume(k),C):be(k)?(e.consume(k),w):I(k)}function C(k){return k===45||k===46||k===58||k===95||We(k)?(e.consume(k),C):x(k)}function x(k){return k===61?(e.consume(k),E):be(k)?(e.consume(k),x):w(k)}function E(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),l=k,T):be(k)?(e.consume(k),E):_(k)}function T(k){return k===l?(e.consume(k),l=null,$):k===null||fe(k)?n(k):(e.consume(k),T)}function _(k){return k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||Ae(k)?x(k):(e.consume(k),_)}function $(k){return k===47||k===62||be(k)?w(k):n(k)}function I(k){return k===62?(e.consume(k),D):n(k)}function D(k){return k===null||fe(k)?z(k):be(k)?(e.consume(k),D):n(k)}function z(k){return k===45&&i===2?(e.consume(k),R):k===60&&i===1?(e.consume(k),U):k===62&&i===4?(e.consume(k),N):k===63&&i===3?(e.consume(k),v):k===93&&i===5?(e.consume(k),V):fe(k)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(jy,H,P)(k)):k===null||fe(k)?(e.exit("htmlFlowData"),P(k)):(e.consume(k),z)}function P(k){return e.check(Uy,L,H)(k)}function L(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),M}function M(k){return k===null||fe(k)?P(k):(e.enter("htmlFlowData"),z(k))}function R(k){return k===45?(e.consume(k),v):z(k)}function U(k){return k===47?(e.consume(k),a="",B):z(k)}function B(k){if(k===62){const W=a.toLowerCase();return rc.includes(W)?(e.consume(k),N):z(k)}return qe(k)&&a.length<8?(e.consume(k),a+=String.fromCharCode(k),B):z(k)}function V(k){return k===93?(e.consume(k),v):z(k)}function v(k){return k===62?(e.consume(k),N):k===45&&i===2?(e.consume(k),v):z(k)}function N(k){return k===null||fe(k)?(e.exit("htmlFlowData"),H(k)):(e.consume(k),N)}function H(k){return e.exit("htmlFlow"),t(k)}}function Vy(e,t,n){const r=this;return i;function i(a){return fe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function qy(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(zn,t,n)}}const Ky={name:"htmlText",tokenize:Yy};function Yy(e,t,n){const r=this;let i,o,a;return s;function s(v){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(v),l}function l(v){return v===33?(e.consume(v),c):v===47?(e.consume(v),x):v===63?(e.consume(v),w):qe(v)?(e.consume(v),_):n(v)}function c(v){return v===45?(e.consume(v),f):v===91?(e.consume(v),o=0,m):qe(v)?(e.consume(v),b):n(v)}function f(v){return v===45?(e.consume(v),d):n(v)}function u(v){return v===null?n(v):v===45?(e.consume(v),p):fe(v)?(a=u,U(v)):(e.consume(v),u)}function p(v){return v===45?(e.consume(v),d):u(v)}function d(v){return v===62?R(v):v===45?p(v):u(v)}function m(v){const N="CDATA[";return v===N.charCodeAt(o++)?(e.consume(v),o===N.length?h:m):n(v)}function h(v){return v===null?n(v):v===93?(e.consume(v),g):fe(v)?(a=h,U(v)):(e.consume(v),h)}function g(v){return v===93?(e.consume(v),y):h(v)}function y(v){return v===62?R(v):v===93?(e.consume(v),y):h(v)}function b(v){return v===null||v===62?R(v):fe(v)?(a=b,U(v)):(e.consume(v),b)}function w(v){return v===null?n(v):v===63?(e.consume(v),C):fe(v)?(a=w,U(v)):(e.consume(v),w)}function C(v){return v===62?R(v):w(v)}function x(v){return qe(v)?(e.consume(v),E):n(v)}function E(v){return v===45||We(v)?(e.consume(v),E):T(v)}function T(v){return fe(v)?(a=T,U(v)):be(v)?(e.consume(v),T):R(v)}function _(v){return v===45||We(v)?(e.consume(v),_):v===47||v===62||Ae(v)?$(v):n(v)}function $(v){return v===47?(e.consume(v),R):v===58||v===95||qe(v)?(e.consume(v),I):fe(v)?(a=$,U(v)):be(v)?(e.consume(v),$):R(v)}function I(v){return v===45||v===46||v===58||v===95||We(v)?(e.consume(v),I):D(v)}function D(v){return v===61?(e.consume(v),z):fe(v)?(a=D,U(v)):be(v)?(e.consume(v),D):$(v)}function z(v){return v===null||v===60||v===61||v===62||v===96?n(v):v===34||v===39?(e.consume(v),i=v,P):fe(v)?(a=z,U(v)):be(v)?(e.consume(v),z):(e.consume(v),L)}function P(v){return v===i?(e.consume(v),i=void 0,M):v===null?n(v):fe(v)?(a=P,U(v)):(e.consume(v),P)}function L(v){return v===null||v===34||v===39||v===60||v===61||v===96?n(v):v===47||v===62||Ae(v)?$(v):(e.consume(v),L)}function M(v){return v===47||v===62||Ae(v)?$(v):n(v)}function R(v){return v===62?(e.consume(v),e.exit("htmlTextData"),e.exit("htmlText"),t):n(v)}function U(v){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),B}function B(v){return be(v)?we(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):V(v)}function V(v){return e.enter("htmlTextData"),a(v)}}const lo={name:"labelEnd",resolveAll:Zy,resolveTo:Xy,tokenize:eb},Gy={tokenize:tb},Qy={tokenize:nb},Jy={tokenize:rb};function Zy(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&et(e,0,e.length,n),e}function Xy(e,t){let n=e.length,r=0,i,o,a,s;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",l,t],["enter",c,t]],s=it(s,e.slice(o+1,o+r+3)),s=it(s,[["enter",f,t]]),s=it(s,Er(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),s=it(s,[["exit",f,t],e[a-2],e[a-1],["exit",c,t]]),s=it(s,e.slice(a+1)),s=it(s,[["exit",l,t]]),et(e,o,e.length,s),e}function eb(e,t,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(p){return o?o._inactive?u(p):(a=r.parser.defined.includes(st(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(Gy,f,a?f:u)(p):p===91?e.attempt(Qy,f,a?c:u)(p):a?f(p):u(p)}function c(p){return e.attempt(Jy,f,u)(p)}function f(p){return t(p)}function u(p){return o._balanced=!0,n(p)}}function tb(e,t,n){return r;function r(u){return e.enter("resource"),e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),i}function i(u){return Ae(u)?Un(e,o)(u):o(u)}function o(u){return u===41?f(u):ec(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function a(u){return Ae(u)?Un(e,l)(u):f(u)}function s(u){return n(u)}function l(u){return u===34||u===39||u===40?nc(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):f(u)}function c(u){return Ae(u)?Un(e,f)(u):f(u)}function f(u){return u===41?(e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),e.exit("resource"),t):n(u)}}function nb(e,t,n){const r=this;return i;function i(s){return tc.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(st(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function rb(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const ib={name:"labelStartImage",resolveAll:lo.resolveAll,tokenize:ob};function ob(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const ab={name:"labelStartLink",resolveAll:lo.resolveAll,tokenize:sb};function sb(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const co={name:"lineEnding",tokenize:lb};function lb(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),we(e,t,"linePrefix")}}const Cr={name:"thematicBreak",tokenize:cb};function cb(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,s(c)}function s(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||fe(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),be(c)?we(e,s,"whitespace")(c):s(c))}}const Qe={continuation:{tokenize:pb},exit:mb,name:"list",tokenize:db},ub={partial:!0,tokenize:gb},fb={partial:!0,tokenize:hb};function db(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(d){const m=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:oo(d)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(Cr,n,c)(d):c(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return oo(d)&&++a<10?(e.consume(d),l):(!r.interrupt||a<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),c(d)):n(d)}function c(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(zn,r.interrupt?n:f,e.attempt(ub,p,u))}function f(d){return r.containerState.initialBlankLine=!0,o++,p(d)}function u(d){return be(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function pb(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(zn,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,we(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!be(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(fb,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,we(e,e.attempt(Qe,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function hb(e,t,n){const r=this;return we(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function mb(e){e.exit(this.containerState.type)}function gb(e,t,n){const r=this;return we(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!be(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const ic={name:"setextUnderline",resolveTo:yb,tokenize:bb};function yb(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function bb(e,t,n){const r=this;let i;return o;function o(c){let f=r.events.length,u;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){u=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||u)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),be(c)?we(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||fe(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const vb={tokenize:wb};function wb(e){const t=this,n=e.attempt(zn,r,e.attempt(this.parser.constructs.flowInitial,i,we(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Cy,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const xb={resolveAll:ac()},kb=oc("string"),Sb=oc("text");function oc(e){return{resolveAll:ac(e==="text"?Eb:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(f){return c(f)?o(f):s(f)}function s(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),l}function l(f){return c(f)?(n.exit("data"),o(f)):(n.consume(f),l)}function c(f){if(f===null)return!0;const u=i[f];let p=-1;if(u)for(;++p<u.length;){const d=u[p];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function ac(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Eb(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,a=-1,s=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(c===-2)l=!0,s++;else if(c!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const c={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const Cb=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:Dy},disable:{null:[]},document:{42:Qe,43:Qe,45:Qe,48:Qe,49:Qe,50:Qe,51:Qe,52:Qe,53:Qe,54:Qe,55:Qe,56:Qe,57:Qe,62:Yl},flow:{35:Fy,42:Cr,45:[ic,Cr],60:zy,61:ic,95:Cr,96:Zl,126:Zl},flowInitial:{[-2]:so,[-1]:so,32:so},insideSpan:{null:[ao,xb]},string:{38:Ql,92:Gl},text:{[-5]:co,[-4]:co,[-3]:co,33:ib,38:Ql,42:ao,60:[ay,Ky],91:ab,92:[_y,Gl],93:lo,95:ao,96:vy}},Symbol.toStringTag,{value:"Module"}));function Ab(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],s=[];const l={attempt:T(x),check:T(E),consume:b,enter:w,exit:C,interrupt:T(E,{interrupt:!0})},c={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:d,write:u};let f=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function u(D){return a=it(a,D),g(),a[a.length-1]!==null?[]:(_(t,0),c.events=Er(o,c.events,c),c.events)}function p(D,z){return Tb(d(D),z)}function d(D){return Ib(a,D)}function m(){const{_bufferIndex:D,_index:z,line:P,column:L,offset:M}=r;return{_bufferIndex:D,_index:z,line:P,column:L,offset:M}}function h(D){i[D.line]=D.column,I()}function g(){let D;for(;r._index<a.length;){const z=a[r._index];if(typeof z=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<z.length;)y(z.charCodeAt(r._bufferIndex));else y(z)}}function y(D){f=f(D)}function b(D){fe(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,I()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=D}function w(D,z){const P=z||{};return P.type=D,P.start=m(),c.events.push(["enter",P,c]),s.push(P),P}function C(D){const z=s.pop();return z.end=m(),c.events.push(["exit",z,c]),z}function x(D,z){_(D,z.from)}function E(D,z){z.restore()}function T(D,z){return P;function P(L,M,R){let U,B,V,v;return Array.isArray(L)?H(L):"tokenize"in L?H([L]):N(L);function N(Y){return Z;function Z(re){const oe=re!==null&&Y[re],G=re!==null&&Y.null,Q=[...Array.isArray(oe)?oe:oe?[oe]:[],...Array.isArray(G)?G:G?[G]:[]];return H(Q)(re)}}function H(Y){return U=Y,B=0,Y.length===0?R:k(Y[B])}function k(Y){return Z;function Z(re){return v=$(),V=Y,Y.partial||(c.currentConstruct=Y),Y.name&&c.parser.constructs.disable.null.includes(Y.name)?te():Y.tokenize.call(z?Object.assign(Object.create(c),z):c,l,W,te)(re)}}function W(Y){return D(V,v),M}function te(Y){return v.restore(),++B<U.length?k(U[B]):R}}}function _(D,z){D.resolveAll&&!o.includes(D)&&o.push(D),D.resolve&&et(c.events,z,c.events.length-z,D.resolve(c.events.slice(z),c)),D.resolveTo&&(c.events=D.resolveTo(c.events,c))}function $(){const D=m(),z=c.previous,P=c.currentConstruct,L=c.events.length,M=Array.from(s);return{from:L,restore:R};function R(){r=D,c.previous=z,c.currentConstruct=P,c.events.length=L,s=M,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ib(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function Tb(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
12
12
  `;break}case-3:{a=`\r
13
- `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function Tb(e){const r={constructs:ql([Eb,...(e||{}).extensions||[]]),content:i(Zg),defined:[],document:i(ey),flow:i(bb),lazy:{},string:i(xb),text:i(kb)};return r;function i(o){return a;function a(s){return Cb(r,o,s)}}}function Ob(e){for(;!tc(e););return e}const cc=/[\0\t\n\r]/g;function Db(){let e=1,t="",n=!0,r;return i;function i(o,a,s){const l=[];let c,f,u,p,d;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),u=0,t="",n&&(o.charCodeAt(0)===65279&&u++,n=void 0);u<o.length;){if(cc.lastIndex=u,c=cc.exec(o),p=c&&c.index!==void 0?c.index:o.length,d=o.charCodeAt(p),!c){t=o.slice(u);break}if(d===10&&u===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),u<p&&(l.push(o.slice(u,p)),e+=p-u),d){case 0:{l.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,l.push(-2);e++<f;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}u=p+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Mb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Pb(e){return e.replace(Mb,Nb)}function Nb(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Kl(n.slice(o?2:1),o?16:10)}return io(n)||e}const uc={}.hasOwnProperty;function _b(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Lb(n)(Ob(Tb(n).document().write(Db()(e,t,!0))))}function Lb(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(me),autolinkProtocol:$,autolinkEmail:$,atxHeading:o(K),blockQuote:o(J),characterEscape:$,characterReference:$,codeFenced:o(Q),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(Q,a),codeText:o(j,a),codeTextData:$,data:$,codeFlowValue:$,definition:o(ne),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(se),hardBreakEscape:o(G),hardBreakTrailing:o(G),htmlFlow:o(ue,a),htmlFlowData:$,htmlText:o(ue,a),htmlTextData:$,image:o(pe),label:a,link:o(me),listItem:o(Ue),listItemValue:p,listOrdered:o(De,u),listUnordered:o(De),paragraph:o(He),reference:k,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(K),strong:o(qe),thematicBreak:o(ce)},exit:{atxHeading:l(),atxHeadingSequence:x,autolink:l(),autolinkEmail:ae,autolinkProtocol:oe,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:Y,characterReference:X,codeFenced:l(g),codeFencedFence:h,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:I,codeIndented:l(y),codeText:l(P),codeTextData:I,data:I,definition:l(),definitionDestinationString:E,definitionLabelString:b,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(F),hardBreakTrailing:l(F),htmlFlow:l(_),htmlFlowData:I,htmlText:l(R),htmlTextData:I,image:l(U),label:q,labelText:z,lineEnding:D,link:l(L),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:W,resourceDestinationString:v,resourceTitleString:M,resource:H,setextHeading:l(N),setextHeadingLineSequence:T,setextHeadingText:C,strong:l(),thematicBreak:l()}};fc(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(B){let V={type:"root",children:[]};const le={stack:[V],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:f,data:n},re=[];let de=-1;for(;++de<B.length;)if(B[de][1].type==="listOrdered"||B[de][1].type==="listUnordered")if(B[de][0]==="enter")re.push(de);else{const Te=re.pop();de=i(B,Te,de)}for(de=-1;++de<B.length;){const Te=t[B[de][0]];uc.call(Te,B[de][1].type)&&Te[B[de][1].type].call(Object.assign({sliceSerialize:B[de][2].sliceSerialize},le),B[de][1])}if(le.tokenStack.length>0){const Te=le.tokenStack[le.tokenStack.length-1];(Te[1]||dc).call(le,void 0,Te[0])}for(V.position={start:Tt(B.length>0?B[0][1].start:{line:1,column:1,offset:0}),end:Tt(B.length>0?B[B.length-2][1].end:{line:1,column:1,offset:0})},de=-1;++de<t.transforms.length;)V=t.transforms[de](V)||V;return V}function i(B,V,le){let re=V-1,de=-1,Te=!1,ft,tt,vt,At;for(;++re<=le;){const Be=B[re];switch(Be[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Be[0]==="enter"?de++:de--,At=void 0;break}case"lineEndingBlank":{Be[0]==="enter"&&(ft&&!At&&!de&&!vt&&(vt=re),At=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:At=void 0}if(!de&&Be[0]==="enter"&&Be[1].type==="listItemPrefix"||de===-1&&Be[0]==="exit"&&(Be[1].type==="listUnordered"||Be[1].type==="listOrdered")){if(ft){let wt=re;for(tt=void 0;wt--;){const nt=B[wt];if(nt[1].type==="lineEnding"||nt[1].type==="lineEndingBlank"){if(nt[0]==="exit")continue;tt&&(B[tt][1].type="lineEndingBlank",Te=!0),nt[1].type="lineEnding",tt=wt}else if(!(nt[1].type==="linePrefix"||nt[1].type==="blockQuotePrefix"||nt[1].type==="blockQuotePrefixWhitespace"||nt[1].type==="blockQuoteMarker"||nt[1].type==="listItemIndent"))break}vt&&(!tt||vt<tt)&&(ft._spread=!0),ft.end=Object.assign({},tt?B[tt][1].start:Be[1].end),B.splice(tt||re,0,["exit",ft,Be[2]]),re++,le++}if(Be[1].type==="listItemPrefix"){const wt={type:"listItem",_spread:!1,start:Object.assign({},Be[1].start),end:void 0};ft=wt,B.splice(re,0,["enter",wt,Be[2]]),re++,le++,vt=void 0,At=!0}}}return B[V][1]._spread=Te,le}function o(B,V){return le;function le(re){s.call(this,B(re),re),V&&V.call(this,re)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(B,V,le){this.stack[this.stack.length-1].children.push(B),this.stack.push(B),this.tokenStack.push([V,le||void 0]),B.position={start:Tt(V.start),end:void 0}}function l(B){return V;function V(le){B&&B.call(this,le),c.call(this,le)}}function c(B,V){const le=this.stack.pop(),re=this.tokenStack.pop();if(re)re[0].type!==B.type&&(V?V.call(this,B,re[0]):(re[1]||dc).call(this,B,re[0]));else throw new Error("Cannot close `"+B.type+"` ("+Bn({start:B.start,end:B.end})+"): it’s not open");le.position.end=Tt(B.end)}function f(){return ro(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function p(B){if(this.data.expectingFirstListItemValue){const V=this.stack[this.stack.length-2];V.start=Number.parseInt(this.sliceSerialize(B),10),this.data.expectingFirstListItemValue=void 0}}function d(){const B=this.resume(),V=this.stack[this.stack.length-1];V.lang=B}function m(){const B=this.resume(),V=this.stack[this.stack.length-1];V.meta=B}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const B=this.resume(),V=this.stack[this.stack.length-1];V.value=B.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const B=this.resume(),V=this.stack[this.stack.length-1];V.value=B.replace(/(\r?\n|\r)$/g,"")}function b(B){const V=this.resume(),le=this.stack[this.stack.length-1];le.label=V,le.identifier=at(this.sliceSerialize(B)).toLowerCase()}function w(){const B=this.resume(),V=this.stack[this.stack.length-1];V.title=B}function E(){const B=this.resume(),V=this.stack[this.stack.length-1];V.url=B}function x(B){const V=this.stack[this.stack.length-1];if(!V.depth){const le=this.sliceSerialize(B).length;V.depth=le}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function T(B){const V=this.stack[this.stack.length-1];V.depth=this.sliceSerialize(B).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function $(B){const le=this.stack[this.stack.length-1].children;let re=le[le.length-1];(!re||re.type!=="text")&&(re=ee(),re.position={start:Tt(B.start),end:void 0},le.push(re)),this.stack.push(re)}function I(B){const V=this.stack.pop();V.value+=this.sliceSerialize(B),V.position.end=Tt(B.end)}function D(B){const V=this.stack[this.stack.length-1];if(this.data.atHardBreak){const le=V.children[V.children.length-1];le.position.end=Tt(B.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(V.type)&&($.call(this,B),I.call(this,B))}function F(){this.data.atHardBreak=!0}function _(){const B=this.resume(),V=this.stack[this.stack.length-1];V.value=B}function R(){const B=this.resume(),V=this.stack[this.stack.length-1];V.value=B}function P(){const B=this.resume(),V=this.stack[this.stack.length-1];V.value=B}function L(){const B=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=V,delete B.url,delete B.title}else delete B.identifier,delete B.label;this.data.referenceType=void 0}function U(){const B=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=V,delete B.url,delete B.title}else delete B.identifier,delete B.label;this.data.referenceType=void 0}function z(B){const V=this.sliceSerialize(B),le=this.stack[this.stack.length-2];le.label=Pb(V),le.identifier=at(V).toLowerCase()}function q(){const B=this.stack[this.stack.length-1],V=this.resume(),le=this.stack[this.stack.length-1];if(this.data.inReference=!0,le.type==="link"){const re=B.children;le.children=re}else le.alt=V}function v(){const B=this.resume(),V=this.stack[this.stack.length-1];V.url=B}function M(){const B=this.resume(),V=this.stack[this.stack.length-1];V.title=B}function H(){this.data.inReference=void 0}function k(){this.data.referenceType="collapsed"}function W(B){const V=this.resume(),le=this.stack[this.stack.length-1];le.label=V,le.identifier=at(this.sliceSerialize(B)).toLowerCase(),this.data.referenceType="full"}function te(B){this.data.characterReferenceType=B.type}function Y(B){const V=this.sliceSerialize(B),le=this.data.characterReferenceType;let re;le?(re=Kl(V,le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):re=io(V);const de=this.stack[this.stack.length-1];de.value+=re}function X(B){const V=this.stack.pop();V.position.end=Tt(B.end)}function oe(B){I.call(this,B);const V=this.stack[this.stack.length-1];V.url=this.sliceSerialize(B)}function ae(B){I.call(this,B);const V=this.stack[this.stack.length-1];V.url="mailto:"+this.sliceSerialize(B)}function J(){return{type:"blockquote",children:[]}}function Q(){return{type:"code",lang:null,meta:null,value:""}}function j(){return{type:"inlineCode",value:""}}function ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function se(){return{type:"emphasis",children:[]}}function K(){return{type:"heading",depth:0,children:[]}}function G(){return{type:"break"}}function ue(){return{type:"html",value:""}}function pe(){return{type:"image",title:null,url:"",alt:null}}function me(){return{type:"link",title:null,url:"",children:[]}}function De(B){return{type:"list",ordered:B.type==="listOrdered",start:null,spread:B._spread,children:[]}}function Ue(B){return{type:"listItem",spread:B._spread,checked:null,children:[]}}function He(){return{type:"paragraph",children:[]}}function qe(){return{type:"strong",children:[]}}function ee(){return{type:"text",value:""}}function ce(){return{type:"thematicBreak"}}}function Tt(e){return{line:e.line,column:e.column,offset:e.offset}}function fc(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?fc(e,r):Fb(e,r)}}function Fb(e,t){let n;for(n in t)if(uc.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function dc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Bn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Bn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Bn({start:t.start,end:t.end})+") is still open")}function Rb(e){const t=this;t.parser=n;function n(r){return _b(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Bb(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function $b(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
14
- `}]}function zb(e,t){const n=t.value?t.value+`
15
- `:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function jb(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ub(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hb(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=tn(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function Wb(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vb(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function pc(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function qb(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return pc(e,t);const i={src:tn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function Kb(e,t){const n={src:tn(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Yb(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Gb(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return pc(e,t);const i={href:tn(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function Qb(e,t){const n={href:tn(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Jb(e,t,n){const r=e.all(t),i=n?Zb(n):hc(t),o={},a=[];if(typeof t.checked=="boolean"){const f=r[0];let u;f&&f.type==="element"&&f.tagName==="p"?u=f:(u={type:"element",tagName:"p",properties:{},children:[]},r.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const f=r[s];(i||s!==0||f.type!=="element"||f.tagName!=="p")&&a.push({type:"text",value:`
13
+ `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function Ob(e){const r={constructs:Wl([Cb,...(e||{}).extensions||[]]),content:i(Xg),defined:[],document:i(ty),flow:i(vb),lazy:{},string:i(kb),text:i(Sb)};return r;function i(o){return a;function a(s){return Ab(r,o,s)}}}function Db(e){for(;!Xl(e););return e}const sc=/[\0\t\n\r]/g;function Mb(){let e=1,t="",n=!0,r;return i;function i(o,a,s){const l=[];let c,f,u,p,d;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),u=0,t="",n&&(o.charCodeAt(0)===65279&&u++,n=void 0);u<o.length;){if(sc.lastIndex=u,c=sc.exec(o),p=c&&c.index!==void 0?c.index:o.length,d=o.charCodeAt(p),!c){t=o.slice(u);break}if(d===10&&u===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),u<p&&(l.push(o.slice(u,p)),e+=p-u),d){case 0:{l.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,l.push(-2);e++<f;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}u=p+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Pb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Nb(e){return e.replace(Pb,_b)}function _b(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Vl(n.slice(o?2:1),o?16:10)}return io(n)||e}const lc={}.hasOwnProperty;function Lb(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Fb(n)(Db(Ob(n).document().write(Mb()(e,t,!0))))}function Fb(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(he),autolinkProtocol:$,autolinkEmail:$,atxHeading:o(pe),blockQuote:o(G),characterEscape:$,characterReference:$,codeFenced:o(Q),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(Q,a),codeText:o(j,a),codeTextData:$,data:$,codeFlowValue:$,definition:o(X),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(ae),hardBreakEscape:o(ie),hardBreakTrailing:o(ie),htmlFlow:o(K,a),htmlFlowData:$,htmlText:o(K,a),htmlTextData:$,image:o(ce),label:a,link:o(he),listItem:o(ke),listItemValue:p,listOrdered:o(Ce,u),listUnordered:o(Ce),paragraph:o(je),reference:k,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(pe),strong:o(Ye),thematicBreak:o(se)},exit:{atxHeading:l(),atxHeadingSequence:x,autolink:l(),autolinkEmail:oe,autolinkProtocol:re,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:Y,characterReference:Z,codeFenced:l(g),codeFencedFence:h,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:I,codeIndented:l(y),codeText:l(M),codeTextData:I,data:I,definition:l(),definitionDestinationString:C,definitionLabelString:b,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(z),hardBreakTrailing:l(z),htmlFlow:l(P),htmlFlowData:I,htmlText:l(L),htmlTextData:I,image:l(U),label:V,labelText:B,lineEnding:D,link:l(R),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:W,resourceDestinationString:v,resourceTitleString:N,resource:H,setextHeading:l(_),setextHeadingLineSequence:T,setextHeadingText:E,strong:l(),thematicBreak:l()}};cc(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(F){let q={type:"root",children:[]};const le={stack:[q],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:f,data:n},ue=[];let ye=-1;for(;++ye<F.length;)if(F[ye][1].type==="listOrdered"||F[ye][1].type==="listUnordered")if(F[ye][0]==="enter")ue.push(ye);else{const de=ue.pop();ye=i(F,de,ye)}for(ye=-1;++ye<F.length;){const de=t[F[ye][0]];lc.call(de,F[ye][1].type)&&de[F[ye][1].type].call(Object.assign({sliceSerialize:F[ye][2].sliceSerialize},le),F[ye][1])}if(le.tokenStack.length>0){const de=le.tokenStack[le.tokenStack.length-1];(de[1]||uc).call(le,void 0,de[0])}for(q.position={start:Tt(F.length>0?F[0][1].start:{line:1,column:1,offset:0}),end:Tt(F.length>0?F[F.length-2][1].end:{line:1,column:1,offset:0})},ye=-1;++ye<t.transforms.length;)q=t.transforms[ye](q)||q;return q}function i(F,q,le){let ue=q-1,ye=-1,de=!1,Te,Le,vt,At;for(;++ue<=le;){const Ue=F[ue];switch(Ue[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ue[0]==="enter"?ye++:ye--,At=void 0;break}case"lineEndingBlank":{Ue[0]==="enter"&&(Te&&!At&&!ye&&!vt&&(vt=ue),At=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:At=void 0}if(!ye&&Ue[0]==="enter"&&Ue[1].type==="listItemPrefix"||ye===-1&&Ue[0]==="exit"&&(Ue[1].type==="listUnordered"||Ue[1].type==="listOrdered")){if(Te){let wt=ue;for(Le=void 0;wt--;){const rt=F[wt];if(rt[1].type==="lineEnding"||rt[1].type==="lineEndingBlank"){if(rt[0]==="exit")continue;Le&&(F[Le][1].type="lineEndingBlank",de=!0),rt[1].type="lineEnding",Le=wt}else if(!(rt[1].type==="linePrefix"||rt[1].type==="blockQuotePrefix"||rt[1].type==="blockQuotePrefixWhitespace"||rt[1].type==="blockQuoteMarker"||rt[1].type==="listItemIndent"))break}vt&&(!Le||vt<Le)&&(Te._spread=!0),Te.end=Object.assign({},Le?F[Le][1].start:Ue[1].end),F.splice(Le||ue,0,["exit",Te,Ue[2]]),ue++,le++}if(Ue[1].type==="listItemPrefix"){const wt={type:"listItem",_spread:!1,start:Object.assign({},Ue[1].start),end:void 0};Te=wt,F.splice(ue,0,["enter",wt,Ue[2]]),ue++,le++,vt=void 0,At=!0}}}return F[q][1]._spread=de,le}function o(F,q){return le;function le(ue){s.call(this,F(ue),ue),q&&q.call(this,ue)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(F,q,le){this.stack[this.stack.length-1].children.push(F),this.stack.push(F),this.tokenStack.push([q,le||void 0]),F.position={start:Tt(q.start),end:void 0}}function l(F){return q;function q(le){F&&F.call(this,le),c.call(this,le)}}function c(F,q){const le=this.stack.pop(),ue=this.tokenStack.pop();if(ue)ue[0].type!==F.type&&(q?q.call(this,F,ue[0]):(ue[1]||uc).call(this,F,ue[0]));else throw new Error("Cannot close `"+F.type+"` ("+Bn({start:F.start,end:F.end})+"): it’s not open");le.position.end=Tt(F.end)}function f(){return ro(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function p(F){if(this.data.expectingFirstListItemValue){const q=this.stack[this.stack.length-2];q.start=Number.parseInt(this.sliceSerialize(F),10),this.data.expectingFirstListItemValue=void 0}}function d(){const F=this.resume(),q=this.stack[this.stack.length-1];q.lang=F}function m(){const F=this.resume(),q=this.stack[this.stack.length-1];q.meta=F}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const F=this.resume(),q=this.stack[this.stack.length-1];q.value=F.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const F=this.resume(),q=this.stack[this.stack.length-1];q.value=F.replace(/(\r?\n|\r)$/g,"")}function b(F){const q=this.resume(),le=this.stack[this.stack.length-1];le.label=q,le.identifier=st(this.sliceSerialize(F)).toLowerCase()}function w(){const F=this.resume(),q=this.stack[this.stack.length-1];q.title=F}function C(){const F=this.resume(),q=this.stack[this.stack.length-1];q.url=F}function x(F){const q=this.stack[this.stack.length-1];if(!q.depth){const le=this.sliceSerialize(F).length;q.depth=le}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function T(F){const q=this.stack[this.stack.length-1];q.depth=this.sliceSerialize(F).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function $(F){const le=this.stack[this.stack.length-1].children;let ue=le[le.length-1];(!ue||ue.type!=="text")&&(ue=ee(),ue.position={start:Tt(F.start),end:void 0},le.push(ue)),this.stack.push(ue)}function I(F){const q=this.stack.pop();q.value+=this.sliceSerialize(F),q.position.end=Tt(F.end)}function D(F){const q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const le=q.children[q.children.length-1];le.position.end=Tt(F.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(q.type)&&($.call(this,F),I.call(this,F))}function z(){this.data.atHardBreak=!0}function P(){const F=this.resume(),q=this.stack[this.stack.length-1];q.value=F}function L(){const F=this.resume(),q=this.stack[this.stack.length-1];q.value=F}function M(){const F=this.resume(),q=this.stack[this.stack.length-1];q.value=F}function R(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=q,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function U(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=q,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function B(F){const q=this.sliceSerialize(F),le=this.stack[this.stack.length-2];le.label=Nb(q),le.identifier=st(q).toLowerCase()}function V(){const F=this.stack[this.stack.length-1],q=this.resume(),le=this.stack[this.stack.length-1];if(this.data.inReference=!0,le.type==="link"){const ue=F.children;le.children=ue}else le.alt=q}function v(){const F=this.resume(),q=this.stack[this.stack.length-1];q.url=F}function N(){const F=this.resume(),q=this.stack[this.stack.length-1];q.title=F}function H(){this.data.inReference=void 0}function k(){this.data.referenceType="collapsed"}function W(F){const q=this.resume(),le=this.stack[this.stack.length-1];le.label=q,le.identifier=st(this.sliceSerialize(F)).toLowerCase(),this.data.referenceType="full"}function te(F){this.data.characterReferenceType=F.type}function Y(F){const q=this.sliceSerialize(F),le=this.data.characterReferenceType;let ue;le?(ue=Vl(q,le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ue=io(q);const ye=this.stack[this.stack.length-1];ye.value+=ue}function Z(F){const q=this.stack.pop();q.position.end=Tt(F.end)}function re(F){I.call(this,F);const q=this.stack[this.stack.length-1];q.url=this.sliceSerialize(F)}function oe(F){I.call(this,F);const q=this.stack[this.stack.length-1];q.url="mailto:"+this.sliceSerialize(F)}function G(){return{type:"blockquote",children:[]}}function Q(){return{type:"code",lang:null,meta:null,value:""}}function j(){return{type:"inlineCode",value:""}}function X(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ae(){return{type:"emphasis",children:[]}}function pe(){return{type:"heading",depth:0,children:[]}}function ie(){return{type:"break"}}function K(){return{type:"html",value:""}}function ce(){return{type:"image",title:null,url:"",alt:null}}function he(){return{type:"link",title:null,url:"",children:[]}}function Ce(F){return{type:"list",ordered:F.type==="listOrdered",start:null,spread:F._spread,children:[]}}function ke(F){return{type:"listItem",spread:F._spread,checked:null,children:[]}}function je(){return{type:"paragraph",children:[]}}function Ye(){return{type:"strong",children:[]}}function ee(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}function Tt(e){return{line:e.line,column:e.column,offset:e.offset}}function cc(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?cc(e,r):Rb(e,r)}}function Rb(e,t){let n;for(n in t)if(lc.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function uc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Bn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Bn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Bn({start:t.start,end:t.end})+") is still open")}function Bb(e){const t=this;t.parser=n;function n(r){return Lb(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function $b(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function zb(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
14
+ `}]}function jb(e,t){const n=t.value?t.value+`
15
+ `:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function Ub(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hb(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Wb(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=tn(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function Vb(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qb(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function fc(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function Kb(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fc(e,t);const i={src:tn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function Yb(e,t){const n={src:tn(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Gb(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Qb(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fc(e,t);const i={href:tn(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function Jb(e,t){const n={href:tn(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Zb(e,t,n){const r=e.all(t),i=n?Xb(n):dc(t),o={},a=[];if(typeof t.checked=="boolean"){const f=r[0];let u;f&&f.type==="element"&&f.tagName==="p"?u=f:(u={type:"element",tagName:"p",properties:{},children:[]},r.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const f=r[s];(i||s!==0||f.type!=="element"||f.tagName!=="p")&&a.push({type:"text",value:`
16
16
  `}),f.type==="element"&&f.tagName==="p"&&!i?a.push(...f.children):a.push(f)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
17
- `});const c={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,c),e.applyData(t,c)}function Zb(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=hc(n[r])}return t}function hc(e){const t=e.spread;return t??e.children.length>1}function Xb(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function ev(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tv(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function nv(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rv(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=Ji(t.children[1]),l=_l(t.children[t.children.length-1]);s&&l&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function iv(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:t.children.length;let l=-1;const c=[];for(;++l<s;){const u=t.children[l],p={},d=a?a[l]:void 0;d&&(p.align=d);let m={type:"element",tagName:o,properties:p,children:[]};u&&(m.children=e.all(u),e.patch(u,m),m=e.applyData(u,m)),c.push(m)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,f),e.applyData(t,f)}function ov(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const mc=9,gc=32;function av(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(yc(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(yc(t.slice(i),i>0,!1)),o.join("")}function yc(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===mc||o===gc;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===mc||o===gc;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function sv(e,t){const n={type:"text",value:av(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function lv(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const cv={blockquote:Bb,break:$b,code:zb,delete:jb,emphasis:Ub,footnoteReference:Hb,heading:Wb,html:Vb,imageReference:qb,image:Kb,inlineCode:Yb,linkReference:Gb,link:Qb,listItem:Jb,list:Xb,paragraph:ev,root:tv,strong:nv,table:rv,tableCell:ov,tableRow:iv,text:sv,thematicBreak:lv,toml:Ar,yaml:Ar,definition:Ar,footnoteDefinition:Ar};function Ar(){}const bc=-1,Ir=0,Hn=1,Tr=2,uo=3,fo=4,po=5,ho=6,vc=7,wc=8,xc=typeof self=="object"?self:globalThis,uv=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case Ir:case bc:return n(a,i);case Hn:{const s=n([],i);for(const l of a)s.push(r(l));return s}case Tr:{const s=n({},i);for(const[l,c]of a)s[r(l)]=r(c);return s}case uo:return n(new Date(a),i);case fo:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case po:{const s=n(new Map,i);for(const[l,c]of a)s.set(r(l),r(c));return s}case ho:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case vc:{const{name:s,message:l}=a;return n(new xc[s](l),i)}case wc:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:s}=new Uint8Array(a);return n(new DataView(s),a)}}return n(new xc[o](a),i)};return r},kc=e=>uv(new Map,e)(0),rn="",{toString:fv}={},{keys:dv}=Object,Wn=e=>{const t=typeof e;if(t!=="object"||!e)return[Ir,t];const n=fv.call(e).slice(8,-1);switch(n){case"Array":return[Hn,rn];case"Object":return[Tr,rn];case"Date":return[uo,rn];case"RegExp":return[fo,rn];case"Map":return[po,rn];case"Set":return[ho,rn];case"DataView":return[Hn,n]}return n.includes("Array")?[Hn,n]:n.includes("Error")?[vc,n]:[Tr,n]},Or=([e,t])=>e===Ir&&(t==="function"||t==="symbol"),pv=(e,t,n,r)=>{const i=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},o=a=>{if(n.has(a))return n.get(a);let[s,l]=Wn(a);switch(s){case Ir:{let f=a;switch(l){case"bigint":s=wc,f=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([bc],a)}return i([s,f],a)}case Hn:{if(l){let p=a;return l==="DataView"?p=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(a)),i([l,[...p]],a)}const f=[],u=i([s,f],a);for(const p of a)f.push(o(p));return u}case Tr:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const f=[],u=i([s,f],a);for(const p of dv(a))(e||!Or(Wn(a[p])))&&f.push([o(p),o(a[p])]);return u}case uo:return i([s,a.toISOString()],a);case fo:{const{source:f,flags:u}=a;return i([s,{source:f,flags:u}],a)}case po:{const f=[],u=i([s,f],a);for(const[p,d]of a)(e||!(Or(Wn(p))||Or(Wn(d))))&&f.push([o(p),o(d)]);return u}case ho:{const f=[],u=i([s,f],a);for(const p of a)(e||!Or(Wn(p)))&&f.push(o(p));return u}}const{message:c}=a;return i([s,{name:l,message:c}],a)};return o},Sc=(e,{json:t,lossy:n}={})=>{const r=[];return pv(!(t||n),!!t,new Map,r)(e),r},Dr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?kc(Sc(e,t)):structuredClone(e):(e,t)=>kc(Sc(e,t));function hv(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function mv(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function gv(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||hv,r=e.options.footnoteBackLabel||mv,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const f=e.all(c),u=String(c.identifier).toUpperCase(),p=tn(u.toLowerCase());let d=0;const m=[],h=e.footnoteCounts.get(u);for(;h!==void 0&&++d<=h;){m.length>0&&m.push({type:"text",value:" "});let b=typeof n=="string"?n:n(l,d);typeof b=="string"&&(b={type:"text",value:b}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const g=f[f.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const b=g.children[g.children.length-1];b&&b.type==="text"?b.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...m)}else f.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(c,y),s.push(y)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Dr(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
17
+ `});const c={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,c),e.applyData(t,c)}function Xb(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=dc(n[r])}return t}function dc(e){const t=e.spread;return t??e.children.length>1}function ev(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function tv(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nv(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function rv(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iv(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=Ji(t.children[1]),l=Pl(t.children[t.children.length-1]);s&&l&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function ov(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:t.children.length;let l=-1;const c=[];for(;++l<s;){const u=t.children[l],p={},d=a?a[l]:void 0;d&&(p.align=d);let m={type:"element",tagName:o,properties:p,children:[]};u&&(m.children=e.all(u),e.patch(u,m),m=e.applyData(u,m)),c.push(m)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,f),e.applyData(t,f)}function av(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const pc=9,hc=32;function sv(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(mc(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(mc(t.slice(i),i>0,!1)),o.join("")}function mc(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===pc||o===hc;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===pc||o===hc;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function lv(e,t){const n={type:"text",value:sv(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function cv(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const uv={blockquote:$b,break:zb,code:jb,delete:Ub,emphasis:Hb,footnoteReference:Wb,heading:Vb,html:qb,imageReference:Kb,image:Yb,inlineCode:Gb,linkReference:Qb,link:Jb,listItem:Zb,list:ev,paragraph:tv,root:nv,strong:rv,table:iv,tableCell:av,tableRow:ov,text:lv,thematicBreak:cv,toml:Ar,yaml:Ar,definition:Ar,footnoteDefinition:Ar};function Ar(){}const gc=-1,Ir=0,Hn=1,Tr=2,uo=3,fo=4,po=5,ho=6,yc=7,bc=8,vc=typeof self=="object"?self:globalThis,fv=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case Ir:case gc:return n(a,i);case Hn:{const s=n([],i);for(const l of a)s.push(r(l));return s}case Tr:{const s=n({},i);for(const[l,c]of a)s[r(l)]=r(c);return s}case uo:return n(new Date(a),i);case fo:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case po:{const s=n(new Map,i);for(const[l,c]of a)s.set(r(l),r(c));return s}case ho:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case yc:{const{name:s,message:l}=a;return n(new vc[s](l),i)}case bc:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:s}=new Uint8Array(a);return n(new DataView(s),a)}}return n(new vc[o](a),i)};return r},wc=e=>fv(new Map,e)(0),rn="",{toString:dv}={},{keys:pv}=Object,Wn=e=>{const t=typeof e;if(t!=="object"||!e)return[Ir,t];const n=dv.call(e).slice(8,-1);switch(n){case"Array":return[Hn,rn];case"Object":return[Tr,rn];case"Date":return[uo,rn];case"RegExp":return[fo,rn];case"Map":return[po,rn];case"Set":return[ho,rn];case"DataView":return[Hn,n]}return n.includes("Array")?[Hn,n]:n.includes("Error")?[yc,n]:[Tr,n]},Or=([e,t])=>e===Ir&&(t==="function"||t==="symbol"),hv=(e,t,n,r)=>{const i=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},o=a=>{if(n.has(a))return n.get(a);let[s,l]=Wn(a);switch(s){case Ir:{let f=a;switch(l){case"bigint":s=bc,f=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([gc],a)}return i([s,f],a)}case Hn:{if(l){let p=a;return l==="DataView"?p=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(a)),i([l,[...p]],a)}const f=[],u=i([s,f],a);for(const p of a)f.push(o(p));return u}case Tr:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const f=[],u=i([s,f],a);for(const p of pv(a))(e||!Or(Wn(a[p])))&&f.push([o(p),o(a[p])]);return u}case uo:return i([s,a.toISOString()],a);case fo:{const{source:f,flags:u}=a;return i([s,{source:f,flags:u}],a)}case po:{const f=[],u=i([s,f],a);for(const[p,d]of a)(e||!(Or(Wn(p))||Or(Wn(d))))&&f.push([o(p),o(d)]);return u}case ho:{const f=[],u=i([s,f],a);for(const p of a)(e||!Or(Wn(p)))&&f.push(o(p));return u}}const{message:c}=a;return i([s,{name:l,message:c}],a)};return o},xc=(e,{json:t,lossy:n}={})=>{const r=[];return hv(!(t||n),!!t,new Map,r)(e),r},Dr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?wc(xc(e,t)):structuredClone(e):(e,t)=>wc(xc(e,t));function mv(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function gv(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function yv(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||mv,r=e.options.footnoteBackLabel||gv,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const f=e.all(c),u=String(c.identifier).toUpperCase(),p=tn(u.toLowerCase());let d=0;const m=[],h=e.footnoteCounts.get(u);for(;h!==void 0&&++d<=h;){m.length>0&&m.push({type:"text",value:" "});let b=typeof n=="string"?n:n(l,d);typeof b=="string"&&(b={type:"text",value:b}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const g=f[f.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const b=g.children[g.children.length-1];b&&b.type==="text"?b.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...m)}else f.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(c,y),s.push(y)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Dr(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
18
18
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
19
- `}]}}const Mr=function(e){if(e==null)return wv;if(typeof e=="function")return Pr(e);if(typeof e=="object")return Array.isArray(e)?yv(e):bv(e);if(typeof e=="string")return vv(e);throw new Error("Expected function, string, or object as test")};function yv(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Mr(e[n]);return Pr(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function bv(e){const t=e;return Pr(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function vv(e){return Pr(t);function t(n){return n&&n.type===e}}function Pr(e){return t;function t(n,r,i){return!!(xv(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function wv(){return!0}function xv(e){return e!==null&&typeof e=="object"&&"type"in e}function RT(e){return e}const Ec=[],kv=!0,mo=!1,Sv="skip";function Cc(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Mr(i),a=r?-1:1;s(e,void 0,[])();function s(l,c,f){const u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){const d=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return p;function p(){let d=Ec,m,h,g;if((!t||o(l,c,f[f.length-1]||void 0))&&(d=Ev(n(l,f)),d[0]===mo))return d;if("children"in l&&l.children){const y=l;if(y.children&&d[0]!==Sv)for(h=(r?y.children.length:-1)+a,g=f.concat(y);h>-1&&h<y.children.length;){const b=y.children[h];if(m=s(b,h,g)(),m[0]===mo)return m;h=typeof m[1]=="number"?m[1]:h+a}}return d}}}function Ev(e){return Array.isArray(e)?e:typeof e=="number"?[kv,e]:e==null?Ec:[e]}function go(e,t,n,r){let i,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),Cc(e,o,s,i);function s(l,c){const f=c[c.length-1],u=f?f.children.indexOf(l):void 0;return a(l,u,f)}}const yo={}.hasOwnProperty,Cv={};function Av(e,t){const n=t||Cv,r=new Map,i=new Map,o=new Map,a={...cv,...n.handlers},s={all:c,applyData:Tv,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:l,options:n,patch:Iv,wrap:Dv};return go(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const u=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();u.has(p)||u.set(p,f)}}),s;function l(f,u){const p=f.type,d=s.handlers[p];if(yo.call(s.handlers,p)&&d)return d(s,f,u);if(s.options.passThrough&&s.options.passThrough.includes(p)){if("children"in f){const{children:h,...g}=f,y=Dr(g);return y.children=s.all(f),y}return Dr(f)}return(s.options.unknownHandler||Ov)(s,f,u)}function c(f){const u=[];if("children"in f){const p=f.children;let d=-1;for(;++d<p.length;){const m=s.one(p[d],f);if(m){if(d&&p[d-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Ac(m.value)),!Array.isArray(m)&&m.type==="element")){const h=m.children[0];h&&h.type==="text"&&(h.value=Ac(h.value))}Array.isArray(m)?u.push(...m):u.push(m)}}}return u}}function Iv(e,t){e.position&&(t.position=Eg(e))}function Tv(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,Dr(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Ov(e,t){const n=t.data||{},r="value"in t&&!(yo.call(n,"hProperties")||yo.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Dv(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
19
+ `}]}}const Mr=function(e){if(e==null)return xv;if(typeof e=="function")return Pr(e);if(typeof e=="object")return Array.isArray(e)?bv(e):vv(e);if(typeof e=="string")return wv(e);throw new Error("Expected function, string, or object as test")};function bv(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Mr(e[n]);return Pr(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function vv(e){const t=e;return Pr(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function wv(e){return Pr(t);function t(n){return n&&n.type===e}}function Pr(e){return t;function t(n,r,i){return!!(kv(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function xv(){return!0}function kv(e){return e!==null&&typeof e=="object"&&"type"in e}function BT(e){return e}const kc=[],Sv=!0,mo=!1,Ev="skip";function Sc(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Mr(i),a=r?-1:1;s(e,void 0,[])();function s(l,c,f){const u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){const d=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return p;function p(){let d=kc,m,h,g;if((!t||o(l,c,f[f.length-1]||void 0))&&(d=Cv(n(l,f)),d[0]===mo))return d;if("children"in l&&l.children){const y=l;if(y.children&&d[0]!==Ev)for(h=(r?y.children.length:-1)+a,g=f.concat(y);h>-1&&h<y.children.length;){const b=y.children[h];if(m=s(b,h,g)(),m[0]===mo)return m;h=typeof m[1]=="number"?m[1]:h+a}}return d}}}function Cv(e){return Array.isArray(e)?e:typeof e=="number"?[Sv,e]:e==null?kc:[e]}function go(e,t,n,r){let i,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),Sc(e,o,s,i);function s(l,c){const f=c[c.length-1],u=f?f.children.indexOf(l):void 0;return a(l,u,f)}}const yo={}.hasOwnProperty,Av={};function Iv(e,t){const n=t||Av,r=new Map,i=new Map,o=new Map,a={...uv,...n.handlers},s={all:c,applyData:Ov,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:l,options:n,patch:Tv,wrap:Mv};return go(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const u=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();u.has(p)||u.set(p,f)}}),s;function l(f,u){const p=f.type,d=s.handlers[p];if(yo.call(s.handlers,p)&&d)return d(s,f,u);if(s.options.passThrough&&s.options.passThrough.includes(p)){if("children"in f){const{children:h,...g}=f,y=Dr(g);return y.children=s.all(f),y}return Dr(f)}return(s.options.unknownHandler||Dv)(s,f,u)}function c(f){const u=[];if("children"in f){const p=f.children;let d=-1;for(;++d<p.length;){const m=s.one(p[d],f);if(m){if(d&&p[d-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Ec(m.value)),!Array.isArray(m)&&m.type==="element")){const h=m.children[0];h&&h.type==="text"&&(h.value=Ec(h.value))}Array.isArray(m)?u.push(...m):u.push(m)}}}return u}}function Tv(e,t){e.position&&(t.position=Cg(e))}function Ov(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,Dr(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Dv(e,t){const n=t.data||{},r="value"in t&&!(yo.call(n,"hProperties")||yo.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Mv(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
20
20
  `});++r<e.length;)r&&n.push({type:"text",value:`
21
21
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
22
- `}),n}function Ac(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ic(e,t){const n=Av(e,t),r=n.one(e,void 0),i=gv(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
23
- `},i),o}function Mv(e,t){return e&&"run"in e?async function(n,r){const i=Ic(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Ic(n,{file:r,...e||t})}}function Tc(e){if(e)throw e}var Nr=Object.prototype.hasOwnProperty,Oc=Object.prototype.toString,Dc=Object.defineProperty,Mc=Object.getOwnPropertyDescriptor,Pc=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Oc.call(t)==="[object Array]"},Nc=function(t){if(!t||Oc.call(t)!=="[object Object]")return!1;var n=Nr.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Nr.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Nr.call(t,i)},_c=function(t,n){Dc&&n.name==="__proto__"?Dc(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Lc=function(t,n){if(n==="__proto__")if(Nr.call(t,n)){if(Mc)return Mc(t,n).value}else return;return t[n]},Pv=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,f=!1;for(typeof s=="boolean"&&(f=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=Lc(s,n),i=Lc(t,n),s!==i&&(f&&i&&(Nc(i)||(o=Pc(i)))?(o?(o=!1,a=r&&Pc(r)?r:[]):a=r&&Nc(r)?r:{},_c(s,{name:n,newValue:e(f,a,i)})):typeof i<"u"&&_c(s,{name:n,newValue:i}));return s};const bo=jt(Pv);function vo(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Nv(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(l,...c){const f=e[++o];let u=-1;if(l){a(l);return}for(;++u<i.length;)(c[u]===null||c[u]===void 0)&&(c[u]=i[u]);i=c,f?_v(f,s)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function _v(e,t){let n;return r;function r(...a){const s=e.length>a.length;let l;s&&a.push(i);try{l=e.apply(this,a)}catch(c){const f=c;if(s&&n)throw f;return i(f)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}const dt={basename:Lv,dirname:Fv,extname:Rv,join:Bv,sep:"/"};function Lv(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Vn(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Fv(e){if(Vn(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Rv(e){Vn(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const s=e.codePointAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Bv(...e){let t=-1,n;for(;++t<e.length;)Vn(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":$v(n)}function $v(e){Vn(e);const t=e.codePointAt(0)===47;let n=zv(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function zv(e,t){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function Vn(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const jv={cwd:Uv};function Uv(){return"/"}function wo(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Hv(e){if(typeof e=="string")e=new URL(e);else if(!wo(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Wv(e)}function Wv(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const xo=["history","path","basename","stem","extname","dirname"];class Fc{constructor(t){let n;t?wo(t)?n={path:t}:typeof t=="string"||Vv(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":jv.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<xo.length;){const o=xo[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)xo.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?dt.basename(this.path):void 0}set basename(t){So(t,"basename"),ko(t,"basename"),this.path=dt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?dt.dirname(this.path):void 0}set dirname(t){Rc(this.basename,"dirname"),this.path=dt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?dt.extname(this.path):void 0}set extname(t){if(ko(t,"extname"),Rc(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=dt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){wo(t)&&(t=Hv(t)),So(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?dt.basename(this.path,this.extname):void 0}set stem(t){So(t,"stem"),ko(t,"stem"),this.path=dt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new $e(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ko(e,t){if(e&&e.includes(dt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+dt.sep+"`")}function So(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Rc(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Vv(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const qv=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},Kv={}.hasOwnProperty;class Eo extends qv{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Nv()}copy(){const t=new Eo;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(bo(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Io("data",this.frozen),this.namespace[t]=n,this):Kv.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Io("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=_r(t),r=this.parser||this.Parser;return Co("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Co("process",this.parser||this.Parser),Ao("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const s=_r(t),l=r.parse(s);r.run(l,s,function(f,u,p){if(f||!u||!p)return c(f);const d=u,m=r.stringify(d,p);Qv(m)?p.value=m:p.result=m,c(f,p)});function c(f,u){f||!u?a(f):o?o(u):n(void 0,u)}}}processSync(t){let n=!1,r;return this.freeze(),Co("processSync",this.parser||this.Parser),Ao("processSync",this.compiler||this.Compiler),this.process(t,i),$c("processSync","process",n),r;function i(o,a){n=!0,Tc(o),r=a}}run(t,n,r){Bc(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(a,s){const l=_r(n);i.run(t,l,c);function c(f,u,p){const d=u||t;f?s(f):a?a(d):r(void 0,d,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),$c("runSync","run",r),i;function o(a,s){Tc(a),i=s,r=!0}}stringify(t,n){this.freeze();const r=_r(n),i=this.compiler||this.Compiler;return Ao("stringify",i),Bc(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Io("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[f,...u]=c;l(f,u)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(c.plugins),c.settings&&(i.settings=bo(!0,i.settings,c.settings))}function s(c){let f=-1;if(c!=null)if(Array.isArray(c))for(;++f<c.length;){const u=c[f];o(u)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,f){let u=-1,p=-1;for(;++u<r.length;)if(r[u][0]===c){p=u;break}if(p===-1)r.push([c,...f]);else if(f.length>0){let[d,...m]=f;const h=r[p][1];vo(h)&&vo(d)&&(d=bo(!0,h,d)),r[p]=[c,d,...m]}}}}const Yv=new Eo().freeze();function Co(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ao(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Io(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Bc(e){if(!vo(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function $c(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function _r(e){return Gv(e)?e:new Fc(e)}function Gv(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Qv(e){return typeof e=="string"||Jv(e)}function Jv(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Zv="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",zc=[],jc={allowDangerousHtml:!0},Xv=/^(https?|ircs?|mailto|xmpp)$/i,ew=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Uc(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,a=e.disallowedElements,s=e.rehypePlugins||zc,l=e.remarkPlugins||zc,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...jc}:jc,f=e.skipHtml,u=e.unwrapDisallowed,p=e.urlTransform||Hc,d=Yv().use(Rb).use(l).use(Mv,c).use(s),m=new Fc;typeof r=="string"&&(m.value=r);for(const b of ew)Object.hasOwn(e,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+Zv+b.id,void 0);const h=d.parse(m);let g=d.runSync(h,m);return i&&(g={type:"element",tagName:"div",properties:{className:i},children:g.type==="root"?g.children:[g]}),go(g,y),Og(g,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function y(b,w,E){if(b.type==="raw"&&E&&typeof w=="number")return f?E.children.splice(w,1):E.children[w]={type:"text",value:b.value},w;if(b.type==="element"){let x;for(x in no)if(Object.hasOwn(no,x)&&Object.hasOwn(b.properties,x)){const C=b.properties[x],T=no[x];(T===null||T.includes(b.tagName))&&(b.properties[x]=p(String(C||""),x,b))}}if(b.type==="element"){let x=t?!t.includes(b.tagName):a?a.includes(b.tagName):!1;if(!x&&n&&typeof w=="number"&&(x=!n(b,w,E)),x&&E&&typeof w=="number")return u&&b.children?E.children.splice(w,1,...b.children):E.children.splice(w,1),w}}}function Hc(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||Xv.test(e.slice(0,t))?e:""}function tw(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Wc(e,t,n){const i=Mr((n||{}).ignore||[]),o=nw(t);let a=-1;for(;++a<o.length;)Cc(e,"text",s);function s(c,f){let u=-1,p;for(;++u<f.length;){const d=f[u],m=p?p.children:void 0;if(i(d,m?m.indexOf(d):void 0,p))return;p=d}if(p)return l(c,f)}function l(c,f){const u=f[f.length-1],p=o[a][0],d=o[a][1];let m=0;const g=u.children.indexOf(c);let y=!1,b=[];p.lastIndex=0;let w=p.exec(c.value);for(;w;){const E=w.index,x={index:w.index,input:w.input,stack:[...f,c]};let C=d(...w,x);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?p.lastIndex=E+1:(m!==E&&b.push({type:"text",value:c.value.slice(m,E)}),Array.isArray(C)?b.push(...C):C&&b.push(C),m=E+w[0].length,y=!0),!p.global)break;w=p.exec(c.value)}return y?(m<c.value.length&&b.push({type:"text",value:c.value.slice(m)}),u.children.splice(g,1,...b)):b=[c],g+b.length}}function nw(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([rw(i[0]),iw(i[1])])}return t}function rw(e){return typeof e=="string"?new RegExp(tw(e),"g"):e}function iw(e){return typeof e=="function"?e:function(){return e}}function ow(e){Wc(e,[/\r?\n|\r/g,aw])}function aw(){return{type:"break"}}function sw(){return function(e){ow(e)}}function Vc(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const To="phrasing",Oo=["autolink","link","image","label"];function lw(){return{transforms:[mw],enter:{literalAutolink:uw,literalAutolinkEmail:Do,literalAutolinkHttp:Do,literalAutolinkWww:Do},exit:{literalAutolink:hw,literalAutolinkEmail:pw,literalAutolinkHttp:fw,literalAutolinkWww:dw}}}function cw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:To,notInConstruct:Oo},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:To,notInConstruct:Oo},{character:":",before:"[ps]",after:"\\/",inConstruct:To,notInConstruct:Oo}]}}function uw(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Do(e){this.config.enter.autolinkProtocol.call(this,e)}function fw(e){this.config.exit.autolinkProtocol.call(this,e)}function dw(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function pw(e){this.config.exit.autolinkEmail.call(this,e)}function hw(e){this.exit(e)}function mw(e){Wc(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,gw],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),yw]],{ignore:["link","linkReference"]})}function gw(e,t,n,r,i){let o="";if(!qc(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!bw(n)))return!1;const a=vw(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function yw(e,t,n,r){return!qc(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function bw(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function vw(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Vc(e,"(");let o=Vc(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function qc(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Wt(n)||Sr(n))&&(!t||n!==47)}Kc.peek=Tw;function ww(){this.buffer()}function xw(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function kw(){this.buffer()}function Sw(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Ew(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=at(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Cw(e){this.exit(e)}function Aw(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=at(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Iw(e){this.exit(e)}function Tw(){return"["}function Kc(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),s(),a(),o+=i.move("]"),o}function Ow(){return{enter:{gfmFootnoteCallString:ww,gfmFootnoteCall:xw,gfmFootnoteDefinitionLabelString:kw,gfmFootnoteDefinition:Sw},exit:{gfmFootnoteCallString:Ew,gfmFootnoteCall:Cw,gfmFootnoteDefinitionLabelString:Aw,gfmFootnoteDefinition:Iw}}}function Dw(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Kc},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,a){const s=o.createTracker(a);let l=s.move("[^");const c=o.enter("footnoteDefinition"),f=o.enter("label");return l+=s.move(o.safe(o.associationId(r),{before:l,after:"]"})),f(),l+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),l+=s.move((t?`
24
- `:" ")+o.indentLines(o.containerFlow(r,s.current()),t?Yc:Mw))),c(),l}}function Mw(e,t,n){return t===0?e:Yc(e,t,n)}function Yc(e,t,n){return(n?"":" ")+e}const Pw=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Gc.peek=Rw;function Nw(){return{canContainEols:["delete"],enter:{strikethrough:Lw},exit:{strikethrough:Fw}}}function _w(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Pw}],handlers:{delete:Gc}}}function Lw(e){this.enter({type:"delete",children:[]},e)}function Fw(e){this.exit(e)}function Gc(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function Rw(){return"~"}function Bw(e){return e.length}function $w(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Bw,o=[],a=[],s=[],l=[];let c=0,f=-1;for(;++f<e.length;){const h=[],g=[];let y=-1;for(e[f].length>c&&(c=e[f].length);++y<e[f].length;){const b=zw(e[f][y]);if(n.alignDelimiters!==!1){const w=i(b);g[y]=w,(l[y]===void 0||w>l[y])&&(l[y]=w)}h.push(b)}a[f]=h,s[f]=g}let u=-1;if(typeof r=="object"&&"length"in r)for(;++u<c;)o[u]=Qc(r[u]);else{const h=Qc(r);for(;++u<c;)o[u]=h}u=-1;const p=[],d=[];for(;++u<c;){const h=o[u];let g="",y="";h===99?(g=":",y=":"):h===108?g=":":h===114&&(y=":");let b=n.alignDelimiters===!1?1:Math.max(1,l[u]-g.length-y.length);const w=g+"-".repeat(b)+y;n.alignDelimiters!==!1&&(b=g.length+b+y.length,b>l[u]&&(l[u]=b),d[u]=b),p[u]=w}a.splice(1,0,p),s.splice(1,0,d),f=-1;const m=[];for(;++f<a.length;){const h=a[f],g=s[f];u=-1;const y=[];for(;++u<c;){const b=h[u]||"";let w="",E="";if(n.alignDelimiters!==!1){const x=l[u]-(g[u]||0),C=o[u];C===114?w=" ".repeat(x):C===99?x%2?(w=" ".repeat(x/2+.5),E=" ".repeat(x/2-.5)):(w=" ".repeat(x/2),E=w):E=" ".repeat(x)}n.delimiterStart!==!1&&!u&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&b==="")&&(n.delimiterStart!==!1||u)&&y.push(" "),n.alignDelimiters!==!1&&y.push(w),y.push(b),n.alignDelimiters!==!1&&y.push(E),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||u!==c-1)&&y.push("|")}m.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return m.join(`
25
- `)}function zw(e){return e==null?"":String(e)}function Qc(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function jw(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),Uw);return i(),a}function Uw(e,t,n){return">"+(n?"":" ")+e}function Hw(e,t){return Jc(e,t.inConstruct,!0)&&!Jc(e,t.notInConstruct,!1)}function Jc(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Zc(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
26
- `&&Hw(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
27
- `}function Ww(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>a&&(a=o):o=1,i=r+t.length,r=n.indexOf(t,i);return a}function Vw(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function qw(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Kw(e,t,n,r){const i=qw(n),o=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(Vw(e,n)){const u=n.enter("codeIndented"),p=n.indentLines(o,Yw);return u(),p}const s=n.createTracker(r),l=i.repeat(Math.max(Ww(o,i)+1,3)),c=n.enter("codeFenced");let f=s.move(l);if(e.lang){const u=n.enter(`codeFencedLang${a}`);f+=s.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...s.current()})),u()}if(e.lang&&e.meta){const u=n.enter(`codeFencedMeta${a}`);f+=s.move(" "),f+=s.move(n.safe(e.meta,{before:f,after:`
22
+ `}),n}function Ec(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Cc(e,t){const n=Iv(e,t),r=n.one(e,void 0),i=yv(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
23
+ `},i),o}function Pv(e,t){return e&&"run"in e?async function(n,r){const i=Cc(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Cc(n,{file:r,...e||t})}}function Ac(e){if(e)throw e}var Nr=Object.prototype.hasOwnProperty,Ic=Object.prototype.toString,Tc=Object.defineProperty,Oc=Object.getOwnPropertyDescriptor,Dc=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Ic.call(t)==="[object Array]"},Mc=function(t){if(!t||Ic.call(t)!=="[object Object]")return!1;var n=Nr.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Nr.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Nr.call(t,i)},Pc=function(t,n){Tc&&n.name==="__proto__"?Tc(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Nc=function(t,n){if(n==="__proto__")if(Nr.call(t,n)){if(Oc)return Oc(t,n).value}else return;return t[n]},Nv=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,f=!1;for(typeof s=="boolean"&&(f=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=Nc(s,n),i=Nc(t,n),s!==i&&(f&&i&&(Mc(i)||(o=Dc(i)))?(o?(o=!1,a=r&&Dc(r)?r:[]):a=r&&Mc(r)?r:{},Pc(s,{name:n,newValue:e(f,a,i)})):typeof i<"u"&&Pc(s,{name:n,newValue:i}));return s};const bo=jt(Nv);function vo(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function _v(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(l,...c){const f=e[++o];let u=-1;if(l){a(l);return}for(;++u<i.length;)(c[u]===null||c[u]===void 0)&&(c[u]=i[u]);i=c,f?Lv(f,s)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Lv(e,t){let n;return r;function r(...a){const s=e.length>a.length;let l;s&&a.push(i);try{l=e.apply(this,a)}catch(c){const f=c;if(s&&n)throw f;return i(f)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}const dt={basename:Fv,dirname:Rv,extname:Bv,join:$v,sep:"/"};function Fv(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Vn(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Rv(e){if(Vn(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Bv(e){Vn(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const s=e.codePointAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function $v(...e){let t=-1,n;for(;++t<e.length;)Vn(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":zv(n)}function zv(e){Vn(e);const t=e.codePointAt(0)===47;let n=jv(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function jv(e,t){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function Vn(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Uv={cwd:Hv};function Hv(){return"/"}function wo(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Wv(e){if(typeof e=="string")e=new URL(e);else if(!wo(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Vv(e)}function Vv(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const xo=["history","path","basename","stem","extname","dirname"];class _c{constructor(t){let n;t?wo(t)?n={path:t}:typeof t=="string"||qv(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Uv.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<xo.length;){const o=xo[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)xo.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?dt.basename(this.path):void 0}set basename(t){So(t,"basename"),ko(t,"basename"),this.path=dt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?dt.dirname(this.path):void 0}set dirname(t){Lc(this.basename,"dirname"),this.path=dt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?dt.extname(this.path):void 0}set extname(t){if(ko(t,"extname"),Lc(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=dt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){wo(t)&&(t=Wv(t)),So(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?dt.basename(this.path,this.extname):void 0}set stem(t){So(t,"stem"),ko(t,"stem"),this.path=dt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new He(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ko(e,t){if(e&&e.includes(dt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+dt.sep+"`")}function So(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Lc(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function qv(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Kv=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},Yv={}.hasOwnProperty;class Eo extends Kv{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=_v()}copy(){const t=new Eo;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(bo(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Io("data",this.frozen),this.namespace[t]=n,this):Yv.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Io("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=_r(t),r=this.parser||this.Parser;return Co("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Co("process",this.parser||this.Parser),Ao("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const s=_r(t),l=r.parse(s);r.run(l,s,function(f,u,p){if(f||!u||!p)return c(f);const d=u,m=r.stringify(d,p);Jv(m)?p.value=m:p.result=m,c(f,p)});function c(f,u){f||!u?a(f):o?o(u):n(void 0,u)}}}processSync(t){let n=!1,r;return this.freeze(),Co("processSync",this.parser||this.Parser),Ao("processSync",this.compiler||this.Compiler),this.process(t,i),Rc("processSync","process",n),r;function i(o,a){n=!0,Ac(o),r=a}}run(t,n,r){Fc(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(a,s){const l=_r(n);i.run(t,l,c);function c(f,u,p){const d=u||t;f?s(f):a?a(d):r(void 0,d,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Rc("runSync","run",r),i;function o(a,s){Ac(a),i=s,r=!0}}stringify(t,n){this.freeze();const r=_r(n),i=this.compiler||this.Compiler;return Ao("stringify",i),Fc(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Io("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[f,...u]=c;l(f,u)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(c.plugins),c.settings&&(i.settings=bo(!0,i.settings,c.settings))}function s(c){let f=-1;if(c!=null)if(Array.isArray(c))for(;++f<c.length;){const u=c[f];o(u)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,f){let u=-1,p=-1;for(;++u<r.length;)if(r[u][0]===c){p=u;break}if(p===-1)r.push([c,...f]);else if(f.length>0){let[d,...m]=f;const h=r[p][1];vo(h)&&vo(d)&&(d=bo(!0,h,d)),r[p]=[c,d,...m]}}}}const Gv=new Eo().freeze();function Co(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ao(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Io(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Fc(e){if(!vo(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Rc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function _r(e){return Qv(e)?e:new _c(e)}function Qv(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Jv(e){return typeof e=="string"||Zv(e)}function Zv(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Xv="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Bc=[],$c={allowDangerousHtml:!0},ew=/^(https?|ircs?|mailto|xmpp)$/i,tw=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function zc(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,a=e.disallowedElements,s=e.rehypePlugins||Bc,l=e.remarkPlugins||Bc,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...$c}:$c,f=e.skipHtml,u=e.unwrapDisallowed,p=e.urlTransform||jc,d=Gv().use(Bb).use(l).use(Pv,c).use(s),m=new _c;typeof r=="string"&&(m.value=r);for(const b of tw)Object.hasOwn(e,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+Xv+b.id,void 0);const h=d.parse(m);let g=d.runSync(h,m);return i&&(g={type:"element",tagName:"div",properties:{className:i},children:g.type==="root"?g.children:[g]}),go(g,y),Dg(g,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function y(b,w,C){if(b.type==="raw"&&C&&typeof w=="number")return f?C.children.splice(w,1):C.children[w]={type:"text",value:b.value},w;if(b.type==="element"){let x;for(x in no)if(Object.hasOwn(no,x)&&Object.hasOwn(b.properties,x)){const E=b.properties[x],T=no[x];(T===null||T.includes(b.tagName))&&(b.properties[x]=p(String(E||""),x,b))}}if(b.type==="element"){let x=t?!t.includes(b.tagName):a?a.includes(b.tagName):!1;if(!x&&n&&typeof w=="number"&&(x=!n(b,w,C)),x&&C&&typeof w=="number")return u&&b.children?C.children.splice(w,1,...b.children):C.children.splice(w,1),w}}}function jc(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||ew.test(e.slice(0,t))?e:""}function nw(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Uc(e,t,n){const i=Mr((n||{}).ignore||[]),o=rw(t);let a=-1;for(;++a<o.length;)Sc(e,"text",s);function s(c,f){let u=-1,p;for(;++u<f.length;){const d=f[u],m=p?p.children:void 0;if(i(d,m?m.indexOf(d):void 0,p))return;p=d}if(p)return l(c,f)}function l(c,f){const u=f[f.length-1],p=o[a][0],d=o[a][1];let m=0;const g=u.children.indexOf(c);let y=!1,b=[];p.lastIndex=0;let w=p.exec(c.value);for(;w;){const C=w.index,x={index:w.index,input:w.input,stack:[...f,c]};let E=d(...w,x);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?p.lastIndex=C+1:(m!==C&&b.push({type:"text",value:c.value.slice(m,C)}),Array.isArray(E)?b.push(...E):E&&b.push(E),m=C+w[0].length,y=!0),!p.global)break;w=p.exec(c.value)}return y?(m<c.value.length&&b.push({type:"text",value:c.value.slice(m)}),u.children.splice(g,1,...b)):b=[c],g+b.length}}function rw(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([iw(i[0]),ow(i[1])])}return t}function iw(e){return typeof e=="string"?new RegExp(nw(e),"g"):e}function ow(e){return typeof e=="function"?e:function(){return e}}function aw(e){Uc(e,[/\r?\n|\r/g,sw])}function sw(){return{type:"break"}}function lw(){return function(e){aw(e)}}function Hc(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const To="phrasing",Oo=["autolink","link","image","label"];function cw(){return{transforms:[gw],enter:{literalAutolink:fw,literalAutolinkEmail:Do,literalAutolinkHttp:Do,literalAutolinkWww:Do},exit:{literalAutolink:mw,literalAutolinkEmail:hw,literalAutolinkHttp:dw,literalAutolinkWww:pw}}}function uw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:To,notInConstruct:Oo},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:To,notInConstruct:Oo},{character:":",before:"[ps]",after:"\\/",inConstruct:To,notInConstruct:Oo}]}}function fw(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Do(e){this.config.enter.autolinkProtocol.call(this,e)}function dw(e){this.config.exit.autolinkProtocol.call(this,e)}function pw(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function hw(e){this.config.exit.autolinkEmail.call(this,e)}function mw(e){this.exit(e)}function gw(e){Uc(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,yw],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),bw]],{ignore:["link","linkReference"]})}function yw(e,t,n,r,i){let o="";if(!Wc(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!vw(n)))return!1;const a=ww(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function bw(e,t,n,r){return!Wc(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function vw(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function ww(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Hc(e,"(");let o=Hc(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Wc(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Wt(n)||Sr(n))&&(!t||n!==47)}Vc.peek=Ow;function xw(){this.buffer()}function kw(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Sw(){this.buffer()}function Ew(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Cw(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=st(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Aw(e){this.exit(e)}function Iw(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=st(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Tw(e){this.exit(e)}function Ow(){return"["}function Vc(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),s(),a(),o+=i.move("]"),o}function Dw(){return{enter:{gfmFootnoteCallString:xw,gfmFootnoteCall:kw,gfmFootnoteDefinitionLabelString:Sw,gfmFootnoteDefinition:Ew},exit:{gfmFootnoteCallString:Cw,gfmFootnoteCall:Aw,gfmFootnoteDefinitionLabelString:Iw,gfmFootnoteDefinition:Tw}}}function Mw(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Vc},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,a){const s=o.createTracker(a);let l=s.move("[^");const c=o.enter("footnoteDefinition"),f=o.enter("label");return l+=s.move(o.safe(o.associationId(r),{before:l,after:"]"})),f(),l+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),l+=s.move((t?`
24
+ `:" ")+o.indentLines(o.containerFlow(r,s.current()),t?qc:Pw))),c(),l}}function Pw(e,t,n){return t===0?e:qc(e,t,n)}function qc(e,t,n){return(n?"":" ")+e}const Nw=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Kc.peek=Bw;function _w(){return{canContainEols:["delete"],enter:{strikethrough:Fw},exit:{strikethrough:Rw}}}function Lw(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Nw}],handlers:{delete:Kc}}}function Fw(e){this.enter({type:"delete",children:[]},e)}function Rw(e){this.exit(e)}function Kc(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function Bw(){return"~"}function $w(e){return e.length}function zw(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||$w,o=[],a=[],s=[],l=[];let c=0,f=-1;for(;++f<e.length;){const h=[],g=[];let y=-1;for(e[f].length>c&&(c=e[f].length);++y<e[f].length;){const b=jw(e[f][y]);if(n.alignDelimiters!==!1){const w=i(b);g[y]=w,(l[y]===void 0||w>l[y])&&(l[y]=w)}h.push(b)}a[f]=h,s[f]=g}let u=-1;if(typeof r=="object"&&"length"in r)for(;++u<c;)o[u]=Yc(r[u]);else{const h=Yc(r);for(;++u<c;)o[u]=h}u=-1;const p=[],d=[];for(;++u<c;){const h=o[u];let g="",y="";h===99?(g=":",y=":"):h===108?g=":":h===114&&(y=":");let b=n.alignDelimiters===!1?1:Math.max(1,l[u]-g.length-y.length);const w=g+"-".repeat(b)+y;n.alignDelimiters!==!1&&(b=g.length+b+y.length,b>l[u]&&(l[u]=b),d[u]=b),p[u]=w}a.splice(1,0,p),s.splice(1,0,d),f=-1;const m=[];for(;++f<a.length;){const h=a[f],g=s[f];u=-1;const y=[];for(;++u<c;){const b=h[u]||"";let w="",C="";if(n.alignDelimiters!==!1){const x=l[u]-(g[u]||0),E=o[u];E===114?w=" ".repeat(x):E===99?x%2?(w=" ".repeat(x/2+.5),C=" ".repeat(x/2-.5)):(w=" ".repeat(x/2),C=w):C=" ".repeat(x)}n.delimiterStart!==!1&&!u&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&b==="")&&(n.delimiterStart!==!1||u)&&y.push(" "),n.alignDelimiters!==!1&&y.push(w),y.push(b),n.alignDelimiters!==!1&&y.push(C),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||u!==c-1)&&y.push("|")}m.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return m.join(`
25
+ `)}function jw(e){return e==null?"":String(e)}function Yc(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Uw(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),Hw);return i(),a}function Hw(e,t,n){return">"+(n?"":" ")+e}function Ww(e,t){return Gc(e,t.inConstruct,!0)&&!Gc(e,t.notInConstruct,!1)}function Gc(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Qc(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
26
+ `&&Ww(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
27
+ `}function Vw(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>a&&(a=o):o=1,i=r+t.length,r=n.indexOf(t,i);return a}function qw(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Kw(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Yw(e,t,n,r){const i=Kw(n),o=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(qw(e,n)){const u=n.enter("codeIndented"),p=n.indentLines(o,Gw);return u(),p}const s=n.createTracker(r),l=i.repeat(Math.max(Vw(o,i)+1,3)),c=n.enter("codeFenced");let f=s.move(l);if(e.lang){const u=n.enter(`codeFencedLang${a}`);f+=s.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...s.current()})),u()}if(e.lang&&e.meta){const u=n.enter(`codeFencedMeta${a}`);f+=s.move(" "),f+=s.move(n.safe(e.meta,{before:f,after:`
28
28
  `,encode:["`"],...s.current()})),u()}return f+=s.move(`
29
29
  `),o&&(f+=s.move(o+`
30
- `)),f+=s.move(l),c(),f}function Yw(e,t,n){return(n?"":" ")+e}function Mo(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Gw(e,t,n,r){const i=Mo(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
31
- `,...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),a(),c}function Qw(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function qn(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Lr(e,t,n){const r=nn(e),i=nn(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Xc.peek=Jw;function Xc(e,t,n,r){const i=Qw(n),o=n.enter("emphasis"),a=n.createTracker(r),s=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),f=Lr(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(l=qn(c)+l.slice(1));const u=l.charCodeAt(l.length-1),p=Lr(r.after.charCodeAt(0),u,i);p.inside&&(l=l.slice(0,-1)+qn(u));const d=a.move(i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},s+l+d}function Jw(e,t,n){return n.options.emphasis||"*"}function Zw(e,t){let n=!1;return go(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,mo}),!!((!e.depth||e.depth<3)&&ro(e)&&(t.options.setext||n))}function Xw(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(Zw(e,n)){const f=n.enter("headingSetext"),u=n.enter("phrasing"),p=n.containerPhrasing(e,{...o.current(),before:`
30
+ `)),f+=s.move(l),c(),f}function Gw(e,t,n){return(n?"":" ")+e}function Mo(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Qw(e,t,n,r){const i=Mo(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
31
+ `,...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),a(),c}function Jw(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function qn(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Lr(e,t,n){const r=nn(e),i=nn(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Jc.peek=Zw;function Jc(e,t,n,r){const i=Jw(n),o=n.enter("emphasis"),a=n.createTracker(r),s=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),f=Lr(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(l=qn(c)+l.slice(1));const u=l.charCodeAt(l.length-1),p=Lr(r.after.charCodeAt(0),u,i);p.inside&&(l=l.slice(0,-1)+qn(u));const d=a.move(i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},s+l+d}function Zw(e,t,n){return n.options.emphasis||"*"}function Xw(e,t){let n=!1;return go(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,mo}),!!((!e.depth||e.depth<3)&&ro(e)&&(t.options.setext||n))}function ex(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(Xw(e,n)){const f=n.enter("headingSetext"),u=n.enter("phrasing"),p=n.containerPhrasing(e,{...o.current(),before:`
32
32
  `,after:`
33
33
  `});return u(),f(),p+`
34
34
  `+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
35
35
  `))+1))}const a="#".repeat(i),s=n.enter("headingAtx"),l=n.enter("phrasing");o.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
36
- `,...o.current()});return/^[\t ]/.test(c)&&(c=qn(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c}eu.peek=ex;function eu(e){return e.value||""}function ex(){return"<"}tu.peek=tx;function tu(e,t,n,r){const i=Mo(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),c+=l.move(")"),a(),c}function tx(){return"!"}nu.peek=nx;function nu(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=f,o(),i==="full"||!c||c!==u?l+=s.move(u+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function nx(){return"!"}ru.peek=rx;function ru(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const a=n.unsafe[o],s=n.compilePattern(a);let l;if(a.atBreak)for(;l=s.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function rx(){return"`"}function iu(e,t){const n=ro(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}ou.peek=ix;function ou(e,t,n,r){const i=Mo(n),o=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(iu(e,n)){const f=n.stack;n.stack=[],s=n.enter("autolink");let u=a.move("<");return u+=a.move(n.containerPhrasing(e,{before:u,after:">",...a.current()})),u+=a.move(">"),s(),n.stack=f,u}s=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=a.move(" "+i),c+=a.move(n.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),c+=a.move(")"),s(),c}function ix(e,t,n){return iu(e,n)?"<":"["}au.peek=ox;function au(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=f,o(),i==="full"||!c||c!==u?l+=s.move(u+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function ox(){return"["}function Po(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function ax(e){const t=Po(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function sx(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function su(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function lx(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?sx(n):Po(n);const s=e.ordered?a==="."?")":".":ax(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),su(n)===a&&f){let u=-1;for(;++u<e.children.length;){const p=e.children[u];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=o,i(),c}function cx(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function ux(e,t,n,r){const i=cx(n);let o=n.bulletCurrent||Po(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const s=n.createTracker(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),f);return l(),c;function f(u,p,d){return p?(d?"":" ".repeat(a))+u:(d?o:o+" ".repeat(a-o.length))+u}}function fx(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),i(),a}const dx=Mr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function px(e,t,n,r){return(e.children.some(function(a){return dx(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function hx(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}lu.peek=mx;function lu(e,t,n,r){const i=hx(n),o=n.enter("strong"),a=n.createTracker(r),s=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),f=Lr(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(l=qn(c)+l.slice(1));const u=l.charCodeAt(l.length-1),p=Lr(r.after.charCodeAt(0),u,i);p.inside&&(l=l.slice(0,-1)+qn(u));const d=a.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},s+l+d}function mx(e,t,n){return n.options.strong||"*"}function gx(e,t,n,r){return n.safe(e.value,r)}function yx(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function bx(e,t,n){const r=(su(n)+(n.options.ruleSpaces?" ":"")).repeat(yx(n));return n.options.ruleSpaces?r.slice(0,-1):r}const cu={blockquote:jw,break:Zc,code:Kw,definition:Gw,emphasis:Xc,hardBreak:Zc,heading:Xw,html:eu,image:tu,imageReference:nu,inlineCode:ru,link:ou,linkReference:au,list:lx,listItem:ux,paragraph:fx,root:px,strong:lu,text:gx,thematicBreak:bx};function vx(){return{enter:{table:wx,tableData:uu,tableHeader:uu,tableRow:kx},exit:{codeText:Sx,table:xx,tableData:No,tableHeader:No,tableRow:No}}}function wx(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function xx(e){this.exit(e),this.data.inTable=void 0}function kx(e){this.enter({type:"tableRow",children:[]},e)}function No(e){this.exit(e)}function uu(e){this.enter({type:"tableCell",children:[]},e)}function Sx(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Ex));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Ex(e,t){return t==="|"?t:e}function Cx(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
36
+ `,...o.current()});return/^[\t ]/.test(c)&&(c=qn(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c}Zc.peek=tx;function Zc(e){return e.value||""}function tx(){return"<"}Xc.peek=nx;function Xc(e,t,n,r){const i=Mo(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),c+=l.move(")"),a(),c}function nx(){return"!"}eu.peek=rx;function eu(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=f,o(),i==="full"||!c||c!==u?l+=s.move(u+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function rx(){return"!"}tu.peek=ix;function tu(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const a=n.unsafe[o],s=n.compilePattern(a);let l;if(a.atBreak)for(;l=s.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function ix(){return"`"}function nu(e,t){const n=ro(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}ru.peek=ox;function ru(e,t,n,r){const i=Mo(n),o=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(nu(e,n)){const f=n.stack;n.stack=[],s=n.enter("autolink");let u=a.move("<");return u+=a.move(n.containerPhrasing(e,{before:u,after:">",...a.current()})),u+=a.move(">"),s(),n.stack=f,u}s=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=a.move(" "+i),c+=a.move(n.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),c+=a.move(")"),s(),c}function ox(e,t,n){return nu(e,n)?"<":"["}iu.peek=ax;function iu(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=f,o(),i==="full"||!c||c!==u?l+=s.move(u+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function ax(){return"["}function Po(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function sx(e){const t=Po(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function lx(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ou(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function cx(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?lx(n):Po(n);const s=e.ordered?a==="."?")":".":sx(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),ou(n)===a&&f){let u=-1;for(;++u<e.children.length;){const p=e.children[u];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=o,i(),c}function ux(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function fx(e,t,n,r){const i=ux(n);let o=n.bulletCurrent||Po(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const s=n.createTracker(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),f);return l(),c;function f(u,p,d){return p?(d?"":" ".repeat(a))+u:(d?o:o+" ".repeat(a-o.length))+u}}function dx(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),i(),a}const px=Mr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function hx(e,t,n,r){return(e.children.some(function(a){return px(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function mx(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}au.peek=gx;function au(e,t,n,r){const i=mx(n),o=n.enter("strong"),a=n.createTracker(r),s=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),f=Lr(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(l=qn(c)+l.slice(1));const u=l.charCodeAt(l.length-1),p=Lr(r.after.charCodeAt(0),u,i);p.inside&&(l=l.slice(0,-1)+qn(u));const d=a.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},s+l+d}function gx(e,t,n){return n.options.strong||"*"}function yx(e,t,n,r){return n.safe(e.value,r)}function bx(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function vx(e,t,n){const r=(ou(n)+(n.options.ruleSpaces?" ":"")).repeat(bx(n));return n.options.ruleSpaces?r.slice(0,-1):r}const su={blockquote:Uw,break:Qc,code:Yw,definition:Qw,emphasis:Jc,hardBreak:Qc,heading:ex,html:Zc,image:Xc,imageReference:eu,inlineCode:tu,link:ru,linkReference:iu,list:cx,listItem:fx,paragraph:dx,root:hx,strong:au,text:yx,thematicBreak:vx};function wx(){return{enter:{table:xx,tableData:lu,tableHeader:lu,tableRow:Sx},exit:{codeText:Ex,table:kx,tableData:No,tableHeader:No,tableRow:No}}}function xx(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function kx(e){this.exit(e),this.data.inTable=void 0}function Sx(e){this.enter({type:"tableRow",children:[]},e)}function No(e){this.exit(e)}function lu(e){this.enter({type:"tableCell",children:[]},e)}function Ex(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Cx));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Cx(e,t){return t==="|"?t:e}function Ax(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
37
37
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:l,tableRow:s}};function a(d,m,h,g){return c(f(d,h,g),d.align)}function s(d,m,h,g){const y=u(d,h,g),b=c([y]);return b.slice(0,b.indexOf(`
38
- `))}function l(d,m,h,g){const y=h.enter("tableCell"),b=h.enter("phrasing"),w=h.containerPhrasing(d,{...g,before:o,after:o});return b(),y(),w}function c(d,m){return $w(d,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(d,m,h){const g=d.children;let y=-1;const b=[],w=m.enter("table");for(;++y<g.length;)b[y]=u(g[y],m,h);return w(),b}function u(d,m,h){const g=d.children;let y=-1;const b=[],w=m.enter("tableRow");for(;++y<g.length;)b[y]=l(g[y],d,m,h);return w(),b}function p(d,m,h){let g=cu.inlineCode(d,m,h);return h.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function Ax(){return{exit:{taskListCheckValueChecked:fu,taskListCheckValueUnchecked:fu,paragraph:Tx}}}function Ix(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Ox}}}function fu(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Tx(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,a;for(;++o<i.length;){const s=i[o];if(s.type==="paragraph"){a=s;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Ox(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(a);let l=cu.listItem(e,t,n,{...r,...s.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(f){return f+a}}function Dx(){return[lw(),Ow(),Nw(),vx(),Ax()]}function Mx(e){return{extensions:[cw(),Dw(e),_w(),Cx(e),Ix()]}}const Px={tokenize:Bx,partial:!0},du={tokenize:$x,partial:!0},pu={tokenize:zx,partial:!0},hu={tokenize:jx,partial:!0},Nx={tokenize:Ux,partial:!0},mu={name:"wwwAutolink",tokenize:Fx,previous:yu},gu={name:"protocolAutolink",tokenize:Rx,previous:bu},kt={name:"emailAutolink",tokenize:Lx,previous:vu},pt={};function _x(){return{text:pt}}let Vt=48;for(;Vt<123;)pt[Vt]=kt,Vt++,Vt===58?Vt=65:Vt===91&&(Vt=97);pt[43]=kt,pt[45]=kt,pt[46]=kt,pt[95]=kt,pt[72]=[kt,gu],pt[104]=[kt,gu],pt[87]=[kt,mu],pt[119]=[kt,mu];function Lx(e,t,n){const r=this;let i,o;return a;function a(u){return!_o(u)||!vu.call(r,r.previous)||Lo(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(u))}function s(u){return _o(u)?(e.consume(u),s):u===64?(e.consume(u),l):n(u)}function l(u){return u===46?e.check(Nx,f,c)(u):u===45||u===95||ze(u)?(o=!0,e.consume(u),l):f(u)}function c(u){return e.consume(u),i=!0,l}function f(u){return o&&i&&We(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(u)):n(u)}}function Fx(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!yu.call(r,r.previous)||Lo(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Px,e.attempt(du,e.attempt(pu,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function Rx(e,t,n){const r=this;let i="",o=!1;return a;function a(u){return(u===72||u===104)&&bu.call(r,r.previous)&&!Lo(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(u),e.consume(u),s):n(u)}function s(u){if(We(u)&&i.length<5)return i+=String.fromCodePoint(u),e.consume(u),s;if(u===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(u),l}return n(u)}function l(u){return u===47?(e.consume(u),o?c:(o=!0,l)):n(u)}function c(u){return u===null||kr(u)||Se(u)||Wt(u)||Sr(u)?n(u):e.attempt(du,e.attempt(pu,f),n)(u)}function f(u){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(u)}}function Bx(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function $x(e,t,n){let r,i,o;return a;function a(c){return c===46||c===95?e.check(hu,l,s)(c):c===null||Se(c)||Wt(c)||c!==45&&Sr(c)?l(c):(o=!0,e.consume(c),a)}function s(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),a}function l(c){return i||r||!o?n(c):t(c)}}function zx(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(hu,t,o)(a):a===null||Se(a)||Wt(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function jx(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),i):s===60||s===null||Se(s)||Wt(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||Se(s)||Wt(s)?t(s):r(s)}function o(s){return We(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):We(s)?(e.consume(s),a):n(s)}}function Ux(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return ze(o)?n(o):t(o)}}function yu(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Se(e)}function bu(e){return!We(e)}function vu(e){return!(e===47||_o(e))}function _o(e){return e===43||e===45||e===46||e===95||ze(e)}function Lo(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Hx={tokenize:Jx,partial:!0};function Wx(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Yx,continuation:{tokenize:Gx},exit:Qx}},text:{91:{name:"gfmFootnoteCall",tokenize:Kx},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Vx,resolveTo:qx}}}}function Vx(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!a||!a._balanced)return n(l);const c=at(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function qx(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function Kx(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return s;function s(u){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),l}function l(u){return u!==94?n(u):(e.enter("gfmFootnoteCallMarker"),e.consume(u),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(u){if(o>999||u===93&&!a||u===null||u===91||Se(u))return n(u);if(u===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(at(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(u)}return Se(u)||(a=!0),o++,e.consume(u),u===92?f:c}function f(u){return u===91||u===92||u===93?(e.consume(u),o++,c):c(u)}}function Yx(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,s;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(m)}function f(m){if(a>999||m===93&&!s||m===null||m===91||Se(m))return n(m);if(m===93){e.exit("chunkString");const h=e.exit("gfmFootnoteDefinitionLabelString");return o=at(r.sliceSerialize(h)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Se(m)||(s=!0),a++,e.consume(m),m===92?u:f}function u(m){return m===91||m===92||m===93?(e.consume(m),a++,f):f(m)}function p(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),ve(e,d,"gfmFootnoteDefinitionWhitespace")):n(m)}function d(m){return t(m)}}function Gx(e,t,n){return e.check(zn,t,e.attempt(Hx,t,n))}function Qx(e){e.exit("gfmFootnoteDefinition")}function Jx(e,t,n){const r=this;return ve(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function Zx(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,s){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let c=l;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[l][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[l][1].end)},u={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[l][1].start)},p=[["enter",f,s],["enter",a[c][1],s],["exit",a[c][1],s],["enter",u,s]],d=s.parser.constructs.insideSpan.null;d&&Ze(p,p.length,0,Er(d,a.slice(c+1,l),s)),Ze(p,p.length,0,[["exit",u,s],["enter",a[l][1],s],["exit",a[l][1],s],["exit",f,s]]),Ze(a,c-1,l-c+3,p),l=c+p.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function o(a,s,l){const c=this.previous,f=this.events;let u=0;return p;function p(m){return c===126&&f[f.length-1][1].type!=="characterEscape"?l(m):(a.enter("strikethroughSequenceTemporary"),d(m))}function d(m){const h=nn(c);if(m===126)return u>1?l(m):(a.consume(m),u++,d);if(u<2&&!n)return l(m);const g=a.exit("strikethroughSequenceTemporary"),y=nn(m);return g._open=!y||y===2&&!!h,g._close=!h||h===2&&!!y,s(m)}}}class Xx{constructor(){this.map=[]}add(t,n,r){e0(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function e0(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function t0(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function n0(){return{flow:{null:{name:"table",tokenize:r0,resolveAll:i0}}}}function r0(e,t,n){const r=this;let i=0,o=0,a;return s;function s(I){let D=r.events.length-1;for(;D>-1;){const R=r.events[D][1].type;if(R==="lineEnding"||R==="linePrefix")D--;else break}const F=D>-1?r.events[D][1].type:null,_=F==="tableHead"||F==="tableRow"?C:l;return _===C&&r.parser.lazy[r.now().line]?n(I):_(I)}function l(I){return e.enter("tableHead"),e.enter("tableRow"),c(I)}function c(I){return I===124||(a=!0,o+=1),f(I)}function f(I){return I===null?n(I):fe(I)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),d):n(I):ye(I)?ve(e,f,"whitespace")(I):(o+=1,a&&(a=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,f):(e.enter("data"),u(I)))}function u(I){return I===null||I===124||Se(I)?(e.exit("data"),f(I)):(e.consume(I),I===92?p:u)}function p(I){return I===92||I===124?(e.consume(I),u):u(I)}function d(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,ye(I)?ve(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?g(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),h):x(I)}function h(I){return ye(I)?ve(e,g,"whitespace")(I):g(I)}function g(I){return I===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):I===45?(o+=1,y(I)):I===null||fe(I)?E(I):x(I)}function y(I){return I===45?(e.enter("tableDelimiterFiller"),b(I)):x(I)}function b(I){return I===45?(e.consume(I),b):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(I))}function w(I){return ye(I)?ve(e,E,"whitespace")(I):E(I)}function E(I){return I===124?m(I):I===null||fe(I)?!a||i!==o?x(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):x(I)}function x(I){return n(I)}function C(I){return e.enter("tableRow"),T(I)}function T(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),T):I===null||fe(I)?(e.exit("tableRow"),t(I)):ye(I)?ve(e,T,"whitespace")(I):(e.enter("data"),N(I))}function N(I){return I===null||I===124||Se(I)?(e.exit("data"),T(I)):(e.consume(I),I===92?$:N)}function $(I){return I===92||I===124?(e.consume(I),N):N(I)}}function i0(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],a=[0,0,0,0],s=!1,l=0,c,f,u;const p=new Xx;for(;++n<e.length;){const d=e[n],m=d[1];d[0]==="enter"?m.type==="tableHead"?(s=!1,l!==0&&(wu(p,t,l,c,f),f=void 0,l=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,u=void 0,o=[0,0,0,0],a=[0,n+1,0,0],s&&(s=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",f,t]])),i=m.type==="tableDelimiterRow"?2:f?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(o[1]!==0&&(a[0]=a[1],u=Fr(p,t,o,i,void 0,u),o=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(a[0]=a[1],u=Fr(p,t,o,i,void 0,u)),o=a,a=[o[1],n,0,0])):m.type==="tableHead"?(s=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,o[1]!==0?(a[0]=a[1],u=Fr(p,t,o,i,n,u)):a[1]!==0&&(u=Fr(p,t,a,i,n,u)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&wu(p,t,l,c,f),p.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=t0(t.events,n))}return e}function Fr(e,t,n,r,i,o){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(o.end=Object.assign({},on(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=on(t.events,n[1]);if(o={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=on(t.events,n[2]),f=on(t.events,n[3]),u={type:s,start:Object.assign({},c),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",u,t]]),r!==2){const p=t.events[n[2]],d=t.events[n[3]];if(p[1].end=Object.assign({},d[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,h=n[3]-n[2]-1;e.add(m,h,[])}}e.add(n[3]+1,0,[["exit",u,t]])}return i!==void 0&&(o.end=Object.assign({},on(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function wu(e,t,n,r,i){const o=[],a=on(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function on(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const o0={name:"tasklistCheck",tokenize:s0};function a0(){return{text:{91:o0}}}function s0(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return Se(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(l)}function s(l){return fe(l)?t(l):ye(l)?e.check({tokenize:l0},t,n)(l):n(l)}}function l0(e,t,n){return ve(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function c0(e){return ql([_x(),Wx(),Zx(e),n0(),a0()])}const u0={};function f0(e){const t=this,n=e||u0,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(c0(n)),o.push(Dx()),a.push(Mx(n))}const ge={container:{className:"bpReset bpContainer bpFont",dropzone:{overlay:{className:"bpDropzoneOverlay"}}},loader:{className:"bpReset bpLoader"},modal:{overlay:{className:"bpModalOverlay"},dialog:{container:{className:"bpReset bpModalContainer"},title:{className:"bpModalTitle"},description:{className:"bpModalDescription"},content:{container:{className:"bpModalContentContainer"},textarea:{className:"bpModalContentTextArea"}},button:{container:{className:"bpModalButtonContainer"},confirm:{className:"bpModalButtonConfirm"},cancel:{className:"bpModalButtonCancel"}}}},messagePreview:{container:{className:"bpMessagePreviewContainer"},message:{className:"bpMessagePreviewMessage"},description:{className:"bpMessagePreviewDescription"},closeButton:{className:"bpMessagePreviewCloseButton"},avatar:{container:{className:"bpMessagePreviewAvatarContainer"},image:{className:"bpMessagePreviewAvatarImage"},fallback:{className:"bpMessagePreviewAvatarFallback"}}},fab:{container:{className:"bpReset bpFabContainer"},icon:{className:"bpFabIcon"},image:{className:"bpFabImage"}},notification:{container:{className:"bpReset bpNotificationContainer"},title:{className:"bpNotificationTitle"},description:{className:"bpNotificationDescription"},icon:{className:"bpNotificationIcon"},closeIcon:{className:"bpNotificationCloseIcon"}},header:{container:{className:"bpReset bpHeaderContainer bpFont"},content:{container:{className:"bpReset bpHeaderContentContainer"},title:{className:"bpHeaderContentTitle"},description:{className:"bpHeaderContentDescription"},avatar:{container:{className:"bpReset bpHeaderContentAvatarContainer"},image:{className:"bpHeaderContentAvatarImage"},fallback:{className:"bpHeaderContentAvatarFallback"}},toggleSound:{className:"bpHeaderSoundToggleButton"},actions:{container:{className:"bpReset bpHeaderContentActionsContainer"},icons:{className:"bpHeaderContentActionsIcons"}}},expandedContent:{container:{className:"bpReset bpHeaderExpandedContentContainer"},descriptionItems:{container:{className:"bpReset bpHeaderExpandedContentDescriptionItemsContainer"},icon:{className:"bpHeaderExpandedContentDescriptionItemsIcon"},text:{className:"bpHeaderExpandedContentDescriptionItemsText"},link:{className:"bpHeaderExpandedContentDescriptionItemsLink"}},group:{className:"bpHeaderExpandedContentGroup"}},newConversationIcon:{className:"bpHeaderNewConversationIcon"}},composer:{wrapper:{className:"bpReset bpComposerWrapper"},container:{className:"bpReset bpComposerContainer bpFont"},footer:{className:"bpComposerFooter"},inputContainer:{className:"bpComposerInputContainer"},input:{className:"bpComposerInput"},sendbutton:{className:"bpComposerSendButton"},uploadButton:{className:"bpComposerUploadButton"},voiceButton:{className:"bpComposerVoiceButton"},fileContainer:{className:"bpComposerFileContainer"},fileWidget:{container:{className:"bpComposerFileAttachement"},loader:{className:"bpComposerFileLoader"},fileIcon:{container:{className:"bpComposerFileIconWrapper"},icon:{className:"bpComposerFileIcon"}},metadata:{container:{className:"bpComposerFileMetadata"},name:{className:"bpComposerFileName"},type:{className:"bpComposerFileExtension"}},removeIcon:{className:"bpComposerFileRemoveIcon"},errorIcon:{className:"bpComposerFileErrorIcon"},previewImage:{className:"bpComposerFilePreviewImage"}}},messageList:{scrollDownButton:{className:"bpMessageListScrollDownButton"},container:{className:"bpReset bpMessageListContainer bpFont"},viewPort:{className:"bpMessageListViewport"},marquee:{container:{className:"bpReset bpMessageListMarqueeContainer"},content:{className:"bpMessageListMarqueeContent"},title:{className:"bpMessageListMarqueeTitle"},description:{className:"bpMessageListMarqueeDescription"},avatar:{container:{className:"bpReset bpMessageListMarqueeAvatarContainer"},image:{className:"bpMessageListMarqueeAvatarImage"},fallback:{className:"bpMessageListMarqueeAvatarFallback"}}},headerMessage:{className:"bpMessageListHeaderMessage"}},message:{container:{className:"bpReset bpMessageContainer"},avatar:{container:{className:"bpReset bpMessageAvatarContainer"},image:{className:"bpMessageAvatarImage"},fallback:{className:"bpMessageAvatarFallback"}},deliveryStatus:{className:"bpMessageDeliveryStatus"},blocks:{text:{heading1:{className:"bpMessageBlocksTextHeading1"},heading2:{className:"bpMessageBlocksTextHeading2"},heading3:{className:"bpMessageBlocksTextHeading3"},heading4:{className:"bpMessageBlocksTextHeading4"},unorderedList:{className:"bpMessageBlocksTextUnorderedList"},orderedList:{className:"bpMessageBlocksTextOrderedList"},listItem:{className:"bpMessageBlocksTextListItem"},link:{className:"bpMessageBlocksTextLink"},italic:{className:"bpMessageBlocksTextItalic"},bold:{className:"bpMessageBlocksTextBold"},text:{className:"bpMessageBlocksTextText"},image:{className:"bpMessageBlocksTextImage"},imageError:{className:"bpMessageBlocksTextImageError"},horizontalRule:{className:"bpMessageBlocksTextHorizontalRule"},lineBreak:{className:"bpMessageBlocksTextLineBreak"},input:{className:"bpMessageBlocksTextInput"},codeBlockContainer:{className:"bpMessageBlocksTextCodeBlockContainer"},codeBlockTitle:{className:"bpMessageBlocksTextCodeBlockTitle"},codeBlockCopyIcon:{className:"bpMessageBlocksTextCodeBlockCopyIcon"},codeBlock:{className:"bpMessageBlocksTextCodeBlock"},code:{className:"bpMessageBlocksTextCode"},tableContainer:{className:"bpMessageBlocksTextTableContainer"},table:{className:"bpMessageBlocksTextTable"},tableHeader:{className:"bpMessageBlocksTextTableHeader"},tableData:{className:"bpMessageBlocksTextTableData"},tableRow:{className:"bpMessageBlocksTextTableRow"}},audio:{className:"bpMessageBlocksAudio"},image:{image:{className:"bpMessageBlocksImageImage"},placeholder:{className:"bpMessageBlocksImagePlaceholder"},skeleton:{className:"bpSkeleton"}},video:{className:"bpMessageBlocksVideo"},location:{container:{className:"bpMessageBlocksLocationContainer"},title:{className:"bpMessageBlocksLocationTitle"},icon:{className:"bpMessageBlocksLocationIcon"}},file:{container:{className:"bpMessageBlocksFileContainer"},title:{className:"bpMessageBlocksFileTitle"},icon:{className:"bpMessageBlocksFileIcon"}},row:{className:"bpMessageBlocksRow"},column:{className:"bpMessageBlocksColumn"},bubble:{container:{className:"bpMessageBlocksBubble"},feedbackContainer:{className:"bpMessageBlocksBubbleFeedbackContainer"},feedbackIcon:{className:"bpMessageBlocksBubbleFeedbackIcon"}},carousel:{container:{className:"bpMessageBlocksCarouselContainer"},slidesContainer:{className:"bpMessageBlocksCarouselSlidesContainer"},backButton:{className:"bpMessageBlocksCarouselBackButton"},nextButton:{className:"bpMessageBlocksCarouselNextButton"}},dropdown:{button:{container:{className:"bpMessageBlocksDropdownButtonContainer"},text:{className:"bpMessageBlocksDropdownButtonText"},icon:{className:"bpMessageBlocksDropdownButtonIcon"}},content:{container:{className:"bpMessageBlocksDropdownContentContainer"},item:{className:"bpMessageBlocksDropdownContentItem"}}},button:{className:"bpMessageBlocksButton"}}},error:{container:{className:"bpReset bpErrorContainer"},id:{className:"bpErrorId"},header:{container:{className:"bpErrorHeader"},actions:{className:"bpErrorHeaderActions"}},content:{className:"bpErrorContent"},errorTitle:{className:"bpErrorTitle"},errorMessage:{className:"bpErrorMessage"},icon:{className:"bpErrorIcon"}},typingIndicator:{container:{className:"bpTypingIndicatorContainer"},loader:{className:"bpTypingIndicatorLoader"}},proactiveBubble:{container:{className:"bpProactiveBubbleContainer"},content:{className:"bpProactiveBubbleContent"},layout:{className:"bpProactiveBubbleLayout"},icon:{className:"bpProactiveBubbleIcon"},message:{className:"bpProactiveBubbleMessage"},closeButton:{className:"bpProactiveBubbleCloseButton"},arrow:{className:"bpProactiveBubbleArrow"}}};/**
38
+ `))}function l(d,m,h,g){const y=h.enter("tableCell"),b=h.enter("phrasing"),w=h.containerPhrasing(d,{...g,before:o,after:o});return b(),y(),w}function c(d,m){return zw(d,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(d,m,h){const g=d.children;let y=-1;const b=[],w=m.enter("table");for(;++y<g.length;)b[y]=u(g[y],m,h);return w(),b}function u(d,m,h){const g=d.children;let y=-1;const b=[],w=m.enter("tableRow");for(;++y<g.length;)b[y]=l(g[y],d,m,h);return w(),b}function p(d,m,h){let g=su.inlineCode(d,m,h);return h.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function Ix(){return{exit:{taskListCheckValueChecked:cu,taskListCheckValueUnchecked:cu,paragraph:Ox}}}function Tx(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Dx}}}function cu(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Ox(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,a;for(;++o<i.length;){const s=i[o];if(s.type==="paragraph"){a=s;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Dx(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(a);let l=su.listItem(e,t,n,{...r,...s.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(f){return f+a}}function Mx(){return[cw(),Dw(),_w(),wx(),Ix()]}function Px(e){return{extensions:[uw(),Mw(e),Lw(),Ax(e),Tx()]}}const Nx={tokenize:$x,partial:!0},uu={tokenize:zx,partial:!0},fu={tokenize:jx,partial:!0},du={tokenize:Ux,partial:!0},_x={tokenize:Hx,partial:!0},pu={name:"wwwAutolink",tokenize:Rx,previous:mu},hu={name:"protocolAutolink",tokenize:Bx,previous:gu},kt={name:"emailAutolink",tokenize:Fx,previous:yu},pt={};function Lx(){return{text:pt}}let Vt=48;for(;Vt<123;)pt[Vt]=kt,Vt++,Vt===58?Vt=65:Vt===91&&(Vt=97);pt[43]=kt,pt[45]=kt,pt[46]=kt,pt[95]=kt,pt[72]=[kt,hu],pt[104]=[kt,hu],pt[87]=[kt,pu],pt[119]=[kt,pu];function Fx(e,t,n){const r=this;let i,o;return a;function a(u){return!_o(u)||!yu.call(r,r.previous)||Lo(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(u))}function s(u){return _o(u)?(e.consume(u),s):u===64?(e.consume(u),l):n(u)}function l(u){return u===46?e.check(_x,f,c)(u):u===45||u===95||We(u)?(o=!0,e.consume(u),l):f(u)}function c(u){return e.consume(u),i=!0,l}function f(u){return o&&i&&qe(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(u)):n(u)}}function Rx(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!mu.call(r,r.previous)||Lo(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Nx,e.attempt(uu,e.attempt(fu,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function Bx(e,t,n){const r=this;let i="",o=!1;return a;function a(u){return(u===72||u===104)&&gu.call(r,r.previous)&&!Lo(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(u),e.consume(u),s):n(u)}function s(u){if(qe(u)&&i.length<5)return i+=String.fromCodePoint(u),e.consume(u),s;if(u===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(u),l}return n(u)}function l(u){return u===47?(e.consume(u),o?c:(o=!0,l)):n(u)}function c(u){return u===null||kr(u)||Ae(u)||Wt(u)||Sr(u)?n(u):e.attempt(uu,e.attempt(fu,f),n)(u)}function f(u){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(u)}}function $x(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function zx(e,t,n){let r,i,o;return a;function a(c){return c===46||c===95?e.check(du,l,s)(c):c===null||Ae(c)||Wt(c)||c!==45&&Sr(c)?l(c):(o=!0,e.consume(c),a)}function s(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),a}function l(c){return i||r||!o?n(c):t(c)}}function jx(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(du,t,o)(a):a===null||Ae(a)||Wt(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function Ux(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),i):s===60||s===null||Ae(s)||Wt(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||Ae(s)||Wt(s)?t(s):r(s)}function o(s){return qe(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):qe(s)?(e.consume(s),a):n(s)}}function Hx(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return We(o)?n(o):t(o)}}function mu(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ae(e)}function gu(e){return!qe(e)}function yu(e){return!(e===47||_o(e))}function _o(e){return e===43||e===45||e===46||e===95||We(e)}function Lo(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Wx={tokenize:Zx,partial:!0};function Vx(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Gx,continuation:{tokenize:Qx},exit:Jx}},text:{91:{name:"gfmFootnoteCall",tokenize:Yx},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:qx,resolveTo:Kx}}}}function qx(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!a||!a._balanced)return n(l);const c=st(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function Kx(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function Yx(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return s;function s(u){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),l}function l(u){return u!==94?n(u):(e.enter("gfmFootnoteCallMarker"),e.consume(u),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(u){if(o>999||u===93&&!a||u===null||u===91||Ae(u))return n(u);if(u===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(st(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(u)}return Ae(u)||(a=!0),o++,e.consume(u),u===92?f:c}function f(u){return u===91||u===92||u===93?(e.consume(u),o++,c):c(u)}}function Gx(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,s;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(m)}function f(m){if(a>999||m===93&&!s||m===null||m===91||Ae(m))return n(m);if(m===93){e.exit("chunkString");const h=e.exit("gfmFootnoteDefinitionLabelString");return o=st(r.sliceSerialize(h)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Ae(m)||(s=!0),a++,e.consume(m),m===92?u:f}function u(m){return m===91||m===92||m===93?(e.consume(m),a++,f):f(m)}function p(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),we(e,d,"gfmFootnoteDefinitionWhitespace")):n(m)}function d(m){return t(m)}}function Qx(e,t,n){return e.check(zn,t,e.attempt(Wx,t,n))}function Jx(e){e.exit("gfmFootnoteDefinition")}function Zx(e,t,n){const r=this;return we(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function Xx(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,s){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let c=l;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[l][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[l][1].end)},u={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[l][1].start)},p=[["enter",f,s],["enter",a[c][1],s],["exit",a[c][1],s],["enter",u,s]],d=s.parser.constructs.insideSpan.null;d&&et(p,p.length,0,Er(d,a.slice(c+1,l),s)),et(p,p.length,0,[["exit",u,s],["enter",a[l][1],s],["exit",a[l][1],s],["exit",f,s]]),et(a,c-1,l-c+3,p),l=c+p.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function o(a,s,l){const c=this.previous,f=this.events;let u=0;return p;function p(m){return c===126&&f[f.length-1][1].type!=="characterEscape"?l(m):(a.enter("strikethroughSequenceTemporary"),d(m))}function d(m){const h=nn(c);if(m===126)return u>1?l(m):(a.consume(m),u++,d);if(u<2&&!n)return l(m);const g=a.exit("strikethroughSequenceTemporary"),y=nn(m);return g._open=!y||y===2&&!!h,g._close=!h||h===2&&!!y,s(m)}}}class e0{constructor(){this.map=[]}add(t,n,r){t0(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function t0(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function n0(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function r0(){return{flow:{null:{name:"table",tokenize:i0,resolveAll:o0}}}}function i0(e,t,n){const r=this;let i=0,o=0,a;return s;function s(I){let D=r.events.length-1;for(;D>-1;){const L=r.events[D][1].type;if(L==="lineEnding"||L==="linePrefix")D--;else break}const z=D>-1?r.events[D][1].type:null,P=z==="tableHead"||z==="tableRow"?E:l;return P===E&&r.parser.lazy[r.now().line]?n(I):P(I)}function l(I){return e.enter("tableHead"),e.enter("tableRow"),c(I)}function c(I){return I===124||(a=!0,o+=1),f(I)}function f(I){return I===null?n(I):fe(I)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),d):n(I):be(I)?we(e,f,"whitespace")(I):(o+=1,a&&(a=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,f):(e.enter("data"),u(I)))}function u(I){return I===null||I===124||Ae(I)?(e.exit("data"),f(I)):(e.consume(I),I===92?p:u)}function p(I){return I===92||I===124?(e.consume(I),u):u(I)}function d(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,be(I)?we(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?g(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),h):x(I)}function h(I){return be(I)?we(e,g,"whitespace")(I):g(I)}function g(I){return I===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):I===45?(o+=1,y(I)):I===null||fe(I)?C(I):x(I)}function y(I){return I===45?(e.enter("tableDelimiterFiller"),b(I)):x(I)}function b(I){return I===45?(e.consume(I),b):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(I))}function w(I){return be(I)?we(e,C,"whitespace")(I):C(I)}function C(I){return I===124?m(I):I===null||fe(I)?!a||i!==o?x(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):x(I)}function x(I){return n(I)}function E(I){return e.enter("tableRow"),T(I)}function T(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),T):I===null||fe(I)?(e.exit("tableRow"),t(I)):be(I)?we(e,T,"whitespace")(I):(e.enter("data"),_(I))}function _(I){return I===null||I===124||Ae(I)?(e.exit("data"),T(I)):(e.consume(I),I===92?$:_)}function $(I){return I===92||I===124?(e.consume(I),_):_(I)}}function o0(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],a=[0,0,0,0],s=!1,l=0,c,f,u;const p=new e0;for(;++n<e.length;){const d=e[n],m=d[1];d[0]==="enter"?m.type==="tableHead"?(s=!1,l!==0&&(bu(p,t,l,c,f),f=void 0,l=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,u=void 0,o=[0,0,0,0],a=[0,n+1,0,0],s&&(s=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",f,t]])),i=m.type==="tableDelimiterRow"?2:f?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(o[1]!==0&&(a[0]=a[1],u=Fr(p,t,o,i,void 0,u),o=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(a[0]=a[1],u=Fr(p,t,o,i,void 0,u)),o=a,a=[o[1],n,0,0])):m.type==="tableHead"?(s=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,o[1]!==0?(a[0]=a[1],u=Fr(p,t,o,i,n,u)):a[1]!==0&&(u=Fr(p,t,a,i,n,u)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&bu(p,t,l,c,f),p.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=n0(t.events,n))}return e}function Fr(e,t,n,r,i,o){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(o.end=Object.assign({},on(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=on(t.events,n[1]);if(o={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=on(t.events,n[2]),f=on(t.events,n[3]),u={type:s,start:Object.assign({},c),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",u,t]]),r!==2){const p=t.events[n[2]],d=t.events[n[3]];if(p[1].end=Object.assign({},d[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,h=n[3]-n[2]-1;e.add(m,h,[])}}e.add(n[3]+1,0,[["exit",u,t]])}return i!==void 0&&(o.end=Object.assign({},on(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function bu(e,t,n,r,i){const o=[],a=on(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function on(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const a0={name:"tasklistCheck",tokenize:l0};function s0(){return{text:{91:a0}}}function l0(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return Ae(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(l)}function s(l){return fe(l)?t(l):be(l)?e.check({tokenize:c0},t,n)(l):n(l)}}function c0(e,t,n){return we(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function u0(e){return Wl([Lx(),Vx(),Xx(e),r0(),s0()])}const f0={};function d0(e){const t=this,n=e||f0,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(u0(n)),o.push(Mx()),a.push(Px(n))}const ge={container:{className:"bpReset bpContainer bpFont",dropzone:{overlay:{className:"bpDropzoneOverlay"}}},loader:{className:"bpReset bpLoader"},modal:{overlay:{className:"bpModalOverlay"},dialog:{container:{className:"bpReset bpModalContainer"},title:{className:"bpModalTitle"},description:{className:"bpModalDescription"},content:{container:{className:"bpModalContentContainer"},textarea:{className:"bpModalContentTextArea"}},button:{container:{className:"bpModalButtonContainer"},confirm:{className:"bpModalButtonConfirm"},cancel:{className:"bpModalButtonCancel"}}}},messagePreview:{container:{className:"bpMessagePreviewContainer"},message:{className:"bpMessagePreviewMessage"},description:{className:"bpMessagePreviewDescription"},closeButton:{className:"bpMessagePreviewCloseButton"},avatar:{container:{className:"bpMessagePreviewAvatarContainer"},image:{className:"bpMessagePreviewAvatarImage"},fallback:{className:"bpMessagePreviewAvatarFallback"}}},fab:{container:{className:"bpReset bpFabContainer"},icon:{className:"bpFabIcon"},image:{className:"bpFabImage"}},notification:{container:{className:"bpReset bpNotificationContainer"},title:{className:"bpNotificationTitle"},description:{className:"bpNotificationDescription"},icon:{className:"bpNotificationIcon"},closeIcon:{className:"bpNotificationCloseIcon"}},header:{container:{className:"bpReset bpHeaderContainer bpFont"},content:{container:{className:"bpReset bpHeaderContentContainer"},title:{className:"bpHeaderContentTitle"},description:{className:"bpHeaderContentDescription"},avatar:{container:{className:"bpReset bpHeaderContentAvatarContainer"},image:{className:"bpHeaderContentAvatarImage"},fallback:{className:"bpHeaderContentAvatarFallback"}},toggleSound:{className:"bpHeaderSoundToggleButton"},actions:{container:{className:"bpReset bpHeaderContentActionsContainer"},icons:{className:"bpHeaderContentActionsIcons"}}},expandedContent:{container:{className:"bpReset bpHeaderExpandedContentContainer"},descriptionItems:{container:{className:"bpReset bpHeaderExpandedContentDescriptionItemsContainer"},icon:{className:"bpHeaderExpandedContentDescriptionItemsIcon"},text:{className:"bpHeaderExpandedContentDescriptionItemsText"},link:{className:"bpHeaderExpandedContentDescriptionItemsLink"}},group:{className:"bpHeaderExpandedContentGroup"}},newConversationIcon:{className:"bpHeaderNewConversationIcon"}},composer:{wrapper:{className:"bpReset bpComposerWrapper"},container:{className:"bpReset bpComposerContainer bpFont"},footer:{className:"bpComposerFooter"},inputContainer:{className:"bpComposerInputContainer"},input:{className:"bpComposerInput"},inputLoader:{className:"bpComposerInputLoader"},sendbutton:{className:"bpComposerSendButton"},uploadButton:{className:"bpComposerUploadButton"},voiceButton:{className:"bpComposerVoiceButton"},fileContainer:{className:"bpComposerFileContainer"},fileWidget:{container:{className:"bpComposerFileAttachement"},loader:{className:"bpComposerFileLoader"},fileIcon:{container:{className:"bpComposerFileIconWrapper"},icon:{className:"bpComposerFileIcon"}},metadata:{container:{className:"bpComposerFileMetadata"},name:{className:"bpComposerFileName"},type:{className:"bpComposerFileExtension"}},removeIcon:{className:"bpComposerFileRemoveIcon"},errorIcon:{className:"bpComposerFileErrorIcon"},previewImage:{className:"bpComposerFilePreviewImage"}}},messageList:{scrollDownButton:{className:"bpMessageListScrollDownButton"},container:{className:"bpReset bpMessageListContainer bpFont"},viewPort:{className:"bpMessageListViewport"},marquee:{container:{className:"bpReset bpMessageListMarqueeContainer"},content:{className:"bpMessageListMarqueeContent"},title:{className:"bpMessageListMarqueeTitle"},description:{className:"bpMessageListMarqueeDescription"},avatar:{container:{className:"bpReset bpMessageListMarqueeAvatarContainer"},image:{className:"bpMessageListMarqueeAvatarImage"},fallback:{className:"bpMessageListMarqueeAvatarFallback"}}},headerMessage:{className:"bpMessageListHeaderMessage"}},message:{container:{className:"bpReset bpMessageContainer"},avatar:{container:{className:"bpReset bpMessageAvatarContainer"},image:{className:"bpMessageAvatarImage"},fallback:{className:"bpMessageAvatarFallback"}},deliveryStatus:{className:"bpMessageDeliveryStatus"},blocks:{text:{heading1:{className:"bpMessageBlocksTextHeading1"},heading2:{className:"bpMessageBlocksTextHeading2"},heading3:{className:"bpMessageBlocksTextHeading3"},heading4:{className:"bpMessageBlocksTextHeading4"},unorderedList:{className:"bpMessageBlocksTextUnorderedList"},orderedList:{className:"bpMessageBlocksTextOrderedList"},listItem:{className:"bpMessageBlocksTextListItem"},link:{className:"bpMessageBlocksTextLink"},italic:{className:"bpMessageBlocksTextItalic"},bold:{className:"bpMessageBlocksTextBold"},text:{className:"bpMessageBlocksTextText"},image:{className:"bpMessageBlocksTextImage"},imageError:{className:"bpMessageBlocksTextImageError"},horizontalRule:{className:"bpMessageBlocksTextHorizontalRule"},lineBreak:{className:"bpMessageBlocksTextLineBreak"},input:{className:"bpMessageBlocksTextInput"},codeBlockContainer:{className:"bpMessageBlocksTextCodeBlockContainer"},codeBlockTitle:{className:"bpMessageBlocksTextCodeBlockTitle"},codeBlockCopyIcon:{className:"bpMessageBlocksTextCodeBlockCopyIcon"},codeBlock:{className:"bpMessageBlocksTextCodeBlock"},code:{className:"bpMessageBlocksTextCode"},tableContainer:{className:"bpMessageBlocksTextTableContainer"},table:{className:"bpMessageBlocksTextTable"},tableHeader:{className:"bpMessageBlocksTextTableHeader"},tableData:{className:"bpMessageBlocksTextTableData"},tableRow:{className:"bpMessageBlocksTextTableRow"}},audio:{className:"bpMessageBlocksAudio"},image:{image:{className:"bpMessageBlocksImageImage"},placeholder:{className:"bpMessageBlocksImagePlaceholder"},skeleton:{className:"bpSkeleton"}},video:{className:"bpMessageBlocksVideo"},location:{container:{className:"bpMessageBlocksLocationContainer"},title:{className:"bpMessageBlocksLocationTitle"},icon:{className:"bpMessageBlocksLocationIcon"}},file:{container:{className:"bpMessageBlocksFileContainer"},title:{className:"bpMessageBlocksFileTitle"},icon:{className:"bpMessageBlocksFileIcon"}},row:{className:"bpMessageBlocksRow"},column:{className:"bpMessageBlocksColumn"},bubble:{container:{className:"bpMessageBlocksBubble"},feedbackContainer:{className:"bpMessageBlocksBubbleFeedbackContainer"},feedbackIcon:{className:"bpMessageBlocksBubbleFeedbackIcon"}},carousel:{container:{className:"bpMessageBlocksCarouselContainer"},slidesContainer:{className:"bpMessageBlocksCarouselSlidesContainer"},backButton:{className:"bpMessageBlocksCarouselBackButton"},nextButton:{className:"bpMessageBlocksCarouselNextButton"}},dropdown:{button:{container:{className:"bpMessageBlocksDropdownButtonContainer"},text:{className:"bpMessageBlocksDropdownButtonText"},icon:{className:"bpMessageBlocksDropdownButtonIcon"}},content:{container:{className:"bpMessageBlocksDropdownContentContainer"},item:{className:"bpMessageBlocksDropdownContentItem"}}},button:{className:"bpMessageBlocksButton"}}},error:{container:{className:"bpReset bpErrorContainer"},id:{className:"bpErrorId"},header:{container:{className:"bpErrorHeader"},actions:{className:"bpErrorHeaderActions"}},content:{className:"bpErrorContent"},errorTitle:{className:"bpErrorTitle"},errorMessage:{className:"bpErrorMessage"},icon:{className:"bpErrorIcon"}},typingIndicator:{container:{className:"bpTypingIndicatorContainer"},loader:{className:"bpTypingIndicatorLoader"}},proactiveBubble:{container:{className:"bpProactiveBubbleContainer"},content:{className:"bpProactiveBubbleContent"},layout:{className:"bpProactiveBubbleLayout"},icon:{className:"bpProactiveBubbleIcon"},message:{className:"bpProactiveBubbleMessage"},closeButton:{className:"bpProactiveBubbleCloseButton"},arrow:{className:"bpProactiveBubbleArrow"}}};/**
39
39
  * @license lucide-react v0.525.0 - ISC
40
40
  *
41
41
  * This source code is licensed under the ISC license.
42
42
  * See the LICENSE file in the root directory of this source tree.
43
- */const d0=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),p0=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),xu=e=>{const t=p0(e);return t.charAt(0).toUpperCase()+t.slice(1)},ku=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),h0=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
43
+ */const p0=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),h0=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),vu=e=>{const t=h0(e);return t.charAt(0).toUpperCase()+t.slice(1)},wu=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),m0=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
44
44
  * @license lucide-react v0.525.0 - ISC
45
45
  *
46
46
  * This source code is licensed under the ISC license.
47
47
  * See the LICENSE file in the root directory of this source tree.
48
- */var m0={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
48
+ */var g0={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
49
49
  * @license lucide-react v0.525.0 - ISC
50
50
  *
51
51
  * This source code is licensed under the ISC license.
52
52
  * See the LICENSE file in the root directory of this source tree.
53
- */const g0=O.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},l)=>O.createElement("svg",{ref:l,...m0,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ku("lucide",i),...!o&&!h0(s)&&{"aria-hidden":"true"},...s},[...a.map(([c,f])=>O.createElement(c,f)),...Array.isArray(o)?o:[o]]));/**
53
+ */const y0=O.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},l)=>O.createElement("svg",{ref:l,...g0,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:wu("lucide",i),...!o&&!m0(s)&&{"aria-hidden":"true"},...s},[...a.map(([c,f])=>O.createElement(c,f)),...Array.isArray(o)?o:[o]]));/**
54
54
  * @license lucide-react v0.525.0 - ISC
55
55
  *
56
56
  * This source code is licensed under the ISC license.
57
57
  * See the LICENSE file in the root directory of this source tree.
58
- */const we=(e,t)=>{const n=O.forwardRef(({className:r,...i},o)=>O.createElement(g0,{ref:o,iconNode:t,className:ku(`lucide-${d0(xu(e))}`,`lucide-${e}`,r),...i}));return n.displayName=xu(e),n};/**
58
+ */const xe=(e,t)=>{const n=O.forwardRef(({className:r,...i},o)=>O.createElement(y0,{ref:o,iconNode:t,className:wu(`lucide-${p0(vu(e))}`,`lucide-${e}`,r),...i}));return n.displayName=vu(e),n};/**
59
59
  * @license lucide-react v0.525.0 - ISC
60
60
  *
61
61
  * This source code is licensed under the ISC license.
62
62
  * See the LICENSE file in the root directory of this source tree.
63
- */const y0=we("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
63
+ */const b0=xe("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
64
64
  * @license lucide-react v0.525.0 - ISC
65
65
  *
66
66
  * This source code is licensed under the ISC license.
67
67
  * See the LICENSE file in the root directory of this source tree.
68
- */const Su=we("bot-off",[["path",{d:"M13.67 8H18a2 2 0 0 1 2 2v4.33",key:"7az073"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}],["path",{d:"M8 8H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 1.414-.586",key:"s09a7a"}],["path",{d:"M9 13v2",key:"rq6x2g"}],["path",{d:"M9.67 4H12v2.33",key:"110xot"}]]);/**
68
+ */const xu=xe("bot-off",[["path",{d:"M13.67 8H18a2 2 0 0 1 2 2v4.33",key:"7az073"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}],["path",{d:"M8 8H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 1.414-.586",key:"s09a7a"}],["path",{d:"M9 13v2",key:"rq6x2g"}],["path",{d:"M9.67 4H12v2.33",key:"110xot"}]]);/**
69
69
  * @license lucide-react v0.525.0 - ISC
70
70
  *
71
71
  * This source code is licensed under the ISC license.
72
72
  * See the LICENSE file in the root directory of this source tree.
73
- */const b0=we("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
73
+ */const v0=xe("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
74
74
  * @license lucide-react v0.525.0 - ISC
75
75
  *
76
76
  * This source code is licensed under the ISC license.
77
77
  * See the LICENSE file in the root directory of this source tree.
78
- */const v0=we("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
78
+ */const w0=xe("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
79
79
  * @license lucide-react v0.525.0 - ISC
80
80
  *
81
81
  * This source code is licensed under the ISC license.
82
82
  * See the LICENSE file in the root directory of this source tree.
83
- */const w0=we("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
83
+ */const x0=xe("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
84
84
  * @license lucide-react v0.525.0 - ISC
85
85
  *
86
86
  * This source code is licensed under the ISC license.
87
87
  * See the LICENSE file in the root directory of this source tree.
88
- */const x0=we("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
88
+ */const k0=xe("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
89
89
  * @license lucide-react v0.525.0 - ISC
90
90
  *
91
91
  * This source code is licensed under the ISC license.
92
92
  * See the LICENSE file in the root directory of this source tree.
93
- */const k0=we("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
93
+ */const S0=xe("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
94
94
  * @license lucide-react v0.525.0 - ISC
95
95
  *
96
96
  * This source code is licensed under the ISC license.
97
97
  * See the LICENSE file in the root directory of this source tree.
98
- */const Eu=we("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
98
+ */const ku=xe("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
99
99
  * @license lucide-react v0.525.0 - ISC
100
100
  *
101
101
  * This source code is licensed under the ISC license.
102
102
  * See the LICENSE file in the root directory of this source tree.
103
- */const S0=we("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/**
103
+ */const E0=xe("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/**
104
104
  * @license lucide-react v0.525.0 - ISC
105
105
  *
106
106
  * This source code is licensed under the ISC license.
107
107
  * See the LICENSE file in the root directory of this source tree.
108
- */const E0=we("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
108
+ */const C0=xe("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
109
109
  * @license lucide-react v0.525.0 - ISC
110
110
  *
111
111
  * This source code is licensed under the ISC license.
112
112
  * See the LICENSE file in the root directory of this source tree.
113
- */const C0=we("file-down",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
113
+ */const A0=xe("file-down",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
114
114
  * @license lucide-react v0.525.0 - ISC
115
115
  *
116
116
  * This source code is licensed under the ISC license.
117
117
  * See the LICENSE file in the root directory of this source tree.
118
- */const Cu=we("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
118
+ */const Su=xe("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
119
119
  * @license lucide-react v0.525.0 - ISC
120
120
  *
121
121
  * This source code is licensed under the ISC license.
122
122
  * See the LICENSE file in the root directory of this source tree.
123
- */const A0=we("files",[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]]);/**
123
+ */const I0=xe("files",[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]]);/**
124
124
  * @license lucide-react v0.525.0 - ISC
125
125
  *
126
126
  * This source code is licensed under the ISC license.
127
127
  * See the LICENSE file in the root directory of this source tree.
128
- */const I0=we("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
128
+ */const T0=xe("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
129
129
  * @license lucide-react v0.525.0 - ISC
130
130
  *
131
131
  * This source code is licensed under the ISC license.
132
132
  * See the LICENSE file in the root directory of this source tree.
133
- */const Au=we("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);/**
133
+ */const Eu=xe("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);/**
134
134
  * @license lucide-react v0.525.0 - ISC
135
135
  *
136
136
  * This source code is licensed under the ISC license.
137
137
  * See the LICENSE file in the root directory of this source tree.
138
- */const T0=we("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
138
+ */const O0=xe("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
139
139
  * @license lucide-react v0.525.0 - ISC
140
140
  *
141
141
  * This source code is licensed under the ISC license.
142
142
  * See the LICENSE file in the root directory of this source tree.
143
- */const O0=we("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
143
+ */const D0=xe("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
144
144
  * @license lucide-react v0.525.0 - ISC
145
145
  *
146
146
  * This source code is licensed under the ISC license.
147
147
  * See the LICENSE file in the root directory of this source tree.
148
- */const D0=we("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);/**
148
+ */const M0=xe("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
149
149
  * @license lucide-react v0.525.0 - ISC
150
150
  *
151
151
  * This source code is licensed under the ISC license.
152
152
  * See the LICENSE file in the root directory of this source tree.
153
- */const M0=we("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
153
+ */const P0=xe("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);/**
154
154
  * @license lucide-react v0.525.0 - ISC
155
155
  *
156
156
  * This source code is licensed under the ISC license.
157
157
  * See the LICENSE file in the root directory of this source tree.
158
- */const P0=we("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]);/**
158
+ */const N0=xe("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
159
159
  * @license lucide-react v0.525.0 - ISC
160
160
  *
161
161
  * This source code is licensed under the ISC license.
162
162
  * See the LICENSE file in the root directory of this source tree.
163
- */const N0=we("monitor-cog",[["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m14.305 7.53.923-.382",key:"1mlnsw"}],["path",{d:"m15.228 4.852-.923-.383",key:"82mpwg"}],["path",{d:"m16.852 3.228-.383-.924",key:"ln4sir"}],["path",{d:"m16.852 8.772-.383.923",key:"1dejw0"}],["path",{d:"m19.148 3.228.383-.924",key:"192kgf"}],["path",{d:"m19.53 9.696-.382-.924",key:"fiavlr"}],["path",{d:"m20.772 4.852.924-.383",key:"1j8mgp"}],["path",{d:"m20.772 7.148.924.383",key:"zix9be"}],["path",{d:"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7",key:"1tnzv8"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}]]);/**
163
+ */const _0=xe("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]);/**
164
164
  * @license lucide-react v0.525.0 - ISC
165
165
  *
166
166
  * This source code is licensed under the ISC license.
167
167
  * See the LICENSE file in the root directory of this source tree.
168
- */const _0=we("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);/**
168
+ */const L0=xe("monitor-cog",[["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m14.305 7.53.923-.382",key:"1mlnsw"}],["path",{d:"m15.228 4.852-.923-.383",key:"82mpwg"}],["path",{d:"m16.852 3.228-.383-.924",key:"ln4sir"}],["path",{d:"m16.852 8.772-.383.923",key:"1dejw0"}],["path",{d:"m19.148 3.228.383-.924",key:"192kgf"}],["path",{d:"m19.53 9.696-.382-.924",key:"fiavlr"}],["path",{d:"m20.772 4.852.924-.383",key:"1j8mgp"}],["path",{d:"m20.772 7.148.924.383",key:"zix9be"}],["path",{d:"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7",key:"1tnzv8"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}]]);/**
169
169
  * @license lucide-react v0.525.0 - ISC
170
170
  *
171
171
  * This source code is licensed under the ISC license.
172
172
  * See the LICENSE file in the root directory of this source tree.
173
- */const L0=we("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
173
+ */const F0=xe("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);/**
174
174
  * @license lucide-react v0.525.0 - ISC
175
175
  *
176
176
  * This source code is licensed under the ISC license.
177
177
  * See the LICENSE file in the root directory of this source tree.
178
- */const F0=we("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
178
+ */const R0=xe("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
179
179
  * @license lucide-react v0.525.0 - ISC
180
180
  *
181
181
  * This source code is licensed under the ISC license.
182
182
  * See the LICENSE file in the root directory of this source tree.
183
- */const R0=we("thumbs-down",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
183
+ */const B0=xe("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
184
184
  * @license lucide-react v0.525.0 - ISC
185
185
  *
186
186
  * This source code is licensed under the ISC license.
187
187
  * See the LICENSE file in the root directory of this source tree.
188
- */const B0=we("thumbs-up",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
188
+ */const $0=xe("thumbs-down",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
189
189
  * @license lucide-react v0.525.0 - ISC
190
190
  *
191
191
  * This source code is licensed under the ISC license.
192
192
  * See the LICENSE file in the root directory of this source tree.
193
- */const $0=we("unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);/**
193
+ */const z0=xe("thumbs-up",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
194
194
  * @license lucide-react v0.525.0 - ISC
195
195
  *
196
196
  * This source code is licensed under the ISC license.
197
197
  * See the LICENSE file in the root directory of this source tree.
198
- */const z0=we("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
198
+ */const j0=xe("unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);/**
199
199
  * @license lucide-react v0.525.0 - ISC
200
200
  *
201
201
  * This source code is licensed under the ISC license.
202
202
  * See the LICENSE file in the root directory of this source tree.
203
- */const Iu=we("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
203
+ */const U0=xe("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
204
204
  * @license lucide-react v0.525.0 - ISC
205
205
  *
206
206
  * This source code is licensed under the ISC license.
207
207
  * See the LICENSE file in the root directory of this source tree.
208
- */const j0=we("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
208
+ */const Cu=xe("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
209
209
  * @license lucide-react v0.525.0 - ISC
210
210
  *
211
211
  * This source code is licensed under the ISC license.
212
212
  * See the LICENSE file in the root directory of this source tree.
213
- */const U0=we("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
213
+ */const H0=xe("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
214
214
  * @license lucide-react v0.525.0 - ISC
215
215
  *
216
216
  * This source code is licensed under the ISC license.
217
217
  * See the LICENSE file in the root directory of this source tree.
218
- */const Tu=we("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),H0=({text:e})=>{const{message:{blocks:{text:t}}}=ge,[n,r]=O.useState(new Map);function i(a){if(n.has(a))return;const s=new Image;s.src=a,s.onerror=()=>{r(l=>new Map(l).set(a,!0))},s.onload=()=>{r(l=>new Map(l).set(a,!1))}}O.useEffect(()=>{const a=/!\[.*?\]\((.*?)\)/g,s=[];let l;for(;(l=a.exec(e))!==null;){const c=l[1];c&&!s.includes(c)&&s.push(c)}s.forEach(c=>{i(c)})},[e]);const o={h1:({node:a,...s})=>S.jsx("h1",{...s,...t.heading1}),h2:({node:a,...s})=>S.jsx("h2",{...s,...t.heading2}),h3:({node:a,...s})=>S.jsx("h3",{...s,...t.heading3}),h4:({node:a,...s})=>S.jsx("h4",{...s,...t.heading4}),h5:"h4",h6:"h4",em:({node:a,...s})=>S.jsx("em",{...s,...t.italic}),strong:({node:a,...s})=>S.jsx("strong",{...s,...t.bold}),p:({node:a,...s})=>S.jsx("p",{...s,...t.text}),hr:({node:a,...s})=>S.jsx("hr",{...s,...t.horizontalRule}),a:({node:a,href:s,children:l,...c})=>S.jsx("a",{...c,...t.link,onMouseUp:f=>{window.open(s,"_blank","noopener,noreferrer")},children:l}),img:({node:a,...s})=>{const l=s.src;return n.get(l)||!1?S.jsx("div",{"data-error":!0,...t.image,children:S.jsx(Au,{strokeWidth:"1"})}):S.jsx("img",{...s,...t.image})},ol:({node:a,...s})=>S.jsx("ol",{...s,...t.orderedList}),ul:({node:a,...s})=>S.jsx("ul",{...s,...t.unorderedList}),li:({node:a,...s})=>S.jsx("li",{...s,...t.listItem}),br:({node:a,...s})=>S.jsx("br",{...s,...t.lineBreak}),pre:({node:a,...s})=>{var m,h;const l=a==null?void 0:a.children[0],c=W0(((h=(m=l==null?void 0:l.properties)==null?void 0:m.className)==null?void 0:h[0])||""),[f,u]=O.useState(!1),p=O.useRef(null),d=()=>{if(!p.current)return;const g=p.current.textContent||"";navigator.clipboard.writeText(g).then(()=>{u(!0),setTimeout(()=>{u(!1)},1500)}).catch(y=>{console.error("Failed to copy code to clipboard:",y)})};return S.jsxs("div",{...t.codeBlockContainer,children:[S.jsxs("div",{...t.codeBlockTitle,children:[c?S.jsx("span",{children:c}):"Code",f?S.jsx(b0,{...t.codeBlockCopyIcon}):S.jsx(A0,{...t.codeBlockCopyIcon,onClick:d})]}),S.jsx("pre",{ref:p,...s,...t.codeBlock})]})},input:({node:a,...s})=>S.jsx("input",{...s,...t.input,disabled:!1}),code:({node:a,...s})=>S.jsx("code",{...s,...t.code}),table:({node:a,...s})=>S.jsx("div",{...t.tableContainer,children:S.jsx("table",{...s,...t.table})}),th:({node:a,...s})=>S.jsx("th",{...s,...t.tableHeader}),tr:({node:a,...s})=>S.jsx("tr",{...s,...t.tableRow}),td:({node:a,...s})=>S.jsx("td",{...s,...t.tableData})};return S.jsx(Uc,{urlTransform:a=>a.startsWith("tel:")?a:Hc(a),components:o,remarkPlugins:[f0,sw],children:e})},W0=e=>{if(!e)return"";const t=e.match(/language-(\w+)/);return t?t[1]:""},V0={},Ou=e=>{let t;const n=new Set,r=(l,c)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const u=t;t=c??typeof f!="object"?f:Object.assign({},t,f),n.forEach(p=>p(t,u))}},i=()=>t,s={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(V0?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,s),s},q0=e=>e?Ou(e):Ou;var Fo={exports:{}},Ro={},Rr={exports:{}},Bo={};/**
218
+ */const W0=xe("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
219
+ * @license lucide-react v0.525.0 - ISC
220
+ *
221
+ * This source code is licensed under the ISC license.
222
+ * See the LICENSE file in the root directory of this source tree.
223
+ */const Au=xe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),V0=({text:e})=>{const{message:{blocks:{text:t}}}=ge,[n,r]=O.useState(new Map);function i(a){if(n.has(a))return;const s=new Image;s.src=a,s.onerror=()=>{r(l=>new Map(l).set(a,!0))},s.onload=()=>{r(l=>new Map(l).set(a,!1))}}O.useEffect(()=>{const a=/!\[.*?\]\((.*?)\)/g,s=[];let l;for(;(l=a.exec(e))!==null;){const c=l[1];c&&!s.includes(c)&&s.push(c)}s.forEach(c=>{i(c)})},[e]);const o={h1:({node:a,...s})=>S.jsx("h1",{...s,...t.heading1}),h2:({node:a,...s})=>S.jsx("h2",{...s,...t.heading2}),h3:({node:a,...s})=>S.jsx("h3",{...s,...t.heading3}),h4:({node:a,...s})=>S.jsx("h4",{...s,...t.heading4}),h5:"h4",h6:"h4",em:({node:a,...s})=>S.jsx("em",{...s,...t.italic}),strong:({node:a,...s})=>S.jsx("strong",{...s,...t.bold}),p:({node:a,...s})=>S.jsx("p",{...s,...t.text}),hr:({node:a,...s})=>S.jsx("hr",{...s,...t.horizontalRule}),a:({node:a,href:s,children:l,...c})=>S.jsx("a",{...c,...t.link,onMouseUp:f=>{window.open(s,"_blank","noopener,noreferrer")},children:l}),img:({node:a,...s})=>{const l=s.src;return n.get(l)||!1?S.jsx("div",{"data-error":!0,...t.image,children:S.jsx(Eu,{strokeWidth:"1"})}):S.jsx("img",{...s,...t.image})},ol:({node:a,...s})=>S.jsx("ol",{...s,...t.orderedList}),ul:({node:a,...s})=>S.jsx("ul",{...s,...t.unorderedList}),li:({node:a,...s})=>S.jsx("li",{...s,...t.listItem}),br:({node:a,...s})=>S.jsx("br",{...s,...t.lineBreak}),pre:({node:a,...s})=>{var m,h;const l=a==null?void 0:a.children[0],c=q0(((h=(m=l==null?void 0:l.properties)==null?void 0:m.className)==null?void 0:h[0])||""),[f,u]=O.useState(!1),p=O.useRef(null),d=()=>{if(!p.current)return;const g=p.current.textContent||"";navigator.clipboard.writeText(g).then(()=>{u(!0),setTimeout(()=>{u(!1)},1500)}).catch(y=>{console.error("Failed to copy code to clipboard:",y)})};return S.jsxs("div",{...t.codeBlockContainer,children:[S.jsxs("div",{...t.codeBlockTitle,children:[c?S.jsx("span",{children:c}):"Code",f?S.jsx(v0,{...t.codeBlockCopyIcon}):S.jsx(I0,{...t.codeBlockCopyIcon,onClick:d})]}),S.jsx("pre",{ref:p,...s,...t.codeBlock})]})},input:({node:a,...s})=>S.jsx("input",{...s,...t.input,disabled:!1}),code:({node:a,...s})=>S.jsx("code",{...s,...t.code}),table:({node:a,...s})=>S.jsx("div",{...t.tableContainer,children:S.jsx("table",{...s,...t.table})}),th:({node:a,...s})=>S.jsx("th",{...s,...t.tableHeader}),tr:({node:a,...s})=>S.jsx("tr",{...s,...t.tableRow}),td:({node:a,...s})=>S.jsx("td",{...s,...t.tableData})};return S.jsx(zc,{urlTransform:a=>a.startsWith("tel:")?a:jc(a),components:o,remarkPlugins:[d0,lw],children:e})},q0=e=>{if(!e)return"";const t=e.match(/language-(\w+)/);return t?t[1]:""},K0={},Iu=e=>{let t;const n=new Set,r=(l,c)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const u=t;t=c??typeof f!="object"?f:Object.assign({},t,f),n.forEach(p=>p(t,u))}},i=()=>t,s={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(K0?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,s),s},Y0=e=>e?Iu(e):Iu;var Fo={exports:{}},Ro={},Rr={exports:{}},Bo={};/**
219
224
  * @license React
220
225
  * use-sync-external-store-shim.production.min.js
221
226
  *
@@ -223,7 +228,7 @@ Please start a new conversation.`,zi={ResourceNotFound:{type:"configuration",mes
223
228
  *
224
229
  * This source code is licensed under the MIT license found in the
225
230
  * LICENSE file in the root directory of this source tree.
226
- */var Du;function K0(){if(Du)return Bo;Du=1;var e=O;function t(u,p){return u===p&&(u!==0||1/u===1/p)||u!==u&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function s(u,p){var d=p(),m=r({inst:{value:d,getSnapshot:p}}),h=m[0].inst,g=m[1];return o(function(){h.value=d,h.getSnapshot=p,l(h)&&g({inst:h})},[u,d,p]),i(function(){return l(h)&&g({inst:h}),u(function(){l(h)&&g({inst:h})})},[u]),a(d),d}function l(u){var p=u.getSnapshot;u=u.value;try{var d=p();return!n(u,d)}catch{return!0}}function c(u,p){return p()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return Bo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Bo}var $o={};/**
231
+ */var Tu;function G0(){if(Tu)return Bo;Tu=1;var e=O;function t(u,p){return u===p&&(u!==0||1/u===1/p)||u!==u&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function s(u,p){var d=p(),m=r({inst:{value:d,getSnapshot:p}}),h=m[0].inst,g=m[1];return o(function(){h.value=d,h.getSnapshot=p,l(h)&&g({inst:h})},[u,d,p]),i(function(){return l(h)&&g({inst:h}),u(function(){l(h)&&g({inst:h})})},[u]),a(d),d}function l(u){var p=u.getSnapshot;u=u.value;try{var d=p();return!n(u,d)}catch{return!0}}function c(u,p){return p()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return Bo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Bo}var $o={};/**
227
232
  * @license React
228
233
  * use-sync-external-store-shim.development.js
229
234
  *
@@ -231,7 +236,7 @@ Please start a new conversation.`,zi={ResourceNotFound:{type:"configuration",mes
231
236
  *
232
237
  * This source code is licensed under the MIT license found in the
233
238
  * LICENSE file in the root directory of this source tree.
234
- */var Mu;function Y0(){return Mu||(Mu=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=O,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(w){{for(var E=arguments.length,x=new Array(E>1?E-1:0),C=1;C<E;C++)x[C-1]=arguments[C];r("error",w,x)}}function r(w,E,x){{var C=t.ReactDebugCurrentFrame,T=C.getStackAddendum();T!==""&&(E+="%s",x=x.concat([T]));var N=x.map(function($){return String($)});N.unshift("Warning: "+E),Function.prototype.apply.call(console[w],console,N)}}function i(w,E){return w===E&&(w!==0||1/w===1/E)||w!==w&&E!==E}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue,f=!1,u=!1;function p(w,E,x){f||e.startTransition!==void 0&&(f=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var C=E();if(!u){var T=E();o(C,T)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}var N=a({inst:{value:C,getSnapshot:E}}),$=N[0].inst,I=N[1];return l(function(){$.value=C,$.getSnapshot=E,d($)&&I({inst:$})},[w,C,E]),s(function(){d($)&&I({inst:$});var D=function(){d($)&&I({inst:$})};return w(D)},[w]),c(C),C}function d(w){var E=w.getSnapshot,x=w.value;try{var C=E();return!o(x,C)}catch{return!0}}function m(w,E,x){return E()}var h=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!h,y=g?m:p,b=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y;$o.useSyncExternalStore=b,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),$o}var Pu;function Nu(){return Pu||(Pu=1,process.env.NODE_ENV==="production"?Rr.exports=K0():Rr.exports=Y0()),Rr.exports}/**
239
+ */var Ou;function Q0(){return Ou||(Ou=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=O,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(w){{for(var C=arguments.length,x=new Array(C>1?C-1:0),E=1;E<C;E++)x[E-1]=arguments[E];r("error",w,x)}}function r(w,C,x){{var E=t.ReactDebugCurrentFrame,T=E.getStackAddendum();T!==""&&(C+="%s",x=x.concat([T]));var _=x.map(function($){return String($)});_.unshift("Warning: "+C),Function.prototype.apply.call(console[w],console,_)}}function i(w,C){return w===C&&(w!==0||1/w===1/C)||w!==w&&C!==C}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue,f=!1,u=!1;function p(w,C,x){f||e.startTransition!==void 0&&(f=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var E=C();if(!u){var T=C();o(E,T)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}var _=a({inst:{value:E,getSnapshot:C}}),$=_[0].inst,I=_[1];return l(function(){$.value=E,$.getSnapshot=C,d($)&&I({inst:$})},[w,E,C]),s(function(){d($)&&I({inst:$});var D=function(){d($)&&I({inst:$})};return w(D)},[w]),c(E),E}function d(w){var C=w.getSnapshot,x=w.value;try{var E=C();return!o(x,E)}catch{return!0}}function m(w,C,x){return C()}var h=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!h,y=g?m:p,b=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y;$o.useSyncExternalStore=b,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),$o}var Du;function Mu(){return Du||(Du=1,process.env.NODE_ENV==="production"?Rr.exports=G0():Rr.exports=Q0()),Rr.exports}/**
235
240
  * @license React
236
241
  * use-sync-external-store-shim/with-selector.production.min.js
237
242
  *
@@ -239,7 +244,7 @@ Please start a new conversation.`,zi={ResourceNotFound:{type:"configuration",mes
239
244
  *
240
245
  * This source code is licensed under the MIT license found in the
241
246
  * LICENSE file in the root directory of this source tree.
242
- */var _u;function G0(){if(_u)return Ro;_u=1;var e=O,t=Nu();function n(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;return Ro.useSyncExternalStoreWithSelector=function(c,f,u,p,d){var m=o(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=s(function(){function y(C){if(!b){if(b=!0,w=C,C=p(C),d!==void 0&&h.hasValue){var T=h.value;if(d(T,C))return E=T}return E=C}if(T=E,r(w,C))return T;var N=p(C);return d!==void 0&&d(T,N)?T:(w=C,E=N)}var b=!1,w,E,x=u===void 0?null:u;return[function(){return y(f())},x===null?void 0:function(){return y(x())}]},[f,u,p,d]);var g=i(c,m[0],m[1]);return a(function(){h.hasValue=!0,h.value=g},[g]),l(g),g},Ro}var zo={};/**
247
+ */var Pu;function J0(){if(Pu)return Ro;Pu=1;var e=O,t=Mu();function n(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;return Ro.useSyncExternalStoreWithSelector=function(c,f,u,p,d){var m=o(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=s(function(){function y(E){if(!b){if(b=!0,w=E,E=p(E),d!==void 0&&h.hasValue){var T=h.value;if(d(T,E))return C=T}return C=E}if(T=C,r(w,E))return T;var _=p(E);return d!==void 0&&d(T,_)?T:(w=E,C=_)}var b=!1,w,C,x=u===void 0?null:u;return[function(){return y(f())},x===null?void 0:function(){return y(x())}]},[f,u,p,d]);var g=i(c,m[0],m[1]);return a(function(){h.hasValue=!0,h.value=g},[g]),l(g),g},Ro}var zo={};/**
243
248
  * @license React
244
249
  * use-sync-external-store-shim/with-selector.development.js
245
250
  *
@@ -247,53 +252,54 @@ Please start a new conversation.`,zi={ResourceNotFound:{type:"configuration",mes
247
252
  *
248
253
  * This source code is licensed under the MIT license found in the
249
254
  * LICENSE file in the root directory of this source tree.
250
- */var Lu;function Q0(){return Lu||(Lu=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=O,t=Nu();function n(f,u){return f===u&&(f!==0||1/f===1/u)||f!==f&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;function c(f,u,p,d,m){var h=o(null),g;h.current===null?(g={hasValue:!1,value:null},h.current=g):g=h.current;var y=s(function(){var x=!1,C,T,N=function(F){if(!x){x=!0,C=F;var _=d(F);if(m!==void 0&&g.hasValue){var R=g.value;if(m(R,_))return T=R,R}return T=_,_}var P=C,L=T;if(r(P,F))return L;var U=d(F);return m!==void 0&&m(L,U)?L:(C=F,T=U,U)},$=p===void 0?null:p,I=function(){return N(u())},D=$===null?void 0:function(){return N($())};return[I,D]},[u,p,d,m]),b=y[0],w=y[1],E=i(f,b,w);return a(function(){g.hasValue=!0,g.value=E},[E]),l(E),E}zo.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),zo}process.env.NODE_ENV==="production"?Fo.exports=G0():Fo.exports=Q0();var J0=Fo.exports;const Z0=jt(J0),Fu={},{useSyncExternalStoreWithSelector:X0}=Z0;let Ru=!1;function e1(e,t=e.getState,n){(Fu?"production":void 0)!=="production"&&n&&!Ru&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Ru=!0);const r=X0(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return O.useDebugValue(r),r}const t1=e=>{(Fu?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?q0(e):e,n=(r,i)=>e1(t,r,i);return Object.assign(n,t),n},Ot=e=>t1,Br={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},jo=new Map,$r=e=>{const t=jo.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},n1=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=jo.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return jo.set(n.name,i),{type:"tracked",store:e,...i}},Kn=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:a,store:s,...l}=t;let c;try{c=(o??(Br?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return(Br?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,i);const{connection:f,...u}=n1(s,c,l);let p=!0;i.setState=(h,g,y)=>{const b=n(h,g);if(!p)return b;const w=y===void 0?{type:a||"anonymous"}:typeof y=="string"?{type:y}:y;return s===void 0?(f==null||f.send(w,r()),b):(f==null||f.send({...w,type:`${s}/${w.type}`},{...$r(l.name),[s]:i.getState()}),b)};const d=(...h)=>{const g=p;p=!1,n(...h),p=g},m=e(i.setState,r,i);if(u.type==="untracked"?f==null||f.init(m):(u.stores[u.store]=i,f==null||f.init(Object.fromEntries(Object.entries(u.stores).map(([h,g])=>[h,h===u.store?m:g.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let h=!1;const g=i.dispatch;i.dispatch=(...y)=>{(Br?"production":void 0)!=="production"&&y[0].type==="__setState"&&!h&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),h=!0),g(...y)}}return f.subscribe(h=>{var g;switch(h.type){case"ACTION":if(typeof h.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Uo(h.payload,y=>{if(y.type==="__setState"){if(s===void 0){d(y.state);return}Object.keys(y.state).length!==1&&console.error(`
255
+ */var Nu;function Z0(){return Nu||(Nu=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=O,t=Mu();function n(f,u){return f===u&&(f!==0||1/f===1/u)||f!==f&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;function c(f,u,p,d,m){var h=o(null),g;h.current===null?(g={hasValue:!1,value:null},h.current=g):g=h.current;var y=s(function(){var x=!1,E,T,_=function(z){if(!x){x=!0,E=z;var P=d(z);if(m!==void 0&&g.hasValue){var L=g.value;if(m(L,P))return T=L,L}return T=P,P}var M=E,R=T;if(r(M,z))return R;var U=d(z);return m!==void 0&&m(R,U)?R:(E=z,T=U,U)},$=p===void 0?null:p,I=function(){return _(u())},D=$===null?void 0:function(){return _($())};return[I,D]},[u,p,d,m]),b=y[0],w=y[1],C=i(f,b,w);return a(function(){g.hasValue=!0,g.value=C},[C]),l(C),C}zo.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),zo}process.env.NODE_ENV==="production"?Fo.exports=J0():Fo.exports=Z0();var X0=Fo.exports;const e1=jt(X0),_u={},{useSyncExternalStoreWithSelector:t1}=e1;let Lu=!1;function n1(e,t=e.getState,n){(_u?"production":void 0)!=="production"&&n&&!Lu&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Lu=!0);const r=t1(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return O.useDebugValue(r),r}const r1=e=>{(_u?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Y0(e):e,n=(r,i)=>n1(t,r,i);return Object.assign(n,t),n},Ot=e=>r1,Br={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},jo=new Map,$r=e=>{const t=jo.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},i1=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=jo.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return jo.set(n.name,i),{type:"tracked",store:e,...i}},Kn=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:a,store:s,...l}=t;let c;try{c=(o??(Br?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return(Br?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,i);const{connection:f,...u}=i1(s,c,l);let p=!0;i.setState=(h,g,y)=>{const b=n(h,g);if(!p)return b;const w=y===void 0?{type:a||"anonymous"}:typeof y=="string"?{type:y}:y;return s===void 0?(f==null||f.send(w,r()),b):(f==null||f.send({...w,type:`${s}/${w.type}`},{...$r(l.name),[s]:i.getState()}),b)};const d=(...h)=>{const g=p;p=!1,n(...h),p=g},m=e(i.setState,r,i);if(u.type==="untracked"?f==null||f.init(m):(u.stores[u.store]=i,f==null||f.init(Object.fromEntries(Object.entries(u.stores).map(([h,g])=>[h,h===u.store?m:g.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let h=!1;const g=i.dispatch;i.dispatch=(...y)=>{(Br?"production":void 0)!=="production"&&y[0].type==="__setState"&&!h&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),h=!0),g(...y)}}return f.subscribe(h=>{var g;switch(h.type){case"ACTION":if(typeof h.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Uo(h.payload,y=>{if(y.type==="__setState"){if(s===void 0){d(y.state);return}Object.keys(y.state).length!==1&&console.error(`
251
256
  [zustand devtools middleware] Unsupported __setState action format.
252
257
  When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
253
258
  and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
254
- `);const b=y.state[s];if(b==null)return;JSON.stringify(i.getState())!==JSON.stringify(b)&&d(b);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(y)});case"DISPATCH":switch(h.payload.type){case"RESET":return d(m),s===void 0?f==null?void 0:f.init(i.getState()):f==null?void 0:f.init($r(l.name));case"COMMIT":if(s===void 0){f==null||f.init(i.getState());return}return f==null?void 0:f.init($r(l.name));case"ROLLBACK":return Uo(h.state,y=>{if(s===void 0){d(y),f==null||f.init(i.getState());return}d(y[s]),f==null||f.init($r(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Uo(h.state,y=>{if(s===void 0){d(y);return}JSON.stringify(i.getState())!==JSON.stringify(y[s])&&d(y[s])});case"IMPORT_STATE":{const{nextLiftedState:y}=h.payload,b=(g=y.computedStates.slice(-1)[0])==null?void 0:g.state;if(!b)return;d(s===void 0?b:b[s]),f==null||f.send(null,y);return}case"PAUSE_RECORDING":return p=!p}return}}),m},Uo=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)};function Ho(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const a=l=>l===null?null:JSON.parse(l,void 0),s=(o=n.getItem(i))!=null?o:null;return s instanceof Promise?s.then(a):a(s)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Yn=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Yn(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Yn(r)(n)}}}},r1=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...t},a=!1;const s=new Set,l=new Set;let c;try{c=o.getStorage()}catch{}if(!c)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...g)},r,i);const f=Yn(o.serialize),u=()=>{const g=o.partialize({...r()});let y;const b=f({state:g,version:o.version}).then(w=>c.setItem(o.name,w)).catch(w=>{y=w});if(y)throw y;return b},p=i.setState;i.setState=(g,y)=>{p(g,y),u()};const d=e((...g)=>{n(...g),u()},r,i);let m;const h=()=>{var g;if(!c)return;a=!1,s.forEach(b=>b(r()));const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,r()))||void 0;return Yn(c.getItem.bind(c))(o.name).then(b=>{if(b)return o.deserialize(b)}).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==o.version){if(o.migrate)return o.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var w;return m=o.merge(b,(w=r())!=null?w:d),n(m,!0),u()}).then(()=>{y==null||y(m,void 0),a=!0,l.forEach(b=>b(m))}).catch(b=>{y==null||y(void 0,b)})};return i.persist={setOptions:g=>{o={...o,...g},g.getStorage&&(c=g.getStorage())},clearStorage:()=>{c==null||c.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>h(),hasHydrated:()=>a,onHydrate:g=>(s.add(g),()=>{s.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},h(),m||d},i1=(e,t)=>(n,r,i)=>{let o={storage:Ho(()=>localStorage),partialize:h=>h,version:0,merge:(h,g)=>({...g,...h}),...t},a=!1;const s=new Set,l=new Set;let c=o.storage;if(!c)return e((...h)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...h)},r,i);const f=()=>{const h=o.partialize({...r()});return c.setItem(o.name,{state:h,version:o.version})},u=i.setState;i.setState=(h,g)=>{u(h,g),f()};const p=e((...h)=>{n(...h),f()},r,i);let d;const m=()=>{var h,g;if(!c)return;a=!1,s.forEach(b=>{var w;return b((w=r())!=null?w:p)});const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,(h=r())!=null?h:p))||void 0;return Yn(c.getItem.bind(c))(o.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==o.version){if(o.migrate)return o.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var w;return d=o.merge(b,(w=r())!=null?w:p),n(d,!0),f()}).then(()=>{y==null||y(d,void 0),d=r(),a=!0,l.forEach(b=>b(d))}).catch(b=>{y==null||y(void 0,b)})};return i.persist={setOptions:h=>{o={...o,...h},h.storage&&(c=h.storage)},clearStorage:()=>{c==null||c.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>a,onHydrate:h=>(s.add(h),()=>{s.delete(h)}),onFinishHydration:h=>(l.add(h),()=>{l.delete(h)})},o.skipHydration||m(),d||p},zr=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((Br?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),r1(e,t)):i1(e,t),Bu=Ot()(Kn(zr(e=>({messageHistory:[],addMessageToHistory:t=>e(n=>({...n,messageHistory:[t,...(n.messageHistory??[]).slice(0,100)]}))}),{name:"botpress-message-history"})));let jr;const o1=new Uint8Array(16);function a1(){if(!jr&&(jr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!jr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return jr(o1)}const Fe=[];for(let e=0;e<256;++e)Fe.push((e+256).toString(16).slice(1));function s1(e,t=0){return Fe[e[t+0]]+Fe[e[t+1]]+Fe[e[t+2]]+Fe[e[t+3]]+"-"+Fe[e[t+4]]+Fe[e[t+5]]+"-"+Fe[e[t+6]]+Fe[e[t+7]]+"-"+Fe[e[t+8]]+Fe[e[t+9]]+"-"+Fe[e[t+10]]+Fe[e[t+11]]+Fe[e[t+12]]+Fe[e[t+13]]+Fe[e[t+14]]+Fe[e[t+15]]}const $u={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function l1(e,t,n){if($u.randomUUID&&!e)return $u.randomUUID();e=e||{};const r=e.random||(e.rng||a1)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,s1(r)}function Gn(e){var a;const{metadata:t,conversationId:n,userId:r}=e,{payload:i,disableInput:o}=zu(e.payload);return{id:e.id,conversationId:n,authorId:r,timestamp:new Date(e.createdAt),block:i,feedback:(a=e.feedback)==null?void 0:a.value,disableInput:o,metadata:t}}const zu=e=>{switch(e.type){case"audio":return ju(e);case"card":return c1(e);case"carousel":return u1(e);case"choice":return f1(e);case"dropdown":return d1(e);case"file":return Uu(e);case"image":return Hu(e);case"location":return Wu(e);case"markdown":return Vu(e);case"text":return qu(e);case"video":return Ku(e);case"bloc":return p1(e);case"custom":return{payload:e};default:{const t=e;throw new Error(`Unsuported message type ${t}`)}}},Qn=e=>({block:e,type:"bubble"}),ju=e=>({payload:{type:"audio",url:e.audioUrl}}),c1=e=>({payload:Qn(Yu(e))}),u1=e=>({payload:{type:"carousel",blocks:e.items.map(t=>Yu({...t}))}}),f1=e=>{const t=e.options.map(o=>({title:o.label,value:o.value})),n=e.text,r=l1(),i=Qn({type:"text",text:n});return t.length===0?{disableInput:e.disableFreeText,payload:i}:{disableInput:e.disableFreeText,payload:{type:"column",blocks:[i,{type:"row",blocks:t.map(({title:o,value:a})=>({type:"button",variant:"action",text:o,buttonValue:a,groupId:r}))}]}}},d1=e=>{const t=e.options.map(i=>({label:i.label,value:i.value})),n=e.text,r=[{type:"dropdown",label:n??"Select an option",options:t}];return n&&r.unshift({type:"text",text:n}),{disableInput:!0,payload:Qn({type:"column",blocks:r})}},Uu=e=>({payload:{type:"file",url:e.fileUrl,title:e.title}}),Hu=e=>({payload:{type:"image",url:e.imageUrl}}),Wu=e=>({payload:{type:"location",latitude:e.latitude,longitude:e.longitude,title:e.title??e.address??"View on map"}}),Vu=e=>({payload:Qn({type:"text",text:e.markdown})}),qu=e=>({payload:Qn({type:"text",text:e.text,value:e.value})}),Ku=e=>({payload:{type:"video",url:e.videoUrl}}),p1=e=>({payload:{type:"column",blocks:e.items.map(n=>{switch(n.type){case"audio":return ju({...n.payload,type:n.type}).payload;case"file":return Uu({...n.payload,type:n.type}).payload;case"image":return Hu({...n.payload,type:n.type}).payload;case"location":return Wu({...n.payload,type:n.type}).payload;case"markdown":return Vu({...n.payload,type:n.type}).payload;case"text":return qu({...n.payload,type:n.type}).payload;case"video":return Ku({...n.payload,type:n.type}).payload;default:throw new Error("Unsuported message type")}})}}),Yu=e=>{const t=e.title,n=e.subtitle,r=e.imageUrl,i=e.actions.map(a=>{switch(a.action){case"postback":return{type:"button",variant:"action",text:a.label,buttonValue:a.value,reusable:!0};case"url":return{type:"button",variant:"link",text:a.label,buttonValue:a.value,reusable:!0};case"say":return{type:"button",variant:"action",text:a.label,buttonValue:a.value,reusable:!0};default:throw new Error(`Unknown action type ${a.action}`)}}),o=[];return r&&o.push({type:"image",url:r}),t&&o.push({type:"text",text:`#### ${t}`}),n&&o.push({type:"text",text:n}),i.length>0&&o.push({type:"row",blocks:i}),{type:"column",horizontalAlignment:"center",blocks:[...o]}},an=Ot()(Kn(e=>({messages:[],isFetching:!1,setMessages:t=>e({messages:t}),saveMessage:t=>e(({messages:n})=>{var i;const r=(i=t.metadata)==null?void 0:i.clientMessageId;if(r){const o=n.findIndex(s=>{var l;return((l=s.metadata)==null?void 0:l.clientMessageId)===r}),a=n[o];if(o!==-1)return{messages:[...n.slice(0,o),{...a,...t},...n.slice(o+1)]}}return{messages:[...n.filter(o=>o.id!==t.id),t]}}),updateMessage:(t,n)=>e(({messages:r})=>({messages:r.map(i=>i.id===t?{...i,...n}:i)})),clearMessages:()=>e({messages:[]}),fetchMessages:async({client:t,conversationId:n})=>{const r=[];e({isFetching:!0});try{let i;do{const{messages:o,meta:a}=await t.listConversationMessages({conversationId:n,nextToken:i});r.push(...o),i=a.nextToken}while(i);return r.reverse().map(o=>Gn(o)).filter(Boolean)}finally{e({isFetching:!1})}}}),{name:"messagesStore"})),h1=(e,t)=>Ot()(Kn(zr(n=>({setUser:r=>n(i=>({...i,user:r})),setConversationId:r=>n(i=>({...i,conversationId:r})),clearConversationId:()=>n(r=>({...r,conversationId:void 0})),clearAll:()=>{n(r=>({...r,user:void 0,conversationId:void 0}))}}),{name:e,storage:Ho(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),Dn=class Dn{constructor(){}static getInstance(t="bp-webchat",n){return Dn._instances[t]||(Dn._instances[t]=h1(t,n)),Dn._instances[t]}};Li(Dn,"_instances",{});let Wo=Dn;const Gu=Wo.getInstance,sn=Ot()(Kn(e=>({eventEmitter:ll(),messageContainerRef:O.createRef(),setMessageContainerRef:t=>e({messageContainerRef:t}),portalContainer:null,setPortalContainer:t=>e({portalContainer:t})}),{name:"webchatStore"})),m1=8,g1=e=>Ot()(zr((t,n)=>({files:[],setFiles:r=>t({files:r}),upsertFile:r=>t(({files:i})=>({files:i.some(s=>s.name===r.name)?i.map(s=>s.name===r.name?{...s,...r}:s):[...i,{...r}]})),uploadFile:async(r,i)=>{const o=n().files.some(b=>b.name===r.name),a=n().files.length===m1;if(!o&&a)return;const s=new Date().toISOString(),l=crypto.randomUUID().slice(0,8),c=Ls(r.name),f=n().files.filter(b=>Ls(b.name)===c).length,u=r.name.lastIndexOf("."),p=u>0&&u<r.name.length-1,d=p?r.name.substring(0,u):r.name,m=p?r.name.substring(u):"",h=f>0?` (${f})`:"",g=`${s}_${l}_${d}${h}${m}`,y=new File([r],g,{type:r.type});n().upsertFile({name:g,type:"file",instance:y,status:"loading"});try{const{fileUrl:b,type:w}=await i(y);n().upsertFile({name:g,type:w,url:b,instance:y,status:"uploaded"})}catch{n().upsertFile({name:g,type:"file",instance:y,status:"error"})}},deleteFile:r=>t(({files:i})=>({files:i.filter(o=>o.name!=r)}))}),{name:e,storage:Ho(()=>sessionStorage)})),Mn=class Mn{constructor(){}static getInstance(t="bp-composer-file-store"){return Mn._instances[t]||(Mn._instances[t]=g1(t)),Mn._instances[t]}};Li(Mn,"_instances",{});let Vo=Mn;const Qu=Vo.getInstance,Jn=Ot()(e=>({participants:[],setParticipants:t=>e({participants:t}),addParticipant:t=>e(n=>({participants:[...n.participants,t]})),removeParticipant:t=>e(n=>({participants:n.participants.filter(r=>r.id!==t)})),clearParticipants:()=>e({participants:[]})})),y1=e=>Ot()(Kn(zr((t,n)=>({soundOn:!0,setSoundEnabled:r=>t({soundOn:r}),toggleSound:()=>t({soundOn:!n().soundOn})}),{name:e}))),Pn=class Pn{constructor(){}static getInstance(t="webchat:soundEnabled"){return Pn._instances[t]||(Pn._instances[t]=y1(t)),Pn._instances[t]}};Li(Pn,"_instances",{});let qo=Pn;const Ju=qo.getInstance,b1=({text:e,buttonValue:t,variant:n,groupId:r,reusable:i,sendMessage:o,isReadOnly:a,...s})=>{const l=sn(w=>w.eventEmitter),[c,f]=O.useState(!1),[u,p]=O.useState(!1),[d,m]=O.useState(!1),{message:{blocks:{button:h}}}=ge;O.useEffect(()=>{if(r)return l.on(`button-group-${r}-click`,()=>{p(!0),i||m(!0)})},[l,r,i]);const y={...s,onClick:w=>{if((d||a)&&n==="link"){w.preventDefault();return}f(!0),i||m(!0),r&&l.emit(`button-group-${r}-click`),n!=="link"&&o&&(o==null||o({type:"text",text:e,value:t}))},"data-activated":c?"":void 0,"data-group-activated":u?"":void 0,"data-type":n,...h},b=d||a;return n==="link"?S.jsx("a",{...y,style:a?{pointerEvents:"none"}:void 0,href:t,target:"_blank",rel:"noopener noreferrer",children:e}):S.jsx("button",{...y,style:a?{pointerEvents:"none"}:void 0,disabled:b,children:e})},Ko=O.createContext(null);function Zu(){const e=O.useContext(Ko);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const Yo=O.createContext({showInputModal:void 0});function Go(){return O.useContext(Yo)}const Xu=O.forwardRef(({block:e,direction:t,sender:n,timestamp:r,messageId:i,feedback:o,metadata:a,isReadOnly:s,sendMessage:l,addMessageFeedback:c,...f},u)=>{const{showInputModal:p}=Go(),{message:{blocks:{bubble:{container:d,feedbackContainer:m,feedbackIcon:h}}}}=ge;return t=="incoming"?S.jsxs("div",{"data-direction":"incoming","data-feedback":!!o,...f,...d,ref:u,children:[S.jsx(Kt,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:s,metadata:a,sendMessage:l}}),c&&p&&e.type==="text"&&S.jsxs("div",{...m,children:[S.jsx(B0,{...h,"data-selected":o==="positive",onClick:()=>c(i,{value:"positive"})}),S.jsx(R0,{...h,"data-selected":o==="negative",onClick:async()=>{const g=await p({title:"Help us improve",description:"Please provide feedback to help us improve.",confirmButtonText:"Send feedback",cancelButtonText:"Cancel",Content:v1});c(i,{value:"negative",comment:g})}})]})]}):S.jsx("div",{"data-direction":"outgoing",...f,...d,ref:u,children:S.jsx(Kt,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:s,metadata:a,sendMessage:l,addMessageFeedback:c}})})});Xu.displayName="Bubble";const v1=({setValue:e})=>{const{modal:{dialog:{content:t}}}=ge;return S.jsx("textarea",{...t.textarea,placeholder:"Let us know what went wrong...",onChange:n=>e(n.target.value)})},ef=({className:e,...t})=>S.jsx("div",{"data-slot":"skeleton",className:`bpSkeleton ${e||""}`,...t});ef.displayName="Skeleton";var it=function(){return it=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},it.apply(this,arguments)};function tf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ln(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(f){try{c(r.next(f))}catch(u){a(u)}}function l(f){try{c(r.throw(f))}catch(u){a(u)}}function c(f){f.done?o(f.value):i(f.value).then(s,l)}c((r=r.apply(e,t||[])).next())})}function cn(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(f){return l([c,f])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(f){c=[6,f],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function nf(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function Qo(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function w1(){var e=O.useRef(!1),t=O.useCallback(function(){return e.current},[]);return O.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function x1(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=O.useRef(0),i=w1(),o=O.useState(n),a=o[0],s=o[1],l=O.useCallback(function(){for(var c=[],f=0;f<arguments.length;f++)c[f]=arguments[f];var u=++r.current;return a.loading||s(function(p){return it(it({},p),{loading:!0})}),e.apply(void 0,c).then(function(p){return i()&&u===r.current&&s({value:p,loading:!1}),p},function(p){return i()&&u===r.current&&s({error:p,loading:!1}),p})},t);return[a,l]}function k1(e,t){t===void 0&&(t=[]);var n=x1(e,t,{loading:!0}),r=n[0],i=n[1];return O.useEffect(function(){i()},[i]),r}const rf=O.forwardRef(({url:e,type:t,orientation:n="auto",...r},i)=>{const o=O.useId(),{setIsLoading:a}=Zu(),[s,l]=O.useState(n==="auto"?"square":n),[c,f]=O.useState("initial"),{message:{blocks:{image:u}}}=ge;return O.useLayoutEffect(()=>(a(p=>[...p,o]),()=>{a(p=>p.filter(d=>d!==o))}),[o,a]),k1(async()=>{if(!e)return;const p=new Image;try{const{width:d,height:m}=await Zh(e);n==="auto"&&l(S1(d,m)),p.onload=()=>{f("loaded"),a(h=>h.filter(g=>g!==o))},p.onerror=()=>{f("error"),l("square"),a(h=>h.filter(g=>g!==o))},p.src=e,p.complete&&(p.naturalWidth>0?(f("loaded"),a(h=>h.filter(g=>g!==o))):(f("error"),l("square"),a(h=>h.filter(g=>g!==o))))}catch(d){console.error(d),f("error"),a(m=>m.filter(h=>h!==o))}return()=>{p.onload=null,p.onerror=null}},[e,o,a,n]),e?c==="error"?S.jsx("div",{"data-error":"true","data-orientation":s,...r,...u.image,ref:i,children:S.jsx(Au,{size:"25%",strokeWidth:"5%"})}):c==="initial"?S.jsx(ef,{"data-orientation":s,...u.placeholder}):S.jsx("img",{"data-orientation":s,"data-loaded":c==="loaded",...r,...u.image,src:e,alt:"",ref:i}):null});rf.displayName="Image";function S1(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((o,a)=>Math.abs(n[a]-r)<Math.abs(n[o]-r)?a:o)}const of=O.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{video:i}}}=ge;return S.jsx("div",{children:S.jsx("video",{...n,"data-chromatic":"ignore",style:t?{pointerEvents:"none"}:void 0,controls:!0,src:e,...i,ref:r})})});of.displayName="Video";const af=O.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{audio:i}}}=ge;return S.jsx("div",{children:S.jsx("audio",{...n,controls:!0,style:t?{pointerEvents:"none"}:void 0,src:e,...i,ref:r})})});af.displayName="Audio";const sf=O.forwardRef(({latitude:e,longitude:t,title:n,isReadOnly:r,...i},o)=>{const a=`https://www.google.com/maps/search/?api=1&query=${e},${t}`,{message:{blocks:{location:s}}}=ge;return S.jsxs("a",{...i,...s.container,style:r?{pointerEvents:"none"}:void 0,href:a,type:"_blank",rel:"noopener",ref:o,children:[S.jsx("p",{...s.title,children:n}),S.jsx(M0,{...s.icon})]})});sf.displayName="Location";const lf=O.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,messageId:a,isReadOnly:s,sendMessage:l,...c},f)=>{const{message:{blocks:{column:u}}}=ge;return S.jsx("div",{"data-horizontal":t,"data-vertical":n,...c,...u,ref:f,children:e.map((p,d)=>S.jsx(Kt,{block:{...p,direction:r,timestamp:o,sender:i,messageId:a,isReadOnly:s,sendMessage:l}},d))})});lf.displayName="Column";const cf=O.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,metadata:a,messageId:s,isReadOnly:l,sendMessage:c,...f},u)=>{const{message:{blocks:{row:p}}}=ge;return S.jsx("div",{"data-horizontal":t,"data-vertical":n,...f,...p,ref:u,children:e.map((d,m)=>S.jsx(Kt,{block:{...d,direction:r,timestamp:o,sender:i,messageId:s,isReadOnly:l,sendMessage:c}},m))})});cf.displayName="Row";function E1(e){return Object.prototype.toString.call(e)==="[object Object]"}function uf(e){return E1(e)||Array.isArray(e)}function C1(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Jo(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const i=JSON.stringify(Object.keys(e.breakpoints||{})),o=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==o?!1:n.every(a=>{const s=e[a],l=t[a];return typeof s=="function"?`${s}`==`${l}`:!uf(s)||!uf(l)?s===l:Jo(s,l)})}function ff(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function A1(e,t){if(e.length!==t.length)return!1;const n=ff(e),r=ff(t);return n.every((i,o)=>{const a=r[o];return Jo(i,a)})}function Zo(e){return typeof e=="number"}function df(e){return typeof e=="string"}function Xo(e){return typeof e=="boolean"}function pf(e){return Object.prototype.toString.call(e)==="[object Object]"}function Me(e){return Math.abs(e)}function ea(e){return Math.sign(e)}function Ur(e,t){return Me(e-t)}function I1(e,t){if(e===0||t===0||Me(e)<=Me(t))return 0;const n=Ur(Me(e),Me(t));return Me(n/e)}function Zn(e){return Wr(e).map(Number)}function St(e){return e[Hr(e)]}function Hr(e){return Math.max(0,e.length-1)}function Wr(e){return Object.keys(e)}function hf(e,t){return[e,t].reduce((n,r)=>(Wr(r).forEach(i=>{const o=n[i],a=r[i],s=pf(o)&&pf(a);n[i]=s?hf(o,a):a}),n),{})}function mf(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function T1(e,t){const n={start:r,center:i,end:o};function r(){return 0}function i(c){return o(c)/2}function o(c){return t-c}function a(){return t*Number(e)}function s(c){return Zo(e)?a():n[e](c)}return{measure:s}}function O1(e,t){const n=e==="y"?"y":"x",r=e==="y"?"x":"y",i=s(),o=l();function a(f){const{width:u,height:p}=f;return n==="x"?u:p}function s(){return n==="y"?"top":t==="rtl"?"right":"left"}function l(){return n==="y"?"bottom":t==="rtl"?"left":"right"}return{scroll:n,cross:r,startEdge:i,endEdge:o,measureSize:a}}function Dt(e,t){const n=Me(e-t);function r(c){return c<e}function i(c){return c>t}function o(c){return r(c)||i(c)}function a(c){return o(c)?r(c)?e:t:c}function s(c){return n?c-n*Math.ceil((c-t)/n):c}return{length:n,max:t,min:e,constrain:a,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:s}}function gf(e,t,n){const{constrain:r}=Dt(0,e),i=e+1;let o=a(t);function a(p){return n?Me((i+p)%i):r(p)}function s(){return o}function l(p){return o=a(p),u}function c(p){return f().set(s()+p)}function f(){return gf(e,s(),n)}const u={get:s,set:l,add:c,clone:f};return u}function D1(e){const t=e==="rtl"?-1:1;function n(i){return i*t}return{apply:n}}function Xn(){let e=[];function t(i,o,a,s={passive:!0}){return i.addEventListener(o,a,s),e.push(()=>i.removeEventListener(o,a,s)),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function M1(e,t,n,r,i,o,a,s,l,c,f,u,p,d,m,h,g,y,b){const{cross:w}=e,E=["INPUT","SELECT","TEXTAREA"],x={passive:!1},C=Xn(),T=Xn(),N=Dt(50,225).constrain(m.measure(20)),$={mouse:300,touch:400},I={mouse:500,touch:600},D=h?43:25;let F=!1,_=0,R=0,P=!1,L=!1,U=!1,z=!1;function q(Q,j){if(!j)return;function ne(K){(Xo(j)||j(Q,K))&&te(K)}const se=n;C.add(se,"dragstart",K=>K.preventDefault(),x).add(se,"touchmove",()=>{},x).add(se,"touchend",()=>{}).add(se,"touchstart",ne).add(se,"mousedown",ne).add(se,"touchcancel",X).add(se,"contextmenu",X).add(se,"click",oe,!0)}function v(){C.clear(),T.clear()}function M(){const Q=z?r:n;T.add(Q,"touchmove",Y,x).add(Q,"touchend",X).add(Q,"mousemove",Y,x).add(Q,"mouseup",X)}function H(Q){const j=Q.nodeName||"";return E.includes(j)}function k(){return(h?I:$)[z?"mouse":"touch"]}function W(Q,j){const ne=p.add(ea(Q)*-1),se=u.byDistance(Q,!h).distance;return h||Me(Q)<N?se:y&&j?se*.5:u.byIndex(ne.get(),0).distance}function te(Q){const j=mf(Q,i);z=j,!(j&&Q.button!==0)&&(H(Q.target)||(U=h&&j&&!Q.buttons&&F,F=Ur(o.get(),s.get())>=2,P=!0,a.pointerDown(Q),f.useFriction(0).useDuration(0),o.set(s),M(),_=a.readPoint(Q),R=a.readPoint(Q,w),d.emit("pointerDown")))}function Y(Q){const j=a.readPoint(Q),ne=a.readPoint(Q,w),se=Ur(j,_),K=Ur(ne,R);if(!L&&!z&&(!Q.cancelable||(L=se>K,!L)))return X(Q);const G=a.pointerMove(Q);se>g&&(U=!0),f.useFriction(.3).useDuration(1),l.start(),o.add(t.apply(G)),Q.preventDefault()}function X(Q){const ne=u.byDistance(0,!1).index!==p.get(),se=a.pointerUp(Q)*k(),K=W(t.apply(se),ne),G=I1(se,K),ue=D-10*G,pe=b+G/50;L=!1,P=!1,T.clear(),f.useDuration(ue).useFriction(pe),c.distance(K,!h),z=!1,d.emit("pointerUp")}function oe(Q){U&&(Q.stopPropagation(),Q.preventDefault())}function ae(){return P}return{init:q,pointerDown:ae,destroy:v}}function P1(e,t){let r,i;function o(u){return u.timeStamp}function a(u,p){const m=`client${(p||e.scroll)==="x"?"X":"Y"}`;return(mf(u,t)?u:u.touches[0])[m]}function s(u){return r=u,i=u,a(u)}function l(u){const p=a(u)-a(i),d=o(u)-o(r)>170;return i=u,d&&(r=u),p}function c(u){if(!r||!i)return 0;const p=a(i)-a(r),d=o(u)-o(r),m=o(u)-o(i)>170,h=p/d;return d&&!m&&Me(h)>.1?h:0}return{pointerDown:s,pointerMove:l,pointerUp:c,readPoint:a}}function N1(e){function t(r){return e*(r/100)}return{measure:t}}function _1(e,t,n,r,i){let o,a,s=[],l=!1;function c(d){return i.measureSize(d.getBoundingClientRect())}function f(d,m){if(!m)return;a=c(e),s=r.map(c);function h(y){for(const b of y){const w=b.target===e,E=r.indexOf(b.target),x=w?a:s[E],C=c(w?e:r[E]);if(x!==C){n.requestAnimationFrame(()=>{d.reInit(),t.emit("resize")});break}}}o=new ResizeObserver(y=>{l||(Xo(m)||m(d,y))&&h(y)}),[e].concat(r).forEach(y=>o.observe(y))}function u(){o&&o.disconnect(),l=!0}return{init:f,destroy:u}}function L1(e,t,n,r){let i=!0,o=0,a=0,s=n,l=r,c=e.get(),f=0;function u(){const x=t.get()-e.get(),C=!s;let T=0;return C?(o=0,e.set(t),T=x):(o+=x/s,o*=l,c+=o,e.add(o),T=c-f),a=ea(T),f=c,i=Me(x)<.001,E}function p(){return i}function d(){return s}function m(){return a}function h(){return o}function g(){return b(n)}function y(){return w(r)}function b(x){return s=x,E}function w(x){return l=x,E}const E={direction:m,duration:d,velocity:h,seek:u,settled:p,useBaseFriction:y,useBaseDuration:g,useFriction:w,useDuration:b};return E}function F1(e,t,n,r,i){const o=i.measure(10),a=i.measure(50),s=Dt(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function f(d){if(!c())return;const m=e.reachedMin(t.get())?"min":"max",h=Me(e[m]-t.get()),g=n.get()-t.get(),y=s.constrain(h/a);n.subtract(g*y),!d&&Me(g)<o&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function u(d){l=!d}return{constrain:f,toggleActive:u}}function R1(e,t,n,r){const i=Dt(-t+e,n[0]),o=l(),a=c();function s(){const u=o[0],p=St(o),d=o.lastIndexOf(u),m=o.indexOf(p)+1;return Dt(d,m)}function l(){return n.map(i.constrain).map(u=>parseFloat(u.toFixed(3)))}function c(){if(t<=e)return[i.max];if(r==="keepSnaps")return o;const{min:u,max:p}=s();return o.slice(u,p)}return{snapsContained:a}}function B1(e,t,n){const r=t[0],i=n?r-e:St(t);return{limit:Dt(i,r)}}function $1(e,t,n,r){const o=t.min+.1,a=t.max+.1,{reachedMin:s,reachedMax:l}=Dt(o,a);function c(p){return p===1?l(n.get()):p===-1?s(n.get()):!1}function f(p){if(!c(p))return;const d=e*(p*-1);r.forEach(m=>m.add(d))}return{loop:f}}function z1(e){const{max:t,length:n}=e;function r(o){return(o-t)/-n}return{get:r}}function j1(e,t,n,r,i,o,a){const{startEdge:s,endEdge:l}=e,{groupSlides:c}=o,f=d().map(t.measure),u=m(),p=h();function d(){return c(r).map(y=>St(y)[l]-y[0][s]).map(Me)}function m(){return r.map(y=>n[s]-y[s]).map(y=>-Me(y))}function h(){const b=St(u)-St(i);return c(u).map(w=>w[0]).map((w,E,x)=>{const C=!E,T=E===Hr(x);return a&&C?0:a&&T?b:w+f[E]})}return{snaps:u,snapsAligned:p}}function U1(e,t,n,r,i){const{reachedAny:o,removeOffset:a,constrain:s}=r;function l(m){return m.concat().sort((h,g)=>Me(h)-Me(g))[0]}function c(m){const h=e?a(m):s(m),g=t.map(b=>b-h).map(b=>f(b,0)).map((b,w)=>({diff:b,index:w})).sort((b,w)=>Me(b.diff)-Me(w.diff)),{index:y}=g[0];return{index:y,distance:h}}function f(m,h){const g=[m,m+n,m-n];if(!e)return g[0];if(!h)return l(g);const y=g.filter(b=>ea(b)===h);return l(y)}function u(m,h){const g=t[m]-i.get(),y=f(g,h);return{index:m,distance:y}}function p(m,h){const g=i.get()+m,{index:y,distance:b}=c(g),w=!e&&o(g);if(!h||w)return{index:y,distance:m};const E=t[y]-b,x=m+f(E,0);return{index:y,distance:x}}return{byDistance:p,byIndex:u,shortcut:f}}function H1(e,t,n,r,i,o,a){function s(u){const p=u.distance,d=u.index!==t.get();o.add(p),p&&(i.duration()?e.start():(e.update(),e.render(1),e.update())),d&&(n.set(t.get()),t.set(u.index),a.emit("select"))}function l(u,p){const d=r.byDistance(u,p);s(d)}function c(u,p){const d=t.clone().set(u),m=r.byIndex(d.get(),p);s(m)}return{distance:l,index:c}}function Vr(e){let t=e;function n(){return t}function r(l){t=a(l)}function i(l){t+=a(l)}function o(l){t-=a(l)}function a(l){return Zo(l)?l:l.get()}return{get:n,set:r,add:i,subtract:o}}function yf(e,t,n){const r=e.scroll==="x"?a:s,i=n.style;let o=!1;function a(p){return`translate3d(${p}px,0px,0px)`}function s(p){return`translate3d(0px,${p}px,0px)`}function l(p){o||(i.transform=r(t.apply(p)))}function c(p){o=!p}function f(){o||(i.transform="",n.getAttribute("style")||n.removeAttribute("style"))}return{clear:f,to:l,toggleActive:c}}function W1(e,t,n,r,i,o,a,s,l){const c=Zn(i),f=Zn(i).reverse(),u=h().concat(g());function p(x,C){return x.reduce((T,N)=>T-i[N],C)}function d(x,C){return x.reduce((T,N)=>p(T,C)>0?T.concat([N]):T,[])}function m(x,C){const T=C==="start",N=T?-r:r,$=a.findSlideBounds([N]);return x.map(I=>{const D=T?0:-r,F=T?r:0,R=$.filter(P=>P.index===I)[0][T?"end":"start"];return{index:I,slideLocation:Vr(-1),translate:yf(e,t,l[I]),target:()=>s.get()>R?D:F}})}function h(){const x=o[0]-1,C=d(f,x);return m(C,"end")}function g(){const x=n-o[0]-1,C=d(c,x);return m(C,"start")}function y(){return u.every(({index:x})=>{const C=c.filter(T=>T!==x);return p(C,n)<=.1})}function b(){u.forEach(x=>{const{target:C,translate:T,slideLocation:N}=x,$=C();$!==N.get()&&(T.to($),N.set($))})}function w(){u.forEach(x=>x.translate.clear())}return{canLoop:y,clear:w,loop:b,loopPoints:u}}function V1(e,t){let n,r=!1;function i(s,l){if(!l)return;function c(f){for(const u of f)if(u.type==="childList"){s.reInit(),t.emit("slidesChanged");break}}n=new MutationObserver(f=>{r||(Xo(l)||l(s,f))&&c(f)}),n.observe(e,{childList:!0})}function o(){n&&n.disconnect(),r=!0}return{init:i,destroy:o}}function q1(e,t,n,r,i,o,a){const{removeOffset:s,constrain:l}=i,c=.5,f=o?[0,t,-t]:[0],u=d(f,a);function p(g){const y=g||0;return n.map(b=>Dt(c,b-c).constrain(b*y))}function d(g,y){const b=g||f,w=p(y);return b.reduce((E,x)=>{const C=r.map((T,N)=>({start:T-n[N]+w[N]+x,end:T+e-w[N]+x,index:N}));return E.concat(C)},[])}function m(g,y){const b=o?s(g):l(g);return(y||u).reduce((E,x)=>{const{index:C,start:T,end:N}=x,$=E.includes(C),I=T<b&&N>b;return!$&&I?E.concat([C]):E},[])}return{check:m,findSlideBounds:d}}function K1(e,t,n,r,i,o){const{measureSize:a,startEdge:s,endEdge:l}=e,c=n[0]&&i,f=m(),u=h(),p=n.map(a),d=g();function m(){if(!c)return 0;const b=n[0];return Me(t[s]-b[s])}function h(){if(!c)return 0;const b=o.getComputedStyle(St(r));return parseFloat(b.getPropertyValue(`margin-${l}`))}function g(){return n.map((b,w,E)=>{const x=!w,C=w===Hr(E);return x?p[w]+f:C?p[w]+u:E[w+1][s]-b[s]}).map(Me)}return{slideSizes:p,slideSizesWithGaps:d}}function Y1(e,t,n){const r=Zo(n);function i(l,c){return Zn(l).filter(f=>f%c===0).map(f=>l.slice(f,f+c))}function o(l){return Zn(l).reduce((c,f)=>{const p=t.slice(St(c),f+1).reduce((d,m)=>d+m,0);return!f||p>e?c.concat(f):c},[]).map((c,f,u)=>l.slice(c,u[f+1]))}function a(l){return r?i(l,n):o(l)}return{groupSlides:a}}function G1(e,t,n,r,i,o,a,s){const{align:l,axis:c,direction:f,startIndex:u,inViewThreshold:p,loop:d,duration:m,dragFree:h,dragThreshold:g,slidesToScroll:y,skipSnaps:b,containScroll:w}=o,E=t.getBoundingClientRect(),x=n.map(pe=>pe.getBoundingClientRect()),C=D1(f),T=O1(c,f),N=T.measureSize(E),$=N1(N),I=T1(l,N),D=!d&&!!w,F=d||!!w,{slideSizes:_,slideSizesWithGaps:R}=K1(T,E,x,n,F,i),P=Y1(N,R,y),{snaps:L,snapsAligned:U}=j1(T,I,E,x,R,P,D),z=-St(L)+St(R),{snapsContained:q}=R1(N,z,U,w),v=D?q:U,{limit:M}=B1(z,v,d),H=gf(Hr(v),u,d),k=H.clone(),W=Zn(n),te=({dragHandler:pe,scrollBody:me,scrollBounds:De,eventHandler:Ue,animation:He,options:{loop:qe}})=>{const ee=pe.pointerDown();qe||De.constrain(ee);const ce=me.seek().settled();ce&&!ee&&(He.stop(),Ue.emit("settle")),ce||Ue.emit("scroll")},Y=({scrollBody:pe,translate:me,location:De,offsetLocation:Ue,scrollLooper:He,slideLooper:qe,options:{loop:ee}},ce)=>{const B=pe.velocity();Ue.set(De.get()-B+B*ce),ee&&(He.loop(pe.direction()),qe.loop()),me.to(Ue.get())},X={start:()=>s.start(ue),stop:()=>s.stop(ue),update:()=>te(ue),render:pe=>Y(ue,pe)},oe=.68,ae=v[H.get()],J=Vr(ae),Q=Vr(ae),j=Vr(ae),ne=L1(J,j,m,oe),se=U1(d,v,z,M,j),K=H1(X,H,k,se,ne,j,a),G=q1(N,z,_,L,M,d,p),ue={ownerDocument:r,ownerWindow:i,eventHandler:a,containerRect:E,slideRects:x,animation:X,axis:T,direction:C,dragHandler:M1(T,C,e,r,i,j,P1(T,i),J,X,K,ne,se,H,a,$,h,g,b,oe),eventStore:Xn(),percentOfView:$,index:H,indexPrevious:k,limit:M,location:J,offsetLocation:Q,options:o,resizeHandler:_1(t,a,i,n,T),scrollBody:ne,scrollBounds:F1(M,J,j,ne,$),scrollLooper:$1(z,M,Q,[J,Q,j]),scrollProgress:z1(M),scrollSnaps:v,scrollTarget:se,scrollTo:K,slideLooper:W1(T,C,N,z,R,v,G,Q,n),slidesHandler:V1(t,a),slidesInView:G,slideIndexes:W,slidesToScroll:P,target:j,translate:yf(T,C,t)};return ue}function Q1(e){const t=16.666666666666668;let n=[],r=null,i=0,o=0;function a(u){r||(r=u);const p=u-r;for(r=u,i+=p;i>=t;)n.forEach(({animation:m})=>m.update()),i-=t;const d=Me(i/t);n.forEach(({animation:m})=>m.render(d)),o&&e.requestAnimationFrame(a)}function s(u){n.includes(u)||n.push(u),!o&&(o=e.requestAnimationFrame(a))}function l(u){n=n.filter(p=>p!==u),!n.length&&(e.cancelAnimationFrame(o),r=null,i=0,o=0)}function c(){r=null,i=0}return{start:s,stop:l,reset:c,window:e}}function J1(){const e={};let t;function n(l){t=l}function r(l){return e[l]||[]}function i(l){return r(l).forEach(c=>c(t,l)),s}function o(l,c){return e[l]=r(l).concat([c]),s}function a(l,c){return e[l]=r(l).filter(f=>f!==c),s}const s={init:n,emit:i,off:a,on:o};return s}const Z1={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,breakpoints:{},dragFree:!1,dragThreshold:10,inViewThreshold:0,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0};function X1(e){function t(o,a){return hf(o,a||{})}function n(o){const a=o.breakpoints||{},s=Wr(a).filter(l=>e.matchMedia(l).matches).map(l=>a[l]).reduce((l,c)=>t(l,c),{});return t(o,s)}function r(o){return o.map(a=>Wr(a.breakpoints||{})).reduce((a,s)=>a.concat(s),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function ek(e){let t=[];function n(o,a){return t=o.filter(({options:s})=>e.optionsAtMedia(s).active!==!1),t.forEach(s=>s.init(a,e)),o.reduce((s,l)=>Object.assign(s,{[l.name]:l}),{})}function r(){t=t.filter(o=>o.destroy())}return{init:n,destroy:r}}function un(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=X1(i),a=ek(o),s=Xn(),l=Xn(),c=J1(),{animationRealms:f}=un,{mergeOptions:u,optionsAtMedia:p,optionsMediaQueries:d}=o,{on:m,off:h,emit:g}=c,y=_;let b=!1,w,E=u(Z1,un.globalOptions),x=u(E),C=[],T,N,$;function I(){const{container:ne,slides:se}=x;N=(df(ne)?e.querySelector(ne):ne)||e.children[0];const G=df(se)?N.querySelectorAll(se):se;$=[].slice.call(G||N.children)}function D(ne,se){const K=G1(e,N,$,r,i,ne,c,se);if(ne.loop&&!K.slideLooper.canLoop()){const G=Object.assign({},ne,{loop:!1});return D(G,se)}return K}function F(ne,se){if(b)return;const K=f.find(ue=>ue.window===i),G=K||Q1(i);K||f.push(G),E=u(E,ne),x=p(E),C=se||C,I(),w=D(x,G),d([E,...C.map(({options:ue})=>ue)]).forEach(ue=>s.add(ue,"change",_)),x.active&&(w.translate.to(w.location.get()),w.eventHandler.init(j),w.resizeHandler.init(j,x.watchResize),w.slidesHandler.init(j,x.watchSlides),l.add(r,"visibilitychange",()=>{r.hidden&&G.reset()}),w.options.loop&&w.slideLooper.loop(),N.offsetParent&&$.length&&w.dragHandler.init(j,x.watchDrag),T=a.init(C,j))}function _(ne,se){const K=te();R(),F(u({startIndex:K},ne),se),c.emit("reInit")}function R(){w.dragHandler.destroy(),w.animation.stop(),w.eventStore.clear(),w.translate.clear(),w.slideLooper.clear(),w.resizeHandler.destroy(),w.slidesHandler.destroy(),a.destroy(),s.clear(),l.clear()}function P(){b||(b=!0,s.clear(),R(),c.emit("destroy"))}function L(ne){const se=w[ne?"target":"location"].get(),K=x.loop?"removeOffset":"constrain";return w.slidesInView.check(w.limit[K](se))}function U(ne){const se=L(ne);return w.slideIndexes.filter(K=>!se.includes(K))}function z(ne,se,K){!x.active||b||(w.scrollBody.useBaseFriction().useDuration(se?0:x.duration),w.scrollTo.index(ne,K||0))}function q(ne){const se=w.index.add(1).get();z(se,ne===!0,-1)}function v(ne){const se=w.index.add(-1).get();z(se,ne===!0,1)}function M(){return w.index.add(1).get()!==te()}function H(){return w.index.add(-1).get()!==te()}function k(){return w.scrollSnaps.map(w.scrollProgress.get)}function W(){return w.scrollProgress.get(w.location.get())}function te(){return w.index.get()}function Y(){return w.indexPrevious.get()}function X(){return T}function oe(){return w}function ae(){return e}function J(){return N}function Q(){return $}const j={canScrollNext:M,canScrollPrev:H,containerNode:J,internalEngine:oe,destroy:P,off:h,on:m,emit:g,plugins:X,previousScrollSnap:Y,reInit:y,rootNode:ae,scrollNext:q,scrollPrev:v,scrollProgress:W,scrollSnapList:k,scrollTo:z,selectedScrollSnap:te,slideNodes:Q,slidesInView:L,slidesNotInView:U};return F(t,n),setTimeout(()=>c.emit("init"),0),j}un.animationRealms=[],un.globalOptions=void 0;function ta(e={},t=[]){const n=O.useRef(e),r=O.useRef(t),[i,o]=O.useState(),[a,s]=O.useState(),l=O.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return O.useEffect(()=>{if(C1()&&a){un.globalOptions=ta.globalOptions;const c=un(a,n.current,r.current);return o(c),()=>c.destroy()}else o(void 0)},[a,o]),O.useEffect(()=>{Jo(n.current,e)||(n.current=e,l())},[e,l]),O.useEffect(()=>{A1(r.current,t)||(r.current=t,l())},[t,l]),[s,i]}ta.globalOptions=void 0;const bf=O.forwardRef(({blocks:e,direction:t,sender:n,timestamp:r,messageId:i,isReadOnly:o,sendMessage:a,addMessageFeedback:s},l)=>{const[c,f]=ta({skipSnaps:!0,loop:!0}),[u,p]=O.useState(!0),[d,m]=O.useState(!0),h=O.useCallback(()=>f==null?void 0:f.scrollPrev(),[f]),g=O.useCallback(()=>f==null?void 0:f.scrollNext(),[f]),{message:{blocks:{carousel:y}}}=ge,b=O.useCallback(w=>{p(!w.canScrollPrev()),m(!w.canScrollNext())},[]);return O.useEffect(()=>{f&&(b(f),f.on("reInit",b),f.on("select",b))},[f,b]),S.jsxs("div",{...y==null?void 0:y.container,"data-container":"carousel",ref:c,children:[S.jsx("div",{ref:l,...y==null?void 0:y.slidesContainer,children:e.map((w,E)=>S.jsx(Kt,{block:{...w,direction:t,timestamp:r,sender:n,messageId:i,sendMessage:a,isReadOnly:o}},E))}),e.length>1&&S.jsxs(S.Fragment,{children:[S.jsx(w0,{...y==null?void 0:y.backButton,"data-disabled":u?"":void 0,onClick:h}),S.jsx(x0,{...y==null?void 0:y.nextButton,"data-disabled":d?"":void 0,onClick:g})]})]})});bf.displayName="Carousel";const vf=Math.floor;function wf(e){return xf(e)?(e.nodeName||"").toLowerCase():"#document"}function er(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function tk(e){var t;return(t=(xf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xf(e){return e instanceof Node||e instanceof er(e).Node}function ot(e){return e instanceof Element||e instanceof er(e).Element}function fn(e){return e instanceof HTMLElement||e instanceof er(e).HTMLElement}function na(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof er(e).ShadowRoot}function nk(e){return["html","body","#document"].includes(wf(e))}function rk(e){return er(e).getComputedStyle(e)}function ik(e){if(wf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||na(e)&&e.host||tk(e);return na(t)?t.host:t}function Mt(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function Ge(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&na(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function kf(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function ok(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Sf(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(kf())||t.test(ok()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ef(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function Cf(){return/apple/i.test(navigator.vendor)}function ak(){return kf().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Af(e,t){return["mouse","pen"].includes(e)}function sk(e){return"nativeEvent"in e}function lk(e){return e.matches("html,body")}function st(e){return(e==null?void 0:e.ownerDocument)||document}function ra(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function If(e){return"composedPath"in e?e.composedPath()[0]:e.target}const ck="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Tf(e){return fn(e)&&e.matches(ck)}function Re(e){e.preventDefault(),e.stopPropagation()}const dn=Math.min,Xe=Math.max,qr=Math.round,Kr=Math.floor,ht=e=>({x:e,y:e});function Of(e,t,n){return Xe(e,dn(t,n))}function Yr(e,t){return typeof e=="function"?e(t):e}function tr(e){return e.split("-")[0]}function ia(e){return e.split("-")[1]}function Df(e){return e==="x"?"y":"x"}function uk(e){return e==="y"?"height":"width"}const fk=new Set(["top","bottom"]);function nr(e){return fk.has(tr(e))?"y":"x"}function dk(e){return Df(nr(e))}function pk(e){return{top:0,right:0,bottom:0,left:0,...e}}function hk(e){return typeof e!="number"?pk(e):{top:e,right:e,bottom:e,left:e}}function Gr(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Mf(e,t,n){let{reference:r,floating:i}=e;const o=nr(t),a=dk(t),s=uk(a),l=tr(t),c=o==="y",f=r.x+r.width/2-i.width/2,u=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2;let d;switch(l){case"top":d={x:f,y:r.y-i.height};break;case"bottom":d={x:f,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:u};break;case"left":d={x:r.x-i.width,y:u};break;default:d={x:r.x,y:r.y}}switch(ia(t)){case"start":d[a]-=p*(n&&c?-1:1);break;case"end":d[a]+=p*(n&&c?-1:1);break}return d}const mk=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:u}=Mf(c,r,l),p=r,d={},m=0;for(let h=0;h<s.length;h++){const{name:g,fn:y}=s[h],{x:b,y:w,data:E,reset:x}=await y({x:f,y:u,initialPlacement:r,placement:p,strategy:i,middlewareData:d,rects:c,platform:a,elements:{reference:e,floating:t}});f=b??f,u=w??u,d={...d,[g]:{...d[g],...E}},x&&m<=50&&(m++,typeof x=="object"&&(x.placement&&(p=x.placement),x.rects&&(c=x.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:f,y:u}=Mf(c,p,l)),h=-1)}return{x:f,y:u,placement:p,strategy:i,middlewareData:d}};async function Pf(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:p=!1,padding:d=0}=Yr(t,e),m=hk(d),g=s[p?u==="floating"?"reference":"floating":u],y=Gr(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:f,strategy:l})),b=u==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),E=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},x=Gr(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:w,strategy:l}):b);return{top:(y.top-x.top+m.top)/E.y,bottom:(x.bottom-y.bottom+m.bottom)/E.y,left:(y.left-x.left+m.left)/E.x,right:(x.right-y.right+m.right)/E.x}}const gk=new Set(["left","top"]);async function yk(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=tr(n),s=ia(n),l=nr(n)==="y",c=gk.has(a)?-1:1,f=o&&l?-1:1,u=Yr(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof m=="number"&&(d=s==="end"?m*-1:m),l?{x:d*f,y:p*c}:{x:p*c,y:d*f}}const bk=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await yk(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},vk=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:y,y:b}=g;return{x:y,y:b}}},...l}=Yr(e,t),c={x:n,y:r},f=await Pf(t,l),u=nr(tr(i)),p=Df(u);let d=c[p],m=c[u];if(o){const g=p==="y"?"top":"left",y=p==="y"?"bottom":"right",b=d+f[g],w=d-f[y];d=Of(b,d,w)}if(a){const g=u==="y"?"top":"left",y=u==="y"?"bottom":"right",b=m+f[g],w=m-f[y];m=Of(b,m,w)}const h=s.fn({...t,[p]:d,[u]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:o,[u]:a}}}}}},wk=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:s}=t,{apply:l=()=>{},...c}=Yr(e,t),f=await Pf(t,c),u=tr(i),p=ia(i),d=nr(i)==="y",{width:m,height:h}=o.floating;let g,y;u==="top"||u==="bottom"?(g=u,y=p===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(y=u,g=p==="end"?"top":"bottom");const b=h-f.top-f.bottom,w=m-f.left-f.right,E=dn(h-f[g],b),x=dn(m-f[y],w),C=!t.middlewareData.shift;let T=E,N=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=b),C&&!p){const I=Xe(f.left,0),D=Xe(f.right,0),F=Xe(f.top,0),_=Xe(f.bottom,0);d?N=m-2*(I!==0||D!==0?I+D:Xe(f.left,f.right)):T=h-2*(F!==0||_!==0?F+_:Xe(f.top,f.bottom))}await l({...t,availableWidth:N,availableHeight:T});const $=await a.getDimensions(s.floating);return m!==$.width||h!==$.height?{reset:{rects:!0}}:{}}}};function Qr(){return typeof window<"u"}function pn(e){return Nf(e)?(e.nodeName||"").toLowerCase():"#document"}function et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mt(e){var t;return(t=(Nf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Nf(e){return Qr()?e instanceof Node||e instanceof et(e).Node:!1}function lt(e){return Qr()?e instanceof Element||e instanceof et(e).Element:!1}function gt(e){return Qr()?e instanceof HTMLElement||e instanceof et(e).HTMLElement:!1}function _f(e){return!Qr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof et(e).ShadowRoot}const xk=new Set(["inline","contents"]);function rr(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ct(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!xk.has(i)}const kk=new Set(["table","td","th"]);function Sk(e){return kk.has(pn(e))}const Ek=[":popover-open",":modal"];function Jr(e){return Ek.some(t=>{try{return e.matches(t)}catch{return!1}})}const Ck=["transform","translate","scale","rotate","perspective"],Ak=["transform","translate","scale","rotate","perspective","filter"],Ik=["paint","layout","strict","content"];function oa(e){const t=aa(),n=lt(e)?ct(e):e;return Ck.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Ak.some(r=>(n.willChange||"").includes(r))||Ik.some(r=>(n.contain||"").includes(r))}function Tk(e){let t=Pt(e);for(;gt(t)&&!hn(t);){if(oa(t))return t;if(Jr(t))return null;t=Pt(t)}return null}function aa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ok=new Set(["html","body","#document"]);function hn(e){return Ok.has(pn(e))}function ct(e){return et(e).getComputedStyle(e)}function Zr(e){return lt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pt(e){if(pn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_f(e)&&e.host||mt(e);return _f(t)?t.host:t}function Lf(e){const t=Pt(e);return hn(t)?e.ownerDocument?e.ownerDocument.body:e.body:gt(t)&&rr(t)?t:Lf(t)}function Nt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Lf(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=et(i);if(o){const s=sa(a);return t.concat(a,a.visualViewport||[],rr(i)?i:[],s&&n?Nt(s):[])}return t.concat(i,Nt(i,[],n))}function sa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ff(e){const t=ct(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=gt(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=qr(n)!==o||qr(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function la(e){return lt(e)?e:e.contextElement}function mn(e){const t=la(e);if(!gt(t))return ht(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Ff(t);let a=(o?qr(n.width):n.width)/r,s=(o?qr(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Dk=ht(0);function Rf(e){const t=et(e);return!aa()||!t.visualViewport?Dk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Mk(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==et(e)?!1:t}function qt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=la(e);let a=ht(1);t&&(r?lt(r)&&(a=mn(r)):a=mn(e));const s=Mk(o,n,r)?Rf(o):ht(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,f=i.width/a.x,u=i.height/a.y;if(o){const p=et(o),d=r&&lt(r)?et(r):r;let m=p,h=sa(m);for(;h&&r&&d!==m;){const g=mn(h),y=h.getBoundingClientRect(),b=ct(h),w=y.left+(h.clientLeft+parseFloat(b.paddingLeft))*g.x,E=y.top+(h.clientTop+parseFloat(b.paddingTop))*g.y;l*=g.x,c*=g.y,f*=g.x,u*=g.y,l+=w,c+=E,m=et(h),h=sa(m)}}return Gr({width:f,height:u,x:l,y:c})}function Xr(e,t){const n=Zr(e).scrollLeft;return t?t.left+n:qt(mt(e)).left+n}function Bf(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Xr(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Pk(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=mt(r),s=t?Jr(t.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=ht(1);const f=ht(0),u=gt(r);if((u||!u&&!o)&&((pn(r)!=="body"||rr(a))&&(l=Zr(r)),gt(r))){const d=qt(r);c=mn(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}const p=a&&!u&&!o?Bf(a,l):ht(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+f.x+p.x,y:n.y*c.y-l.scrollTop*c.y+f.y+p.y}}function Nk(e){return Array.from(e.getClientRects())}function _k(e){const t=mt(e),n=Zr(e),r=e.ownerDocument.body,i=Xe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Xe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Xr(e);const s=-n.scrollTop;return ct(r).direction==="rtl"&&(a+=Xe(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}const $f=25;function Lk(e,t){const n=et(e),r=mt(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const f=aa();(!f||f&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=Xr(r);if(c<=0){const f=r.ownerDocument,u=f.body,p=getComputedStyle(u),d=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(r.clientWidth-u.clientWidth-d);m<=$f&&(o-=m)}else c<=$f&&(o+=c);return{width:o,height:a,x:s,y:l}}const Fk=new Set(["absolute","fixed"]);function Rk(e,t){const n=qt(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=gt(e)?mn(e):ht(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:a,height:s,x:l,y:c}}function zf(e,t,n){let r;if(t==="viewport")r=Lk(e,n);else if(t==="document")r=_k(mt(e));else if(lt(t))r=Rk(t,n);else{const i=Rf(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Gr(r)}function jf(e,t){const n=Pt(e);return n===t||!lt(n)||hn(n)?!1:ct(n).position==="fixed"||jf(n,t)}function Bk(e,t){const n=t.get(e);if(n)return n;let r=Nt(e,[],!1).filter(s=>lt(s)&&pn(s)!=="body"),i=null;const o=ct(e).position==="fixed";let a=o?Pt(e):e;for(;lt(a)&&!hn(a);){const s=ct(a),l=oa(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&Fk.has(i.position)||rr(a)&&!l&&jf(e,a))?r=r.filter(f=>f!==a):i=s,a=Pt(a)}return t.set(e,r),r}function $k(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?Jr(t)?[]:Bk(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,f)=>{const u=zf(t,f,i);return c.top=Xe(u.top,c.top),c.right=dn(u.right,c.right),c.bottom=dn(u.bottom,c.bottom),c.left=Xe(u.left,c.left),c},zf(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function zk(e){const{width:t,height:n}=Ff(e);return{width:t,height:n}}function jk(e,t,n){const r=gt(t),i=mt(t),o=n==="fixed",a=qt(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=ht(0);function c(){l.x=Xr(i)}if(r||!r&&!o)if((pn(t)!=="body"||rr(i))&&(s=Zr(t)),r){const d=qt(t,!0,o,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&c();o&&!r&&i&&c();const f=i&&!r&&!o?Bf(i,s):ht(0),u=a.left+s.scrollLeft-l.x-f.x,p=a.top+s.scrollTop-l.y-f.y;return{x:u,y:p,width:a.width,height:a.height}}function ca(e){return ct(e).position==="static"}function Uf(e,t){if(!gt(e)||ct(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return mt(e)===n&&(n=n.ownerDocument.body),n}function Hf(e,t){const n=et(e);if(Jr(e))return n;if(!gt(e)){let i=Pt(e);for(;i&&!hn(i);){if(lt(i)&&!ca(i))return i;i=Pt(i)}return n}let r=Uf(e,t);for(;r&&Sk(r)&&ca(r);)r=Uf(r,t);return r&&hn(r)&&ca(r)&&!oa(r)?n:r||Tk(e)||n}const Uk=async function(e){const t=this.getOffsetParent||Hf,n=this.getDimensions,r=await n(e.floating);return{reference:jk(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hk(e){return ct(e).direction==="rtl"}const Wk={convertOffsetParentRelativeRectToViewportRelativeRect:Pk,getDocumentElement:mt,getClippingRect:$k,getOffsetParent:Hf,getElementRects:Uk,getClientRects:Nk,getDimensions:zk,getScale:mn,isElement:lt,isRTL:Hk};function Wf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vk(e,t){let n=null,r;const i=mt(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const c=e.getBoundingClientRect(),{left:f,top:u,width:p,height:d}=c;if(s||t(),!p||!d)return;const m=Kr(u),h=Kr(i.clientWidth-(f+p)),g=Kr(i.clientHeight-(u+d)),y=Kr(f),w={rootMargin:-m+"px "+-h+"px "+-g+"px "+-y+"px",threshold:Xe(0,dn(1,l))||1};let E=!0;function x(C){const T=C[0].intersectionRatio;if(T!==l){if(!E)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!Wf(c,e.getBoundingClientRect())&&a(),E=!1}try{n=new IntersectionObserver(x,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,w)}n.observe(e)}return a(!0),o}function qk(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=la(e),f=i||o?[...c?Nt(c):[],...Nt(t)]:[];f.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const u=c&&s?Vk(c,n):null;let p=-1,d=null;a&&(d=new ResizeObserver(y=>{let[b]=y;b&&b.target===c&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),c&&!l&&d.observe(c),d.observe(t));let m,h=l?qt(e):null;l&&g();function g(){const y=qt(e);h&&!Wf(h,y)&&n(),h=y,m=requestAnimationFrame(g)}return n(),()=>{var y;f.forEach(b=>{i&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),u==null||u(),(y=d)==null||y.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const Kk=bk,Yk=vk,Gk=wk,Qk=(e,t,n)=>{const r=new Map,i={platform:Wk,...n},o={...i.platform,_c:r};return mk(e,t,{...i,platform:o})};var Jk=typeof document<"u",Zk=function(){},ei=Jk?O.useLayoutEffect:Zk;function ti(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ti(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!ti(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Vf(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qf(e,t){const n=Vf(e);return Math.round(t*n)/n}function ua(e){const t=A.useRef(e);return ei(()=>{t.current=e}),t}function Xk(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[f,u]=A.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=A.useState(r);ti(p,r)||d(r);const[m,h]=A.useState(null),[g,y]=A.useState(null),b=A.useCallback(z=>{z!==C.current&&(C.current=z,h(z))},[]),w=A.useCallback(z=>{z!==T.current&&(T.current=z,y(z))},[]),E=o||m,x=a||g,C=A.useRef(null),T=A.useRef(null),N=A.useRef(f),$=l!=null,I=ua(l),D=ua(i),F=ua(c),_=A.useCallback(()=>{if(!C.current||!T.current)return;const z={placement:t,strategy:n,middleware:p};D.current&&(z.platform=D.current),Qk(C.current,T.current,z).then(q=>{const v={...q,isPositioned:F.current!==!1};R.current&&!ti(N.current,v)&&(N.current=v,Is.flushSync(()=>{u(v)}))})},[p,t,n,D,F]);ei(()=>{c===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,u(z=>({...z,isPositioned:!1})))},[c]);const R=A.useRef(!1);ei(()=>(R.current=!0,()=>{R.current=!1}),[]),ei(()=>{if(E&&(C.current=E),x&&(T.current=x),E&&x){if(I.current)return I.current(E,x,_);_()}},[E,x,_,I,$]);const P=A.useMemo(()=>({reference:C,floating:T,setReference:b,setFloating:w}),[b,w]),L=A.useMemo(()=>({reference:E,floating:x}),[E,x]),U=A.useMemo(()=>{const z={position:n,left:0,top:0};if(!L.floating)return z;const q=qf(L.floating,f.x),v=qf(L.floating,f.y);return s?{...z,transform:"translate("+q+"px, "+v+"px)",...Vf(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:v}},[n,s,L.floating,f.x,f.y]);return A.useMemo(()=>({...f,update:_,refs:P,elements:L,floatingStyles:U}),[f,_,P,L,U])}const eS=(e,t)=>({...Kk(e),options:[e,t]}),tS=(e,t)=>({...Yk(e),options:[e,t]}),nS=(e,t)=>({...Gk(e),options:[e,t]});/*!
259
+ `);const b=y.state[s];if(b==null)return;JSON.stringify(i.getState())!==JSON.stringify(b)&&d(b);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(y)});case"DISPATCH":switch(h.payload.type){case"RESET":return d(m),s===void 0?f==null?void 0:f.init(i.getState()):f==null?void 0:f.init($r(l.name));case"COMMIT":if(s===void 0){f==null||f.init(i.getState());return}return f==null?void 0:f.init($r(l.name));case"ROLLBACK":return Uo(h.state,y=>{if(s===void 0){d(y),f==null||f.init(i.getState());return}d(y[s]),f==null||f.init($r(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Uo(h.state,y=>{if(s===void 0){d(y);return}JSON.stringify(i.getState())!==JSON.stringify(y[s])&&d(y[s])});case"IMPORT_STATE":{const{nextLiftedState:y}=h.payload,b=(g=y.computedStates.slice(-1)[0])==null?void 0:g.state;if(!b)return;d(s===void 0?b:b[s]),f==null||f.send(null,y);return}case"PAUSE_RECORDING":return p=!p}return}}),m},Uo=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)};function Ho(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const a=l=>l===null?null:JSON.parse(l,void 0),s=(o=n.getItem(i))!=null?o:null;return s instanceof Promise?s.then(a):a(s)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Yn=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Yn(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Yn(r)(n)}}}},o1=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...t},a=!1;const s=new Set,l=new Set;let c;try{c=o.getStorage()}catch{}if(!c)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...g)},r,i);const f=Yn(o.serialize),u=()=>{const g=o.partialize({...r()});let y;const b=f({state:g,version:o.version}).then(w=>c.setItem(o.name,w)).catch(w=>{y=w});if(y)throw y;return b},p=i.setState;i.setState=(g,y)=>{p(g,y),u()};const d=e((...g)=>{n(...g),u()},r,i);let m;const h=()=>{var g;if(!c)return;a=!1,s.forEach(b=>b(r()));const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,r()))||void 0;return Yn(c.getItem.bind(c))(o.name).then(b=>{if(b)return o.deserialize(b)}).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==o.version){if(o.migrate)return o.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var w;return m=o.merge(b,(w=r())!=null?w:d),n(m,!0),u()}).then(()=>{y==null||y(m,void 0),a=!0,l.forEach(b=>b(m))}).catch(b=>{y==null||y(void 0,b)})};return i.persist={setOptions:g=>{o={...o,...g},g.getStorage&&(c=g.getStorage())},clearStorage:()=>{c==null||c.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>h(),hasHydrated:()=>a,onHydrate:g=>(s.add(g),()=>{s.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},h(),m||d},a1=(e,t)=>(n,r,i)=>{let o={storage:Ho(()=>localStorage),partialize:h=>h,version:0,merge:(h,g)=>({...g,...h}),...t},a=!1;const s=new Set,l=new Set;let c=o.storage;if(!c)return e((...h)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...h)},r,i);const f=()=>{const h=o.partialize({...r()});return c.setItem(o.name,{state:h,version:o.version})},u=i.setState;i.setState=(h,g)=>{u(h,g),f()};const p=e((...h)=>{n(...h),f()},r,i);let d;const m=()=>{var h,g;if(!c)return;a=!1,s.forEach(b=>{var w;return b((w=r())!=null?w:p)});const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,(h=r())!=null?h:p))||void 0;return Yn(c.getItem.bind(c))(o.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==o.version){if(o.migrate)return o.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var w;return d=o.merge(b,(w=r())!=null?w:p),n(d,!0),f()}).then(()=>{y==null||y(d,void 0),d=r(),a=!0,l.forEach(b=>b(d))}).catch(b=>{y==null||y(void 0,b)})};return i.persist={setOptions:h=>{o={...o,...h},h.storage&&(c=h.storage)},clearStorage:()=>{c==null||c.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>a,onHydrate:h=>(s.add(h),()=>{s.delete(h)}),onFinishHydration:h=>(l.add(h),()=>{l.delete(h)})},o.skipHydration||m(),d||p},zr=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((Br?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),o1(e,t)):a1(e,t),Fu=Ot()(Kn(zr(e=>({messageHistory:[],addMessageToHistory:t=>e(n=>({...n,messageHistory:[t,...(n.messageHistory??[]).slice(0,100).filter(String)]}))}),{name:"botpress-message-history"})));let jr;const s1=new Uint8Array(16);function l1(){if(!jr&&(jr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!jr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return jr(s1)}const $e=[];for(let e=0;e<256;++e)$e.push((e+256).toString(16).slice(1));function c1(e,t=0){return $e[e[t+0]]+$e[e[t+1]]+$e[e[t+2]]+$e[e[t+3]]+"-"+$e[e[t+4]]+$e[e[t+5]]+"-"+$e[e[t+6]]+$e[e[t+7]]+"-"+$e[e[t+8]]+$e[e[t+9]]+"-"+$e[e[t+10]]+$e[e[t+11]]+$e[e[t+12]]+$e[e[t+13]]+$e[e[t+14]]+$e[e[t+15]]}const Ru={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function u1(e,t,n){if(Ru.randomUUID&&!e)return Ru.randomUUID();e=e||{};const r=e.random||(e.rng||l1)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,c1(r)}function Gn(e){var a;const{metadata:t,conversationId:n,userId:r}=e,{payload:i,disableInput:o}=Bu(e.payload);return{id:e.id,conversationId:n,authorId:r,timestamp:new Date(e.createdAt),block:i,feedback:(a=e.feedback)==null?void 0:a.value,disableInput:o,metadata:t}}const Bu=e=>{switch(e.type){case"audio":return $u(e);case"card":return f1(e);case"carousel":return d1(e);case"choice":return p1(e);case"dropdown":return h1(e);case"file":return zu(e);case"image":return ju(e);case"location":return Uu(e);case"markdown":return Hu(e);case"text":return Wu(e);case"video":return Vu(e);case"bloc":return m1(e);case"custom":return{payload:e};default:{const t=e;throw new Error(`Unsuported message type ${t}`)}}},Qn=e=>({block:e,type:"bubble"}),$u=e=>({payload:{type:"audio",url:e.audioUrl}}),f1=e=>({payload:Qn(qu(e))}),d1=e=>({payload:{type:"carousel",blocks:e.items.map(t=>qu({...t}))}}),p1=e=>{const t=e.options.map(o=>({title:o.label,value:o.value})),n=e.text,r=u1(),i=Qn({type:"text",text:n});return t.length===0?{disableInput:e.disableFreeText,payload:i}:{disableInput:e.disableFreeText,payload:{type:"column",blocks:[i,{type:"row",blocks:t.map(({title:o,value:a})=>({type:"button",variant:"action",text:o,buttonValue:a,groupId:r}))}]}}},h1=e=>{const t=e.options.map(i=>({label:i.label,value:i.value})),n=e.text,r=[{type:"dropdown",label:n??"Select an option",options:t}];return n&&r.unshift({type:"text",text:n}),{disableInput:!0,payload:Qn({type:"column",blocks:r})}},zu=e=>({payload:{type:"file",url:e.fileUrl,title:e.title}}),ju=e=>({payload:{type:"image",url:e.imageUrl}}),Uu=e=>({payload:{type:"location",latitude:e.latitude,longitude:e.longitude,title:e.title??e.address??"View on map"}}),Hu=e=>({payload:Qn({type:"text",text:e.markdown})}),Wu=e=>({payload:Qn({type:"text",text:e.text,value:e.value})}),Vu=e=>({payload:{type:"video",url:e.videoUrl}}),m1=e=>({payload:{type:"column",blocks:e.items.map(n=>{switch(n.type){case"audio":return $u({...n.payload,type:n.type}).payload;case"file":return zu({...n.payload,type:n.type}).payload;case"image":return ju({...n.payload,type:n.type}).payload;case"location":return Uu({...n.payload,type:n.type}).payload;case"markdown":return Hu({...n.payload,type:n.type}).payload;case"text":return Wu({...n.payload,type:n.type}).payload;case"video":return Vu({...n.payload,type:n.type}).payload;default:throw new Error("Unsuported message type")}})}}),qu=e=>{const t=e.title,n=e.subtitle,r=e.imageUrl,i=e.actions.map(a=>{switch(a.action){case"postback":return{type:"button",variant:"action",text:a.label,buttonValue:a.value,reusable:!0};case"url":return{type:"button",variant:"link",text:a.label,buttonValue:a.value,reusable:!0};case"say":return{type:"button",variant:"action",text:a.label,buttonValue:a.value,reusable:!0};default:throw new Error(`Unknown action type ${a.action}`)}}),o=[];return r&&o.push({type:"image",url:r}),t&&o.push({type:"text",text:`#### ${t}`}),n&&o.push({type:"text",text:n}),i.length>0&&o.push({type:"row",blocks:i}),{type:"column",horizontalAlignment:"center",blocks:[...o]}},an=Ot()(Kn(e=>({messages:[],isFetching:!1,setMessages:t=>e({messages:t}),saveMessage:t=>e(({messages:n})=>{var i;const r=(i=t.metadata)==null?void 0:i.clientMessageId;if(r){const o=n.findIndex(s=>{var l;return((l=s.metadata)==null?void 0:l.clientMessageId)===r}),a=n[o];if(o!==-1)return{messages:[...n.slice(0,o),{...a,...t},...n.slice(o+1)]}}return{messages:[...n.filter(o=>o.id!==t.id),t]}}),updateMessage:(t,n)=>e(({messages:r})=>({messages:r.map(i=>i.id===t?{...i,...n}:i)})),clearMessages:()=>e({messages:[]}),fetchMessages:async({client:t,conversationId:n})=>{const r=[];e({isFetching:!0});try{let i;do{const{messages:o,meta:a}=await t.listConversationMessages({conversationId:n,nextToken:i});r.push(...o),i=a.nextToken}while(i);return r.reverse().map(o=>Gn(o)).filter(Boolean)}finally{e({isFetching:!1})}}}),{name:"messagesStore"})),g1=(e,t)=>Ot()(Kn(zr(n=>({setUser:r=>n(i=>({...i,user:r})),setConversationId:r=>n(i=>({...i,conversationId:r})),clearConversationId:()=>n(r=>({...r,conversationId:void 0})),clearAll:()=>{n(r=>({...r,user:void 0,conversationId:void 0}))}}),{name:e,storage:Ho(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),Dn=class Dn{constructor(){}static getInstance(t="bp-webchat",n){return Dn._instances[t]||(Dn._instances[t]=g1(t,n)),Dn._instances[t]}};Li(Dn,"_instances",{});let Wo=Dn;const Ku=Wo.getInstance,sn=Ot()(Kn(e=>({eventEmitter:Hs(),messageContainerRef:O.createRef(),setMessageContainerRef:t=>e({messageContainerRef:t}),portalContainer:null,setPortalContainer:t=>e({portalContainer:t})}),{name:"webchatStore"})),y1=8,b1=e=>Ot()(zr((t,n)=>({files:[],setFiles:r=>t({files:r}),upsertFile:r=>t(({files:i})=>({files:i.some(s=>s.name===r.name)?i.map(s=>s.name===r.name?{...s,...r}:s):[...i,{...r}]})),uploadFile:async(r,i)=>{if(n().files.length===y1)return;const o=r.name.lastIndexOf("."),a=o>0&&o<r.name.length-1,s=a?r.name.substring(0,o):r.name,l=a?r.name.substring(o):"",c=Cm(s,n().files,p=>p.name),f=c+l,u=new File([r],f,{type:r.type});n().upsertFile({name:c,type:"file",instance:u,status:"loading"});try{const{fileUrl:p,type:d}=await i(u);n().upsertFile({name:c,type:d,url:p,instance:u,status:"uploaded"})}catch{n().upsertFile({name:c,type:"file",instance:u,status:"error"})}},deleteFile:r=>t(({files:i})=>({files:i.filter(o=>o.name!=r)}))}),{name:e,storage:Ho(()=>sessionStorage)})),Mn=class Mn{constructor(){}static getInstance(t="bp-composer-file-store"){return Mn._instances[t]||(Mn._instances[t]=b1(t)),Mn._instances[t]}};Li(Mn,"_instances",{});let Vo=Mn;const Yu=Vo.getInstance,Jn=Ot()(e=>({participants:[],setParticipants:t=>e({participants:t}),addParticipant:t=>e(n=>({participants:[...n.participants,t]})),removeParticipant:t=>e(n=>({participants:n.participants.filter(r=>r.id!==t)})),clearParticipants:()=>e({participants:[]})})),v1=e=>Ot()(Kn(zr((t,n)=>({soundOn:!0,setSoundEnabled:r=>t({soundOn:r}),toggleSound:()=>t({soundOn:!n().soundOn})}),{name:e}))),Pn=class Pn{constructor(){}static getInstance(t="webchat:soundEnabled"){return Pn._instances[t]||(Pn._instances[t]=v1(t)),Pn._instances[t]}};Li(Pn,"_instances",{});let qo=Pn;const Gu=qo.getInstance,w1=({text:e,buttonValue:t,variant:n,groupId:r,reusable:i,sendMessage:o,isReadOnly:a,...s})=>{const l=sn(w=>w.eventEmitter),[c,f]=O.useState(!1),[u,p]=O.useState(!1),[d,m]=O.useState(!1),{message:{blocks:{button:h}}}=ge;O.useEffect(()=>{if(r)return l.on(`button-group-${r}-click`,()=>{p(!0),i||m(!0)})},[l,r,i]);const y={...s,onClick:w=>{if((d||a)&&n==="link"){w.preventDefault();return}f(!0),i||m(!0),r&&l.emit(`button-group-${r}-click`),n!=="link"&&o&&(o==null||o({type:"text",text:e,value:t}))},"data-activated":c?"":void 0,"data-group-activated":u?"":void 0,"data-type":n,...h},b=d||a;return n==="link"?S.jsx("a",{...y,style:a?{pointerEvents:"none"}:void 0,href:t,target:"_blank",rel:"noopener noreferrer",children:e}):S.jsx("button",{...y,style:a?{pointerEvents:"none"}:void 0,disabled:b,children:e})},Ko=O.createContext(null);function Qu(){const e=O.useContext(Ko);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const Yo=O.createContext({showInputModal:void 0});function Go(){return O.useContext(Yo)}const Ju=O.forwardRef(({block:e,direction:t,sender:n,timestamp:r,messageId:i,feedback:o,metadata:a,isReadOnly:s,sendMessage:l,addMessageFeedback:c,...f},u)=>{const{showInputModal:p}=Go(),{message:{blocks:{bubble:{container:d,feedbackContainer:m,feedbackIcon:h}}}}=ge;return t=="incoming"?S.jsxs("div",{"data-direction":"incoming","data-feedback":!!o,...f,...d,ref:u,children:[S.jsx(Kt,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:s,metadata:a,sendMessage:l}}),c&&p&&e.type==="text"&&S.jsxs("div",{...m,children:[S.jsx(z0,{...h,"data-selected":o==="positive",onClick:()=>c(i,{value:"positive"})}),S.jsx($0,{...h,"data-selected":o==="negative",onClick:async()=>{const g=await p({title:"Help us improve",description:"Please provide feedback to help us improve.",confirmButtonText:"Send feedback",cancelButtonText:"Cancel",Content:x1});c(i,{value:"negative",comment:g})}})]})]}):S.jsx("div",{"data-direction":"outgoing",...f,...d,ref:u,children:S.jsx(Kt,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:s,metadata:a,sendMessage:l,addMessageFeedback:c}})})});Ju.displayName="Bubble";const x1=({setValue:e})=>{const{modal:{dialog:{content:t}}}=ge;return S.jsx("textarea",{...t.textarea,placeholder:"Let us know what went wrong...",onChange:n=>e(n.target.value)})},Zu=({className:e,...t})=>S.jsx("div",{"data-slot":"skeleton",className:`bpSkeleton ${e||""}`,...t});Zu.displayName="Skeleton";var ot=function(){return ot=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ot.apply(this,arguments)};function Xu(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ln(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(f){try{c(r.next(f))}catch(u){a(u)}}function l(f){try{c(r.throw(f))}catch(u){a(u)}}function c(f){f.done?o(f.value):i(f.value).then(s,l)}c((r=r.apply(e,t||[])).next())})}function cn(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(f){return l([c,f])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(f){c=[6,f],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ef(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function Qo(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function k1(){var e=O.useRef(!1),t=O.useCallback(function(){return e.current},[]);return O.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function S1(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=O.useRef(0),i=k1(),o=O.useState(n),a=o[0],s=o[1],l=O.useCallback(function(){for(var c=[],f=0;f<arguments.length;f++)c[f]=arguments[f];var u=++r.current;return a.loading||s(function(p){return ot(ot({},p),{loading:!0})}),e.apply(void 0,c).then(function(p){return i()&&u===r.current&&s({value:p,loading:!1}),p},function(p){return i()&&u===r.current&&s({error:p,loading:!1}),p})},t);return[a,l]}function E1(e,t){t===void 0&&(t=[]);var n=S1(e,t,{loading:!0}),r=n[0],i=n[1];return O.useEffect(function(){i()},[i]),r}const tf=O.forwardRef(({url:e,type:t,orientation:n="auto",...r},i)=>{const o=O.useId(),{setIsLoading:a}=Qu(),[s,l]=O.useState(n==="auto"?"square":n),[c,f]=O.useState("initial"),{message:{blocks:{image:u}}}=ge;return O.useLayoutEffect(()=>(a(p=>[...p,o]),()=>{a(p=>p.filter(d=>d!==o))}),[o,a]),E1(async()=>{if(!e)return;const p=new Image;try{const{width:d,height:m}=await Jh(e);n==="auto"&&l(C1(d,m)),p.onload=()=>{f("loaded"),a(h=>h.filter(g=>g!==o))},p.onerror=()=>{f("error"),l("square"),a(h=>h.filter(g=>g!==o))},p.src=e,p.complete&&(p.naturalWidth>0?(f("loaded"),a(h=>h.filter(g=>g!==o))):(f("error"),l("square"),a(h=>h.filter(g=>g!==o))))}catch(d){console.error(d),f("error"),a(m=>m.filter(h=>h!==o))}return()=>{p.onload=null,p.onerror=null}},[e,o,a,n]),e?c==="error"?S.jsx("div",{"data-error":"true","data-orientation":s,...r,...u.image,ref:i,children:S.jsx(Eu,{size:"25%",strokeWidth:"5%"})}):c==="initial"?S.jsx(Zu,{"data-orientation":s,...u.placeholder}):S.jsx("img",{"data-orientation":s,"data-loaded":c==="loaded",...r,...u.image,src:e,alt:"",ref:i}):null});tf.displayName="Image";function C1(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((o,a)=>Math.abs(n[a]-r)<Math.abs(n[o]-r)?a:o)}const nf=O.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{video:i}}}=ge;return S.jsx("div",{children:S.jsx("video",{...n,"data-chromatic":"ignore",style:t?{pointerEvents:"none"}:void 0,controls:!0,src:e,...i,ref:r})})});nf.displayName="Video";const rf=O.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{audio:i}}}=ge;return S.jsx("div",{children:S.jsx("audio",{...n,controls:!0,style:t?{pointerEvents:"none"}:void 0,src:e,...i,ref:r})})});rf.displayName="Audio";const of=O.forwardRef(({latitude:e,longitude:t,title:n,isReadOnly:r,...i},o)=>{const a=`https://www.google.com/maps/search/?api=1&query=${e},${t}`,{message:{blocks:{location:s}}}=ge;return S.jsxs("a",{...i,...s.container,style:r?{pointerEvents:"none"}:void 0,href:a,type:"_blank",rel:"noopener",ref:o,children:[S.jsx("p",{...s.title,children:n}),S.jsx(N0,{...s.icon})]})});of.displayName="Location";const af=O.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,messageId:a,isReadOnly:s,sendMessage:l,...c},f)=>{const{message:{blocks:{column:u}}}=ge;return S.jsx("div",{"data-horizontal":t,"data-vertical":n,...c,...u,ref:f,children:e.map((p,d)=>S.jsx(Kt,{block:{...p,direction:r,timestamp:o,sender:i,messageId:a,isReadOnly:s,sendMessage:l}},d))})});af.displayName="Column";const sf=O.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,metadata:a,messageId:s,isReadOnly:l,sendMessage:c,...f},u)=>{const{message:{blocks:{row:p}}}=ge;return S.jsx("div",{"data-horizontal":t,"data-vertical":n,...f,...p,ref:u,children:e.map((d,m)=>S.jsx(Kt,{block:{...d,direction:r,timestamp:o,sender:i,messageId:s,isReadOnly:l,sendMessage:c}},m))})});sf.displayName="Row";function A1(e){return Object.prototype.toString.call(e)==="[object Object]"}function lf(e){return A1(e)||Array.isArray(e)}function I1(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Jo(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const i=JSON.stringify(Object.keys(e.breakpoints||{})),o=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==o?!1:n.every(a=>{const s=e[a],l=t[a];return typeof s=="function"?`${s}`==`${l}`:!lf(s)||!lf(l)?s===l:Jo(s,l)})}function cf(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function T1(e,t){if(e.length!==t.length)return!1;const n=cf(e),r=cf(t);return n.every((i,o)=>{const a=r[o];return Jo(i,a)})}function Zo(e){return typeof e=="number"}function uf(e){return typeof e=="string"}function Xo(e){return typeof e=="boolean"}function ff(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ne(e){return Math.abs(e)}function ea(e){return Math.sign(e)}function Ur(e,t){return Ne(e-t)}function O1(e,t){if(e===0||t===0||Ne(e)<=Ne(t))return 0;const n=Ur(Ne(e),Ne(t));return Ne(n/e)}function Zn(e){return Wr(e).map(Number)}function St(e){return e[Hr(e)]}function Hr(e){return Math.max(0,e.length-1)}function Wr(e){return Object.keys(e)}function df(e,t){return[e,t].reduce((n,r)=>(Wr(r).forEach(i=>{const o=n[i],a=r[i],s=ff(o)&&ff(a);n[i]=s?df(o,a):a}),n),{})}function pf(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function D1(e,t){const n={start:r,center:i,end:o};function r(){return 0}function i(c){return o(c)/2}function o(c){return t-c}function a(){return t*Number(e)}function s(c){return Zo(e)?a():n[e](c)}return{measure:s}}function M1(e,t){const n=e==="y"?"y":"x",r=e==="y"?"x":"y",i=s(),o=l();function a(f){const{width:u,height:p}=f;return n==="x"?u:p}function s(){return n==="y"?"top":t==="rtl"?"right":"left"}function l(){return n==="y"?"bottom":t==="rtl"?"left":"right"}return{scroll:n,cross:r,startEdge:i,endEdge:o,measureSize:a}}function Dt(e,t){const n=Ne(e-t);function r(c){return c<e}function i(c){return c>t}function o(c){return r(c)||i(c)}function a(c){return o(c)?r(c)?e:t:c}function s(c){return n?c-n*Math.ceil((c-t)/n):c}return{length:n,max:t,min:e,constrain:a,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:s}}function hf(e,t,n){const{constrain:r}=Dt(0,e),i=e+1;let o=a(t);function a(p){return n?Ne((i+p)%i):r(p)}function s(){return o}function l(p){return o=a(p),u}function c(p){return f().set(s()+p)}function f(){return hf(e,s(),n)}const u={get:s,set:l,add:c,clone:f};return u}function P1(e){const t=e==="rtl"?-1:1;function n(i){return i*t}return{apply:n}}function Xn(){let e=[];function t(i,o,a,s={passive:!0}){return i.addEventListener(o,a,s),e.push(()=>i.removeEventListener(o,a,s)),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function N1(e,t,n,r,i,o,a,s,l,c,f,u,p,d,m,h,g,y,b){const{cross:w}=e,C=["INPUT","SELECT","TEXTAREA"],x={passive:!1},E=Xn(),T=Xn(),_=Dt(50,225).constrain(m.measure(20)),$={mouse:300,touch:400},I={mouse:500,touch:600},D=h?43:25;let z=!1,P=0,L=0,M=!1,R=!1,U=!1,B=!1;function V(Q,j){if(!j)return;function X(pe){(Xo(j)||j(Q,pe))&&te(pe)}const ae=n;E.add(ae,"dragstart",pe=>pe.preventDefault(),x).add(ae,"touchmove",()=>{},x).add(ae,"touchend",()=>{}).add(ae,"touchstart",X).add(ae,"mousedown",X).add(ae,"touchcancel",Z).add(ae,"contextmenu",Z).add(ae,"click",re,!0)}function v(){E.clear(),T.clear()}function N(){const Q=B?r:n;T.add(Q,"touchmove",Y,x).add(Q,"touchend",Z).add(Q,"mousemove",Y,x).add(Q,"mouseup",Z)}function H(Q){const j=Q.nodeName||"";return C.includes(j)}function k(){return(h?I:$)[B?"mouse":"touch"]}function W(Q,j){const X=p.add(ea(Q)*-1),ae=u.byDistance(Q,!h).distance;return h||Ne(Q)<_?ae:y&&j?ae*.5:u.byIndex(X.get(),0).distance}function te(Q){const j=pf(Q,i);B=j,!(j&&Q.button!==0)&&(H(Q.target)||(U=h&&j&&!Q.buttons&&z,z=Ur(o.get(),s.get())>=2,M=!0,a.pointerDown(Q),f.useFriction(0).useDuration(0),o.set(s),N(),P=a.readPoint(Q),L=a.readPoint(Q,w),d.emit("pointerDown")))}function Y(Q){const j=a.readPoint(Q),X=a.readPoint(Q,w),ae=Ur(j,P),pe=Ur(X,L);if(!R&&!B&&(!Q.cancelable||(R=ae>pe,!R)))return Z(Q);const ie=a.pointerMove(Q);ae>g&&(U=!0),f.useFriction(.3).useDuration(1),l.start(),o.add(t.apply(ie)),Q.preventDefault()}function Z(Q){const X=u.byDistance(0,!1).index!==p.get(),ae=a.pointerUp(Q)*k(),pe=W(t.apply(ae),X),ie=O1(ae,pe),K=D-10*ie,ce=b+ie/50;R=!1,M=!1,T.clear(),f.useDuration(K).useFriction(ce),c.distance(pe,!h),B=!1,d.emit("pointerUp")}function re(Q){U&&(Q.stopPropagation(),Q.preventDefault())}function oe(){return M}return{init:V,pointerDown:oe,destroy:v}}function _1(e,t){let r,i;function o(u){return u.timeStamp}function a(u,p){const m=`client${(p||e.scroll)==="x"?"X":"Y"}`;return(pf(u,t)?u:u.touches[0])[m]}function s(u){return r=u,i=u,a(u)}function l(u){const p=a(u)-a(i),d=o(u)-o(r)>170;return i=u,d&&(r=u),p}function c(u){if(!r||!i)return 0;const p=a(i)-a(r),d=o(u)-o(r),m=o(u)-o(i)>170,h=p/d;return d&&!m&&Ne(h)>.1?h:0}return{pointerDown:s,pointerMove:l,pointerUp:c,readPoint:a}}function L1(e){function t(r){return e*(r/100)}return{measure:t}}function F1(e,t,n,r,i){let o,a,s=[],l=!1;function c(d){return i.measureSize(d.getBoundingClientRect())}function f(d,m){if(!m)return;a=c(e),s=r.map(c);function h(y){for(const b of y){const w=b.target===e,C=r.indexOf(b.target),x=w?a:s[C],E=c(w?e:r[C]);if(x!==E){n.requestAnimationFrame(()=>{d.reInit(),t.emit("resize")});break}}}o=new ResizeObserver(y=>{l||(Xo(m)||m(d,y))&&h(y)}),[e].concat(r).forEach(y=>o.observe(y))}function u(){o&&o.disconnect(),l=!0}return{init:f,destroy:u}}function R1(e,t,n,r){let i=!0,o=0,a=0,s=n,l=r,c=e.get(),f=0;function u(){const x=t.get()-e.get(),E=!s;let T=0;return E?(o=0,e.set(t),T=x):(o+=x/s,o*=l,c+=o,e.add(o),T=c-f),a=ea(T),f=c,i=Ne(x)<.001,C}function p(){return i}function d(){return s}function m(){return a}function h(){return o}function g(){return b(n)}function y(){return w(r)}function b(x){return s=x,C}function w(x){return l=x,C}const C={direction:m,duration:d,velocity:h,seek:u,settled:p,useBaseFriction:y,useBaseDuration:g,useFriction:w,useDuration:b};return C}function B1(e,t,n,r,i){const o=i.measure(10),a=i.measure(50),s=Dt(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function f(d){if(!c())return;const m=e.reachedMin(t.get())?"min":"max",h=Ne(e[m]-t.get()),g=n.get()-t.get(),y=s.constrain(h/a);n.subtract(g*y),!d&&Ne(g)<o&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function u(d){l=!d}return{constrain:f,toggleActive:u}}function $1(e,t,n,r){const i=Dt(-t+e,n[0]),o=l(),a=c();function s(){const u=o[0],p=St(o),d=o.lastIndexOf(u),m=o.indexOf(p)+1;return Dt(d,m)}function l(){return n.map(i.constrain).map(u=>parseFloat(u.toFixed(3)))}function c(){if(t<=e)return[i.max];if(r==="keepSnaps")return o;const{min:u,max:p}=s();return o.slice(u,p)}return{snapsContained:a}}function z1(e,t,n){const r=t[0],i=n?r-e:St(t);return{limit:Dt(i,r)}}function j1(e,t,n,r){const o=t.min+.1,a=t.max+.1,{reachedMin:s,reachedMax:l}=Dt(o,a);function c(p){return p===1?l(n.get()):p===-1?s(n.get()):!1}function f(p){if(!c(p))return;const d=e*(p*-1);r.forEach(m=>m.add(d))}return{loop:f}}function U1(e){const{max:t,length:n}=e;function r(o){return(o-t)/-n}return{get:r}}function H1(e,t,n,r,i,o,a){const{startEdge:s,endEdge:l}=e,{groupSlides:c}=o,f=d().map(t.measure),u=m(),p=h();function d(){return c(r).map(y=>St(y)[l]-y[0][s]).map(Ne)}function m(){return r.map(y=>n[s]-y[s]).map(y=>-Ne(y))}function h(){const b=St(u)-St(i);return c(u).map(w=>w[0]).map((w,C,x)=>{const E=!C,T=C===Hr(x);return a&&E?0:a&&T?b:w+f[C]})}return{snaps:u,snapsAligned:p}}function W1(e,t,n,r,i){const{reachedAny:o,removeOffset:a,constrain:s}=r;function l(m){return m.concat().sort((h,g)=>Ne(h)-Ne(g))[0]}function c(m){const h=e?a(m):s(m),g=t.map(b=>b-h).map(b=>f(b,0)).map((b,w)=>({diff:b,index:w})).sort((b,w)=>Ne(b.diff)-Ne(w.diff)),{index:y}=g[0];return{index:y,distance:h}}function f(m,h){const g=[m,m+n,m-n];if(!e)return g[0];if(!h)return l(g);const y=g.filter(b=>ea(b)===h);return l(y)}function u(m,h){const g=t[m]-i.get(),y=f(g,h);return{index:m,distance:y}}function p(m,h){const g=i.get()+m,{index:y,distance:b}=c(g),w=!e&&o(g);if(!h||w)return{index:y,distance:m};const C=t[y]-b,x=m+f(C,0);return{index:y,distance:x}}return{byDistance:p,byIndex:u,shortcut:f}}function V1(e,t,n,r,i,o,a){function s(u){const p=u.distance,d=u.index!==t.get();o.add(p),p&&(i.duration()?e.start():(e.update(),e.render(1),e.update())),d&&(n.set(t.get()),t.set(u.index),a.emit("select"))}function l(u,p){const d=r.byDistance(u,p);s(d)}function c(u,p){const d=t.clone().set(u),m=r.byIndex(d.get(),p);s(m)}return{distance:l,index:c}}function Vr(e){let t=e;function n(){return t}function r(l){t=a(l)}function i(l){t+=a(l)}function o(l){t-=a(l)}function a(l){return Zo(l)?l:l.get()}return{get:n,set:r,add:i,subtract:o}}function mf(e,t,n){const r=e.scroll==="x"?a:s,i=n.style;let o=!1;function a(p){return`translate3d(${p}px,0px,0px)`}function s(p){return`translate3d(0px,${p}px,0px)`}function l(p){o||(i.transform=r(t.apply(p)))}function c(p){o=!p}function f(){o||(i.transform="",n.getAttribute("style")||n.removeAttribute("style"))}return{clear:f,to:l,toggleActive:c}}function q1(e,t,n,r,i,o,a,s,l){const c=Zn(i),f=Zn(i).reverse(),u=h().concat(g());function p(x,E){return x.reduce((T,_)=>T-i[_],E)}function d(x,E){return x.reduce((T,_)=>p(T,E)>0?T.concat([_]):T,[])}function m(x,E){const T=E==="start",_=T?-r:r,$=a.findSlideBounds([_]);return x.map(I=>{const D=T?0:-r,z=T?r:0,L=$.filter(M=>M.index===I)[0][T?"end":"start"];return{index:I,slideLocation:Vr(-1),translate:mf(e,t,l[I]),target:()=>s.get()>L?D:z}})}function h(){const x=o[0]-1,E=d(f,x);return m(E,"end")}function g(){const x=n-o[0]-1,E=d(c,x);return m(E,"start")}function y(){return u.every(({index:x})=>{const E=c.filter(T=>T!==x);return p(E,n)<=.1})}function b(){u.forEach(x=>{const{target:E,translate:T,slideLocation:_}=x,$=E();$!==_.get()&&(T.to($),_.set($))})}function w(){u.forEach(x=>x.translate.clear())}return{canLoop:y,clear:w,loop:b,loopPoints:u}}function K1(e,t){let n,r=!1;function i(s,l){if(!l)return;function c(f){for(const u of f)if(u.type==="childList"){s.reInit(),t.emit("slidesChanged");break}}n=new MutationObserver(f=>{r||(Xo(l)||l(s,f))&&c(f)}),n.observe(e,{childList:!0})}function o(){n&&n.disconnect(),r=!0}return{init:i,destroy:o}}function Y1(e,t,n,r,i,o,a){const{removeOffset:s,constrain:l}=i,c=.5,f=o?[0,t,-t]:[0],u=d(f,a);function p(g){const y=g||0;return n.map(b=>Dt(c,b-c).constrain(b*y))}function d(g,y){const b=g||f,w=p(y);return b.reduce((C,x)=>{const E=r.map((T,_)=>({start:T-n[_]+w[_]+x,end:T+e-w[_]+x,index:_}));return C.concat(E)},[])}function m(g,y){const b=o?s(g):l(g);return(y||u).reduce((C,x)=>{const{index:E,start:T,end:_}=x,$=C.includes(E),I=T<b&&_>b;return!$&&I?C.concat([E]):C},[])}return{check:m,findSlideBounds:d}}function G1(e,t,n,r,i,o){const{measureSize:a,startEdge:s,endEdge:l}=e,c=n[0]&&i,f=m(),u=h(),p=n.map(a),d=g();function m(){if(!c)return 0;const b=n[0];return Ne(t[s]-b[s])}function h(){if(!c)return 0;const b=o.getComputedStyle(St(r));return parseFloat(b.getPropertyValue(`margin-${l}`))}function g(){return n.map((b,w,C)=>{const x=!w,E=w===Hr(C);return x?p[w]+f:E?p[w]+u:C[w+1][s]-b[s]}).map(Ne)}return{slideSizes:p,slideSizesWithGaps:d}}function Q1(e,t,n){const r=Zo(n);function i(l,c){return Zn(l).filter(f=>f%c===0).map(f=>l.slice(f,f+c))}function o(l){return Zn(l).reduce((c,f)=>{const p=t.slice(St(c),f+1).reduce((d,m)=>d+m,0);return!f||p>e?c.concat(f):c},[]).map((c,f,u)=>l.slice(c,u[f+1]))}function a(l){return r?i(l,n):o(l)}return{groupSlides:a}}function J1(e,t,n,r,i,o,a,s){const{align:l,axis:c,direction:f,startIndex:u,inViewThreshold:p,loop:d,duration:m,dragFree:h,dragThreshold:g,slidesToScroll:y,skipSnaps:b,containScroll:w}=o,C=t.getBoundingClientRect(),x=n.map(ce=>ce.getBoundingClientRect()),E=P1(f),T=M1(c,f),_=T.measureSize(C),$=L1(_),I=D1(l,_),D=!d&&!!w,z=d||!!w,{slideSizes:P,slideSizesWithGaps:L}=G1(T,C,x,n,z,i),M=Q1(_,L,y),{snaps:R,snapsAligned:U}=H1(T,I,C,x,L,M,D),B=-St(R)+St(L),{snapsContained:V}=$1(_,B,U,w),v=D?V:U,{limit:N}=z1(B,v,d),H=hf(Hr(v),u,d),k=H.clone(),W=Zn(n),te=({dragHandler:ce,scrollBody:he,scrollBounds:Ce,eventHandler:ke,animation:je,options:{loop:Ye}})=>{const ee=ce.pointerDown();Ye||Ce.constrain(ee);const se=he.seek().settled();se&&!ee&&(je.stop(),ke.emit("settle")),se||ke.emit("scroll")},Y=({scrollBody:ce,translate:he,location:Ce,offsetLocation:ke,scrollLooper:je,slideLooper:Ye,options:{loop:ee}},se)=>{const F=ce.velocity();ke.set(Ce.get()-F+F*se),ee&&(je.loop(ce.direction()),Ye.loop()),he.to(ke.get())},Z={start:()=>s.start(K),stop:()=>s.stop(K),update:()=>te(K),render:ce=>Y(K,ce)},re=.68,oe=v[H.get()],G=Vr(oe),Q=Vr(oe),j=Vr(oe),X=R1(G,j,m,re),ae=W1(d,v,B,N,j),pe=V1(Z,H,k,ae,X,j,a),ie=Y1(_,B,P,R,N,d,p),K={ownerDocument:r,ownerWindow:i,eventHandler:a,containerRect:C,slideRects:x,animation:Z,axis:T,direction:E,dragHandler:N1(T,E,e,r,i,j,_1(T,i),G,Z,pe,X,ae,H,a,$,h,g,b,re),eventStore:Xn(),percentOfView:$,index:H,indexPrevious:k,limit:N,location:G,offsetLocation:Q,options:o,resizeHandler:F1(t,a,i,n,T),scrollBody:X,scrollBounds:B1(N,G,j,X,$),scrollLooper:j1(B,N,Q,[G,Q,j]),scrollProgress:U1(N),scrollSnaps:v,scrollTarget:ae,scrollTo:pe,slideLooper:q1(T,E,_,B,L,v,ie,Q,n),slidesHandler:K1(t,a),slidesInView:ie,slideIndexes:W,slidesToScroll:M,target:j,translate:mf(T,E,t)};return K}function Z1(e){const t=16.666666666666668;let n=[],r=null,i=0,o=0;function a(u){r||(r=u);const p=u-r;for(r=u,i+=p;i>=t;)n.forEach(({animation:m})=>m.update()),i-=t;const d=Ne(i/t);n.forEach(({animation:m})=>m.render(d)),o&&e.requestAnimationFrame(a)}function s(u){n.includes(u)||n.push(u),!o&&(o=e.requestAnimationFrame(a))}function l(u){n=n.filter(p=>p!==u),!n.length&&(e.cancelAnimationFrame(o),r=null,i=0,o=0)}function c(){r=null,i=0}return{start:s,stop:l,reset:c,window:e}}function X1(){const e={};let t;function n(l){t=l}function r(l){return e[l]||[]}function i(l){return r(l).forEach(c=>c(t,l)),s}function o(l,c){return e[l]=r(l).concat([c]),s}function a(l,c){return e[l]=r(l).filter(f=>f!==c),s}const s={init:n,emit:i,off:a,on:o};return s}const ek={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,breakpoints:{},dragFree:!1,dragThreshold:10,inViewThreshold:0,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0};function tk(e){function t(o,a){return df(o,a||{})}function n(o){const a=o.breakpoints||{},s=Wr(a).filter(l=>e.matchMedia(l).matches).map(l=>a[l]).reduce((l,c)=>t(l,c),{});return t(o,s)}function r(o){return o.map(a=>Wr(a.breakpoints||{})).reduce((a,s)=>a.concat(s),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function nk(e){let t=[];function n(o,a){return t=o.filter(({options:s})=>e.optionsAtMedia(s).active!==!1),t.forEach(s=>s.init(a,e)),o.reduce((s,l)=>Object.assign(s,{[l.name]:l}),{})}function r(){t=t.filter(o=>o.destroy())}return{init:n,destroy:r}}function un(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=tk(i),a=nk(o),s=Xn(),l=Xn(),c=X1(),{animationRealms:f}=un,{mergeOptions:u,optionsAtMedia:p,optionsMediaQueries:d}=o,{on:m,off:h,emit:g}=c,y=P;let b=!1,w,C=u(ek,un.globalOptions),x=u(C),E=[],T,_,$;function I(){const{container:X,slides:ae}=x;_=(uf(X)?e.querySelector(X):X)||e.children[0];const ie=uf(ae)?_.querySelectorAll(ae):ae;$=[].slice.call(ie||_.children)}function D(X,ae){const pe=J1(e,_,$,r,i,X,c,ae);if(X.loop&&!pe.slideLooper.canLoop()){const ie=Object.assign({},X,{loop:!1});return D(ie,ae)}return pe}function z(X,ae){if(b)return;const pe=f.find(K=>K.window===i),ie=pe||Z1(i);pe||f.push(ie),C=u(C,X),x=p(C),E=ae||E,I(),w=D(x,ie),d([C,...E.map(({options:K})=>K)]).forEach(K=>s.add(K,"change",P)),x.active&&(w.translate.to(w.location.get()),w.eventHandler.init(j),w.resizeHandler.init(j,x.watchResize),w.slidesHandler.init(j,x.watchSlides),l.add(r,"visibilitychange",()=>{r.hidden&&ie.reset()}),w.options.loop&&w.slideLooper.loop(),_.offsetParent&&$.length&&w.dragHandler.init(j,x.watchDrag),T=a.init(E,j))}function P(X,ae){const pe=te();L(),z(u({startIndex:pe},X),ae),c.emit("reInit")}function L(){w.dragHandler.destroy(),w.animation.stop(),w.eventStore.clear(),w.translate.clear(),w.slideLooper.clear(),w.resizeHandler.destroy(),w.slidesHandler.destroy(),a.destroy(),s.clear(),l.clear()}function M(){b||(b=!0,s.clear(),L(),c.emit("destroy"))}function R(X){const ae=w[X?"target":"location"].get(),pe=x.loop?"removeOffset":"constrain";return w.slidesInView.check(w.limit[pe](ae))}function U(X){const ae=R(X);return w.slideIndexes.filter(pe=>!ae.includes(pe))}function B(X,ae,pe){!x.active||b||(w.scrollBody.useBaseFriction().useDuration(ae?0:x.duration),w.scrollTo.index(X,pe||0))}function V(X){const ae=w.index.add(1).get();B(ae,X===!0,-1)}function v(X){const ae=w.index.add(-1).get();B(ae,X===!0,1)}function N(){return w.index.add(1).get()!==te()}function H(){return w.index.add(-1).get()!==te()}function k(){return w.scrollSnaps.map(w.scrollProgress.get)}function W(){return w.scrollProgress.get(w.location.get())}function te(){return w.index.get()}function Y(){return w.indexPrevious.get()}function Z(){return T}function re(){return w}function oe(){return e}function G(){return _}function Q(){return $}const j={canScrollNext:N,canScrollPrev:H,containerNode:G,internalEngine:re,destroy:M,off:h,on:m,emit:g,plugins:Z,previousScrollSnap:Y,reInit:y,rootNode:oe,scrollNext:V,scrollPrev:v,scrollProgress:W,scrollSnapList:k,scrollTo:B,selectedScrollSnap:te,slideNodes:Q,slidesInView:R,slidesNotInView:U};return z(t,n),setTimeout(()=>c.emit("init"),0),j}un.animationRealms=[],un.globalOptions=void 0;function ta(e={},t=[]){const n=O.useRef(e),r=O.useRef(t),[i,o]=O.useState(),[a,s]=O.useState(),l=O.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return O.useEffect(()=>{if(I1()&&a){un.globalOptions=ta.globalOptions;const c=un(a,n.current,r.current);return o(c),()=>c.destroy()}else o(void 0)},[a,o]),O.useEffect(()=>{Jo(n.current,e)||(n.current=e,l())},[e,l]),O.useEffect(()=>{T1(r.current,t)||(r.current=t,l())},[t,l]),[s,i]}ta.globalOptions=void 0;const gf=O.forwardRef(({blocks:e,direction:t,sender:n,timestamp:r,messageId:i,isReadOnly:o,sendMessage:a,addMessageFeedback:s},l)=>{const[c,f]=ta({skipSnaps:!0,loop:!0}),[u,p]=O.useState(!0),[d,m]=O.useState(!0),h=O.useCallback(()=>f==null?void 0:f.scrollPrev(),[f]),g=O.useCallback(()=>f==null?void 0:f.scrollNext(),[f]),{message:{blocks:{carousel:y}}}=ge,b=O.useCallback(w=>{p(!w.canScrollPrev()),m(!w.canScrollNext())},[]);return O.useEffect(()=>{f&&(b(f),f.on("reInit",b),f.on("select",b))},[f,b]),S.jsxs("div",{...y==null?void 0:y.container,"data-container":"carousel",ref:c,children:[S.jsx("div",{ref:l,...y==null?void 0:y.slidesContainer,children:e.map((w,C)=>S.jsx(Kt,{block:{...w,direction:t,timestamp:r,sender:n,messageId:i,sendMessage:a,isReadOnly:o}},C))}),e.length>1&&S.jsxs(S.Fragment,{children:[S.jsx(x0,{...y==null?void 0:y.backButton,"data-disabled":u?"":void 0,onClick:h}),S.jsx(k0,{...y==null?void 0:y.nextButton,"data-disabled":d?"":void 0,onClick:g})]})]})});gf.displayName="Carousel";const yf=Math.floor;function bf(e){return vf(e)?(e.nodeName||"").toLowerCase():"#document"}function er(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rk(e){var t;return(t=(vf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vf(e){return e instanceof Node||e instanceof er(e).Node}function at(e){return e instanceof Element||e instanceof er(e).Element}function fn(e){return e instanceof HTMLElement||e instanceof er(e).HTMLElement}function na(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof er(e).ShadowRoot}function ik(e){return["html","body","#document"].includes(bf(e))}function ok(e){return er(e).getComputedStyle(e)}function ak(e){if(bf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||na(e)&&e.host||rk(e);return na(t)?t.host:t}function Mt(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function Je(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&na(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function wf(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function sk(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function xf(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(wf())||t.test(sk()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function kf(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function Sf(){return/apple/i.test(navigator.vendor)}function lk(){return wf().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Ef(e,t){return["mouse","pen"].includes(e)}function ck(e){return"nativeEvent"in e}function uk(e){return e.matches("html,body")}function lt(e){return(e==null?void 0:e.ownerDocument)||document}function ra(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Cf(e){return"composedPath"in e?e.composedPath()[0]:e.target}const fk="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Af(e){return fn(e)&&e.matches(fk)}function ze(e){e.preventDefault(),e.stopPropagation()}const dn=Math.min,tt=Math.max,qr=Math.round,Kr=Math.floor,ht=e=>({x:e,y:e});function If(e,t,n){return tt(e,dn(t,n))}function Yr(e,t){return typeof e=="function"?e(t):e}function tr(e){return e.split("-")[0]}function ia(e){return e.split("-")[1]}function Tf(e){return e==="x"?"y":"x"}function dk(e){return e==="y"?"height":"width"}const pk=new Set(["top","bottom"]);function nr(e){return pk.has(tr(e))?"y":"x"}function hk(e){return Tf(nr(e))}function mk(e){return{top:0,right:0,bottom:0,left:0,...e}}function gk(e){return typeof e!="number"?mk(e):{top:e,right:e,bottom:e,left:e}}function Gr(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Of(e,t,n){let{reference:r,floating:i}=e;const o=nr(t),a=hk(t),s=dk(a),l=tr(t),c=o==="y",f=r.x+r.width/2-i.width/2,u=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2;let d;switch(l){case"top":d={x:f,y:r.y-i.height};break;case"bottom":d={x:f,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:u};break;case"left":d={x:r.x-i.width,y:u};break;default:d={x:r.x,y:r.y}}switch(ia(t)){case"start":d[a]-=p*(n&&c?-1:1);break;case"end":d[a]+=p*(n&&c?-1:1);break}return d}const yk=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:u}=Of(c,r,l),p=r,d={},m=0;for(let h=0;h<s.length;h++){const{name:g,fn:y}=s[h],{x:b,y:w,data:C,reset:x}=await y({x:f,y:u,initialPlacement:r,placement:p,strategy:i,middlewareData:d,rects:c,platform:a,elements:{reference:e,floating:t}});f=b??f,u=w??u,d={...d,[g]:{...d[g],...C}},x&&m<=50&&(m++,typeof x=="object"&&(x.placement&&(p=x.placement),x.rects&&(c=x.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:f,y:u}=Of(c,p,l)),h=-1)}return{x:f,y:u,placement:p,strategy:i,middlewareData:d}};async function Df(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:p=!1,padding:d=0}=Yr(t,e),m=gk(d),g=s[p?u==="floating"?"reference":"floating":u],y=Gr(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:f,strategy:l})),b=u==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),C=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},x=Gr(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:w,strategy:l}):b);return{top:(y.top-x.top+m.top)/C.y,bottom:(x.bottom-y.bottom+m.bottom)/C.y,left:(y.left-x.left+m.left)/C.x,right:(x.right-y.right+m.right)/C.x}}const bk=new Set(["left","top"]);async function vk(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=tr(n),s=ia(n),l=nr(n)==="y",c=bk.has(a)?-1:1,f=o&&l?-1:1,u=Yr(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof m=="number"&&(d=s==="end"?m*-1:m),l?{x:d*f,y:p*c}:{x:p*c,y:d*f}}const wk=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await vk(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},xk=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:y,y:b}=g;return{x:y,y:b}}},...l}=Yr(e,t),c={x:n,y:r},f=await Df(t,l),u=nr(tr(i)),p=Tf(u);let d=c[p],m=c[u];if(o){const g=p==="y"?"top":"left",y=p==="y"?"bottom":"right",b=d+f[g],w=d-f[y];d=If(b,d,w)}if(a){const g=u==="y"?"top":"left",y=u==="y"?"bottom":"right",b=m+f[g],w=m-f[y];m=If(b,m,w)}const h=s.fn({...t,[p]:d,[u]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:o,[u]:a}}}}}},kk=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:s}=t,{apply:l=()=>{},...c}=Yr(e,t),f=await Df(t,c),u=tr(i),p=ia(i),d=nr(i)==="y",{width:m,height:h}=o.floating;let g,y;u==="top"||u==="bottom"?(g=u,y=p===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(y=u,g=p==="end"?"top":"bottom");const b=h-f.top-f.bottom,w=m-f.left-f.right,C=dn(h-f[g],b),x=dn(m-f[y],w),E=!t.middlewareData.shift;let T=C,_=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=b),E&&!p){const I=tt(f.left,0),D=tt(f.right,0),z=tt(f.top,0),P=tt(f.bottom,0);d?_=m-2*(I!==0||D!==0?I+D:tt(f.left,f.right)):T=h-2*(z!==0||P!==0?z+P:tt(f.top,f.bottom))}await l({...t,availableWidth:_,availableHeight:T});const $=await a.getDimensions(s.floating);return m!==$.width||h!==$.height?{reset:{rects:!0}}:{}}}};function Qr(){return typeof window<"u"}function pn(e){return Mf(e)?(e.nodeName||"").toLowerCase():"#document"}function nt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mt(e){var t;return(t=(Mf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Mf(e){return Qr()?e instanceof Node||e instanceof nt(e).Node:!1}function ct(e){return Qr()?e instanceof Element||e instanceof nt(e).Element:!1}function gt(e){return Qr()?e instanceof HTMLElement||e instanceof nt(e).HTMLElement:!1}function Pf(e){return!Qr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof nt(e).ShadowRoot}const Sk=new Set(["inline","contents"]);function rr(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ut(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Sk.has(i)}const Ek=new Set(["table","td","th"]);function Ck(e){return Ek.has(pn(e))}const Ak=[":popover-open",":modal"];function Jr(e){return Ak.some(t=>{try{return e.matches(t)}catch{return!1}})}const Ik=["transform","translate","scale","rotate","perspective"],Tk=["transform","translate","scale","rotate","perspective","filter"],Ok=["paint","layout","strict","content"];function oa(e){const t=aa(),n=ct(e)?ut(e):e;return Ik.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Tk.some(r=>(n.willChange||"").includes(r))||Ok.some(r=>(n.contain||"").includes(r))}function Dk(e){let t=Pt(e);for(;gt(t)&&!hn(t);){if(oa(t))return t;if(Jr(t))return null;t=Pt(t)}return null}function aa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Mk=new Set(["html","body","#document"]);function hn(e){return Mk.has(pn(e))}function ut(e){return nt(e).getComputedStyle(e)}function Zr(e){return ct(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pt(e){if(pn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Pf(e)&&e.host||mt(e);return Pf(t)?t.host:t}function Nf(e){const t=Pt(e);return hn(t)?e.ownerDocument?e.ownerDocument.body:e.body:gt(t)&&rr(t)?t:Nf(t)}function Nt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Nf(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=nt(i);if(o){const s=sa(a);return t.concat(a,a.visualViewport||[],rr(i)?i:[],s&&n?Nt(s):[])}return t.concat(i,Nt(i,[],n))}function sa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _f(e){const t=ut(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=gt(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=qr(n)!==o||qr(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function la(e){return ct(e)?e:e.contextElement}function mn(e){const t=la(e);if(!gt(t))return ht(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=_f(t);let a=(o?qr(n.width):n.width)/r,s=(o?qr(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Pk=ht(0);function Lf(e){const t=nt(e);return!aa()||!t.visualViewport?Pk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Nk(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==nt(e)?!1:t}function qt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=la(e);let a=ht(1);t&&(r?ct(r)&&(a=mn(r)):a=mn(e));const s=Nk(o,n,r)?Lf(o):ht(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,f=i.width/a.x,u=i.height/a.y;if(o){const p=nt(o),d=r&&ct(r)?nt(r):r;let m=p,h=sa(m);for(;h&&r&&d!==m;){const g=mn(h),y=h.getBoundingClientRect(),b=ut(h),w=y.left+(h.clientLeft+parseFloat(b.paddingLeft))*g.x,C=y.top+(h.clientTop+parseFloat(b.paddingTop))*g.y;l*=g.x,c*=g.y,f*=g.x,u*=g.y,l+=w,c+=C,m=nt(h),h=sa(m)}}return Gr({width:f,height:u,x:l,y:c})}function Xr(e,t){const n=Zr(e).scrollLeft;return t?t.left+n:qt(mt(e)).left+n}function Ff(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Xr(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function _k(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=mt(r),s=t?Jr(t.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=ht(1);const f=ht(0),u=gt(r);if((u||!u&&!o)&&((pn(r)!=="body"||rr(a))&&(l=Zr(r)),gt(r))){const d=qt(r);c=mn(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}const p=a&&!u&&!o?Ff(a,l):ht(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+f.x+p.x,y:n.y*c.y-l.scrollTop*c.y+f.y+p.y}}function Lk(e){return Array.from(e.getClientRects())}function Fk(e){const t=mt(e),n=Zr(e),r=e.ownerDocument.body,i=tt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=tt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Xr(e);const s=-n.scrollTop;return ut(r).direction==="rtl"&&(a+=tt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}const Rf=25;function Rk(e,t){const n=nt(e),r=mt(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const f=aa();(!f||f&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=Xr(r);if(c<=0){const f=r.ownerDocument,u=f.body,p=getComputedStyle(u),d=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(r.clientWidth-u.clientWidth-d);m<=Rf&&(o-=m)}else c<=Rf&&(o+=c);return{width:o,height:a,x:s,y:l}}const Bk=new Set(["absolute","fixed"]);function $k(e,t){const n=qt(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=gt(e)?mn(e):ht(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:a,height:s,x:l,y:c}}function Bf(e,t,n){let r;if(t==="viewport")r=Rk(e,n);else if(t==="document")r=Fk(mt(e));else if(ct(t))r=$k(t,n);else{const i=Lf(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Gr(r)}function $f(e,t){const n=Pt(e);return n===t||!ct(n)||hn(n)?!1:ut(n).position==="fixed"||$f(n,t)}function zk(e,t){const n=t.get(e);if(n)return n;let r=Nt(e,[],!1).filter(s=>ct(s)&&pn(s)!=="body"),i=null;const o=ut(e).position==="fixed";let a=o?Pt(e):e;for(;ct(a)&&!hn(a);){const s=ut(a),l=oa(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&Bk.has(i.position)||rr(a)&&!l&&$f(e,a))?r=r.filter(f=>f!==a):i=s,a=Pt(a)}return t.set(e,r),r}function jk(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?Jr(t)?[]:zk(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,f)=>{const u=Bf(t,f,i);return c.top=tt(u.top,c.top),c.right=dn(u.right,c.right),c.bottom=dn(u.bottom,c.bottom),c.left=tt(u.left,c.left),c},Bf(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Uk(e){const{width:t,height:n}=_f(e);return{width:t,height:n}}function Hk(e,t,n){const r=gt(t),i=mt(t),o=n==="fixed",a=qt(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=ht(0);function c(){l.x=Xr(i)}if(r||!r&&!o)if((pn(t)!=="body"||rr(i))&&(s=Zr(t)),r){const d=qt(t,!0,o,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&c();o&&!r&&i&&c();const f=i&&!r&&!o?Ff(i,s):ht(0),u=a.left+s.scrollLeft-l.x-f.x,p=a.top+s.scrollTop-l.y-f.y;return{x:u,y:p,width:a.width,height:a.height}}function ca(e){return ut(e).position==="static"}function zf(e,t){if(!gt(e)||ut(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return mt(e)===n&&(n=n.ownerDocument.body),n}function jf(e,t){const n=nt(e);if(Jr(e))return n;if(!gt(e)){let i=Pt(e);for(;i&&!hn(i);){if(ct(i)&&!ca(i))return i;i=Pt(i)}return n}let r=zf(e,t);for(;r&&Ck(r)&&ca(r);)r=zf(r,t);return r&&hn(r)&&ca(r)&&!oa(r)?n:r||Dk(e)||n}const Wk=async function(e){const t=this.getOffsetParent||jf,n=this.getDimensions,r=await n(e.floating);return{reference:Hk(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Vk(e){return ut(e).direction==="rtl"}const qk={convertOffsetParentRelativeRectToViewportRelativeRect:_k,getDocumentElement:mt,getClippingRect:jk,getOffsetParent:jf,getElementRects:Wk,getClientRects:Lk,getDimensions:Uk,getScale:mn,isElement:ct,isRTL:Vk};function Uf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kk(e,t){let n=null,r;const i=mt(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const c=e.getBoundingClientRect(),{left:f,top:u,width:p,height:d}=c;if(s||t(),!p||!d)return;const m=Kr(u),h=Kr(i.clientWidth-(f+p)),g=Kr(i.clientHeight-(u+d)),y=Kr(f),w={rootMargin:-m+"px "+-h+"px "+-g+"px "+-y+"px",threshold:tt(0,dn(1,l))||1};let C=!0;function x(E){const T=E[0].intersectionRatio;if(T!==l){if(!C)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!Uf(c,e.getBoundingClientRect())&&a(),C=!1}try{n=new IntersectionObserver(x,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,w)}n.observe(e)}return a(!0),o}function Yk(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=la(e),f=i||o?[...c?Nt(c):[],...Nt(t)]:[];f.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const u=c&&s?Kk(c,n):null;let p=-1,d=null;a&&(d=new ResizeObserver(y=>{let[b]=y;b&&b.target===c&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),c&&!l&&d.observe(c),d.observe(t));let m,h=l?qt(e):null;l&&g();function g(){const y=qt(e);h&&!Uf(h,y)&&n(),h=y,m=requestAnimationFrame(g)}return n(),()=>{var y;f.forEach(b=>{i&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),u==null||u(),(y=d)==null||y.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const Gk=wk,Qk=xk,Jk=kk,Zk=(e,t,n)=>{const r=new Map,i={platform:qk,...n},o={...i.platform,_c:r};return yk(e,t,{...i,platform:o})};var Xk=typeof document<"u",eS=function(){},ei=Xk?O.useLayoutEffect:eS;function ti(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ti(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!ti(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Hf(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Wf(e,t){const n=Hf(e);return Math.round(t*n)/n}function ua(e){const t=A.useRef(e);return ei(()=>{t.current=e}),t}function tS(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[f,u]=A.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=A.useState(r);ti(p,r)||d(r);const[m,h]=A.useState(null),[g,y]=A.useState(null),b=A.useCallback(B=>{B!==E.current&&(E.current=B,h(B))},[]),w=A.useCallback(B=>{B!==T.current&&(T.current=B,y(B))},[]),C=o||m,x=a||g,E=A.useRef(null),T=A.useRef(null),_=A.useRef(f),$=l!=null,I=ua(l),D=ua(i),z=ua(c),P=A.useCallback(()=>{if(!E.current||!T.current)return;const B={placement:t,strategy:n,middleware:p};D.current&&(B.platform=D.current),Zk(E.current,T.current,B).then(V=>{const v={...V,isPositioned:z.current!==!1};L.current&&!ti(_.current,v)&&(_.current=v,Ts.flushSync(()=>{u(v)}))})},[p,t,n,D,z]);ei(()=>{c===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,u(B=>({...B,isPositioned:!1})))},[c]);const L=A.useRef(!1);ei(()=>(L.current=!0,()=>{L.current=!1}),[]),ei(()=>{if(C&&(E.current=C),x&&(T.current=x),C&&x){if(I.current)return I.current(C,x,P);P()}},[C,x,P,I,$]);const M=A.useMemo(()=>({reference:E,floating:T,setReference:b,setFloating:w}),[b,w]),R=A.useMemo(()=>({reference:C,floating:x}),[C,x]),U=A.useMemo(()=>{const B={position:n,left:0,top:0};if(!R.floating)return B;const V=Wf(R.floating,f.x),v=Wf(R.floating,f.y);return s?{...B,transform:"translate("+V+"px, "+v+"px)",...Hf(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:v}},[n,s,R.floating,f.x,f.y]);return A.useMemo(()=>({...f,update:P,refs:M,elements:R,floatingStyles:U}),[f,P,M,R,U])}const nS=(e,t)=>({...Gk(e),options:[e,t]}),rS=(e,t)=>({...Qk(e),options:[e,t]}),iS=(e,t)=>({...Jk(e),options:[e,t]});/*!
255
260
  * tabbable 6.3.0
256
261
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
257
- */var rS=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],fa=rS.join(","),Kf=typeof Element>"u",ir=Kf?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ni=!Kf&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},or=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",a=o||n&&t&&or(t.parentNode);return a},iS=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},oS=function(t,n,r){if(or(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(fa));return n&&ir.call(t,fa)&&i.unshift(t),i=i.filter(r),i},da=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var a=o.shift();if(!or(a,!1))if(a.tagName==="SLOT"){var s=a.assignedElements(),l=s.length?s:a.children,c=da(l,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:a,candidates:c})}else{var f=ir.call(a,fa);f&&r.filter(a)&&(n||!t.includes(a))&&i.push(a);var u=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),p=!or(u,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(u&&p){var d=da(u===!0?a.children:u.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:a,candidates:d})}else o.unshift.apply(o,a.children)}}return i},Yf=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Gf=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||iS(t))&&!Yf(t)?0:t.tabIndex},aS=function(t,n){var r=Gf(t);return r<0&&n&&!Yf(t)?0:r},sS=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Qf=function(t){return t.tagName==="INPUT"},lS=function(t){return Qf(t)&&t.type==="hidden"},cS=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},uS=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},fS=function(t){if(!t.name)return!0;var n=t.form||ni(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var o=uS(i,t.form);return!o||o===t},dS=function(t){return Qf(t)&&t.type==="radio"},pS=function(t){return dS(t)&&!fS(t)},hS=function(t){var n,r=t&&ni(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var a,s,l;for(o=!!((a=i)!==null&&a!==void 0&&(s=a.ownerDocument)!==null&&s!==void 0&&s.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var c,f,u;r=ni(i),i=(c=r)===null||c===void 0?void 0:c.host,o=!!((f=i)!==null&&f!==void 0&&(u=f.ownerDocument)!==null&&u!==void 0&&u.contains(i))}}return o},Jf=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},mS=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var a=ir.call(t,"details>summary:first-of-type"),s=a?t.parentElement:t;if(ir.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var c=t.parentElement,f=ni(t);if(c&&!c.shadowRoot&&i(c)===!0)return Jf(t);t.assignedSlot?t=t.assignedSlot:!c&&f!==t.ownerDocument?t=f.host:t=c}t=l}if(hS(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Jf(t);return!1},gS=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return ir.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},yS=function(t,n){return!(n.disabled||or(n)||lS(n)||mS(n,t)||cS(n)||gS(n))},Zf=function(t,n){return!(pS(n)||Gf(n)<0||!yS(t,n))},bS=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Xf=function(t){var n=[],r=[];return t.forEach(function(i,o){var a=!!i.scopeParent,s=a?i.scopeParent:i,l=aS(s,a),c=a?Xf(i.candidates):s;l===0?a?n.push.apply(n,c):n.push(s):r.push({documentOrder:o,tabIndex:l,item:i,isScope:a,content:c})}),r.sort(sS).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},pa=function(t,n){n=n||{};var r;return n.getShadowRoot?r=da([t],n.includeContainer,{filter:Zf.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:bS}):r=oS(t,n.includeContainer,Zf.bind(null,n)),Xf(r)};const ha="ArrowUp",ri="ArrowDown",gn="ArrowLeft",ar="ArrowRight";function ii(e,t,n){return Math.floor(e/t)!==n}function sr(e,t){return t<0||t>=e.current.length}function ma(e,t){return je(e,{disabledIndices:t})}function ed(e,t){return je(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function je(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const a=e.current;let s=n;do{var l,c;s=s+(r?-o:o)}while(s>=0&&s<=a.length-1&&(i?i.includes(s):a[s]==null||(l=a[s])!=null&&l.hasAttribute("disabled")||((c=a[s])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return s}function vS(e,t){let{event:n,orientation:r,loop:i,cols:o,disabledIndices:a,minIndex:s,maxIndex:l,prevIndex:c,stopEvent:f=!1}=t,u=c;if(n.key===ha){if(f&&Re(n),c===-1)u=l;else if(u=je(e,{startingIndex:u,amount:o,decrement:!0,disabledIndices:a}),i&&(c-o<s||u<0)){const p=c%o,d=l%o,m=l-(d-p);d===p?u=l:u=d>p?m:m-o}sr(e,u)&&(u=c)}if(n.key===ri&&(f&&Re(n),c===-1?u=s:(u=je(e,{startingIndex:c,amount:o,disabledIndices:a}),i&&c+o>l&&(u=je(e,{startingIndex:c%o-o,amount:o,disabledIndices:a}))),sr(e,u)&&(u=c)),r==="both"){const p=vf(c/o);n.key===ar&&(f&&Re(n),c%o!==o-1?(u=je(e,{startingIndex:c,disabledIndices:a}),i&&ii(u,o,p)&&(u=je(e,{startingIndex:c-c%o-1,disabledIndices:a}))):i&&(u=je(e,{startingIndex:c-c%o-1,disabledIndices:a})),ii(u,o,p)&&(u=c)),n.key===gn&&(f&&Re(n),c%o!==0?(u=je(e,{startingIndex:c,disabledIndices:a,decrement:!0}),i&&ii(u,o,p)&&(u=je(e,{startingIndex:c+(o-c%o),decrement:!0,disabledIndices:a}))):i&&(u=je(e,{startingIndex:c+(o-c%o),decrement:!0,disabledIndices:a})),ii(u,o,p)&&(u=c));const d=vf(l/o)===p;sr(e,u)&&(i&&d?u=n.key===gn?l:je(e,{startingIndex:c-c%o-1,disabledIndices:a}):u=c)}return u}let td=0;function Et(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(td);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():td=requestAnimationFrame(o)}var _e=typeof document<"u"?O.useLayoutEffect:O.useEffect;function oi(){return oi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oi.apply(this,arguments)}let ga=!1,wS=0;const nd=()=>"floating-ui-"+wS++;function xS(){const[e,t]=A.useState(()=>ga?nd():void 0);return _e(()=>{e==null&&t(nd())},[]),A.useEffect(()=>{ga||(ga=!0)},[]),e}const ya=A.useId||xS;function kS(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const SS=A.createContext(null),ES=A.createContext(null),rd=()=>{var e;return((e=A.useContext(SS))==null?void 0:e.id)||null},ai=()=>A.useContext(ES);function lr(e){return"data-floating-ui-"+e}function _t(e){const t=O.useRef(e);return _e(()=>{t.current=e}),t}function CS(e,t){var n;let r=[],i=(n=e.find(o=>o.id===t))==null?void 0:n.parentId;for(;i;){const o=e.find(a=>a.id===i);i=o==null?void 0:o.parentId,o&&(r=r.concat(o))}return r}function yn(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(a=>{var s;return i.parentId===a.id&&((s=i.context)==null?void 0:s.open)})}),n=n.concat(r);return n}function AS(e,t){let n,r=-1;function i(o,a){a>r&&(n=o,r=a),yn(e,o).forEach(l=>{i(l.id,a+1)})}return i(t,0),e.find(o=>o.id===n)}let bn=new WeakMap,si=new WeakSet,li={},ba=0;const IS=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,id=e=>e&&(e.host||id(e.parentNode)),TS=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=id(n);return e.contains(r)?r:null}).filter(n=>n!=null);function OS(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,a=TS(t,e),s=new Set,l=new Set(a),c=[];li[i]||(li[i]=new WeakMap);const f=li[i];a.forEach(u),p(t),s.clear();function u(d){!d||s.has(d)||(s.add(d),d.parentNode&&u(d.parentNode))}function p(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,m=>{if(s.has(m))p(m);else{const h=o?m.getAttribute(o):null,g=h!==null&&h!=="false",y=(bn.get(m)||0)+1,b=(f.get(m)||0)+1;bn.set(m,y),f.set(m,b),c.push(m),y===1&&g&&si.add(m),b===1&&m.setAttribute(i,""),!g&&o&&m.setAttribute(o,"true")}})}return ba++,()=>{c.forEach(d=>{const m=(bn.get(d)||0)-1,h=(f.get(d)||0)-1;bn.set(d,m),f.set(d,h),m||(!si.has(d)&&o&&d.removeAttribute(o),si.delete(d)),h||d.removeAttribute(i)}),ba--,ba||(bn=new WeakMap,bn=new WeakMap,si=new WeakSet,li={})}}function od(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=st(e[0]).body;return OS(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const va=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ad(e,t){const n=pa(e,va());t==="prev"&&n.reverse();const r=n.indexOf(Mt(st(e)));return n.slice(r+1)[0]}function sd(){return ad(document.body,"next")}function ld(){return ad(document.body,"prev")}function cr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ge(n,r)}function DS(e){pa(e,va()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function MS(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const wa={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let PS;function cd(e){e.key==="Tab"&&(e.target,clearTimeout(PS))}const ci=A.forwardRef(function(t,n){const[r,i]=A.useState();_e(()=>(Cf()&&i("button"),document.addEventListener("keydown",cd),()=>{document.removeEventListener("keydown",cd)}),[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[lr("focus-guard")]:"",style:wa};return A.createElement("span",oi({},t,o))}),ud=A.createContext(null);function NS(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=A.useState(null),o=ya(),a=fd(),s=A.useMemo(()=>({id:t,root:n,portalContext:a,uniqueId:o}),[t,n,a,o]),l=A.useRef();return _e(()=>()=>{r==null||r.remove()},[r,s]),_e(()=>{if(l.current===s)return;l.current=s;const{id:c,root:f,portalContext:u,uniqueId:p}=s,d=c?document.getElementById(c):null,m=lr("portal");if(d){const h=document.createElement("div");h.id=p,h.setAttribute(m,""),d.appendChild(h),i(h)}else{let h=f||(u==null?void 0:u.portalNode);h&&!ot(h)&&(h=h.current),h=h||document.body;let g=null;c&&(g=document.createElement("div"),g.id=c,h.appendChild(g));const y=document.createElement("div");y.id=p,y.setAttribute(m,""),h=g||h,h.appendChild(y),i(y)}},[s]),r}function _S(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=NS({id:n,root:r}),[a,s]=A.useState(null),l=A.useRef(null),c=A.useRef(null),f=A.useRef(null),u=A.useRef(null),p=!!a&&!a.modal&&a.open&&i&&!!(r||o);return A.useEffect(()=>{if(!o||!i||a!=null&&a.modal)return;function d(m){o&&cr(m)&&(m.type==="focusin"?MS:DS)(o)}return o.addEventListener("focusin",d,!0),o.addEventListener("focusout",d,!0),()=>{o.removeEventListener("focusin",d,!0),o.removeEventListener("focusout",d,!0)}},[o,i,a==null?void 0:a.modal]),A.createElement(ud.Provider,{value:A.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:f,afterInsideRef:u,portalNode:o,setFocusManagerState:s}),[i,o])},p&&o&&A.createElement(ci,{"data-type":"outside",ref:l,onFocus:d=>{if(cr(d,o)){var m;(m=f.current)==null||m.focus()}else{const h=ld()||(a==null?void 0:a.refs.domReference.current);h==null||h.focus()}}}),p&&o&&A.createElement("span",{"aria-owns":o.id,style:wa}),o&&Cs.createPortal(t,o),p&&o&&A.createElement(ci,{"data-type":"outside",ref:c,onFocus:d=>{if(cr(d,o)){var m;(m=u.current)==null||m.focus()}else{const h=sd()||(a==null?void 0:a.refs.domReference.current);h==null||h.focus(),a!=null&&a.closeOnFocusOut&&(a==null||a.onOpenChange(!1,d.nativeEvent))}}}))}const fd=()=>A.useContext(ud),LS=A.forwardRef(function(t,n){return A.createElement("button",oi({},t,{type:"button",ref:n,tabIndex:-1,style:wa}))});function FS(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:a=0,returnFocus:s=!0,modal:l=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:f=!0}=e,{open:u,refs:p,nodeId:d,onOpenChange:m,events:h,dataRef:g,elements:{domReference:y,floating:b}}=t,w=IS()?o:!0,E=_t(i),x=_t(a),C=_t(s),T=ai(),N=fd(),$=typeof a=="number"&&a<0,I=A.useRef(null),D=A.useRef(null),F=A.useRef(!1),_=A.useRef(null),R=A.useRef(!1),P=N!=null,L=y&&y.getAttribute("role")==="combobox"&&Tf(y)&&$,U=A.useCallback(function(M){return M===void 0&&(M=b),M?pa(M,va()):[]},[b]),z=A.useCallback(M=>{const H=U(M);return E.current.map(k=>y&&k==="reference"?y:b&&k==="floating"?b:H).filter(Boolean).flat()},[y,b,E,U]);A.useEffect(()=>{if(r||!l)return;function M(k){if(k.key==="Tab"){Ge(b,Mt(st(b)))&&U().length===0&&!L&&Re(k);const W=z(),te=If(k);E.current[0]==="reference"&&te===y&&(Re(k),k.shiftKey?Et(W[W.length-1]):Et(W[1])),E.current[1]==="floating"&&te===b&&k.shiftKey&&(Re(k),Et(W[0]))}}const H=st(b);return H.addEventListener("keydown",M),()=>{H.removeEventListener("keydown",M)}},[r,y,b,l,E,p,L,U,z]),A.useEffect(()=>{if(r||!f)return;function M(){R.current=!0,setTimeout(()=>{R.current=!1})}function H(k){const W=k.relatedTarget;queueMicrotask(()=>{const te=!(Ge(y,W)||Ge(b,W)||Ge(W,b)||Ge(N==null?void 0:N.portalNode,W)||W!=null&&W.hasAttribute(lr("focus-guard"))||T&&(yn(T.nodesRef.current,d).find(Y=>{var X,oe;return Ge((X=Y.context)==null?void 0:X.elements.floating,W)||Ge((oe=Y.context)==null?void 0:oe.elements.domReference,W)})||CS(T.nodesRef.current,d).find(Y=>{var X,oe;return((X=Y.context)==null?void 0:X.elements.floating)===W||((oe=Y.context)==null?void 0:oe.elements.domReference)===W})));W&&te&&!R.current&&W!==_.current&&(F.current=!0,m(!1,k))})}if(b&&fn(y))return y.addEventListener("focusout",H),y.addEventListener("pointerdown",M),!l&&b.addEventListener("focusout",H),()=>{y.removeEventListener("focusout",H),y.removeEventListener("pointerdown",M),!l&&b.removeEventListener("focusout",H)}},[r,y,b,l,d,T,N,m,f]),A.useEffect(()=>{var M;if(r)return;const H=Array.from((N==null||(M=N.portalNode)==null?void 0:M.querySelectorAll("["+lr("portal")+"]"))||[]);if(b){const k=[b,...H,I.current,D.current,E.current.includes("reference")||L?y:null].filter(te=>te!=null),W=l?od(k,w,!w):od(k);return()=>{W()}}},[r,y,b,l,E,N,L,w]),_e(()=>{if(r||!b)return;const M=st(b),H=Mt(M);queueMicrotask(()=>{const k=z(b),W=x.current,te=(typeof W=="number"?k[W]:W.current)||b,Y=Ge(b,H);!$&&!Y&&u&&Et(te,{preventScroll:te===b})})},[r,u,b,$,z,x]),_e(()=>{if(r||!b)return;let M=!1;const H=st(b),k=Mt(H),W=g.current;_.current=k;function te(Y){if(Y.type==="escapeKey"&&p.domReference.current&&(_.current=p.domReference.current),["referencePress","escapeKey"].includes(Y.type))return;const X=Y.data.returnFocus;typeof X=="object"?(F.current=!1,M=X.preventScroll):F.current=!X}return h.on("dismiss",te),()=>{h.off("dismiss",te);const Y=Mt(H);(Ge(b,Y)||T&&yn(T.nodesRef.current,d).some(oe=>{var ae;return Ge((ae=oe.context)==null?void 0:ae.elements.floating,Y)})||W.openEvent&&["click","mousedown"].includes(W.openEvent.type))&&p.domReference.current&&(_.current=p.domReference.current),C.current&&fn(_.current)&&!F.current&&Et(_.current,{cancelPrevious:!1,preventScroll:M})}},[r,b,C,g,p,h,T,d]),_e(()=>{if(!(r||!N))return N.setFocusManagerState({modal:l,closeOnFocusOut:f,open:u,onOpenChange:m,refs:p}),()=>{N.setFocusManagerState(null)}},[r,N,l,u,m,p,f]),_e(()=>{if(!r&&b&&typeof MutationObserver=="function"&&!$){const M=()=>{const k=b.getAttribute("tabindex");E.current.includes("floating")||Mt(st(b))!==p.domReference.current&&U().length===0?k!=="0"&&b.setAttribute("tabindex","0"):k!=="-1"&&b.setAttribute("tabindex","-1")};M();const H=new MutationObserver(M);return H.observe(b,{childList:!0,subtree:!0,attributes:!0}),()=>{H.disconnect()}}},[r,b,p,E,U,$]);function q(M){return r||!c||!l?null:A.createElement(LS,{ref:M==="start"?I:D,onClick:H=>m(!1,H.nativeEvent)},typeof c=="string"?c:"Dismiss")}const v=!r&&w&&!L&&(P||l);return A.createElement(A.Fragment,null,v&&A.createElement(ci,{"data-type":"inside",ref:N==null?void 0:N.beforeInsideRef,onFocus:M=>{if(l){const k=z();Et(i[0]==="reference"?k[0]:k[k.length-1])}else if(N!=null&&N.preserveTabOrder&&N.portalNode)if(F.current=!1,cr(M,N.portalNode)){const k=sd()||y;k==null||k.focus()}else{var H;(H=N.beforeOutsideRef.current)==null||H.focus()}}}),!L&&q("start"),n,q("end"),v&&A.createElement(ci,{"data-type":"inside",ref:N==null?void 0:N.afterInsideRef,onFocus:M=>{if(l)Et(z()[0]);else if(N!=null&&N.preserveTabOrder&&N.portalNode)if(f&&(F.current=!0),cr(M,N.portalNode)){const k=ld()||y;k==null||k.focus()}else{var H;(H=N.afterOutsideRef.current)==null||H.focus()}}}))}function dd(e){return fn(e.target)&&e.target.tagName==="BUTTON"}function pd(e){return Tf(e)}function RS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:a=!0,event:s="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:f=!0}=t,u=A.useRef(),p=A.useRef(!1);return A.useMemo(()=>a?{reference:{onPointerDown(d){u.current=d.pointerType},onMouseDown(d){d.button===0&&(Af(u.current)&&c||s!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,d.nativeEvent):(d.preventDefault(),r(!0,d.nativeEvent))))},onClick(d){if(s==="mousedown"&&u.current){u.current=void 0;return}Af(u.current)&&c||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,d.nativeEvent):r(!0,d.nativeEvent))},onKeyDown(d){u.current=void 0,!(d.defaultPrevented||!f||dd(d))&&(d.key===" "&&!pd(o)&&(d.preventDefault(),p.current=!0),d.key==="Enter"&&r(!(n&&l),d.nativeEvent))},onKeyUp(d){d.defaultPrevented||!f||dd(d)||pd(o)||d.key===" "&&p.current&&(p.current=!1,r(!(n&&l),d.nativeEvent))}}}:{},[a,i,s,c,f,o,l,n,r])}const BS=A.useInsertionEffect||(e=>e());function Lt(e){const t=A.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return BS(()=>{t.current=e}),A.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}const $S={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},zS={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},jS=e=>{var t,n;return{escapeKeyBubbles:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePressBubbles:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function US(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:o,elements:{reference:a,domReference:s,floating:l},dataRef:c}=e,{enabled:f=!0,escapeKey:u=!0,outsidePress:p=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:h="pointerdown",ancestorScroll:g=!1,bubbles:y}=t,b=ai(),w=rd()!=null,E=Lt(typeof p=="function"?p:()=>!1),x=typeof p=="function"?E:p,C=A.useRef(!1),{escapeKeyBubbles:T,outsidePressBubbles:N}=jS(y),$=Lt(D=>{if(!n||!f||!u||D.key!=="Escape")return;const F=b?yn(b.nodesRef.current,o):[];if(!T&&(D.stopPropagation(),F.length>0)){let _=!0;if(F.forEach(R=>{var P;if((P=R.context)!=null&&P.open&&!R.context.dataRef.current.__escapeKeyBubbles){_=!1;return}}),!_)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,sk(D)?D.nativeEvent:D)}),I=Lt(D=>{const F=C.current;if(C.current=!1,F||typeof x=="function"&&!x(D))return;const _=If(D),R="["+lr("inert")+"]",P=st(l).querySelectorAll(R);let L=ot(_)?_:null;for(;L&&!nk(L);){const q=ik(L);if(q===st(l).body||!ot(q))break;L=q}if(P.length&&ot(_)&&!lk(_)&&!Ge(_,l)&&Array.from(P).every(q=>!Ge(L,q)))return;if(fn(_)&&l){const q=_.clientWidth>0&&_.scrollWidth>_.clientWidth,v=_.clientHeight>0&&_.scrollHeight>_.clientHeight;let M=v&&D.offsetX>_.clientWidth;if(v&&rk(_).direction==="rtl"&&(M=D.offsetX<=_.offsetWidth-_.clientWidth),M||q&&D.offsetY>_.clientHeight)return}const U=b&&yn(b.nodesRef.current,o).some(q=>{var v;return ra(D,(v=q.context)==null?void 0:v.elements.floating)});if(ra(D,l)||ra(D,s)||U)return;const z=b?yn(b.nodesRef.current,o):[];if(z.length>0){let q=!0;if(z.forEach(v=>{var M;if((M=v.context)!=null&&M.open&&!v.context.dataRef.current.__outsidePressBubbles){q=!1;return}}),!q)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:Sf(D)||Ef(D)}}),r(!1,D)});return A.useEffect(()=>{if(!n||!f)return;c.current.__escapeKeyBubbles=T,c.current.__outsidePressBubbles=N;function D(R){r(!1,R)}const F=st(l);u&&F.addEventListener("keydown",$),x&&F.addEventListener(d,I);let _=[];return g&&(ot(s)&&(_=Nt(s)),ot(l)&&(_=_.concat(Nt(l))),!ot(a)&&a&&a.contextElement&&(_=_.concat(Nt(a.contextElement)))),_=_.filter(R=>{var P;return R!==((P=F.defaultView)==null?void 0:P.visualViewport)}),_.forEach(R=>{R.addEventListener("scroll",D,{passive:!0})}),()=>{u&&F.removeEventListener("keydown",$),x&&F.removeEventListener(d,I),_.forEach(R=>{R.removeEventListener("scroll",D)})}},[c,l,s,a,u,x,d,n,r,g,f,T,N,$,I]),A.useEffect(()=>{C.current=!1},[x,d]),A.useMemo(()=>f?{reference:{onKeyDown:$,[$S[h]]:D=>{m&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,D.nativeEvent))}},floating:{onKeyDown:$,[zS[d]]:()=>{C.current=!0}}}:{},[f,i,m,d,h,r,$])}let xa;process.env.NODE_ENV!=="production"&&(xa=new Set);function HS(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var o;const T="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((o=e.elements)!=null&&o.reference&&!ot(e.elements.reference)){var a;if(!((a=xa)!=null&&a.has(T))){var s;(s=xa)==null||s.add(T),console.error(T)}}}const[l,c]=A.useState(null),f=((t=e.elements)==null?void 0:t.reference)||l,u=Xk(e),p=ai(),d=Lt((T,N)=>{T&&(h.current.openEvent=N),r==null||r(T,N)}),m=A.useRef(null),h=A.useRef({}),g=A.useState(()=>kS())[0],y=ya(),b=A.useCallback(T=>{const N=ot(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),contextElement:T}:T;u.refs.setReference(N)},[u.refs]),w=A.useCallback(T=>{(ot(T)||T===null)&&(m.current=T,c(T)),(ot(u.refs.reference.current)||u.refs.reference.current===null||T!==null&&!ot(T))&&u.refs.setReference(T)},[u.refs]),E=A.useMemo(()=>({...u.refs,setReference:w,setPositionReference:b,domReference:m}),[u.refs,w,b]),x=A.useMemo(()=>({...u.elements,domReference:f}),[u.elements,f]),C=A.useMemo(()=>({...u,refs:E,elements:x,dataRef:h,nodeId:i,floatingId:y,events:g,open:n,onOpenChange:d}),[u,i,y,g,n,d,E,x]);return _e(()=>{const T=p==null?void 0:p.nodesRef.current.find(N=>N.id===i);T&&(T.context=C)}),A.useMemo(()=>({...u,context:C,refs:E,elements:x}),[u,E,x,C])}function ka(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(a=>{let[s,l]=a;if(s.indexOf("on")===0){if(r.has(s)||r.set(s,[]),typeof l=="function"){var c;(c=r.get(s))==null||c.push(l),i[s]=function(){for(var f,u=arguments.length,p=new Array(u),d=0;d<u;d++)p[d]=arguments[d];return(f=r.get(s))==null?void 0:f.map(m=>m(...p)).find(m=>m!==void 0)}}}else i[s]=l}),i),{})}}function WS(e){e===void 0&&(e=[]);const t=e,n=A.useCallback(o=>ka(o,e,"reference"),t),r=A.useCallback(o=>ka(o,e,"floating"),t),i=A.useCallback(o=>ka(o,e,"item"),e.map(o=>o==null?void 0:o.item));return A.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let hd=!1;function ui(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function md(e,t){return ui(t,e===ha||e===ri,e===gn||e===ar)}function Sa(e,t,n){return ui(t,e===ri,n?e===gn:e===ar)||e==="Enter"||e==" "||e===""}function VS(e,t,n){return ui(t,n?e===gn:e===ar,e===ri)}function gd(e,t,n){return ui(t,n?e===ar:e===gn,e===ha)}function qS(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:o,floating:a}}=e,{listRef:s,activeIndex:l,onNavigate:c=()=>{},enabled:f=!0,selectedIndex:u=null,allowEscape:p=!1,loop:d=!1,nested:m=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:y="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:w=!0,disabledIndices:E=void 0,orientation:x="vertical",cols:C=1,scrollItemIntoView:T=!0,virtualItemRef:N}=t;process.env.NODE_ENV!=="production"&&(p&&(d||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),g||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),x==="vertical"&&C>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const $=rd(),I=ai(),D=Lt(c),F=A.useRef(y),_=A.useRef(u??-1),R=A.useRef(null),P=A.useRef(!0),L=A.useRef(D),U=A.useRef(!!a),z=A.useRef(!1),q=A.useRef(!1),v=_t(E),M=_t(n),H=_t(T),[k,W]=A.useState(),[te,Y]=A.useState(),X=Lt(function(J,Q,j){j===void 0&&(j=!1);const ne=J.current[Q.current];ne&&(g?(W(ne.id),I==null||I.events.emit("virtualfocus",ne),N&&(N.current=ne)):Et(ne,{preventScroll:!0,sync:ak()&&Cf()?hd||z.current:!1}),requestAnimationFrame(()=>{const se=H.current;se&&ne&&(j||!P.current)&&(ne.scrollIntoView==null||ne.scrollIntoView(typeof se=="boolean"?{block:"nearest",inline:"nearest"}:se))}))});_e(()=>{document.createElement("div").focus({get preventScroll(){return hd=!0,!1}})},[]),_e(()=>{f&&(n&&a?F.current&&u!=null&&(q.current=!0,D(u)):U.current&&(_.current=-1,L.current(null)))},[f,n,a,u,D]),_e(()=>{if(f&&n&&a)if(l==null){if(z.current=!1,u!=null)return;if(U.current&&(_.current=-1,X(s,_)),!U.current&&F.current&&(R.current!=null||F.current===!0&&R.current==null)){let J=0;const Q=()=>{s.current[0]==null?(J<2&&(J?requestAnimationFrame:queueMicrotask)(Q),J++):(_.current=R.current==null||Sa(R.current,x,h)||m?ma(s,v.current):ed(s,v.current),R.current=null,D(_.current))};Q()}}else sr(s,l)||(_.current=l,X(s,_,q.current),q.current=!1)},[f,n,a,l,u,m,s,x,h,D,X,v]),_e(()=>{var J,Q;if(!f||a||!I||g||!U.current)return;const j=I.nodesRef.current,ne=(J=j.find(G=>G.id===$))==null||(Q=J.context)==null?void 0:Q.elements.floating,se=Mt(st(a)),K=j.some(G=>G.context&&Ge(G.context.elements.floating,se));ne&&!K&&P.current&&ne.focus({preventScroll:!0})},[f,a,I,$,g]),_e(()=>{if(!f||!I||!g||$)return;function J(Q){Y(Q.id),N&&(N.current=Q)}return I.events.on("virtualfocus",J),()=>{I.events.off("virtualfocus",J)}},[f,I,g,$,N]),_e(()=>{L.current=D,U.current=!!a}),_e(()=>{n||(R.current=null)},[n]);const oe=l!=null,ae=A.useMemo(()=>{function J(j){if(!n)return;const ne=s.current.indexOf(j);ne!==-1&&D(ne)}return{onFocus(j){let{currentTarget:ne}=j;J(ne)},onClick:j=>{let{currentTarget:ne}=j;return ne.focus({preventScroll:!0})},...b&&{onMouseMove(j){let{currentTarget:ne}=j;J(ne)},onPointerLeave(j){let{pointerType:ne}=j;!P.current||ne==="touch"||(_.current=-1,X(s,_),D(null),g||Et(i.floating.current,{preventScroll:!0}))}}}},[n,i,X,b,s,D,g]);return A.useMemo(()=>{if(!f)return{};const J=v.current;function Q(G){if(P.current=!1,z.current=!0,!M.current&&G.currentTarget===i.floating.current)return;if(m&&gd(G.key,x,h)){Re(G),r(!1,G.nativeEvent),fn(o)&&!g&&o.focus();return}const ue=_.current,pe=ma(s,J),me=ed(s,J);if(G.key==="Home"&&(Re(G),_.current=pe,D(_.current)),G.key==="End"&&(Re(G),_.current=me,D(_.current)),!(C>1&&(_.current=vS(s,{event:G,orientation:x,loop:d,cols:C,disabledIndices:J,minIndex:pe,maxIndex:me,prevIndex:_.current,stopEvent:!0}),D(_.current),x==="both"))&&md(G.key,x)){if(Re(G),n&&!g&&Mt(G.currentTarget.ownerDocument)===G.currentTarget){_.current=Sa(G.key,x,h)?pe:me,D(_.current);return}Sa(G.key,x,h)?d?_.current=ue>=me?p&&ue!==s.current.length?-1:pe:je(s,{startingIndex:ue,disabledIndices:J}):_.current=Math.min(me,je(s,{startingIndex:ue,disabledIndices:J})):d?_.current=ue<=pe?p&&ue!==-1?s.current.length:me:je(s,{startingIndex:ue,decrement:!0,disabledIndices:J}):_.current=Math.max(pe,je(s,{startingIndex:ue,decrement:!0,disabledIndices:J})),sr(s,_.current)?D(null):D(_.current)}}function j(G){y==="auto"&&Sf(G.nativeEvent)&&(F.current=!0)}function ne(G){F.current=y,y==="auto"&&Ef(G.nativeEvent)&&(F.current=!0)}const se=g&&n&&oe&&{"aria-activedescendant":te||k},K=s.current.find(G=>(G==null?void 0:G.id)===k);return{reference:{...se,onKeyDown(G){P.current=!1;const ue=G.key.indexOf("Arrow")===0,pe=VS(G.key,x,h),me=gd(G.key,x,h),De=md(G.key,x),Ue=(m?pe:De)||G.key==="Enter"||G.key.trim()==="";if(g&&n){const ce=I==null?void 0:I.nodesRef.current.find(V=>V.parentId==null),B=I&&ce?AS(I.nodesRef.current,ce.id):null;if(ue&&B&&N){const V=new KeyboardEvent("keydown",{key:G.key,bubbles:!0});if(pe||me){var He,qe;const le=((He=B.context)==null?void 0:He.elements.domReference)===G.currentTarget,re=me&&!le?(qe=B.context)==null?void 0:qe.elements.domReference:pe?K:null;re&&(Re(G),re.dispatchEvent(V),Y(void 0))}if(De&&B.context&&B.context.open&&B.parentId&&G.currentTarget!==B.context.elements.domReference){var ee;Re(G),(ee=B.context.elements.domReference)==null||ee.dispatchEvent(V);return}}return Q(G)}if(!(!n&&!w&&ue)){if(Ue&&(R.current=m&&De?null:G.key),m){pe&&(Re(G),n?(_.current=ma(s,J),D(_.current)):r(!0,G.nativeEvent));return}De&&(u!=null&&(_.current=u),Re(G),!n&&w?r(!0,G.nativeEvent):Q(G),n&&D(_.current))}},onFocus(){n&&D(null)},onPointerDown:ne,onMouseDown:j,onClick:j},floating:{"aria-orientation":x==="both"?void 0:x,...se,onKeyDown:Q,onPointerMove(){P.current=!0}},item:ae}},[o,i,k,te,v,M,s,f,x,h,g,n,oe,m,u,w,p,C,d,y,D,r,ae,I,N])}function KS(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:o="dialog"}=t,a=ya();return A.useMemo(()=>{const s={id:r,role:o};return i?o==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:s}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?r:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:a}},floating:{...s,...o==="menu"&&{"aria-labelledby":a}}}:{}},[i,o,n,r,a])}function YS(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:a,onMatch:s,onTypingChange:l,enabled:c=!0,findMatch:f=null,resetMs:u=750,ignoreKeys:p=[],selectedIndex:d=null}=t,m=A.useRef(),h=A.useRef(""),g=A.useRef((n=d??a)!=null?n:-1),y=A.useRef(null),b=Lt(s),w=Lt(l),E=_t(f),x=_t(p);return _e(()=>{r&&(clearTimeout(m.current),y.current=null,h.current="")},[r]),_e(()=>{if(r&&h.current===""){var C;g.current=(C=d??a)!=null?C:-1}},[r,d,a]),A.useMemo(()=>{if(!c)return{};function C($){$?i.current.typing||(i.current.typing=$,w($)):i.current.typing&&(i.current.typing=$,w($))}function T($,I,D){const F=E.current?E.current(I,D):I.find(_=>(_==null?void 0:_.toLocaleLowerCase().indexOf(D.toLocaleLowerCase()))===0);return F?$.indexOf(F):-1}function N($){const I=o.current;if(h.current.length>0&&h.current[0]!==" "&&(T(I,I,h.current)===-1?C(!1):$.key===" "&&Re($)),I==null||x.current.includes($.key)||$.key.length!==1||$.ctrlKey||$.metaKey||$.altKey)return;r&&$.key!==" "&&(Re($),C(!0)),I.every(R=>{var P,L;return R?((P=R[0])==null?void 0:P.toLocaleLowerCase())!==((L=R[1])==null?void 0:L.toLocaleLowerCase()):!0})&&h.current===$.key&&(h.current="",g.current=y.current),h.current+=$.key,clearTimeout(m.current),m.current=setTimeout(()=>{h.current="",g.current=y.current,C(!1)},u);const F=g.current,_=T(I,[...I.slice((F||0)+1),...I.slice(0,(F||0)+1)],h.current);_!==-1?(b(_),y.current=_):$.key!==" "&&(h.current="",C(!1))}return{reference:{onKeyDown:N},floating:{onKeyDown:N,onKeyUp($){$.key===" "&&C(!1)}}}},[c,r,i,o,u,x,E,b,w])}const GS=({options:e,reusable:t,sendMessage:n,isReadOnly:r})=>{var P,L,U,z,q;const i=sn(v=>v.messageContainerRef),o=sn(v=>v.portalContainer),[a,s]=A.useState(!1),[l,c]=A.useState(null),[f,u]=A.useState(null),{message:{blocks:{dropdown:p}}}=ge,d=e.reduce((v,M)=>(v[M.label]=M.value,v),{}),m=d?Object.keys(d):[],h=v=>{s(f!==null&&!t?!1:v)},{refs:g,floatingStyles:y,context:b}=HS({placement:"bottom-start",open:a,onOpenChange:h,whileElementsMounted:qk,middleware:[eS(5),tS({padding:10,boundary:(i==null?void 0:i.current)??void 0,crossAxis:!0}),nS({apply({rects:v,elements:M,availableHeight:H}){Object.assign(M.floating.style,{maxHeight:`${H}px`,minWidth:`${v.reference.width}px`})},padding:10})]}),w=A.useRef([]),E=A.useRef(m),x=A.useRef(!1),C=RS(b,{event:"mousedown"}),T=US(b),N=KS(b,{role:"listbox"}),$=qS(b,{listRef:w,activeIndex:l,selectedIndex:f,onNavigate:c,loop:!0}),I=YS(b,{listRef:E,activeIndex:l,selectedIndex:f,onMatch:a?c:u,onTypingChange(v){x.current=v}}),{getReferenceProps:D,getFloatingProps:F,getItemProps:_}=WS([T,N,$,I,C]),R=v=>{u(v),m[v]!==void 0&&(n==null||n({type:"text",text:m[v]??"",value:d[m[v]]??""})),s(!1)};return S.jsxs(S.Fragment,{children:[S.jsxs("div",{tabIndex:0,ref:g.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":f!==null&&!t?"":void 0,style:r?{pointerEvents:"none"}:void 0,...(P=p.button)==null?void 0:P.container,...D(),children:[S.jsx("span",{...(L=p.button)==null?void 0:L.text,children:f?m[f]:"Select..."}),S.jsx(v0,{...(U=p.button)==null?void 0:U.icon})]}),a&&S.jsx(_S,{root:o??void 0,children:S.jsx(FS,{context:b,modal:!1,children:S.jsx("div",{ref:g.setFloating,className:(q=(z=p.content)==null?void 0:z.container)==null?void 0:q.className,style:{...y,pointerEvents:"auto"},...F(),children:m.map((v,M)=>{var H;return S.jsx("div",{ref:k=>{w.current[M]=k},role:"option",tabIndex:M===l?0:-1,"aria-selected":M===f&&M===l,"data-active":M===l?"":void 0,...(H=p.content)==null?void 0:H.item,..._({onClick(){R(M)},onKeyDown(k){k.key==="Enter"&&(k.preventDefault(),R(M)),k.key===" "&&!x.current&&(k.preventDefault(),R(M))}}),children:v},v)})})})})]})},yd=O.forwardRef(({title:e,url:t,isReadOnly:n,...r},i)=>{const{message:{blocks:{file:o}}}=ge;return S.jsxs("a",{...r,...o.container,href:t,style:n?{pointerEvents:"none"}:void 0,download:!0,ref:i,target:"_blank",rel:"noreferrer",children:[S.jsx("p",{...o.title,children:e||t}),S.jsx(C0,{...o.icon})]})});yd.displayName="File";const QS=Ot()((e,t)=>({components:{},getCustomComponent:async n=>{const r=t().components[n];if(r)return r;const i=await fetch(n).then(c=>c.text()),o=new Blob([i],{type:"application/javascript"}),s=await import(URL.createObjectURL(o)),l=()=>s.default;return e(c=>({components:{...c.components,[n]:l}})),l}}));globalThis.React=O;const bd={audio:af,bubble:Xu,button:b1,carousel:bf,column:lf,dropdown:GS,file:yd,image:rf,location:sf,row:cf,text:H0,video:of,custom:({url:e,name:t,data:n,...r})=>{const i=QS(c=>c.getCustomComponent),[o,a]=O.useState(null),[s,l]=O.useState(null);return O.useEffect(()=>{i(e).then(a).catch(c=>{l(c.message)})},[e]),s?S.jsx("div",{style:{color:"red"},children:s}):o?S.jsx(o,{...n,...r}):null}},Kt=({block:e,renderers:t,...n})=>{const r=(t==null?void 0:t[e.type])??bd[e.type],i={...n,...e};return S.jsx(r,{...i})};function vd(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=vd(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ur(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=vd(e))&&(r&&(r+=" "),r+=t);return r}const JS=({disabled:e,onFileSelected:t})=>{const n=O.useRef(null),{uploadButton:r}=ge.composer,i=()=>{n.current&&n.current.click()},o=a=>{const s=a.target.files;s&&s.length>0&&Array.from(s).forEach(l=>{t(l)})};return S.jsxs(S.Fragment,{children:[S.jsx(L0,{...r,role:"button",tabIndex:0,"aria-label":"Upload File Button","data-disabled":e,onClick:i}),S.jsx("input",{value:"",multiple:!0,type:"file",ref:n,style:{display:"none"},onChange:o})]})},ZS=({name:e,type:t,instance:n,status:r,removeFile:i})=>{const{loader:o,fileIcon:a,removeIcon:s,errorIcon:l,previewImage:c}=ge.composer.fileWidget,f=["PNG","JPEG","JPG"].includes(di(e)),[u,p]=O.useState("");return O.useEffect(()=>{if(!n||!f){p("");return}const d=n;if(!(d instanceof File||d instanceof Blob)){p("");return}const h=URL.createObjectURL(d);return p(h),()=>{h&&URL.revokeObjectURL(h)}},[n,f]),r==="loading"?S.jsx(fi,{name:e,status:r,removeButton:S.jsx("div",{...o}),extension:di(e),children:S.jsx("div",{...a.container,children:S.jsx(Ea,{type:t,...a.icon})})}):r==="error"?S.jsx(fi,{name:e,status:r,removeButton:S.jsx(wd,{removeFile:()=>i(e)}),extension:"Upload Error",children:S.jsxs("div",{...a.container,children:[S.jsx(k0,{...l}),S.jsx(Ea,{type:t,...a.icon})]})}):r=="uploaded"&&f?S.jsx(fi,{name:e,status:r,removeButton:S.jsx(wd,{removeFile:()=>i(e)}),extension:di(e),children:S.jsx("div",{...a.container,children:S.jsx("img",{src:u,alt:e,...c})})}):S.jsx(fi,{name:e,status:r,removeButton:S.jsx(Eu,{onClick:()=>i(e),...s}),extension:di(e),children:S.jsx("div",{...a.container,children:S.jsx(Ea,{type:t,...a.icon})})})},fi=({name:e,status:t,removeButton:n,children:r,extension:i})=>{const{container:o,metadata:a}=ge.composer.fileWidget,s=_s(e);return S.jsxs("div",{"data-status":t,title:e,...o,children:[n,r,S.jsxs("div",{...a.container,children:[S.jsx("div",{...a.name,children:s}),S.jsx("div",{...a.type,children:i})]})]})},Ea=({type:e,...t})=>e==="image"?S.jsx(T0,{...t}):e==="video"?S.jsx(z0,{...t}):e==="audio"?S.jsx(Iu,{...t}):S.jsx(Cu,{...t}),di=e=>{const t=e.split(".").pop();return t?t.toUpperCase():"File"},wd=({removeFile:e})=>{const{composer:{fileWidget:{removeIcon:t}}}=ge;return S.jsx(Eu,{role:"button",tabIndex:0,"aria-label":"Remove File Button",onClick:()=>e(),...t})};function XS(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var eE=O.useLayoutEffect,tE=function(t){var n=O.useRef(t);return eE(function(){n.current=t}),n},xd=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},nE=function(t,n){var r=O.useRef();return O.useCallback(function(i){t.current=i,r.current&&xd(r.current,null),r.current=n,n&&xd(n,i)},[n])},kd={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},rE=function(t){Object.keys(kd).forEach(function(n){t.style.setProperty(n,kd[n],"important")})},Sd=rE,Ve=null,Ed=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function iE(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Ve||(Ve=document.createElement("textarea"),Ve.setAttribute("tabindex","-1"),Ve.setAttribute("aria-hidden","true"),Sd(Ve)),Ve.parentNode===null&&document.body.appendChild(Ve);var i=e.paddingSize,o=e.borderSize,a=e.sizingStyle,s=a.boxSizing;Object.keys(a).forEach(function(p){var d=p;Ve.style[d]=a[d]}),Sd(Ve),Ve.value=t;var l=Ed(Ve,e);Ve.value=t,l=Ed(Ve,e),Ve.value="x";var c=Ve.scrollHeight-i,f=c*n;s==="border-box"&&(f=f+i+o),l=Math.max(f,l);var u=c*r;return s==="border-box"&&(u=u+i+o),l=Math.min(u,l),[l,c]}var Cd=function(){},oE=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},aE=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],sE=!!document.documentElement.currentStyle,lE=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=oE(aE,n),i=r.boxSizing;if(i==="")return null;sE&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),a=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:a}},cE=lE;function Ad(e,t,n){var r=tE(n);A.useLayoutEffect(function(){var i=function(a){return r.current(a)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var uE=function(t){Ad(window,"resize",t)},fE=function(t){Ad(document.fonts,"loadingdone",t)},dE=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],pE=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,o=t.minRows,a=t.onChange,s=a===void 0?Cd:a,l=t.onHeightChange,c=l===void 0?Cd:l,f=XS(t,dE),u=f.value!==void 0,p=A.useRef(null),d=nE(p,n),m=A.useRef(0),h=A.useRef(),g=function(){var w=p.current,E=r&&h.current?h.current:cE(w);if(E){h.current=E;var x=iE(E,w.value||w.placeholder||"x",o,i),C=x[0],T=x[1];m.current!==C&&(m.current=C,w.style.setProperty("height",C+"px","important"),c(C,{rowHeight:T}))}},y=function(w){u||g(),s(w)};return A.useLayoutEffect(g),uE(g),fE(g),A.createElement("textarea",xt({},f,{onChange:y,ref:d}))},hE=A.forwardRef(pE);const mE=({inputRef:e,composerPlaceholder:t,composerDisabled:n,textInput:r,historyIndex:i,setTextInput:o,setHistoryIndex:a,sendComposerMessage:s,allowFileUpload:l,onFilePasted:c})=>{const f=Bu(d=>d.messageHistory),{input:u}=ge.composer,p=d=>{if(!l||!c||!d.clipboardData)return;const m=Array.from(d.clipboardData.files);m.length>0&&(d.preventDefault(),m.forEach(h=>{c(h)}))};return S.jsx(hE,{...u,"aria-label":"Message Input",ref:e,placeholder:t??"Type your message...",disabled:n,value:r,"data-has-value":!!r,onChange:d=>{const m=d.target.value;o(m),f.includes(m)||a(-1)},onPaste:p,maxRows:5,onKeyDown:d=>{if(n)return;const m=d.nativeEvent;m.isComposing||m.keyCode===229||(d.key==="Enter"&&d.shiftKey?(d.preventDefault(),o(`${r}
258
- `)):d.key==="Enter"&&(d.preventDefault(),s()),d.key==="ArrowUp"&&(r.trim()===""||f.includes(r)&&i>=0)&&(d.preventDefault(),i<f.length-1&&o(f[i+1]??""),a(Math.min(i+1,f.length-1))),d.key==="ArrowDown"&&(r.trim()===""||f.includes(r))&&i>=0&&(d.preventDefault(),o(i===0?"":f[i-1]??""),a(Math.max(i-1,-1))))}})},gE=({disabled:e,setTextInput:t})=>{const[n,r]=O.useState(!1),i=O.useRef(null),{voiceButton:o}=ge.composer,a=window.SpeechRecognition||window.webkitSpeechRecognition,s=()=>{i.current||(i.current=new a);const l=i.current;l&&(l.continuous=!0,l.onresult=c=>{var u,p,d;const f=((d=(p=(u=c.results)==null?void 0:u[0])==null?void 0:p[0])==null?void 0:d.transcript)??"";t(f??""),l.stop(),r(!1)},n?(l.stop(),r(!1)):(l.start(),r(!0)))};if(a)return S.jsx(P0,{...o,tabIndex:0,"aria-label":"Voice Input Button",role:"button","data-show":!e,"data-listens":!!n,onClick:s})},Id=O.memo(O.forwardRef(({className:e,inputRef:t,disableComposer:n,isReadOnly:r,allowFileUpload:i,connected:o,composerPlaceholder:a,footer:s,sendMessage:l,uploadFile:c,storageKey:f,children:u,...p},d)=>{const{composer:m}=ge,h=n||r||!o,[g,y]=O.useState(""),[b,w]=O.useState(-1),E=Qu(f),x=E(F=>F.files),C=E(F=>F.setFiles),T=E(F=>F.deleteFile),N=E(F=>F.uploadFile),$=Bu(F=>F.addMessageToHistory),I=!!g||x.filter(F=>F.status==="uploaded").length>0;t=t??O.useRef(null);const D=()=>{const F=x.filter(P=>P.status==="uploaded");if(!F.length&&!g)return;const _=(F==null?void 0:F.map(P=>{const L=P.url,U=P.type;return{video:{type:"video",videoUrl:L},audio:{type:"audio",audioUrl:L},image:{type:"image",imageUrl:L}}[U]??{title:P.name,type:"file",fileUrl:L}}))??[];g&&_.push({type:"text",text:g});let R;_.length==1?R=_[0]:R={type:"bloc",items:_.map(L=>{const{type:U,...z}=L;return{type:U,payload:z}})},l==null||l(R),C([]),y(""),$(g),w(-1)};return r?null:S.jsxs(S.Fragment,{children:[S.jsxs("div",{"data-disabled":h,className:ur(m.container.className,e),ref:d,...p,children:[u,x.length>0&&S.jsx("div",{...m==null?void 0:m.fileContainer,children:x.map(F=>S.jsx(ZS,{...F,removeFile:T},F.name))}),S.jsxs("div",{...m.inputContainer,onClick:()=>{t&&"current"in t&&t.current&&t.current.focus()},children:[i&&S.jsx(JS,{disabled:h,onFileSelected:F=>{c&&N(F,c)}}),S.jsx(mE,{inputRef:t,composerPlaceholder:a,composerDisabled:h,textInput:g,historyIndex:b,setTextInput:y,setHistoryIndex:w,sendComposerMessage:D,allowFileUpload:i,onFilePasted:F=>{c&&N(F,c)}}),!h&&S.jsxs(S.Fragment,{children:[S.jsx(y0,{...m.sendbutton,role:"button",tabIndex:0,"aria-label":"Send Message Button","data-show":I,onClick:()=>D()}),S.jsx(gE,{disabled:I,setTextInput:y})]})]})]}),S.jsx(Uc,{components:{a:({node:F,..._})=>S.jsx("a",{..._,target:"_blank",rel:"noreferrer noopener"})},allowedElements:["a","strong","code","em","p","span"],...m.footer,children:s})]})}));var Ca={exports:{}},pi={exports:{}},xe={};/** @license React v16.13.1
262
+ */var oS=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],fa=oS.join(","),Vf=typeof Element>"u",ir=Vf?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ni=!Vf&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},or=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",a=o||n&&t&&or(t.parentNode);return a},aS=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},sS=function(t,n,r){if(or(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(fa));return n&&ir.call(t,fa)&&i.unshift(t),i=i.filter(r),i},da=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var a=o.shift();if(!or(a,!1))if(a.tagName==="SLOT"){var s=a.assignedElements(),l=s.length?s:a.children,c=da(l,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:a,candidates:c})}else{var f=ir.call(a,fa);f&&r.filter(a)&&(n||!t.includes(a))&&i.push(a);var u=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),p=!or(u,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(u&&p){var d=da(u===!0?a.children:u.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:a,candidates:d})}else o.unshift.apply(o,a.children)}}return i},qf=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Kf=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||aS(t))&&!qf(t)?0:t.tabIndex},lS=function(t,n){var r=Kf(t);return r<0&&n&&!qf(t)?0:r},cS=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Yf=function(t){return t.tagName==="INPUT"},uS=function(t){return Yf(t)&&t.type==="hidden"},fS=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},dS=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},pS=function(t){if(!t.name)return!0;var n=t.form||ni(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var o=dS(i,t.form);return!o||o===t},hS=function(t){return Yf(t)&&t.type==="radio"},mS=function(t){return hS(t)&&!pS(t)},gS=function(t){var n,r=t&&ni(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var a,s,l;for(o=!!((a=i)!==null&&a!==void 0&&(s=a.ownerDocument)!==null&&s!==void 0&&s.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var c,f,u;r=ni(i),i=(c=r)===null||c===void 0?void 0:c.host,o=!!((f=i)!==null&&f!==void 0&&(u=f.ownerDocument)!==null&&u!==void 0&&u.contains(i))}}return o},Gf=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},yS=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var a=ir.call(t,"details>summary:first-of-type"),s=a?t.parentElement:t;if(ir.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var c=t.parentElement,f=ni(t);if(c&&!c.shadowRoot&&i(c)===!0)return Gf(t);t.assignedSlot?t=t.assignedSlot:!c&&f!==t.ownerDocument?t=f.host:t=c}t=l}if(gS(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Gf(t);return!1},bS=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return ir.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},vS=function(t,n){return!(n.disabled||or(n)||uS(n)||yS(n,t)||fS(n)||bS(n))},Qf=function(t,n){return!(mS(n)||Kf(n)<0||!vS(t,n))},wS=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Jf=function(t){var n=[],r=[];return t.forEach(function(i,o){var a=!!i.scopeParent,s=a?i.scopeParent:i,l=lS(s,a),c=a?Jf(i.candidates):s;l===0?a?n.push.apply(n,c):n.push(s):r.push({documentOrder:o,tabIndex:l,item:i,isScope:a,content:c})}),r.sort(cS).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},pa=function(t,n){n=n||{};var r;return n.getShadowRoot?r=da([t],n.includeContainer,{filter:Qf.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:wS}):r=sS(t,n.includeContainer,Qf.bind(null,n)),Jf(r)};const ha="ArrowUp",ri="ArrowDown",gn="ArrowLeft",ar="ArrowRight";function ii(e,t,n){return Math.floor(e/t)!==n}function sr(e,t){return t<0||t>=e.current.length}function ma(e,t){return Ve(e,{disabledIndices:t})}function Zf(e,t){return Ve(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ve(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const a=e.current;let s=n;do{var l,c;s=s+(r?-o:o)}while(s>=0&&s<=a.length-1&&(i?i.includes(s):a[s]==null||(l=a[s])!=null&&l.hasAttribute("disabled")||((c=a[s])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return s}function xS(e,t){let{event:n,orientation:r,loop:i,cols:o,disabledIndices:a,minIndex:s,maxIndex:l,prevIndex:c,stopEvent:f=!1}=t,u=c;if(n.key===ha){if(f&&ze(n),c===-1)u=l;else if(u=Ve(e,{startingIndex:u,amount:o,decrement:!0,disabledIndices:a}),i&&(c-o<s||u<0)){const p=c%o,d=l%o,m=l-(d-p);d===p?u=l:u=d>p?m:m-o}sr(e,u)&&(u=c)}if(n.key===ri&&(f&&ze(n),c===-1?u=s:(u=Ve(e,{startingIndex:c,amount:o,disabledIndices:a}),i&&c+o>l&&(u=Ve(e,{startingIndex:c%o-o,amount:o,disabledIndices:a}))),sr(e,u)&&(u=c)),r==="both"){const p=yf(c/o);n.key===ar&&(f&&ze(n),c%o!==o-1?(u=Ve(e,{startingIndex:c,disabledIndices:a}),i&&ii(u,o,p)&&(u=Ve(e,{startingIndex:c-c%o-1,disabledIndices:a}))):i&&(u=Ve(e,{startingIndex:c-c%o-1,disabledIndices:a})),ii(u,o,p)&&(u=c)),n.key===gn&&(f&&ze(n),c%o!==0?(u=Ve(e,{startingIndex:c,disabledIndices:a,decrement:!0}),i&&ii(u,o,p)&&(u=Ve(e,{startingIndex:c+(o-c%o),decrement:!0,disabledIndices:a}))):i&&(u=Ve(e,{startingIndex:c+(o-c%o),decrement:!0,disabledIndices:a})),ii(u,o,p)&&(u=c));const d=yf(l/o)===p;sr(e,u)&&(i&&d?u=n.key===gn?l:Ve(e,{startingIndex:c-c%o-1,disabledIndices:a}):u=c)}return u}let Xf=0;function Et(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Xf);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():Xf=requestAnimationFrame(o)}var Re=typeof document<"u"?O.useLayoutEffect:O.useEffect;function oi(){return oi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oi.apply(this,arguments)}let ga=!1,kS=0;const ed=()=>"floating-ui-"+kS++;function SS(){const[e,t]=A.useState(()=>ga?ed():void 0);return Re(()=>{e==null&&t(ed())},[]),A.useEffect(()=>{ga||(ga=!0)},[]),e}const ya=A.useId||SS;function ES(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const CS=A.createContext(null),AS=A.createContext(null),td=()=>{var e;return((e=A.useContext(CS))==null?void 0:e.id)||null},ai=()=>A.useContext(AS);function lr(e){return"data-floating-ui-"+e}function _t(e){const t=O.useRef(e);return Re(()=>{t.current=e}),t}function IS(e,t){var n;let r=[],i=(n=e.find(o=>o.id===t))==null?void 0:n.parentId;for(;i;){const o=e.find(a=>a.id===i);i=o==null?void 0:o.parentId,o&&(r=r.concat(o))}return r}function yn(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(a=>{var s;return i.parentId===a.id&&((s=i.context)==null?void 0:s.open)})}),n=n.concat(r);return n}function TS(e,t){let n,r=-1;function i(o,a){a>r&&(n=o,r=a),yn(e,o).forEach(l=>{i(l.id,a+1)})}return i(t,0),e.find(o=>o.id===n)}let bn=new WeakMap,si=new WeakSet,li={},ba=0;const OS=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,nd=e=>e&&(e.host||nd(e.parentNode)),DS=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=nd(n);return e.contains(r)?r:null}).filter(n=>n!=null);function MS(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,a=DS(t,e),s=new Set,l=new Set(a),c=[];li[i]||(li[i]=new WeakMap);const f=li[i];a.forEach(u),p(t),s.clear();function u(d){!d||s.has(d)||(s.add(d),d.parentNode&&u(d.parentNode))}function p(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,m=>{if(s.has(m))p(m);else{const h=o?m.getAttribute(o):null,g=h!==null&&h!=="false",y=(bn.get(m)||0)+1,b=(f.get(m)||0)+1;bn.set(m,y),f.set(m,b),c.push(m),y===1&&g&&si.add(m),b===1&&m.setAttribute(i,""),!g&&o&&m.setAttribute(o,"true")}})}return ba++,()=>{c.forEach(d=>{const m=(bn.get(d)||0)-1,h=(f.get(d)||0)-1;bn.set(d,m),f.set(d,h),m||(!si.has(d)&&o&&d.removeAttribute(o),si.delete(d)),h||d.removeAttribute(i)}),ba--,ba||(bn=new WeakMap,bn=new WeakMap,si=new WeakSet,li={})}}function rd(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=lt(e[0]).body;return MS(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const va=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function id(e,t){const n=pa(e,va());t==="prev"&&n.reverse();const r=n.indexOf(Mt(lt(e)));return n.slice(r+1)[0]}function od(){return id(document.body,"next")}function ad(){return id(document.body,"prev")}function cr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Je(n,r)}function PS(e){pa(e,va()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function NS(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const wa={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let _S;function sd(e){e.key==="Tab"&&(e.target,clearTimeout(_S))}const ci=A.forwardRef(function(t,n){const[r,i]=A.useState();Re(()=>(Sf()&&i("button"),document.addEventListener("keydown",sd),()=>{document.removeEventListener("keydown",sd)}),[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[lr("focus-guard")]:"",style:wa};return A.createElement("span",oi({},t,o))}),ld=A.createContext(null);function LS(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=A.useState(null),o=ya(),a=cd(),s=A.useMemo(()=>({id:t,root:n,portalContext:a,uniqueId:o}),[t,n,a,o]),l=A.useRef();return Re(()=>()=>{r==null||r.remove()},[r,s]),Re(()=>{if(l.current===s)return;l.current=s;const{id:c,root:f,portalContext:u,uniqueId:p}=s,d=c?document.getElementById(c):null,m=lr("portal");if(d){const h=document.createElement("div");h.id=p,h.setAttribute(m,""),d.appendChild(h),i(h)}else{let h=f||(u==null?void 0:u.portalNode);h&&!at(h)&&(h=h.current),h=h||document.body;let g=null;c&&(g=document.createElement("div"),g.id=c,h.appendChild(g));const y=document.createElement("div");y.id=p,y.setAttribute(m,""),h=g||h,h.appendChild(y),i(y)}},[s]),r}function FS(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=LS({id:n,root:r}),[a,s]=A.useState(null),l=A.useRef(null),c=A.useRef(null),f=A.useRef(null),u=A.useRef(null),p=!!a&&!a.modal&&a.open&&i&&!!(r||o);return A.useEffect(()=>{if(!o||!i||a!=null&&a.modal)return;function d(m){o&&cr(m)&&(m.type==="focusin"?NS:PS)(o)}return o.addEventListener("focusin",d,!0),o.addEventListener("focusout",d,!0),()=>{o.removeEventListener("focusin",d,!0),o.removeEventListener("focusout",d,!0)}},[o,i,a==null?void 0:a.modal]),A.createElement(ld.Provider,{value:A.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:f,afterInsideRef:u,portalNode:o,setFocusManagerState:s}),[i,o])},p&&o&&A.createElement(ci,{"data-type":"outside",ref:l,onFocus:d=>{if(cr(d,o)){var m;(m=f.current)==null||m.focus()}else{const h=ad()||(a==null?void 0:a.refs.domReference.current);h==null||h.focus()}}}),p&&o&&A.createElement("span",{"aria-owns":o.id,style:wa}),o&&As.createPortal(t,o),p&&o&&A.createElement(ci,{"data-type":"outside",ref:c,onFocus:d=>{if(cr(d,o)){var m;(m=u.current)==null||m.focus()}else{const h=od()||(a==null?void 0:a.refs.domReference.current);h==null||h.focus(),a!=null&&a.closeOnFocusOut&&(a==null||a.onOpenChange(!1,d.nativeEvent))}}}))}const cd=()=>A.useContext(ld),RS=A.forwardRef(function(t,n){return A.createElement("button",oi({},t,{type:"button",ref:n,tabIndex:-1,style:wa}))});function BS(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:a=0,returnFocus:s=!0,modal:l=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:f=!0}=e,{open:u,refs:p,nodeId:d,onOpenChange:m,events:h,dataRef:g,elements:{domReference:y,floating:b}}=t,w=OS()?o:!0,C=_t(i),x=_t(a),E=_t(s),T=ai(),_=cd(),$=typeof a=="number"&&a<0,I=A.useRef(null),D=A.useRef(null),z=A.useRef(!1),P=A.useRef(null),L=A.useRef(!1),M=_!=null,R=y&&y.getAttribute("role")==="combobox"&&Af(y)&&$,U=A.useCallback(function(N){return N===void 0&&(N=b),N?pa(N,va()):[]},[b]),B=A.useCallback(N=>{const H=U(N);return C.current.map(k=>y&&k==="reference"?y:b&&k==="floating"?b:H).filter(Boolean).flat()},[y,b,C,U]);A.useEffect(()=>{if(r||!l)return;function N(k){if(k.key==="Tab"){Je(b,Mt(lt(b)))&&U().length===0&&!R&&ze(k);const W=B(),te=Cf(k);C.current[0]==="reference"&&te===y&&(ze(k),k.shiftKey?Et(W[W.length-1]):Et(W[1])),C.current[1]==="floating"&&te===b&&k.shiftKey&&(ze(k),Et(W[0]))}}const H=lt(b);return H.addEventListener("keydown",N),()=>{H.removeEventListener("keydown",N)}},[r,y,b,l,C,p,R,U,B]),A.useEffect(()=>{if(r||!f)return;function N(){L.current=!0,setTimeout(()=>{L.current=!1})}function H(k){const W=k.relatedTarget;queueMicrotask(()=>{const te=!(Je(y,W)||Je(b,W)||Je(W,b)||Je(_==null?void 0:_.portalNode,W)||W!=null&&W.hasAttribute(lr("focus-guard"))||T&&(yn(T.nodesRef.current,d).find(Y=>{var Z,re;return Je((Z=Y.context)==null?void 0:Z.elements.floating,W)||Je((re=Y.context)==null?void 0:re.elements.domReference,W)})||IS(T.nodesRef.current,d).find(Y=>{var Z,re;return((Z=Y.context)==null?void 0:Z.elements.floating)===W||((re=Y.context)==null?void 0:re.elements.domReference)===W})));W&&te&&!L.current&&W!==P.current&&(z.current=!0,m(!1,k))})}if(b&&fn(y))return y.addEventListener("focusout",H),y.addEventListener("pointerdown",N),!l&&b.addEventListener("focusout",H),()=>{y.removeEventListener("focusout",H),y.removeEventListener("pointerdown",N),!l&&b.removeEventListener("focusout",H)}},[r,y,b,l,d,T,_,m,f]),A.useEffect(()=>{var N;if(r)return;const H=Array.from((_==null||(N=_.portalNode)==null?void 0:N.querySelectorAll("["+lr("portal")+"]"))||[]);if(b){const k=[b,...H,I.current,D.current,C.current.includes("reference")||R?y:null].filter(te=>te!=null),W=l?rd(k,w,!w):rd(k);return()=>{W()}}},[r,y,b,l,C,_,R,w]),Re(()=>{if(r||!b)return;const N=lt(b),H=Mt(N);queueMicrotask(()=>{const k=B(b),W=x.current,te=(typeof W=="number"?k[W]:W.current)||b,Y=Je(b,H);!$&&!Y&&u&&Et(te,{preventScroll:te===b})})},[r,u,b,$,B,x]),Re(()=>{if(r||!b)return;let N=!1;const H=lt(b),k=Mt(H),W=g.current;P.current=k;function te(Y){if(Y.type==="escapeKey"&&p.domReference.current&&(P.current=p.domReference.current),["referencePress","escapeKey"].includes(Y.type))return;const Z=Y.data.returnFocus;typeof Z=="object"?(z.current=!1,N=Z.preventScroll):z.current=!Z}return h.on("dismiss",te),()=>{h.off("dismiss",te);const Y=Mt(H);(Je(b,Y)||T&&yn(T.nodesRef.current,d).some(re=>{var oe;return Je((oe=re.context)==null?void 0:oe.elements.floating,Y)})||W.openEvent&&["click","mousedown"].includes(W.openEvent.type))&&p.domReference.current&&(P.current=p.domReference.current),E.current&&fn(P.current)&&!z.current&&Et(P.current,{cancelPrevious:!1,preventScroll:N})}},[r,b,E,g,p,h,T,d]),Re(()=>{if(!(r||!_))return _.setFocusManagerState({modal:l,closeOnFocusOut:f,open:u,onOpenChange:m,refs:p}),()=>{_.setFocusManagerState(null)}},[r,_,l,u,m,p,f]),Re(()=>{if(!r&&b&&typeof MutationObserver=="function"&&!$){const N=()=>{const k=b.getAttribute("tabindex");C.current.includes("floating")||Mt(lt(b))!==p.domReference.current&&U().length===0?k!=="0"&&b.setAttribute("tabindex","0"):k!=="-1"&&b.setAttribute("tabindex","-1")};N();const H=new MutationObserver(N);return H.observe(b,{childList:!0,subtree:!0,attributes:!0}),()=>{H.disconnect()}}},[r,b,p,C,U,$]);function V(N){return r||!c||!l?null:A.createElement(RS,{ref:N==="start"?I:D,onClick:H=>m(!1,H.nativeEvent)},typeof c=="string"?c:"Dismiss")}const v=!r&&w&&!R&&(M||l);return A.createElement(A.Fragment,null,v&&A.createElement(ci,{"data-type":"inside",ref:_==null?void 0:_.beforeInsideRef,onFocus:N=>{if(l){const k=B();Et(i[0]==="reference"?k[0]:k[k.length-1])}else if(_!=null&&_.preserveTabOrder&&_.portalNode)if(z.current=!1,cr(N,_.portalNode)){const k=od()||y;k==null||k.focus()}else{var H;(H=_.beforeOutsideRef.current)==null||H.focus()}}}),!R&&V("start"),n,V("end"),v&&A.createElement(ci,{"data-type":"inside",ref:_==null?void 0:_.afterInsideRef,onFocus:N=>{if(l)Et(B()[0]);else if(_!=null&&_.preserveTabOrder&&_.portalNode)if(f&&(z.current=!0),cr(N,_.portalNode)){const k=ad()||y;k==null||k.focus()}else{var H;(H=_.afterOutsideRef.current)==null||H.focus()}}}))}function ud(e){return fn(e.target)&&e.target.tagName==="BUTTON"}function fd(e){return Af(e)}function $S(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:a=!0,event:s="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:f=!0}=t,u=A.useRef(),p=A.useRef(!1);return A.useMemo(()=>a?{reference:{onPointerDown(d){u.current=d.pointerType},onMouseDown(d){d.button===0&&(Ef(u.current)&&c||s!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,d.nativeEvent):(d.preventDefault(),r(!0,d.nativeEvent))))},onClick(d){if(s==="mousedown"&&u.current){u.current=void 0;return}Ef(u.current)&&c||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,d.nativeEvent):r(!0,d.nativeEvent))},onKeyDown(d){u.current=void 0,!(d.defaultPrevented||!f||ud(d))&&(d.key===" "&&!fd(o)&&(d.preventDefault(),p.current=!0),d.key==="Enter"&&r(!(n&&l),d.nativeEvent))},onKeyUp(d){d.defaultPrevented||!f||ud(d)||fd(o)||d.key===" "&&p.current&&(p.current=!1,r(!(n&&l),d.nativeEvent))}}}:{},[a,i,s,c,f,o,l,n,r])}const zS=A.useInsertionEffect||(e=>e());function Lt(e){const t=A.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return zS(()=>{t.current=e}),A.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}const jS={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},US={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},HS=e=>{var t,n;return{escapeKeyBubbles:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePressBubbles:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function WS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:o,elements:{reference:a,domReference:s,floating:l},dataRef:c}=e,{enabled:f=!0,escapeKey:u=!0,outsidePress:p=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:h="pointerdown",ancestorScroll:g=!1,bubbles:y}=t,b=ai(),w=td()!=null,C=Lt(typeof p=="function"?p:()=>!1),x=typeof p=="function"?C:p,E=A.useRef(!1),{escapeKeyBubbles:T,outsidePressBubbles:_}=HS(y),$=Lt(D=>{if(!n||!f||!u||D.key!=="Escape")return;const z=b?yn(b.nodesRef.current,o):[];if(!T&&(D.stopPropagation(),z.length>0)){let P=!0;if(z.forEach(L=>{var M;if((M=L.context)!=null&&M.open&&!L.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,ck(D)?D.nativeEvent:D)}),I=Lt(D=>{const z=E.current;if(E.current=!1,z||typeof x=="function"&&!x(D))return;const P=Cf(D),L="["+lr("inert")+"]",M=lt(l).querySelectorAll(L);let R=at(P)?P:null;for(;R&&!ik(R);){const V=ak(R);if(V===lt(l).body||!at(V))break;R=V}if(M.length&&at(P)&&!uk(P)&&!Je(P,l)&&Array.from(M).every(V=>!Je(R,V)))return;if(fn(P)&&l){const V=P.clientWidth>0&&P.scrollWidth>P.clientWidth,v=P.clientHeight>0&&P.scrollHeight>P.clientHeight;let N=v&&D.offsetX>P.clientWidth;if(v&&ok(P).direction==="rtl"&&(N=D.offsetX<=P.offsetWidth-P.clientWidth),N||V&&D.offsetY>P.clientHeight)return}const U=b&&yn(b.nodesRef.current,o).some(V=>{var v;return ra(D,(v=V.context)==null?void 0:v.elements.floating)});if(ra(D,l)||ra(D,s)||U)return;const B=b?yn(b.nodesRef.current,o):[];if(B.length>0){let V=!0;if(B.forEach(v=>{var N;if((N=v.context)!=null&&N.open&&!v.context.dataRef.current.__outsidePressBubbles){V=!1;return}}),!V)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:xf(D)||kf(D)}}),r(!1,D)});return A.useEffect(()=>{if(!n||!f)return;c.current.__escapeKeyBubbles=T,c.current.__outsidePressBubbles=_;function D(L){r(!1,L)}const z=lt(l);u&&z.addEventListener("keydown",$),x&&z.addEventListener(d,I);let P=[];return g&&(at(s)&&(P=Nt(s)),at(l)&&(P=P.concat(Nt(l))),!at(a)&&a&&a.contextElement&&(P=P.concat(Nt(a.contextElement)))),P=P.filter(L=>{var M;return L!==((M=z.defaultView)==null?void 0:M.visualViewport)}),P.forEach(L=>{L.addEventListener("scroll",D,{passive:!0})}),()=>{u&&z.removeEventListener("keydown",$),x&&z.removeEventListener(d,I),P.forEach(L=>{L.removeEventListener("scroll",D)})}},[c,l,s,a,u,x,d,n,r,g,f,T,_,$,I]),A.useEffect(()=>{E.current=!1},[x,d]),A.useMemo(()=>f?{reference:{onKeyDown:$,[jS[h]]:D=>{m&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,D.nativeEvent))}},floating:{onKeyDown:$,[US[d]]:()=>{E.current=!0}}}:{},[f,i,m,d,h,r,$])}let xa;process.env.NODE_ENV!=="production"&&(xa=new Set);function VS(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var o;const T="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((o=e.elements)!=null&&o.reference&&!at(e.elements.reference)){var a;if(!((a=xa)!=null&&a.has(T))){var s;(s=xa)==null||s.add(T),console.error(T)}}}const[l,c]=A.useState(null),f=((t=e.elements)==null?void 0:t.reference)||l,u=tS(e),p=ai(),d=Lt((T,_)=>{T&&(h.current.openEvent=_),r==null||r(T,_)}),m=A.useRef(null),h=A.useRef({}),g=A.useState(()=>ES())[0],y=ya(),b=A.useCallback(T=>{const _=at(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),contextElement:T}:T;u.refs.setReference(_)},[u.refs]),w=A.useCallback(T=>{(at(T)||T===null)&&(m.current=T,c(T)),(at(u.refs.reference.current)||u.refs.reference.current===null||T!==null&&!at(T))&&u.refs.setReference(T)},[u.refs]),C=A.useMemo(()=>({...u.refs,setReference:w,setPositionReference:b,domReference:m}),[u.refs,w,b]),x=A.useMemo(()=>({...u.elements,domReference:f}),[u.elements,f]),E=A.useMemo(()=>({...u,refs:C,elements:x,dataRef:h,nodeId:i,floatingId:y,events:g,open:n,onOpenChange:d}),[u,i,y,g,n,d,C,x]);return Re(()=>{const T=p==null?void 0:p.nodesRef.current.find(_=>_.id===i);T&&(T.context=E)}),A.useMemo(()=>({...u,context:E,refs:C,elements:x}),[u,C,x,E])}function ka(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(a=>{let[s,l]=a;if(s.indexOf("on")===0){if(r.has(s)||r.set(s,[]),typeof l=="function"){var c;(c=r.get(s))==null||c.push(l),i[s]=function(){for(var f,u=arguments.length,p=new Array(u),d=0;d<u;d++)p[d]=arguments[d];return(f=r.get(s))==null?void 0:f.map(m=>m(...p)).find(m=>m!==void 0)}}}else i[s]=l}),i),{})}}function qS(e){e===void 0&&(e=[]);const t=e,n=A.useCallback(o=>ka(o,e,"reference"),t),r=A.useCallback(o=>ka(o,e,"floating"),t),i=A.useCallback(o=>ka(o,e,"item"),e.map(o=>o==null?void 0:o.item));return A.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let dd=!1;function ui(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function pd(e,t){return ui(t,e===ha||e===ri,e===gn||e===ar)}function Sa(e,t,n){return ui(t,e===ri,n?e===gn:e===ar)||e==="Enter"||e==" "||e===""}function KS(e,t,n){return ui(t,n?e===gn:e===ar,e===ri)}function hd(e,t,n){return ui(t,n?e===ar:e===gn,e===ha)}function YS(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:o,floating:a}}=e,{listRef:s,activeIndex:l,onNavigate:c=()=>{},enabled:f=!0,selectedIndex:u=null,allowEscape:p=!1,loop:d=!1,nested:m=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:y="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:w=!0,disabledIndices:C=void 0,orientation:x="vertical",cols:E=1,scrollItemIntoView:T=!0,virtualItemRef:_}=t;process.env.NODE_ENV!=="production"&&(p&&(d||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),g||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),x==="vertical"&&E>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const $=td(),I=ai(),D=Lt(c),z=A.useRef(y),P=A.useRef(u??-1),L=A.useRef(null),M=A.useRef(!0),R=A.useRef(D),U=A.useRef(!!a),B=A.useRef(!1),V=A.useRef(!1),v=_t(C),N=_t(n),H=_t(T),[k,W]=A.useState(),[te,Y]=A.useState(),Z=Lt(function(G,Q,j){j===void 0&&(j=!1);const X=G.current[Q.current];X&&(g?(W(X.id),I==null||I.events.emit("virtualfocus",X),_&&(_.current=X)):Et(X,{preventScroll:!0,sync:lk()&&Sf()?dd||B.current:!1}),requestAnimationFrame(()=>{const ae=H.current;ae&&X&&(j||!M.current)&&(X.scrollIntoView==null||X.scrollIntoView(typeof ae=="boolean"?{block:"nearest",inline:"nearest"}:ae))}))});Re(()=>{document.createElement("div").focus({get preventScroll(){return dd=!0,!1}})},[]),Re(()=>{f&&(n&&a?z.current&&u!=null&&(V.current=!0,D(u)):U.current&&(P.current=-1,R.current(null)))},[f,n,a,u,D]),Re(()=>{if(f&&n&&a)if(l==null){if(B.current=!1,u!=null)return;if(U.current&&(P.current=-1,Z(s,P)),!U.current&&z.current&&(L.current!=null||z.current===!0&&L.current==null)){let G=0;const Q=()=>{s.current[0]==null?(G<2&&(G?requestAnimationFrame:queueMicrotask)(Q),G++):(P.current=L.current==null||Sa(L.current,x,h)||m?ma(s,v.current):Zf(s,v.current),L.current=null,D(P.current))};Q()}}else sr(s,l)||(P.current=l,Z(s,P,V.current),V.current=!1)},[f,n,a,l,u,m,s,x,h,D,Z,v]),Re(()=>{var G,Q;if(!f||a||!I||g||!U.current)return;const j=I.nodesRef.current,X=(G=j.find(ie=>ie.id===$))==null||(Q=G.context)==null?void 0:Q.elements.floating,ae=Mt(lt(a)),pe=j.some(ie=>ie.context&&Je(ie.context.elements.floating,ae));X&&!pe&&M.current&&X.focus({preventScroll:!0})},[f,a,I,$,g]),Re(()=>{if(!f||!I||!g||$)return;function G(Q){Y(Q.id),_&&(_.current=Q)}return I.events.on("virtualfocus",G),()=>{I.events.off("virtualfocus",G)}},[f,I,g,$,_]),Re(()=>{R.current=D,U.current=!!a}),Re(()=>{n||(L.current=null)},[n]);const re=l!=null,oe=A.useMemo(()=>{function G(j){if(!n)return;const X=s.current.indexOf(j);X!==-1&&D(X)}return{onFocus(j){let{currentTarget:X}=j;G(X)},onClick:j=>{let{currentTarget:X}=j;return X.focus({preventScroll:!0})},...b&&{onMouseMove(j){let{currentTarget:X}=j;G(X)},onPointerLeave(j){let{pointerType:X}=j;!M.current||X==="touch"||(P.current=-1,Z(s,P),D(null),g||Et(i.floating.current,{preventScroll:!0}))}}}},[n,i,Z,b,s,D,g]);return A.useMemo(()=>{if(!f)return{};const G=v.current;function Q(ie){if(M.current=!1,B.current=!0,!N.current&&ie.currentTarget===i.floating.current)return;if(m&&hd(ie.key,x,h)){ze(ie),r(!1,ie.nativeEvent),fn(o)&&!g&&o.focus();return}const K=P.current,ce=ma(s,G),he=Zf(s,G);if(ie.key==="Home"&&(ze(ie),P.current=ce,D(P.current)),ie.key==="End"&&(ze(ie),P.current=he,D(P.current)),!(E>1&&(P.current=xS(s,{event:ie,orientation:x,loop:d,cols:E,disabledIndices:G,minIndex:ce,maxIndex:he,prevIndex:P.current,stopEvent:!0}),D(P.current),x==="both"))&&pd(ie.key,x)){if(ze(ie),n&&!g&&Mt(ie.currentTarget.ownerDocument)===ie.currentTarget){P.current=Sa(ie.key,x,h)?ce:he,D(P.current);return}Sa(ie.key,x,h)?d?P.current=K>=he?p&&K!==s.current.length?-1:ce:Ve(s,{startingIndex:K,disabledIndices:G}):P.current=Math.min(he,Ve(s,{startingIndex:K,disabledIndices:G})):d?P.current=K<=ce?p&&K!==-1?s.current.length:he:Ve(s,{startingIndex:K,decrement:!0,disabledIndices:G}):P.current=Math.max(ce,Ve(s,{startingIndex:K,decrement:!0,disabledIndices:G})),sr(s,P.current)?D(null):D(P.current)}}function j(ie){y==="auto"&&xf(ie.nativeEvent)&&(z.current=!0)}function X(ie){z.current=y,y==="auto"&&kf(ie.nativeEvent)&&(z.current=!0)}const ae=g&&n&&re&&{"aria-activedescendant":te||k},pe=s.current.find(ie=>(ie==null?void 0:ie.id)===k);return{reference:{...ae,onKeyDown(ie){M.current=!1;const K=ie.key.indexOf("Arrow")===0,ce=KS(ie.key,x,h),he=hd(ie.key,x,h),Ce=pd(ie.key,x),ke=(m?ce:Ce)||ie.key==="Enter"||ie.key.trim()==="";if(g&&n){const se=I==null?void 0:I.nodesRef.current.find(q=>q.parentId==null),F=I&&se?TS(I.nodesRef.current,se.id):null;if(K&&F&&_){const q=new KeyboardEvent("keydown",{key:ie.key,bubbles:!0});if(ce||he){var je,Ye;const le=((je=F.context)==null?void 0:je.elements.domReference)===ie.currentTarget,ue=he&&!le?(Ye=F.context)==null?void 0:Ye.elements.domReference:ce?pe:null;ue&&(ze(ie),ue.dispatchEvent(q),Y(void 0))}if(Ce&&F.context&&F.context.open&&F.parentId&&ie.currentTarget!==F.context.elements.domReference){var ee;ze(ie),(ee=F.context.elements.domReference)==null||ee.dispatchEvent(q);return}}return Q(ie)}if(!(!n&&!w&&K)){if(ke&&(L.current=m&&Ce?null:ie.key),m){ce&&(ze(ie),n?(P.current=ma(s,G),D(P.current)):r(!0,ie.nativeEvent));return}Ce&&(u!=null&&(P.current=u),ze(ie),!n&&w?r(!0,ie.nativeEvent):Q(ie),n&&D(P.current))}},onFocus(){n&&D(null)},onPointerDown:X,onMouseDown:j,onClick:j},floating:{"aria-orientation":x==="both"?void 0:x,...ae,onKeyDown:Q,onPointerMove(){M.current=!0}},item:oe}},[o,i,k,te,v,N,s,f,x,h,g,n,re,m,u,w,p,E,d,y,D,r,oe,I,_])}function GS(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:o="dialog"}=t,a=ya();return A.useMemo(()=>{const s={id:r,role:o};return i?o==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:s}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?r:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:a}},floating:{...s,...o==="menu"&&{"aria-labelledby":a}}}:{}},[i,o,n,r,a])}function QS(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:a,onMatch:s,onTypingChange:l,enabled:c=!0,findMatch:f=null,resetMs:u=750,ignoreKeys:p=[],selectedIndex:d=null}=t,m=A.useRef(),h=A.useRef(""),g=A.useRef((n=d??a)!=null?n:-1),y=A.useRef(null),b=Lt(s),w=Lt(l),C=_t(f),x=_t(p);return Re(()=>{r&&(clearTimeout(m.current),y.current=null,h.current="")},[r]),Re(()=>{if(r&&h.current===""){var E;g.current=(E=d??a)!=null?E:-1}},[r,d,a]),A.useMemo(()=>{if(!c)return{};function E($){$?i.current.typing||(i.current.typing=$,w($)):i.current.typing&&(i.current.typing=$,w($))}function T($,I,D){const z=C.current?C.current(I,D):I.find(P=>(P==null?void 0:P.toLocaleLowerCase().indexOf(D.toLocaleLowerCase()))===0);return z?$.indexOf(z):-1}function _($){const I=o.current;if(h.current.length>0&&h.current[0]!==" "&&(T(I,I,h.current)===-1?E(!1):$.key===" "&&ze($)),I==null||x.current.includes($.key)||$.key.length!==1||$.ctrlKey||$.metaKey||$.altKey)return;r&&$.key!==" "&&(ze($),E(!0)),I.every(L=>{var M,R;return L?((M=L[0])==null?void 0:M.toLocaleLowerCase())!==((R=L[1])==null?void 0:R.toLocaleLowerCase()):!0})&&h.current===$.key&&(h.current="",g.current=y.current),h.current+=$.key,clearTimeout(m.current),m.current=setTimeout(()=>{h.current="",g.current=y.current,E(!1)},u);const z=g.current,P=T(I,[...I.slice((z||0)+1),...I.slice(0,(z||0)+1)],h.current);P!==-1?(b(P),y.current=P):$.key!==" "&&(h.current="",E(!1))}return{reference:{onKeyDown:_},floating:{onKeyDown:_,onKeyUp($){$.key===" "&&E(!1)}}}},[c,r,i,o,u,x,C,b,w])}const JS=({options:e,reusable:t,sendMessage:n,isReadOnly:r})=>{var M,R,U,B,V;const i=sn(v=>v.messageContainerRef),o=sn(v=>v.portalContainer),[a,s]=A.useState(!1),[l,c]=A.useState(null),[f,u]=A.useState(null),{message:{blocks:{dropdown:p}}}=ge,d=e.reduce((v,N)=>(v[N.label]=N.value,v),{}),m=d?Object.keys(d):[],h=v=>{s(f!==null&&!t?!1:v)},{refs:g,floatingStyles:y,context:b}=VS({placement:"bottom-start",open:a,onOpenChange:h,whileElementsMounted:Yk,middleware:[nS(5),rS({padding:10,boundary:(i==null?void 0:i.current)??void 0,crossAxis:!0}),iS({apply({rects:v,elements:N,availableHeight:H}){Object.assign(N.floating.style,{maxHeight:`${H}px`,minWidth:`${v.reference.width}px`})},padding:10})]}),w=A.useRef([]),C=A.useRef(m),x=A.useRef(!1),E=$S(b,{event:"mousedown"}),T=WS(b),_=GS(b,{role:"listbox"}),$=YS(b,{listRef:w,activeIndex:l,selectedIndex:f,onNavigate:c,loop:!0}),I=QS(b,{listRef:C,activeIndex:l,selectedIndex:f,onMatch:a?c:u,onTypingChange(v){x.current=v}}),{getReferenceProps:D,getFloatingProps:z,getItemProps:P}=qS([T,_,$,I,E]),L=v=>{u(v),m[v]!==void 0&&(n==null||n({type:"text",text:m[v]??"",value:d[m[v]]??""})),s(!1)};return S.jsxs(S.Fragment,{children:[S.jsxs("div",{tabIndex:0,ref:g.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":f!==null&&!t?"":void 0,style:r?{pointerEvents:"none"}:void 0,...(M=p.button)==null?void 0:M.container,...D(),children:[S.jsx("span",{...(R=p.button)==null?void 0:R.text,children:f?m[f]:"Select..."}),S.jsx(w0,{...(U=p.button)==null?void 0:U.icon})]}),a&&S.jsx(FS,{root:o??void 0,children:S.jsx(BS,{context:b,modal:!1,children:S.jsx("div",{ref:g.setFloating,className:(V=(B=p.content)==null?void 0:B.container)==null?void 0:V.className,style:{...y,pointerEvents:"auto"},...z(),children:m.map((v,N)=>{var H;return S.jsx("div",{ref:k=>{w.current[N]=k},role:"option",tabIndex:N===l?0:-1,"aria-selected":N===f&&N===l,"data-active":N===l?"":void 0,...(H=p.content)==null?void 0:H.item,...P({onClick(){L(N)},onKeyDown(k){k.key==="Enter"&&(k.preventDefault(),L(N)),k.key===" "&&!x.current&&(k.preventDefault(),L(N))}}),children:v},v)})})})})]})},md=O.forwardRef(({title:e,url:t,isReadOnly:n,...r},i)=>{const{message:{blocks:{file:o}}}=ge;return S.jsxs("a",{...r,...o.container,href:t,style:n?{pointerEvents:"none"}:void 0,download:!0,ref:i,target:"_blank",rel:"noreferrer",children:[S.jsx("p",{...o.title,children:e||t}),S.jsx(A0,{...o.icon})]})});md.displayName="File";const ZS=Ot()((e,t)=>({components:{},getCustomComponent:async n=>{const r=t().components[n];if(r)return r;const i=await fetch(n).then(c=>c.text()),o=new Blob([i],{type:"application/javascript"}),s=await import(URL.createObjectURL(o)),l=()=>s.default;return e(c=>({components:{...c.components,[n]:l}})),l}}));globalThis.React=O;const gd={audio:rf,bubble:Ju,button:w1,carousel:gf,column:af,dropdown:JS,file:md,image:tf,location:of,row:sf,text:V0,video:nf,custom:({url:e,name:t,data:n,...r})=>{const i=ZS(c=>c.getCustomComponent),[o,a]=O.useState(null),[s,l]=O.useState(null);return O.useEffect(()=>{i(e).then(a).catch(c=>{l(c.message)})},[e]),s?S.jsx("div",{style:{color:"red"},children:s}):o?S.jsx(o,{...n,...r}):null}},Kt=({block:e,renderers:t,...n})=>{const r=(t==null?void 0:t[e.type])??gd[e.type],i={...n,...e};return S.jsx(r,{...i})};function yd(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=yd(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ur(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=yd(e))&&(r&&(r+=" "),r+=t);return r}const XS=({disabled:e,onFileSelected:t})=>{const n=O.useRef(null),{uploadButton:r}=ge.composer,i=()=>{n.current&&n.current.click()},o=a=>{const s=a.target.files;s&&s.length>0&&Array.from(s).forEach(l=>{t(l)})};return S.jsxs(S.Fragment,{children:[S.jsx(R0,{...r,role:"button",tabIndex:0,"aria-label":"Upload File Button","data-disabled":e,onClick:i}),S.jsx("input",{value:"",multiple:!0,type:"file",ref:n,style:{display:"none"},onChange:o})]})},eE=({name:e,type:t,instance:n,status:r,removeFile:i})=>{const{loader:o,fileIcon:a,removeIcon:s,errorIcon:l,previewImage:c}=ge.composer.fileWidget,f=["PNG","JPEG","JPG"].includes(di(n.name));return r==="loading"?S.jsx(fi,{name:e,status:r,removeButton:S.jsx("div",{...o}),extension:di(n.name),children:S.jsx("div",{...a.container,children:S.jsx(Ea,{type:t,...a.icon})})}):r==="error"?S.jsx(fi,{name:e,status:r,removeButton:S.jsx(bd,{removeFile:()=>i(e)}),extension:"Upload Error",children:S.jsxs("div",{...a.container,children:[S.jsx(S0,{...l}),S.jsx(Ea,{type:t,...a.icon})]})}):r=="uploaded"&&f?S.jsx(fi,{name:e,status:r,removeButton:S.jsx(bd,{removeFile:()=>i(e)}),extension:di(n.name),children:S.jsx("div",{...a.container,children:S.jsx("img",{src:URL.createObjectURL(n),alt:e,...c})})}):S.jsx(fi,{name:e,status:r,removeButton:S.jsx(ku,{onClick:()=>i(e),...s}),extension:di(n.name),children:S.jsx("div",{...a.container,children:S.jsx(Ea,{type:t,...a.icon})})})},fi=({name:e,status:t,removeButton:n,children:r,extension:i})=>{const{container:o,metadata:a}=ge.composer.fileWidget;return S.jsxs("div",{"data-status":t,title:e,...o,children:[n,r,S.jsxs("div",{...a.container,children:[S.jsx("div",{...a.name,children:e}),S.jsx("div",{...a.type,children:i})]})]})},Ea=({type:e,...t})=>e==="image"?S.jsx(O0,{...t}):e==="video"?S.jsx(U0,{...t}):e==="audio"?S.jsx(Cu,{...t}):S.jsx(Su,{...t}),di=e=>{if(!e)return"File";const t=e.split(".").pop();return t?t.toUpperCase():"File"},bd=({removeFile:e})=>{const{composer:{fileWidget:{removeIcon:t}}}=ge;return S.jsx(ku,{role:"button",tabIndex:0,"aria-label":"Remove File Button",onClick:()=>e(),...t})};function tE(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var nE=O.useLayoutEffect,rE=function(t){var n=O.useRef(t);return nE(function(){n.current=t}),n},vd=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},iE=function(t,n){var r=O.useRef();return O.useCallback(function(i){t.current=i,r.current&&vd(r.current,null),r.current=n,n&&vd(n,i)},[n])},wd={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},oE=function(t){Object.keys(wd).forEach(function(n){t.style.setProperty(n,wd[n],"important")})},xd=oE,Ke=null,kd=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function aE(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Ke||(Ke=document.createElement("textarea"),Ke.setAttribute("tabindex","-1"),Ke.setAttribute("aria-hidden","true"),xd(Ke)),Ke.parentNode===null&&document.body.appendChild(Ke);var i=e.paddingSize,o=e.borderSize,a=e.sizingStyle,s=a.boxSizing;Object.keys(a).forEach(function(p){var d=p;Ke.style[d]=a[d]}),xd(Ke),Ke.value=t;var l=kd(Ke,e);Ke.value=t,l=kd(Ke,e),Ke.value="x";var c=Ke.scrollHeight-i,f=c*n;s==="border-box"&&(f=f+i+o),l=Math.max(f,l);var u=c*r;return s==="border-box"&&(u=u+i+o),l=Math.min(u,l),[l,c]}var Sd=function(){},sE=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},lE=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],cE=!!document.documentElement.currentStyle,uE=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=sE(lE,n),i=r.boxSizing;if(i==="")return null;cE&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),a=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:a}},fE=uE;function Ed(e,t,n){var r=rE(n);A.useLayoutEffect(function(){var i=function(a){return r.current(a)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var dE=function(t){Ed(window,"resize",t)},pE=function(t){Ed(document.fonts,"loadingdone",t)},hE=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],mE=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,o=t.minRows,a=t.onChange,s=a===void 0?Sd:a,l=t.onHeightChange,c=l===void 0?Sd:l,f=tE(t,hE),u=f.value!==void 0,p=A.useRef(null),d=iE(p,n),m=A.useRef(0),h=A.useRef(),g=function(){var w=p.current,C=r&&h.current?h.current:fE(w);if(C){h.current=C;var x=aE(C,w.value||w.placeholder||"x",o,i),E=x[0],T=x[1];m.current!==E&&(m.current=E,w.style.setProperty("height",E+"px","important"),c(E,{rowHeight:T}))}},y=function(w){u||g(),s(w)};return A.useLayoutEffect(g),dE(g),pE(g),A.createElement("textarea",xt({},f,{onChange:y,ref:d}))},gE=A.forwardRef(mE);const yE=({inputRef:e,composerPlaceholder:t,composerDisabled:n,textInput:r,historyIndex:i,setTextInput:o,setHistoryIndex:a,sendComposerMessage:s,allowFileUpload:l,onFilePasted:c})=>{const f=Fu(h=>h.messageHistory),[u,p]=O.useState(""),{input:d}=ge.composer,m=h=>{if(!l||!c||!h.clipboardData)return;const g=Array.from(h.clipboardData.files);g.length>0&&(h.preventDefault(),g.forEach(y=>{c(y)}))};return S.jsx(gE,{...d,"aria-label":"Message Input",ref:e,placeholder:t??"Type your message...",disabled:n,value:r,"data-has-value":!!r,onChange:h=>{const g=h.target.value;o(g),f.includes(g)||a(-1)},onPaste:m,maxRows:5,onKeyDown:h=>{if(n)return;const g=h.nativeEvent;if(!(g.isComposing||g.keyCode===229)&&(h.key==="Enter"&&h.shiftKey?(h.preventDefault(),o(`${r}
263
+ `)):h.key==="Enter"&&(h.preventDefault(),s()),!(r.trim().includes(`
264
+ `)||r.trim().includes("\r")))){if(h.key==="ArrowUp"){h.preventDefault(),i===-1&&r.trim()!==""&&p(r);const y=Math.min(i+1,f.length-1);a(y),o(f[y]??"")}if(h.key==="ArrowDown"){h.preventDefault();const y=Math.max(i-1,-1);o(i===-1?r.trim():y===-1?u:f[y]??""),a(y)}}}})},bE=({disabled:e,setTextInput:t})=>{const[n,r]=O.useState(!1),i=O.useRef(null),{voiceButton:o}=ge.composer,a=window.SpeechRecognition||window.webkitSpeechRecognition,s=()=>{i.current||(i.current=new a);const l=i.current;l&&(l.continuous=!0,l.onresult=c=>{var u,p,d;const f=((d=(p=(u=c.results)==null?void 0:u[0])==null?void 0:p[0])==null?void 0:d.transcript)??"";t(f??""),l.stop(),r(!1)},n?(l.stop(),r(!1)):(l.start(),r(!0)))};if(a)return S.jsx(_0,{...o,tabIndex:0,"aria-label":"Voice Input Button",role:"button","data-show":!e,"data-listens":!!n,onClick:s})},Cd=O.memo(O.forwardRef(({className:e,inputRef:t,disableComposer:n,isReadOnly:r,allowFileUpload:i,disableSendButton:o,connected:a,composerPlaceholder:s,footer:l,sendMessage:c,uploadFile:f,storageKey:u,children:p,...d},m)=>{const{composer:h}=ge,g=n||r||!a,[y,b]=O.useState(""),[w,C]=O.useState(-1),x=Yu(u),E=x(P=>P.files),T=x(P=>P.setFiles),_=x(P=>P.deleteFile),$=x(P=>P.uploadFile),I=Fu(P=>P.addMessageToHistory),D=!!y||E.filter(P=>P.status==="uploaded").length>0;t=t??O.useRef(null);const z=()=>{if(o)return;const P=E.filter(R=>R.status==="uploaded");if(!P.length&&!y)return;const L=(P==null?void 0:P.map(R=>{const U=R.url,B=R.type;return{video:{type:"video",videoUrl:U},audio:{type:"audio",audioUrl:U},image:{type:"image",imageUrl:U}}[B]??{title:R.name,type:"file",fileUrl:U}}))??[];y&&L.push({type:"text",text:y});let M;L.length==1?M=L[0]:M={type:"bloc",items:L.map(U=>{const{type:B,...V}=U;return{type:B,payload:V}})},b(""),y.trim()!==""&&(c==null||c(M),T([]),I(y),C(-1))};return r?null:S.jsxs(S.Fragment,{children:[S.jsxs("div",{"data-disabled":g,"data-waiting":o,className:ur(h.container.className,e),ref:m,...d,children:[p,E.length>0&&S.jsx("div",{...h==null?void 0:h.fileContainer,children:E.map(P=>S.jsx(eE,{...P,removeFile:_},P.name))}),S.jsxs("div",{...h.inputContainer,onClick:()=>{t&&"current"in t&&t.current&&t.current.focus()},children:[i&&S.jsx(XS,{disabled:g,onFileSelected:P=>{f&&$(P,f)}}),S.jsx(yE,{inputRef:t,composerPlaceholder:s,composerDisabled:g,textInput:y,historyIndex:w,setTextInput:b,setHistoryIndex:C,sendComposerMessage:z,allowFileUpload:i,onFilePasted:P=>{f&&$(P,f)}}),o&&S.jsx(D0,{...h.inputLoader,role:"status","data-show":o}),!g&&!o&&S.jsxs(S.Fragment,{children:[S.jsx(b0,{...h.sendbutton,role:"button",tabIndex:0,"aria-label":"Send Message Button","data-show":D,onClick:()=>z()}),S.jsx(bE,{disabled:D,setTextInput:b})]})]})]}),S.jsx(zc,{components:{a:({node:P,...L})=>S.jsx("a",{...L,target:"_blank",rel:"noreferrer noopener"})},allowedElements:["a","strong","code","em","p","span"],...h.footer,children:l})]})}));var Ca={exports:{}},pi={exports:{}},Se={};/** @license React v16.13.1
259
265
  * react-is.production.min.js
260
266
  *
261
267
  * Copyright (c) Facebook, Inc. and its affiliates.
262
268
  *
263
269
  * This source code is licensed under the MIT license found in the
264
270
  * LICENSE file in the root directory of this source tree.
265
- */var Td;function yE(){if(Td)return xe;Td=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function w(x){if(typeof x=="object"&&x!==null){var C=x.$$typeof;switch(C){case t:switch(x=x.type,x){case l:case c:case r:case o:case i:case u:return x;default:switch(x=x&&x.$$typeof,x){case s:case f:case m:case d:case a:return x;default:return C}}case n:return C}}}function E(x){return w(x)===c}return xe.AsyncMode=l,xe.ConcurrentMode=c,xe.ContextConsumer=s,xe.ContextProvider=a,xe.Element=t,xe.ForwardRef=f,xe.Fragment=r,xe.Lazy=m,xe.Memo=d,xe.Portal=n,xe.Profiler=o,xe.StrictMode=i,xe.Suspense=u,xe.isAsyncMode=function(x){return E(x)||w(x)===l},xe.isConcurrentMode=E,xe.isContextConsumer=function(x){return w(x)===s},xe.isContextProvider=function(x){return w(x)===a},xe.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===t},xe.isForwardRef=function(x){return w(x)===f},xe.isFragment=function(x){return w(x)===r},xe.isLazy=function(x){return w(x)===m},xe.isMemo=function(x){return w(x)===d},xe.isPortal=function(x){return w(x)===n},xe.isProfiler=function(x){return w(x)===o},xe.isStrictMode=function(x){return w(x)===i},xe.isSuspense=function(x){return w(x)===u},xe.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===r||x===c||x===o||x===i||x===u||x===p||typeof x=="object"&&x!==null&&(x.$$typeof===m||x.$$typeof===d||x.$$typeof===a||x.$$typeof===s||x.$$typeof===f||x.$$typeof===g||x.$$typeof===y||x.$$typeof===b||x.$$typeof===h)},xe.typeOf=w,xe}var ke={};/** @license React v16.13.1
271
+ */var Ad;function vE(){if(Ad)return Se;Ad=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function w(x){if(typeof x=="object"&&x!==null){var E=x.$$typeof;switch(E){case t:switch(x=x.type,x){case l:case c:case r:case o:case i:case u:return x;default:switch(x=x&&x.$$typeof,x){case s:case f:case m:case d:case a:return x;default:return E}}case n:return E}}}function C(x){return w(x)===c}return Se.AsyncMode=l,Se.ConcurrentMode=c,Se.ContextConsumer=s,Se.ContextProvider=a,Se.Element=t,Se.ForwardRef=f,Se.Fragment=r,Se.Lazy=m,Se.Memo=d,Se.Portal=n,Se.Profiler=o,Se.StrictMode=i,Se.Suspense=u,Se.isAsyncMode=function(x){return C(x)||w(x)===l},Se.isConcurrentMode=C,Se.isContextConsumer=function(x){return w(x)===s},Se.isContextProvider=function(x){return w(x)===a},Se.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===t},Se.isForwardRef=function(x){return w(x)===f},Se.isFragment=function(x){return w(x)===r},Se.isLazy=function(x){return w(x)===m},Se.isMemo=function(x){return w(x)===d},Se.isPortal=function(x){return w(x)===n},Se.isProfiler=function(x){return w(x)===o},Se.isStrictMode=function(x){return w(x)===i},Se.isSuspense=function(x){return w(x)===u},Se.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===r||x===c||x===o||x===i||x===u||x===p||typeof x=="object"&&x!==null&&(x.$$typeof===m||x.$$typeof===d||x.$$typeof===a||x.$$typeof===s||x.$$typeof===f||x.$$typeof===g||x.$$typeof===y||x.$$typeof===b||x.$$typeof===h)},Se.typeOf=w,Se}var Ee={};/** @license React v16.13.1
266
272
  * react-is.development.js
267
273
  *
268
274
  * Copyright (c) Facebook, Inc. and its affiliates.
269
275
  *
270
276
  * This source code is licensed under the MIT license found in the
271
277
  * LICENSE file in the root directory of this source tree.
272
- */var Od;function bE(){return Od||(Od=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function w(j){return typeof j=="string"||typeof j=="function"||j===r||j===c||j===o||j===i||j===u||j===p||typeof j=="object"&&j!==null&&(j.$$typeof===m||j.$$typeof===d||j.$$typeof===a||j.$$typeof===s||j.$$typeof===f||j.$$typeof===g||j.$$typeof===y||j.$$typeof===b||j.$$typeof===h)}function E(j){if(typeof j=="object"&&j!==null){var ne=j.$$typeof;switch(ne){case t:var se=j.type;switch(se){case l:case c:case r:case o:case i:case u:return se;default:var K=se&&se.$$typeof;switch(K){case s:case f:case m:case d:case a:return K;default:return ne}}case n:return ne}}}var x=l,C=c,T=s,N=a,$=t,I=f,D=r,F=m,_=d,R=n,P=o,L=i,U=u,z=!1;function q(j){return z||(z=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),v(j)||E(j)===l}function v(j){return E(j)===c}function M(j){return E(j)===s}function H(j){return E(j)===a}function k(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function W(j){return E(j)===f}function te(j){return E(j)===r}function Y(j){return E(j)===m}function X(j){return E(j)===d}function oe(j){return E(j)===n}function ae(j){return E(j)===o}function J(j){return E(j)===i}function Q(j){return E(j)===u}ke.AsyncMode=x,ke.ConcurrentMode=C,ke.ContextConsumer=T,ke.ContextProvider=N,ke.Element=$,ke.ForwardRef=I,ke.Fragment=D,ke.Lazy=F,ke.Memo=_,ke.Portal=R,ke.Profiler=P,ke.StrictMode=L,ke.Suspense=U,ke.isAsyncMode=q,ke.isConcurrentMode=v,ke.isContextConsumer=M,ke.isContextProvider=H,ke.isElement=k,ke.isForwardRef=W,ke.isFragment=te,ke.isLazy=Y,ke.isMemo=X,ke.isPortal=oe,ke.isProfiler=ae,ke.isStrictMode=J,ke.isSuspense=Q,ke.isValidElementType=w,ke.typeOf=E}()),ke}var Dd;function Md(){return Dd||(Dd=1,process.env.NODE_ENV==="production"?pi.exports=yE():pi.exports=bE()),pi.exports}/*
278
+ */var Id;function wE(){return Id||(Id=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function w(j){return typeof j=="string"||typeof j=="function"||j===r||j===c||j===o||j===i||j===u||j===p||typeof j=="object"&&j!==null&&(j.$$typeof===m||j.$$typeof===d||j.$$typeof===a||j.$$typeof===s||j.$$typeof===f||j.$$typeof===g||j.$$typeof===y||j.$$typeof===b||j.$$typeof===h)}function C(j){if(typeof j=="object"&&j!==null){var X=j.$$typeof;switch(X){case t:var ae=j.type;switch(ae){case l:case c:case r:case o:case i:case u:return ae;default:var pe=ae&&ae.$$typeof;switch(pe){case s:case f:case m:case d:case a:return pe;default:return X}}case n:return X}}}var x=l,E=c,T=s,_=a,$=t,I=f,D=r,z=m,P=d,L=n,M=o,R=i,U=u,B=!1;function V(j){return B||(B=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),v(j)||C(j)===l}function v(j){return C(j)===c}function N(j){return C(j)===s}function H(j){return C(j)===a}function k(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function W(j){return C(j)===f}function te(j){return C(j)===r}function Y(j){return C(j)===m}function Z(j){return C(j)===d}function re(j){return C(j)===n}function oe(j){return C(j)===o}function G(j){return C(j)===i}function Q(j){return C(j)===u}Ee.AsyncMode=x,Ee.ConcurrentMode=E,Ee.ContextConsumer=T,Ee.ContextProvider=_,Ee.Element=$,Ee.ForwardRef=I,Ee.Fragment=D,Ee.Lazy=z,Ee.Memo=P,Ee.Portal=L,Ee.Profiler=M,Ee.StrictMode=R,Ee.Suspense=U,Ee.isAsyncMode=V,Ee.isConcurrentMode=v,Ee.isContextConsumer=N,Ee.isContextProvider=H,Ee.isElement=k,Ee.isForwardRef=W,Ee.isFragment=te,Ee.isLazy=Y,Ee.isMemo=Z,Ee.isPortal=re,Ee.isProfiler=oe,Ee.isStrictMode=G,Ee.isSuspense=Q,Ee.isValidElementType=w,Ee.typeOf=C}()),Ee}var Td;function Od(){return Td||(Td=1,process.env.NODE_ENV==="production"?pi.exports=vE():pi.exports=wE()),pi.exports}/*
273
279
  object-assign
274
280
  (c) Sindre Sorhus
275
281
  @license MIT
276
- */var Aa,Pd;function vE(){if(Pd)return Aa;Pd=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var a={},s=0;s<10;s++)a["_"+String.fromCharCode(s)]=s;var l=Object.getOwnPropertyNames(a).map(function(f){return a[f]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(f){c[f]=f}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Aa=i()?Object.assign:function(o,a){for(var s,l=r(o),c,f=1;f<arguments.length;f++){s=Object(arguments[f]);for(var u in s)t.call(s,u)&&(l[u]=s[u]);if(e){c=e(s);for(var p=0;p<c.length;p++)n.call(s,c[p])&&(l[c[p]]=s[c[p]])}}return l},Aa}var Ia,Nd;function Ta(){if(Nd)return Ia;Nd=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ia=e,Ia}var Oa,_d;function Ld(){return _d||(_d=1,Oa=Function.call.bind(Object.prototype.hasOwnProperty)),Oa}var Da,Fd;function wE(){if(Fd)return Da;Fd=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Ta(),n={},r=Ld();e=function(o){var a="Warning: "+o;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function i(o,a,s,l,c){if(process.env.NODE_ENV!=="production"){for(var f in o)if(r(o,f)){var u;try{if(typeof o[f]!="function"){var p=Error((l||"React class")+": "+s+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}u=o[f](a,f,l,s,null,t)}catch(m){u=m}if(u&&!(u instanceof Error)&&e((l||"React class")+": type specification of "+s+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in n)){n[u.message]=!0;var d=c?c():"";e("Failed "+s+" type: "+u.message+(d??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Da=i,Da}var Ma,Rd;function xE(){if(Rd)return Ma;Rd=1;var e=Md(),t=vE(),n=Ta(),r=Ld(),i=wE(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(s){var l="Warning: "+s;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function a(){return null}return Ma=function(s,l){var c=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function u(v){var M=v&&(c&&v[c]||v[f]);if(typeof M=="function")return M}var p="<<anonymous>>",d={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:b(),arrayOf:w,element:E(),elementType:x(),instanceOf:C,node:I(),objectOf:N,oneOf:T,oneOfType:$,shape:F,exact:_};function m(v,M){return v===M?v!==0||1/v===1/M:v!==v&&M!==M}function h(v,M){this.message=v,this.data=M&&typeof M=="object"?M:{},this.stack=""}h.prototype=Error.prototype;function g(v){if(process.env.NODE_ENV!=="production")var M={},H=0;function k(te,Y,X,oe,ae,J,Q){if(oe=oe||p,J=J||X,Q!==n){if(l){var j=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw j.name="Invariant Violation",j}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=oe+":"+X;!M[ne]&&H<3&&(o("You are manually calling a React.PropTypes validation function for the `"+J+"` prop on `"+oe+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),M[ne]=!0,H++)}}return Y[X]==null?te?Y[X]===null?new h("The "+ae+" `"+J+"` is marked as required "+("in `"+oe+"`, but its value is `null`.")):new h("The "+ae+" `"+J+"` is marked as required in "+("`"+oe+"`, but its value is `undefined`.")):null:v(Y,X,oe,ae,J)}var W=k.bind(null,!1);return W.isRequired=k.bind(null,!0),W}function y(v){function M(H,k,W,te,Y,X){var oe=H[k],ae=L(oe);if(ae!==v){var J=U(oe);return new h("Invalid "+te+" `"+Y+"` of type "+("`"+J+"` supplied to `"+W+"`, expected ")+("`"+v+"`."),{expectedType:v})}return null}return g(M)}function b(){return g(a)}function w(v){function M(H,k,W,te,Y){if(typeof v!="function")return new h("Property `"+Y+"` of component `"+W+"` has invalid PropType notation inside arrayOf.");var X=H[k];if(!Array.isArray(X)){var oe=L(X);return new h("Invalid "+te+" `"+Y+"` of type "+("`"+oe+"` supplied to `"+W+"`, expected an array."))}for(var ae=0;ae<X.length;ae++){var J=v(X,ae,W,te,Y+"["+ae+"]",n);if(J instanceof Error)return J}return null}return g(M)}function E(){function v(M,H,k,W,te){var Y=M[H];if(!s(Y)){var X=L(Y);return new h("Invalid "+W+" `"+te+"` of type "+("`"+X+"` supplied to `"+k+"`, expected a single ReactElement."))}return null}return g(v)}function x(){function v(M,H,k,W,te){var Y=M[H];if(!e.isValidElementType(Y)){var X=L(Y);return new h("Invalid "+W+" `"+te+"` of type "+("`"+X+"` supplied to `"+k+"`, expected a single ReactElement type."))}return null}return g(v)}function C(v){function M(H,k,W,te,Y){if(!(H[k]instanceof v)){var X=v.name||p,oe=q(H[k]);return new h("Invalid "+te+" `"+Y+"` of type "+("`"+oe+"` supplied to `"+W+"`, expected ")+("instance of `"+X+"`."))}return null}return g(M)}function T(v){if(!Array.isArray(v))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),a;function M(H,k,W,te,Y){for(var X=H[k],oe=0;oe<v.length;oe++)if(m(X,v[oe]))return null;var ae=JSON.stringify(v,function(Q,j){var ne=U(j);return ne==="symbol"?String(j):j});return new h("Invalid "+te+" `"+Y+"` of value `"+String(X)+"` "+("supplied to `"+W+"`, expected one of "+ae+"."))}return g(M)}function N(v){function M(H,k,W,te,Y){if(typeof v!="function")return new h("Property `"+Y+"` of component `"+W+"` has invalid PropType notation inside objectOf.");var X=H[k],oe=L(X);if(oe!=="object")return new h("Invalid "+te+" `"+Y+"` of type "+("`"+oe+"` supplied to `"+W+"`, expected an object."));for(var ae in X)if(r(X,ae)){var J=v(X,ae,W,te,Y+"."+ae,n);if(J instanceof Error)return J}return null}return g(M)}function $(v){if(!Array.isArray(v))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var M=0;M<v.length;M++){var H=v[M];if(typeof H!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+z(H)+" at index "+M+"."),a}function k(W,te,Y,X,oe){for(var ae=[],J=0;J<v.length;J++){var Q=v[J],j=Q(W,te,Y,X,oe,n);if(j==null)return null;j.data&&r(j.data,"expectedType")&&ae.push(j.data.expectedType)}var ne=ae.length>0?", expected one of type ["+ae.join(", ")+"]":"";return new h("Invalid "+X+" `"+oe+"` supplied to "+("`"+Y+"`"+ne+"."))}return g(k)}function I(){function v(M,H,k,W,te){return R(M[H])?null:new h("Invalid "+W+" `"+te+"` supplied to "+("`"+k+"`, expected a ReactNode."))}return g(v)}function D(v,M,H,k,W){return new h((v||"React class")+": "+M+" type `"+H+"."+k+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+W+"`.")}function F(v){function M(H,k,W,te,Y){var X=H[k],oe=L(X);if(oe!=="object")return new h("Invalid "+te+" `"+Y+"` of type `"+oe+"` "+("supplied to `"+W+"`, expected `object`."));for(var ae in v){var J=v[ae];if(typeof J!="function")return D(W,te,Y,ae,U(J));var Q=J(X,ae,W,te,Y+"."+ae,n);if(Q)return Q}return null}return g(M)}function _(v){function M(H,k,W,te,Y){var X=H[k],oe=L(X);if(oe!=="object")return new h("Invalid "+te+" `"+Y+"` of type `"+oe+"` "+("supplied to `"+W+"`, expected `object`."));var ae=t({},H[k],v);for(var J in ae){var Q=v[J];if(r(v,J)&&typeof Q!="function")return D(W,te,Y,J,U(Q));if(!Q)return new h("Invalid "+te+" `"+Y+"` key `"+J+"` supplied to `"+W+"`.\nBad object: "+JSON.stringify(H[k],null," ")+`
277
- Valid keys: `+JSON.stringify(Object.keys(v),null," "));var j=Q(X,J,W,te,Y+"."+J,n);if(j)return j}return null}return g(M)}function R(v){switch(typeof v){case"number":case"string":case"undefined":return!0;case"boolean":return!v;case"object":if(Array.isArray(v))return v.every(R);if(v===null||s(v))return!0;var M=u(v);if(M){var H=M.call(v),k;if(M!==v.entries){for(;!(k=H.next()).done;)if(!R(k.value))return!1}else for(;!(k=H.next()).done;){var W=k.value;if(W&&!R(W[1]))return!1}}else return!1;return!0;default:return!1}}function P(v,M){return v==="symbol"?!0:M?M["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&M instanceof Symbol:!1}function L(v){var M=typeof v;return Array.isArray(v)?"array":v instanceof RegExp?"object":P(M,v)?"symbol":M}function U(v){if(typeof v>"u"||v===null)return""+v;var M=L(v);if(M==="object"){if(v instanceof Date)return"date";if(v instanceof RegExp)return"regexp"}return M}function z(v){var M=U(v);switch(M){case"array":case"object":return"an "+M;case"boolean":case"date":case"regexp":return"a "+M;default:return M}}function q(v){return!v.constructor||!v.constructor.name?p:v.constructor.name}return d.checkPropTypes=i,d.resetWarningCache=i.resetWarningCache,d.PropTypes=d,d},Ma}var Pa,Bd;function kE(){if(Bd)return Pa;Bd=1;var e=Ta();function t(){}function n(){}return n.resetWarningCache=t,Pa=function(){function r(a,s,l,c,f,u){if(u!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Pa}if(process.env.NODE_ENV!=="production"){var SE=Md(),EE=!0;Ca.exports=xE()(SE.isElement,EE)}else Ca.exports=kE()();var CE=Ca.exports;const Ee=jt(CE);var AE=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function fr(e,t){var n=IE(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function IE(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=AE.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var TE=[".DS_Store","Thumbs.db"];function OE(e){return ln(this,void 0,void 0,function(){return cn(this,function(t){return hi(e)&&DE(e.dataTransfer)?[2,_E(e.dataTransfer,e.type)]:ME(e)?[2,PE(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,NE(e)]:[2,[]]})})}function DE(e){return hi(e)}function ME(e){return hi(e)&&hi(e.target)}function hi(e){return typeof e=="object"&&e!==null}function PE(e){return Na(e.target.files).map(function(t){return fr(t)})}function NE(e){return ln(this,void 0,void 0,function(){var t;return cn(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return fr(r)})]}})})}function _E(e,t){return ln(this,void 0,void 0,function(){var n,r;return cn(this,function(i){switch(i.label){case 0:return e.items?(n=Na(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(LE))]):[3,2];case 1:return r=i.sent(),[2,$d(zd(r))];case 2:return[2,$d(Na(e.files).map(function(o){return fr(o)}))]}})})}function $d(e){return e.filter(function(t){return TE.indexOf(t.name)===-1})}function Na(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function LE(e){if(typeof e.webkitGetAsEntry!="function")return jd(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?Ud(t):jd(e)}function zd(e){return e.reduce(function(t,n){return Qo(Qo([],nf(t),!1),nf(Array.isArray(n)?zd(n):[n]),!1)},[])}function jd(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=fr(t);return Promise.resolve(n)}function FE(e){return ln(this,void 0,void 0,function(){return cn(this,function(t){return[2,e.isDirectory?Ud(e):RE(e)]})})}function Ud(e){var t=e.createReader();return new Promise(function(n,r){var i=[];function o(){var a=this;t.readEntries(function(s){return ln(a,void 0,void 0,function(){var l,c,f;return cn(this,function(u){switch(u.label){case 0:if(s.length)return[3,5];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=u.sent(),n(l),[3,4];case 3:return c=u.sent(),r(c),[3,4];case 4:return[3,6];case 5:f=Promise.all(s.map(FE)),i.push(f),o(),u.label=6;case 6:return[2]}})})},function(s){r(s)})}o()})}function RE(e){return ln(this,void 0,void 0,function(){return cn(this,function(t){return[2,new Promise(function(n,r){e.file(function(i){var o=fr(i,e.fullPath);n(o)},function(i){r(i)})})]})})}var BE=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(a){var s=a.trim().toLowerCase();return s.charAt(0)==="."?r.toLowerCase().endsWith(s):s.endsWith("/*")?o===s.replace(/\/.*$/,""):i===s})}return!0};function Hd(e){return jE(e)||zE(e)||Kd(e)||$E()}function $E(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
278
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zE(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jE(e){if(Array.isArray(e))return _a(e)}function Wd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wd(Object(n),!0).forEach(function(r){qd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wd(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dr(e,t){return WE(e)||HE(e,t)||Kd(e,t)||UE()}function UE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
279
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kd(e,t){if(e){if(typeof e=="string")return _a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _a(e,t)}}function _a(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function HE(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function WE(e){if(Array.isArray(e))return e}var VE="file-invalid-type",qE="file-too-large",KE="file-too-small",YE="too-many-files",GE=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:VE,message:"File type must be ".concat(n)}},Yd=function(t){return{code:qE,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Gd=function(t){return{code:KE,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},QE={code:YE,message:"Too many files"};function Qd(e,t){var n=e.type==="application/x-moz-file"||BE(e,t);return[n,n?null:GE(t)]}function Jd(e,t,n){if(Yt(e.size))if(Yt(t)&&Yt(n)){if(e.size>n)return[!1,Yd(n)];if(e.size<t)return[!1,Gd(t)]}else{if(Yt(t)&&e.size<t)return[!1,Gd(t)];if(Yt(n)&&e.size>n)return[!1,Yd(n)]}return[!0,null]}function Yt(e){return e!=null}function JE(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(l){var c=Qd(l,n),f=dr(c,1),u=f[0],p=Jd(l,r,i),d=dr(p,1),m=d[0],h=s?s(l):null;return u&&m&&!h})}function mi(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function gi(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Zd(e){e.preventDefault()}function ZE(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function XE(e){return e.indexOf("Edge/")!==-1}function eC(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return ZE(e)||XE(e)}function yt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];return t.some(function(s){return!mi(r)&&s&&s.apply(void 0,[r].concat(o)),mi(r)})}}function tC(){return"showOpenFilePicker"in window}function nC(e){if(Yt(e)){var t=Object.entries(e).filter(function(n){var r=dr(n,2),i=r[0],o=r[1],a=!0;return Xd(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),a=!1),(!Array.isArray(o)||!o.every(ep))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),a=!1),a}).reduce(function(n,r){var i=dr(r,2),o=i[0],a=i[1];return Vd(Vd({},n),{},qd({},o,a))},{});return[{description:"Files",accept:t}]}return e}function rC(e){if(Yt(e))return Object.entries(e).reduce(function(t,n){var r=dr(n,2),i=r[0],o=r[1];return[].concat(Hd(t),[i],Hd(o))},[]).filter(function(t){return Xd(t)||ep(t)}).join(",")}function iC(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function oC(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Xd(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function ep(e){return/^.*\.[\w]+$/.test(e)}var aC=["children"],sC=["open"],lC=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],cC=["refKey","onChange","onClick"];function uC(e){return pC(e)||dC(e)||tp(e)||fC()}function fC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
280
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pC(e){if(Array.isArray(e))return Fa(e)}function La(e,t){return gC(e)||mC(e,t)||tp(e,t)||hC()}function hC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
281
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tp(e,t){if(e){if(typeof e=="string")return Fa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fa(e,t)}}function Fa(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mC(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function gC(e){if(Array.isArray(e))return e}function np(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Oe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?np(Object(n),!0).forEach(function(r){Ra(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):np(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ra(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yi(e,t){if(e==null)return{};var n=yC(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function yC(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Ba=O.forwardRef(function(e,t){var n=e.children,r=yi(e,aC),i=ip(r),o=i.open,a=yi(i,sC);return O.useImperativeHandle(t,function(){return{open:o}},[o]),O.createElement(O.Fragment,null,n(Oe(Oe({},a),{},{open:o})))});Ba.displayName="Dropzone";var rp={disabled:!1,getFilesFromEvent:OE,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Ba.defaultProps=rp,Ba.propTypes={children:Ee.func,accept:Ee.objectOf(Ee.arrayOf(Ee.string)),multiple:Ee.bool,preventDropOnDocument:Ee.bool,noClick:Ee.bool,noKeyboard:Ee.bool,noDrag:Ee.bool,noDragEventsBubbling:Ee.bool,minSize:Ee.number,maxSize:Ee.number,maxFiles:Ee.number,disabled:Ee.bool,getFilesFromEvent:Ee.func,onFileDialogCancel:Ee.func,onFileDialogOpen:Ee.func,useFsAccessApi:Ee.bool,autoFocus:Ee.bool,onDragEnter:Ee.func,onDragLeave:Ee.func,onDragOver:Ee.func,onDrop:Ee.func,onDropAccepted:Ee.func,onDropRejected:Ee.func,onError:Ee.func,validator:Ee.func};var $a={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function ip(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Oe(Oe({},rp),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,c=t.onDragEnter,f=t.onDragLeave,u=t.onDragOver,p=t.onDrop,d=t.onDropAccepted,m=t.onDropRejected,h=t.onFileDialogCancel,g=t.onFileDialogOpen,y=t.useFsAccessApi,b=t.autoFocus,w=t.preventDropOnDocument,E=t.noClick,x=t.noKeyboard,C=t.noDrag,T=t.noDragEventsBubbling,N=t.onError,$=t.validator,I=O.useMemo(function(){return rC(n)},[n]),D=O.useMemo(function(){return nC(n)},[n]),F=O.useMemo(function(){return typeof g=="function"?g:op},[g]),_=O.useMemo(function(){return typeof h=="function"?h:op},[h]),R=O.useRef(null),P=O.useRef(null),L=O.useReducer(bC,$a),U=La(L,2),z=U[0],q=U[1],v=z.isFocused,M=z.isFileDialogActive,H=O.useRef(typeof window<"u"&&window.isSecureContext&&y&&tC()),k=function(){!H.current&&M&&setTimeout(function(){if(P.current){var ce=P.current.files;ce.length||(q({type:"closeDialog"}),_())}},300)};O.useEffect(function(){return window.addEventListener("focus",k,!1),function(){window.removeEventListener("focus",k,!1)}},[P,M,_,H]);var W=O.useRef([]),te=function(ce){R.current&&R.current.contains(ce.target)||(ce.preventDefault(),W.current=[])};O.useEffect(function(){return w&&(document.addEventListener("dragover",Zd,!1),document.addEventListener("drop",te,!1)),function(){w&&(document.removeEventListener("dragover",Zd),document.removeEventListener("drop",te))}},[R,w]),O.useEffect(function(){return!r&&b&&R.current&&R.current.focus(),function(){}},[R,b,r]);var Y=O.useCallback(function(ee){N?N(ee):console.error(ee)},[N]),X=O.useCallback(function(ee){ee.preventDefault(),ee.persist(),De(ee),W.current=[].concat(uC(W.current),[ee.target]),gi(ee)&&Promise.resolve(i(ee)).then(function(ce){if(!(mi(ee)&&!T)){var B=ce.length,V=B>0&&JE({files:ce,accept:I,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:$}),le=B>0&&!V;q({isDragAccept:V,isDragReject:le,isDragActive:!0,type:"setDraggedFiles"}),c&&c(ee)}}).catch(function(ce){return Y(ce)})},[i,c,Y,T,I,a,o,s,l,$]),oe=O.useCallback(function(ee){ee.preventDefault(),ee.persist(),De(ee);var ce=gi(ee);if(ce&&ee.dataTransfer)try{ee.dataTransfer.dropEffect="copy"}catch{}return ce&&u&&u(ee),!1},[u,T]),ae=O.useCallback(function(ee){ee.preventDefault(),ee.persist(),De(ee);var ce=W.current.filter(function(V){return R.current&&R.current.contains(V)}),B=ce.indexOf(ee.target);B!==-1&&ce.splice(B,1),W.current=ce,!(ce.length>0)&&(q({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),gi(ee)&&f&&f(ee))},[R,f,T]),J=O.useCallback(function(ee,ce){var B=[],V=[];ee.forEach(function(le){var re=Qd(le,I),de=La(re,2),Te=de[0],ft=de[1],tt=Jd(le,a,o),vt=La(tt,2),At=vt[0],Be=vt[1],wt=$?$(le):null;if(Te&&At&&!wt)B.push(le);else{var nt=[ft,Be];wt&&(nt=nt.concat(wt)),V.push({file:le,errors:nt.filter(function(kT){return kT})})}}),(!s&&B.length>1||s&&l>=1&&B.length>l)&&(B.forEach(function(le){V.push({file:le,errors:[QE]})}),B.splice(0)),q({acceptedFiles:B,fileRejections:V,type:"setFiles"}),p&&p(B,V,ce),V.length>0&&m&&m(V,ce),B.length>0&&d&&d(B,ce)},[q,s,I,a,o,l,p,d,m,$]),Q=O.useCallback(function(ee){ee.preventDefault(),ee.persist(),De(ee),W.current=[],gi(ee)&&Promise.resolve(i(ee)).then(function(ce){mi(ee)&&!T||J(ce,ee)}).catch(function(ce){return Y(ce)}),q({type:"reset"})},[i,J,Y,T]),j=O.useCallback(function(){if(H.current){q({type:"openDialog"}),F();var ee={multiple:s,types:D};window.showOpenFilePicker(ee).then(function(ce){return i(ce)}).then(function(ce){J(ce,null),q({type:"closeDialog"})}).catch(function(ce){iC(ce)?(_(ce),q({type:"closeDialog"})):oC(ce)?(H.current=!1,P.current?(P.current.value=null,P.current.click()):Y(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):Y(ce)});return}P.current&&(q({type:"openDialog"}),F(),P.current.value=null,P.current.click())},[q,F,_,y,J,Y,D,s]),ne=O.useCallback(function(ee){!R.current||!R.current.isEqualNode(ee.target)||(ee.key===" "||ee.key==="Enter"||ee.keyCode===32||ee.keyCode===13)&&(ee.preventDefault(),j())},[R,j]),se=O.useCallback(function(){q({type:"focus"})},[]),K=O.useCallback(function(){q({type:"blur"})},[]),G=O.useCallback(function(){E||(eC()?setTimeout(j,0):j())},[E,j]),ue=function(ce){return r?null:ce},pe=function(ce){return x?null:ue(ce)},me=function(ce){return C?null:ue(ce)},De=function(ce){T&&ce.stopPropagation()},Ue=O.useMemo(function(){return function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ce=ee.refKey,B=ce===void 0?"ref":ce,V=ee.role,le=ee.onKeyDown,re=ee.onFocus,de=ee.onBlur,Te=ee.onClick,ft=ee.onDragEnter,tt=ee.onDragOver,vt=ee.onDragLeave,At=ee.onDrop,Be=yi(ee,lC);return Oe(Oe(Ra({onKeyDown:pe(yt(le,ne)),onFocus:pe(yt(re,se)),onBlur:pe(yt(de,K)),onClick:ue(yt(Te,G)),onDragEnter:me(yt(ft,X)),onDragOver:me(yt(tt,oe)),onDragLeave:me(yt(vt,ae)),onDrop:me(yt(At,Q)),role:typeof V=="string"&&V!==""?V:"presentation"},B,R),!r&&!x?{tabIndex:0}:{}),Be)}},[R,ne,se,K,G,X,oe,ae,Q,x,C,r]),He=O.useCallback(function(ee){ee.stopPropagation()},[]),qe=O.useMemo(function(){return function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ce=ee.refKey,B=ce===void 0?"ref":ce,V=ee.onChange,le=ee.onClick,re=yi(ee,cC),de=Ra({accept:I,multiple:s,type:"file",style:{display:"none"},onChange:ue(yt(V,Q)),onClick:ue(yt(le,He)),tabIndex:-1},B,P);return Oe(Oe({},de),re)}},[P,n,s,Q,r]);return Oe(Oe({},z),{},{isFocused:v&&!r,getRootProps:Ue,getInputProps:qe,rootRef:R,inputRef:P,open:ue(j)})}function bC(e,t){switch(t.type){case"focus":return Oe(Oe({},e),{},{isFocused:!0});case"blur":return Oe(Oe({},e),{},{isFocused:!1});case"openDialog":return Oe(Oe({},$a),{},{isFileDialogActive:!0});case"closeDialog":return Oe(Oe({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Oe(Oe({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Oe(Oe({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Oe({},$a);default:return e}}function op(){}const ap=({children:e})=>{const t=O.useRef(),[n,r]=O.useState({open:!1}),i=({title:a,description:s,confirmButtonText:l,cancelButtonText:c,onConfirm:f,onCancel:u,initialValue:p,Content:d})=>new Promise((m,h)=>{t.current=p,r({open:!0,title:a,description:s,confirmButtonText:l,cancelButtonText:c,content:d?S.jsx(d,{value:p,setValue:g=>{t.current=g}}):null,onConfirm:()=>{f==null||f(),m(t.current),o()},onCancel:()=>{u==null||u(),h(),o()}})}),o=()=>{r(a=>({...a,open:!1}))};return S.jsxs(Yo.Provider,{value:{showInputModal:i},children:[S.jsx(On,{open:n.open,onOpenChange:a=>r(s=>({...s,open:a})),children:S.jsx(On.Content,{title:n.title,description:n.description,confirmButtonText:n.confirmButtonText,cancelButtonText:n.cancelButtonText,onConfirm:n.onConfirm,onCancel:n.onCancel,children:n.content})}),e]})},vC=(e,t)=>{const n=e.replace(/\s+/g,"+");if(!e.replace(/[^a-zA-Z0-9\s\-_]/g,"").trim())return;const i=t.filter(l=>/^\d+$/.test(l)).join(";"),o=`https://fonts.googleapis.com/css2?family=${n}:wght@${i}&display=swap`;if(document.querySelector(`link[href="${o}"]`))return;const s=document.createElement("link");s.rel="stylesheet",s.href=o,document.head.appendChild(s)},sp=({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o,additionalStylesheetUrl:a})=>{O.useMemo(()=>{t&&vC(t,["100","200","300","400","500","600","700","800"])},[t]);const s=O.useMemo(()=>gl({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o}),[e,t,n,r,i,o]);return S.jsxs(S.Fragment,{children:[a&&S.jsx("link",{rel:"stylesheet",href:a}),S.jsxs("style",{children:[s,`
282
+ */var Aa,Dd;function xE(){if(Dd)return Aa;Dd=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var a={},s=0;s<10;s++)a["_"+String.fromCharCode(s)]=s;var l=Object.getOwnPropertyNames(a).map(function(f){return a[f]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(f){c[f]=f}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Aa=i()?Object.assign:function(o,a){for(var s,l=r(o),c,f=1;f<arguments.length;f++){s=Object(arguments[f]);for(var u in s)t.call(s,u)&&(l[u]=s[u]);if(e){c=e(s);for(var p=0;p<c.length;p++)n.call(s,c[p])&&(l[c[p]]=s[c[p]])}}return l},Aa}var Ia,Md;function Ta(){if(Md)return Ia;Md=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ia=e,Ia}var Oa,Pd;function Nd(){return Pd||(Pd=1,Oa=Function.call.bind(Object.prototype.hasOwnProperty)),Oa}var Da,_d;function kE(){if(_d)return Da;_d=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Ta(),n={},r=Nd();e=function(o){var a="Warning: "+o;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function i(o,a,s,l,c){if(process.env.NODE_ENV!=="production"){for(var f in o)if(r(o,f)){var u;try{if(typeof o[f]!="function"){var p=Error((l||"React class")+": "+s+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}u=o[f](a,f,l,s,null,t)}catch(m){u=m}if(u&&!(u instanceof Error)&&e((l||"React class")+": type specification of "+s+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in n)){n[u.message]=!0;var d=c?c():"";e("Failed "+s+" type: "+u.message+(d??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Da=i,Da}var Ma,Ld;function SE(){if(Ld)return Ma;Ld=1;var e=Od(),t=xE(),n=Ta(),r=Nd(),i=kE(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(s){var l="Warning: "+s;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function a(){return null}return Ma=function(s,l){var c=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function u(v){var N=v&&(c&&v[c]||v[f]);if(typeof N=="function")return N}var p="<<anonymous>>",d={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:b(),arrayOf:w,element:C(),elementType:x(),instanceOf:E,node:I(),objectOf:_,oneOf:T,oneOfType:$,shape:z,exact:P};function m(v,N){return v===N?v!==0||1/v===1/N:v!==v&&N!==N}function h(v,N){this.message=v,this.data=N&&typeof N=="object"?N:{},this.stack=""}h.prototype=Error.prototype;function g(v){if(process.env.NODE_ENV!=="production")var N={},H=0;function k(te,Y,Z,re,oe,G,Q){if(re=re||p,G=G||Z,Q!==n){if(l){var j=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw j.name="Invariant Violation",j}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var X=re+":"+Z;!N[X]&&H<3&&(o("You are manually calling a React.PropTypes validation function for the `"+G+"` prop on `"+re+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),N[X]=!0,H++)}}return Y[Z]==null?te?Y[Z]===null?new h("The "+oe+" `"+G+"` is marked as required "+("in `"+re+"`, but its value is `null`.")):new h("The "+oe+" `"+G+"` is marked as required in "+("`"+re+"`, but its value is `undefined`.")):null:v(Y,Z,re,oe,G)}var W=k.bind(null,!1);return W.isRequired=k.bind(null,!0),W}function y(v){function N(H,k,W,te,Y,Z){var re=H[k],oe=R(re);if(oe!==v){var G=U(re);return new h("Invalid "+te+" `"+Y+"` of type "+("`"+G+"` supplied to `"+W+"`, expected ")+("`"+v+"`."),{expectedType:v})}return null}return g(N)}function b(){return g(a)}function w(v){function N(H,k,W,te,Y){if(typeof v!="function")return new h("Property `"+Y+"` of component `"+W+"` has invalid PropType notation inside arrayOf.");var Z=H[k];if(!Array.isArray(Z)){var re=R(Z);return new h("Invalid "+te+" `"+Y+"` of type "+("`"+re+"` supplied to `"+W+"`, expected an array."))}for(var oe=0;oe<Z.length;oe++){var G=v(Z,oe,W,te,Y+"["+oe+"]",n);if(G instanceof Error)return G}return null}return g(N)}function C(){function v(N,H,k,W,te){var Y=N[H];if(!s(Y)){var Z=R(Y);return new h("Invalid "+W+" `"+te+"` of type "+("`"+Z+"` supplied to `"+k+"`, expected a single ReactElement."))}return null}return g(v)}function x(){function v(N,H,k,W,te){var Y=N[H];if(!e.isValidElementType(Y)){var Z=R(Y);return new h("Invalid "+W+" `"+te+"` of type "+("`"+Z+"` supplied to `"+k+"`, expected a single ReactElement type."))}return null}return g(v)}function E(v){function N(H,k,W,te,Y){if(!(H[k]instanceof v)){var Z=v.name||p,re=V(H[k]);return new h("Invalid "+te+" `"+Y+"` of type "+("`"+re+"` supplied to `"+W+"`, expected ")+("instance of `"+Z+"`."))}return null}return g(N)}function T(v){if(!Array.isArray(v))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),a;function N(H,k,W,te,Y){for(var Z=H[k],re=0;re<v.length;re++)if(m(Z,v[re]))return null;var oe=JSON.stringify(v,function(Q,j){var X=U(j);return X==="symbol"?String(j):j});return new h("Invalid "+te+" `"+Y+"` of value `"+String(Z)+"` "+("supplied to `"+W+"`, expected one of "+oe+"."))}return g(N)}function _(v){function N(H,k,W,te,Y){if(typeof v!="function")return new h("Property `"+Y+"` of component `"+W+"` has invalid PropType notation inside objectOf.");var Z=H[k],re=R(Z);if(re!=="object")return new h("Invalid "+te+" `"+Y+"` of type "+("`"+re+"` supplied to `"+W+"`, expected an object."));for(var oe in Z)if(r(Z,oe)){var G=v(Z,oe,W,te,Y+"."+oe,n);if(G instanceof Error)return G}return null}return g(N)}function $(v){if(!Array.isArray(v))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var N=0;N<v.length;N++){var H=v[N];if(typeof H!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+B(H)+" at index "+N+"."),a}function k(W,te,Y,Z,re){for(var oe=[],G=0;G<v.length;G++){var Q=v[G],j=Q(W,te,Y,Z,re,n);if(j==null)return null;j.data&&r(j.data,"expectedType")&&oe.push(j.data.expectedType)}var X=oe.length>0?", expected one of type ["+oe.join(", ")+"]":"";return new h("Invalid "+Z+" `"+re+"` supplied to "+("`"+Y+"`"+X+"."))}return g(k)}function I(){function v(N,H,k,W,te){return L(N[H])?null:new h("Invalid "+W+" `"+te+"` supplied to "+("`"+k+"`, expected a ReactNode."))}return g(v)}function D(v,N,H,k,W){return new h((v||"React class")+": "+N+" type `"+H+"."+k+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+W+"`.")}function z(v){function N(H,k,W,te,Y){var Z=H[k],re=R(Z);if(re!=="object")return new h("Invalid "+te+" `"+Y+"` of type `"+re+"` "+("supplied to `"+W+"`, expected `object`."));for(var oe in v){var G=v[oe];if(typeof G!="function")return D(W,te,Y,oe,U(G));var Q=G(Z,oe,W,te,Y+"."+oe,n);if(Q)return Q}return null}return g(N)}function P(v){function N(H,k,W,te,Y){var Z=H[k],re=R(Z);if(re!=="object")return new h("Invalid "+te+" `"+Y+"` of type `"+re+"` "+("supplied to `"+W+"`, expected `object`."));var oe=t({},H[k],v);for(var G in oe){var Q=v[G];if(r(v,G)&&typeof Q!="function")return D(W,te,Y,G,U(Q));if(!Q)return new h("Invalid "+te+" `"+Y+"` key `"+G+"` supplied to `"+W+"`.\nBad object: "+JSON.stringify(H[k],null," ")+`
283
+ Valid keys: `+JSON.stringify(Object.keys(v),null," "));var j=Q(Z,G,W,te,Y+"."+G,n);if(j)return j}return null}return g(N)}function L(v){switch(typeof v){case"number":case"string":case"undefined":return!0;case"boolean":return!v;case"object":if(Array.isArray(v))return v.every(L);if(v===null||s(v))return!0;var N=u(v);if(N){var H=N.call(v),k;if(N!==v.entries){for(;!(k=H.next()).done;)if(!L(k.value))return!1}else for(;!(k=H.next()).done;){var W=k.value;if(W&&!L(W[1]))return!1}}else return!1;return!0;default:return!1}}function M(v,N){return v==="symbol"?!0:N?N["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&N instanceof Symbol:!1}function R(v){var N=typeof v;return Array.isArray(v)?"array":v instanceof RegExp?"object":M(N,v)?"symbol":N}function U(v){if(typeof v>"u"||v===null)return""+v;var N=R(v);if(N==="object"){if(v instanceof Date)return"date";if(v instanceof RegExp)return"regexp"}return N}function B(v){var N=U(v);switch(N){case"array":case"object":return"an "+N;case"boolean":case"date":case"regexp":return"a "+N;default:return N}}function V(v){return!v.constructor||!v.constructor.name?p:v.constructor.name}return d.checkPropTypes=i,d.resetWarningCache=i.resetWarningCache,d.PropTypes=d,d},Ma}var Pa,Fd;function EE(){if(Fd)return Pa;Fd=1;var e=Ta();function t(){}function n(){}return n.resetWarningCache=t,Pa=function(){function r(a,s,l,c,f,u){if(u!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Pa}if(process.env.NODE_ENV!=="production"){var CE=Od(),AE=!0;Ca.exports=SE()(CE.isElement,AE)}else Ca.exports=EE()();var IE=Ca.exports;const Ie=jt(IE);var TE=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function fr(e,t){var n=OE(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function OE(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=TE.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var DE=[".DS_Store","Thumbs.db"];function ME(e){return ln(this,void 0,void 0,function(){return cn(this,function(t){return hi(e)&&PE(e.dataTransfer)?[2,FE(e.dataTransfer,e.type)]:NE(e)?[2,_E(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,LE(e)]:[2,[]]})})}function PE(e){return hi(e)}function NE(e){return hi(e)&&hi(e.target)}function hi(e){return typeof e=="object"&&e!==null}function _E(e){return Na(e.target.files).map(function(t){return fr(t)})}function LE(e){return ln(this,void 0,void 0,function(){var t;return cn(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return fr(r)})]}})})}function FE(e,t){return ln(this,void 0,void 0,function(){var n,r;return cn(this,function(i){switch(i.label){case 0:return e.items?(n=Na(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(RE))]):[3,2];case 1:return r=i.sent(),[2,Rd(Bd(r))];case 2:return[2,Rd(Na(e.files).map(function(o){return fr(o)}))]}})})}function Rd(e){return e.filter(function(t){return DE.indexOf(t.name)===-1})}function Na(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function RE(e){if(typeof e.webkitGetAsEntry!="function")return $d(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?zd(t):$d(e)}function Bd(e){return e.reduce(function(t,n){return Qo(Qo([],ef(t),!1),ef(Array.isArray(n)?Bd(n):[n]),!1)},[])}function $d(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=fr(t);return Promise.resolve(n)}function BE(e){return ln(this,void 0,void 0,function(){return cn(this,function(t){return[2,e.isDirectory?zd(e):$E(e)]})})}function zd(e){var t=e.createReader();return new Promise(function(n,r){var i=[];function o(){var a=this;t.readEntries(function(s){return ln(a,void 0,void 0,function(){var l,c,f;return cn(this,function(u){switch(u.label){case 0:if(s.length)return[3,5];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=u.sent(),n(l),[3,4];case 3:return c=u.sent(),r(c),[3,4];case 4:return[3,6];case 5:f=Promise.all(s.map(BE)),i.push(f),o(),u.label=6;case 6:return[2]}})})},function(s){r(s)})}o()})}function $E(e){return ln(this,void 0,void 0,function(){return cn(this,function(t){return[2,new Promise(function(n,r){e.file(function(i){var o=fr(i,e.fullPath);n(o)},function(i){r(i)})})]})})}var zE=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(a){var s=a.trim().toLowerCase();return s.charAt(0)==="."?r.toLowerCase().endsWith(s):s.endsWith("/*")?o===s.replace(/\/.*$/,""):i===s})}return!0};function jd(e){return HE(e)||UE(e)||Vd(e)||jE()}function jE(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
284
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UE(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function HE(e){if(Array.isArray(e))return _a(e)}function Ud(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Hd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ud(Object(n),!0).forEach(function(r){Wd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ud(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dr(e,t){return qE(e)||VE(e,t)||Vd(e,t)||WE()}function WE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
285
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vd(e,t){if(e){if(typeof e=="string")return _a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _a(e,t)}}function _a(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function VE(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function qE(e){if(Array.isArray(e))return e}var KE="file-invalid-type",YE="file-too-large",GE="file-too-small",QE="too-many-files",JE=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:KE,message:"File type must be ".concat(n)}},qd=function(t){return{code:YE,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Kd=function(t){return{code:GE,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},ZE={code:QE,message:"Too many files"};function Yd(e,t){var n=e.type==="application/x-moz-file"||zE(e,t);return[n,n?null:JE(t)]}function Gd(e,t,n){if(Yt(e.size))if(Yt(t)&&Yt(n)){if(e.size>n)return[!1,qd(n)];if(e.size<t)return[!1,Kd(t)]}else{if(Yt(t)&&e.size<t)return[!1,Kd(t)];if(Yt(n)&&e.size>n)return[!1,qd(n)]}return[!0,null]}function Yt(e){return e!=null}function XE(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(l){var c=Yd(l,n),f=dr(c,1),u=f[0],p=Gd(l,r,i),d=dr(p,1),m=d[0],h=s?s(l):null;return u&&m&&!h})}function mi(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function gi(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Qd(e){e.preventDefault()}function eC(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function tC(e){return e.indexOf("Edge/")!==-1}function nC(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return eC(e)||tC(e)}function yt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];return t.some(function(s){return!mi(r)&&s&&s.apply(void 0,[r].concat(o)),mi(r)})}}function rC(){return"showOpenFilePicker"in window}function iC(e){if(Yt(e)){var t=Object.entries(e).filter(function(n){var r=dr(n,2),i=r[0],o=r[1],a=!0;return Jd(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),a=!1),(!Array.isArray(o)||!o.every(Zd))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),a=!1),a}).reduce(function(n,r){var i=dr(r,2),o=i[0],a=i[1];return Hd(Hd({},n),{},Wd({},o,a))},{});return[{description:"Files",accept:t}]}return e}function oC(e){if(Yt(e))return Object.entries(e).reduce(function(t,n){var r=dr(n,2),i=r[0],o=r[1];return[].concat(jd(t),[i],jd(o))},[]).filter(function(t){return Jd(t)||Zd(t)}).join(",")}function aC(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function sC(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Jd(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function Zd(e){return/^.*\.[\w]+$/.test(e)}var lC=["children"],cC=["open"],uC=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],fC=["refKey","onChange","onClick"];function dC(e){return mC(e)||hC(e)||Xd(e)||pC()}function pC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
286
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function mC(e){if(Array.isArray(e))return Fa(e)}function La(e,t){return bC(e)||yC(e,t)||Xd(e,t)||gC()}function gC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
287
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xd(e,t){if(e){if(typeof e=="string")return Fa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fa(e,t)}}function Fa(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yC(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function bC(e){if(Array.isArray(e))return e}function ep(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ep(Object(n),!0).forEach(function(r){Ra(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ep(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ra(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yi(e,t){if(e==null)return{};var n=vC(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vC(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Ba=O.forwardRef(function(e,t){var n=e.children,r=yi(e,lC),i=np(r),o=i.open,a=yi(i,cC);return O.useImperativeHandle(t,function(){return{open:o}},[o]),O.createElement(O.Fragment,null,n(Pe(Pe({},a),{},{open:o})))});Ba.displayName="Dropzone";var tp={disabled:!1,getFilesFromEvent:ME,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Ba.defaultProps=tp,Ba.propTypes={children:Ie.func,accept:Ie.objectOf(Ie.arrayOf(Ie.string)),multiple:Ie.bool,preventDropOnDocument:Ie.bool,noClick:Ie.bool,noKeyboard:Ie.bool,noDrag:Ie.bool,noDragEventsBubbling:Ie.bool,minSize:Ie.number,maxSize:Ie.number,maxFiles:Ie.number,disabled:Ie.bool,getFilesFromEvent:Ie.func,onFileDialogCancel:Ie.func,onFileDialogOpen:Ie.func,useFsAccessApi:Ie.bool,autoFocus:Ie.bool,onDragEnter:Ie.func,onDragLeave:Ie.func,onDragOver:Ie.func,onDrop:Ie.func,onDropAccepted:Ie.func,onDropRejected:Ie.func,onError:Ie.func,validator:Ie.func};var $a={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function np(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Pe(Pe({},tp),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,c=t.onDragEnter,f=t.onDragLeave,u=t.onDragOver,p=t.onDrop,d=t.onDropAccepted,m=t.onDropRejected,h=t.onFileDialogCancel,g=t.onFileDialogOpen,y=t.useFsAccessApi,b=t.autoFocus,w=t.preventDropOnDocument,C=t.noClick,x=t.noKeyboard,E=t.noDrag,T=t.noDragEventsBubbling,_=t.onError,$=t.validator,I=O.useMemo(function(){return oC(n)},[n]),D=O.useMemo(function(){return iC(n)},[n]),z=O.useMemo(function(){return typeof g=="function"?g:rp},[g]),P=O.useMemo(function(){return typeof h=="function"?h:rp},[h]),L=O.useRef(null),M=O.useRef(null),R=O.useReducer(wC,$a),U=La(R,2),B=U[0],V=U[1],v=B.isFocused,N=B.isFileDialogActive,H=O.useRef(typeof window<"u"&&window.isSecureContext&&y&&rC()),k=function(){!H.current&&N&&setTimeout(function(){if(M.current){var se=M.current.files;se.length||(V({type:"closeDialog"}),P())}},300)};O.useEffect(function(){return window.addEventListener("focus",k,!1),function(){window.removeEventListener("focus",k,!1)}},[M,N,P,H]);var W=O.useRef([]),te=function(se){L.current&&L.current.contains(se.target)||(se.preventDefault(),W.current=[])};O.useEffect(function(){return w&&(document.addEventListener("dragover",Qd,!1),document.addEventListener("drop",te,!1)),function(){w&&(document.removeEventListener("dragover",Qd),document.removeEventListener("drop",te))}},[L,w]),O.useEffect(function(){return!r&&b&&L.current&&L.current.focus(),function(){}},[L,b,r]);var Y=O.useCallback(function(ee){_?_(ee):console.error(ee)},[_]),Z=O.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ce(ee),W.current=[].concat(dC(W.current),[ee.target]),gi(ee)&&Promise.resolve(i(ee)).then(function(se){if(!(mi(ee)&&!T)){var F=se.length,q=F>0&&XE({files:se,accept:I,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:$}),le=F>0&&!q;V({isDragAccept:q,isDragReject:le,isDragActive:!0,type:"setDraggedFiles"}),c&&c(ee)}}).catch(function(se){return Y(se)})},[i,c,Y,T,I,a,o,s,l,$]),re=O.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ce(ee);var se=gi(ee);if(se&&ee.dataTransfer)try{ee.dataTransfer.dropEffect="copy"}catch{}return se&&u&&u(ee),!1},[u,T]),oe=O.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ce(ee);var se=W.current.filter(function(q){return L.current&&L.current.contains(q)}),F=se.indexOf(ee.target);F!==-1&&se.splice(F,1),W.current=se,!(se.length>0)&&(V({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),gi(ee)&&f&&f(ee))},[L,f,T]),G=O.useCallback(function(ee,se){var F=[],q=[];ee.forEach(function(le){var ue=Yd(le,I),ye=La(ue,2),de=ye[0],Te=ye[1],Le=Gd(le,a,o),vt=La(Le,2),At=vt[0],Ue=vt[1],wt=$?$(le):null;if(de&&At&&!wt)F.push(le);else{var rt=[Te,Ue];wt&&(rt=rt.concat(wt)),q.push({file:le,errors:rt.filter(function(ST){return ST})})}}),(!s&&F.length>1||s&&l>=1&&F.length>l)&&(F.forEach(function(le){q.push({file:le,errors:[ZE]})}),F.splice(0)),V({acceptedFiles:F,fileRejections:q,type:"setFiles"}),p&&p(F,q,se),q.length>0&&m&&m(q,se),F.length>0&&d&&d(F,se)},[V,s,I,a,o,l,p,d,m,$]),Q=O.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ce(ee),W.current=[],gi(ee)&&Promise.resolve(i(ee)).then(function(se){mi(ee)&&!T||G(se,ee)}).catch(function(se){return Y(se)}),V({type:"reset"})},[i,G,Y,T]),j=O.useCallback(function(){if(H.current){V({type:"openDialog"}),z();var ee={multiple:s,types:D};window.showOpenFilePicker(ee).then(function(se){return i(se)}).then(function(se){G(se,null),V({type:"closeDialog"})}).catch(function(se){aC(se)?(P(se),V({type:"closeDialog"})):sC(se)?(H.current=!1,M.current?(M.current.value=null,M.current.click()):Y(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):Y(se)});return}M.current&&(V({type:"openDialog"}),z(),M.current.value=null,M.current.click())},[V,z,P,y,G,Y,D,s]),X=O.useCallback(function(ee){!L.current||!L.current.isEqualNode(ee.target)||(ee.key===" "||ee.key==="Enter"||ee.keyCode===32||ee.keyCode===13)&&(ee.preventDefault(),j())},[L,j]),ae=O.useCallback(function(){V({type:"focus"})},[]),pe=O.useCallback(function(){V({type:"blur"})},[]),ie=O.useCallback(function(){C||(nC()?setTimeout(j,0):j())},[C,j]),K=function(se){return r?null:se},ce=function(se){return x?null:K(se)},he=function(se){return E?null:K(se)},Ce=function(se){T&&se.stopPropagation()},ke=O.useMemo(function(){return function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},se=ee.refKey,F=se===void 0?"ref":se,q=ee.role,le=ee.onKeyDown,ue=ee.onFocus,ye=ee.onBlur,de=ee.onClick,Te=ee.onDragEnter,Le=ee.onDragOver,vt=ee.onDragLeave,At=ee.onDrop,Ue=yi(ee,uC);return Pe(Pe(Ra({onKeyDown:ce(yt(le,X)),onFocus:ce(yt(ue,ae)),onBlur:ce(yt(ye,pe)),onClick:K(yt(de,ie)),onDragEnter:he(yt(Te,Z)),onDragOver:he(yt(Le,re)),onDragLeave:he(yt(vt,oe)),onDrop:he(yt(At,Q)),role:typeof q=="string"&&q!==""?q:"presentation"},F,L),!r&&!x?{tabIndex:0}:{}),Ue)}},[L,X,ae,pe,ie,Z,re,oe,Q,x,E,r]),je=O.useCallback(function(ee){ee.stopPropagation()},[]),Ye=O.useMemo(function(){return function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},se=ee.refKey,F=se===void 0?"ref":se,q=ee.onChange,le=ee.onClick,ue=yi(ee,fC),ye=Ra({accept:I,multiple:s,type:"file",style:{display:"none"},onChange:K(yt(q,Q)),onClick:K(yt(le,je)),tabIndex:-1},F,M);return Pe(Pe({},ye),ue)}},[M,n,s,Q,r]);return Pe(Pe({},B),{},{isFocused:v&&!r,getRootProps:ke,getInputProps:Ye,rootRef:L,inputRef:M,open:K(j)})}function wC(e,t){switch(t.type){case"focus":return Pe(Pe({},e),{},{isFocused:!0});case"blur":return Pe(Pe({},e),{},{isFocused:!1});case"openDialog":return Pe(Pe({},$a),{},{isFileDialogActive:!0});case"closeDialog":return Pe(Pe({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Pe(Pe({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Pe(Pe({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Pe({},$a);default:return e}}function rp(){}const ip=({children:e})=>{const t=O.useRef(),[n,r]=O.useState({open:!1}),i=({title:a,description:s,confirmButtonText:l,cancelButtonText:c,onConfirm:f,onCancel:u,initialValue:p,Content:d})=>new Promise((m,h)=>{t.current=p,r({open:!0,title:a,description:s,confirmButtonText:l,cancelButtonText:c,content:d?S.jsx(d,{value:p,setValue:g=>{t.current=g}}):null,onConfirm:()=>{f==null||f(),m(t.current),o()},onCancel:()=>{u==null||u(),h(),o()}})}),o=()=>{r(a=>({...a,open:!1}))};return S.jsxs(Yo.Provider,{value:{showInputModal:i},children:[S.jsx(On,{open:n.open,onOpenChange:a=>r(s=>({...s,open:a})),children:S.jsx(On.Content,{title:n.title,description:n.description,confirmButtonText:n.confirmButtonText,cancelButtonText:n.cancelButtonText,onConfirm:n.onConfirm,onCancel:n.onCancel,children:n.content})}),e]})},xC=(e,t)=>{const n=e.replace(/\s+/g,"+");if(!e.replace(/[^a-zA-Z0-9\s\-_]/g,"").trim())return;const i=t.filter(l=>/^\d+$/.test(l)).join(";"),o=`https://fonts.googleapis.com/css2?family=${n}:wght@${i}&display=swap`;if(document.querySelector(`link[href="${o}"]`))return;const s=document.createElement("link");s.rel="stylesheet",s.href=o,document.head.appendChild(s)},op=({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o,additionalStylesheetUrl:a})=>{O.useMemo(()=>{t&&xC(t,["100","200","300","400","500","600","700","800"])},[t]);const s=O.useMemo(()=>Js({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o}),[e,t,n,r,i,o]);return S.jsxs(S.Fragment,{children:[a&&S.jsx("link",{rel:"stylesheet",href:a}),S.jsxs("style",{children:[s,`
282
288
  .bpWebchat {
283
289
  border-radius: ${.375*(n??1)}rem;
284
290
  }
285
291
  .bpMessagePreview {
286
292
  border-radius: ${.125*(n??1)}rem;
287
293
  }
288
- `]})]})},za=({children:e,className:t,uploadFile:n,allowFileUpload:r,storageKey:i,connected:o,...a})=>{const{container:s}=ge,l=sn(g=>g.setMessageContainerRef),f=Qu(i)(g=>g.uploadFile),[u,p]=O.useState(0),d=O.useRef(null);O.useEffect(()=>{l(d)},[d,l]);const m=O.useCallback(g=>{n&&(g.forEach(y=>f(y,n)),p(0))},[f,n]),{getRootProps:h}=ip({noClick:!0,noKeyboard:!0,onDrop:m,disabled:!(r&&n),onDragEnter:()=>p(g=>g+1),onDragLeave:()=>p(g=>g-1)});return S.jsxs("div",{...a,className:ur(s.className,t),...h(),ref:d,children:[S.jsxs("div",{"data-hover":u>0,...s.dropzone.overlay,children:["Drop files to upload",S.jsx(S0,{style:{width:"50px"}})]}),S.jsx(ap,{children:e})]})};za.displayName="Container";const lp=O.forwardRef(({onClick:e,imgUrl:t,...n},r)=>{const{fab:i}=ge,{container:o,icon:a,image:s}=i??{};return t?S.jsx("img",{src:t,role:"button",tabIndex:0,...s,draggable:"false",onClick:e}):S.jsx("div",{...n,...o,ref:r,onClick:e,children:S.jsx("div",{...a})})});lp.displayName="Fab";function wC(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function xC(e,t){const n=A.createContext(t),r=o=>{const{children:a,...s}=o,l=A.useMemo(()=>s,Object.values(s));return S.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function i(o){const a=A.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function cp(e,t=[]){let n=[];function r(o,a){const s=A.createContext(a),l=n.length;n=[...n,a];const c=u=>{var y;const{scope:p,children:d,...m}=u,h=((y=p==null?void 0:p[e])==null?void 0:y[l])||s,g=A.useMemo(()=>m,Object.values(m));return S.jsx(h.Provider,{value:g,children:d})};c.displayName=o+"Provider";function f(u,p){var h;const d=((h=p==null?void 0:p[e])==null?void 0:h[l])||s,m=A.useContext(d);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,f]}const i=()=>{const o=n.map(a=>A.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return A.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,kC(i,...t)]}function kC(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const u=l(o)[`__scope${c}`];return{...s,...u}},{});return A.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Gt(e){const t=A.useRef(e);return A.useEffect(()=>{t.current=e}),A.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function up({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=SC({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=Gt(n),l=A.useCallback(c=>{if(o){const u=typeof c=="function"?c(e):c;u!==e&&s(u)}else i(c)},[o,e,i,s]);return[a,l]}function SC({defaultProp:e,onChange:t}){const n=A.useState(e),[r]=n,i=A.useRef(r),o=Gt(t);return A.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var vn=globalThis!=null&&globalThis.document?A.useLayoutEffect:()=>{};function EC(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function fp(...e){return t=>e.forEach(n=>EC(n,t))}function dp(...e){return A.useCallback(fp(...e),e)}var pp=A.forwardRef((e,t)=>{const{children:n,...r}=e,i=A.Children.toArray(n),o=i.find(AC);if(o){const a=o.props.children,s=i.map(l=>l===o?A.Children.count(a)>1?A.Children.only(null):A.isValidElement(a)?a.props.children:null:l);return S.jsx(ja,{...r,ref:t,children:A.isValidElement(a)?A.cloneElement(a,void 0,s):null})}return S.jsx(ja,{...r,ref:t,children:n})});pp.displayName="Slot";var ja=A.forwardRef((e,t)=>{const{children:n,...r}=e;if(A.isValidElement(n)){const i=TC(n);return A.cloneElement(n,{...IC(r,n.props),ref:t?fp(t,i):i})}return A.Children.count(n)>1?A.Children.only(null):null});ja.displayName="SlotClone";var CC=({children:e})=>S.jsx(S.Fragment,{children:e});function AC(e){return A.isValidElement(e)&&e.type===CC}function IC(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function TC(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var OC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ua=OC.reduce((e,t)=>{const n=A.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?pp:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(s,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function DC(e,t){return A.useReducer((n,r)=>t[n][r]??n,e)}var hp=e=>{const{present:t,children:n}=e,r=MC(t),i=typeof n=="function"?n({present:r.isPresent}):A.Children.only(n),o=dp(r.ref,PC(i));return typeof n=="function"||r.isPresent?A.cloneElement(i,{ref:o}):null};hp.displayName="Presence";function MC(e){const[t,n]=A.useState(),r=A.useRef({}),i=A.useRef(e),o=A.useRef("none"),a=e?"mounted":"unmounted",[s,l]=DC(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return A.useEffect(()=>{const c=bi(r.current);o.current=s==="mounted"?c:"none"},[s]),vn(()=>{const c=r.current,f=i.current;if(f!==e){const p=o.current,d=bi(c);e?l("MOUNT"):d==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(f&&p!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),vn(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,u=d=>{const h=bi(r.current).includes(d.animationName);if(d.target===t&&h&&(l("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},p=d=>{d.target===t&&(o.current=bi(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:A.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function bi(e){return(e==null?void 0:e.animationName)||"none"}function PC(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var NC=A.useId||(()=>{}),_C=0;function vi(e){const[t,n]=A.useState(NC());return vn(()=>{n(r=>r??String(_C++))},[e]),e||(t?`radix-${t}`:"")}var Ha="Collapsible",[LC]=cp(Ha),[FC,Wa]=LC(Ha),mp=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:a,...s}=e,[l=!1,c]=up({prop:r,defaultProp:i,onChange:a});return S.jsx(FC,{scope:n,disabled:o,contentId:vi(),open:l,onOpenToggle:A.useCallback(()=>c(f=>!f),[c]),children:S.jsx(Ua.div,{"data-state":qa(l),"data-disabled":o?"":void 0,...s,ref:t})})});mp.displayName=Ha;var gp="CollapsibleTrigger",yp=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Wa(gp,n);return S.jsx(Ua.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":qa(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:wC(e.onClick,i.onOpenToggle)})});yp.displayName=gp;var Va="CollapsibleContent",bp=A.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Wa(Va,e.__scopeCollapsible);return S.jsx(hp,{present:n||i.open,children:({present:o})=>S.jsx(RC,{...r,ref:t,present:o})})});bp.displayName=Va;var RC=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,a=Wa(Va,n),[s,l]=A.useState(r),c=A.useRef(null),f=dp(t,c),u=A.useRef(0),p=u.current,d=A.useRef(0),m=d.current,h=a.open||s,g=A.useRef(h),y=A.useRef();return A.useEffect(()=>{const b=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(b)},[]),vn(()=>{const b=c.current;if(b){y.current=y.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const w=b.getBoundingClientRect();u.current=w.height,d.current=w.width,g.current||(b.style.transitionDuration=y.current.transitionDuration,b.style.animationName=y.current.animationName),l(r)}},[a.open,r]),S.jsx(Ua.div,{"data-state":qa(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!h,...o,ref:f,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function qa(e){return e?"open":"closed"}var BC=mp,$C=bp;const Ka=({restartConversation:e,...t})=>{var o,a;const{header:n}=ge,{showInputModal:r}=Go(),i=async s=>{s.stopPropagation(),r?r({title:"Create New Conversation",description:"This will clear the current conversation and start a new one.",confirmButtonText:"New conversation",cancelButtonText:"Cancel"}).then(()=>e()):e()};return S.jsx(F0,{...t,...(a=(o=n==null?void 0:n.content)==null?void 0:o.actions)==null?void 0:a.icons,"aria-label":"Restart Conversation Button",tabIndex:0,role:"button",onClick:i})},vp=({onClick:e,...t})=>{const{header:n}=ge,r=i=>{i.stopPropagation(),e==null||e()};return S.jsx(Tu,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":"Close Chatbot Button",onClick:r,onKeyDown:i=>{i.key==="Enter"&&r(i)}})},pr=({icon:e,title:t,link:n,...r})=>{var a,s,l,c,f,u,p,d,m,h,g,y;const{header:i}=ge,o=e??E0;return t?n?S.jsxs("a",{...r,...(s=(a=i.expandedContent)==null?void 0:a.descriptionItems)==null?void 0:s.container,href:n,target:"_blank",rel:"noreferrer noopener",children:[S.jsx(o,{...(c=(l=i.expandedContent)==null?void 0:l.descriptionItems)==null?void 0:c.icon}),S.jsx("p",{...(u=(f=i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:u.link,children:t})]}):S.jsxs("div",{...r,...(d=(p=i.expandedContent)==null?void 0:p.descriptionItems)==null?void 0:d.container,children:[S.jsx(o,{...(h=(m=i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:h.icon}),S.jsx("p",{...(y=(g=i.expandedContent)==null?void 0:g.descriptionItems)==null?void 0:y.text,children:t})]}):null},zC=({soundOn:e,toggleSound:t})=>{const n=o=>{o.stopPropagation(),t==null||t()},{header:r}=ge,i=e?Iu:j0;return S.jsx("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n(o))},title:e?"Disable chat sounds":"Enable chat sounds",...r.content.actions.icons,children:S.jsx(i,{size:16})})},wp=({defaultOpen:e,closeWindow:t,configuration:n,restartConversation:r,disabled:i,soundOn:o,toggleSound:a,clientId:s,...l})=>{var m,h,g,y,b,w,E,x,C,T,N,$,I,D,F,_,R,P,L,U,z,q,v,M;const{header:c}=ge,[f,u]=O.useState(e),p=!!((m=n.email)!=null&&m.title)||!!((h=n.phone)!=null&&h.title)||!!((g=n.website)!=null&&g.title)||!!((y=n.termsOfService)!=null&&y.link)||!!((b=n.privacyPolicy)!=null&&b.link),d=p&&!i;return S.jsxs(BC,{open:d?f:!1,onOpenChange:u,"data-disabled":d?void 0:"",...c.container,...l,children:[S.jsxs(yp,{"aria-label":"Expand Header Button",...c.content.container,children:[S.jsx(Fn,{userId:s,src:n.botAvatar,...c.content.avatar,children:n.botName||"Bot"}),S.jsx("h2",{...c.content.title,children:n.botName||"Bot"}),n.botDescription&&S.jsx("p",{...c.content.description,children:n.botDescription}),S.jsxs("div",{...c.content.actions.container,children:[n.soundEnabled&&o!==void 0&&a&&S.jsx(zC,{soundOn:o,toggleSound:a})," ",r&&S.jsx(Ka,{restartConversation:r}),t&&S.jsx(vp,{onClick:t})]})]}),p&&S.jsxs($C,{...c.expandedContent.container,children:[S.jsxs("div",{"data-links":"",...c.expandedContent.group,children:[S.jsx(pr,{"data-email":"",icon:D0,title:(w=n.email)==null?void 0:w.title,link:(x=(E=n.email)==null?void 0:E.link)!=null&&x.startsWith("mailto:")?(C=n.email)==null?void 0:C.link:`mailto:${(T=n.email)==null?void 0:T.link}`}),S.jsx(pr,{"data-phone":"",icon:_0,title:(N=n.phone)==null?void 0:N.title,link:(I=($=n.phone)==null?void 0:$.link)!=null&&I.startsWith("tel:")?(D=n.phone)==null?void 0:D.link:`tel:${(F=n.phone)==null?void 0:F.link}`}),S.jsx(pr,{"data-website":"",link:(_=n.website)==null?void 0:_.link,icon:I0,title:(R=n.website)==null?void 0:R.title})]}),S.jsxs("div",{"data-legal":"",...(P=c.expandedContent)==null?void 0:P.group,children:[((L=n.termsOfService)==null?void 0:L.link)&&S.jsx(pr,{"data-terms":"",link:(U=n.termsOfService)==null?void 0:U.link,icon:Cu,title:(z=n.termsOfService)==null?void 0:z.title}),((q=n.privacyPolicy)==null?void 0:q.link)&&S.jsx(pr,{"data-privacy":"",link:(v=n.privacyPolicy)==null?void 0:v.link,icon:O0,title:(M=n.privacyPolicy)==null?void 0:M.title})]})]})]})},Ya=O.memo(({...e})=>{const{typingIndicator:t}=ge;return S.jsx("div",{...e,...t==null?void 0:t.container,children:S.jsx("div",{...t==null?void 0:t.loader})})});Ya.displayName="TypingIndicator";const Ga=O.memo(O.forwardRef(({direction:e,block:t,disableInput:n,children:r,sender:i,id:o,authorId:a,status:s,renderers:l,isReadOnly:c,isLastDeliveredMessage:f,feedback:u,timestamp:p,metadata:d,sendMessage:m,addMessageFeedback:h,showAvatar:g},y)=>{const[b,w]=O.useState([]),{message:{container:E,deliveryStatus:x}}=ge;return g=g??e==="incoming",S.jsx(Ko.Provider,{value:{isLoading:b,setIsLoading:w},children:S.jsxs("div",{...E,className:ur(E==null?void 0:E.className,f&&(x==null?void 0:x.className)),"data-loaded":b.length===0,"data-disable-input":!!n,"data-direction":e,dir:"auto",ref:y,children:[e==="incoming"&&g&&S.jsx(xp,{authorId:a,sender:i}),t&&S.jsx(Kt,{block:{...t,isReadOnly:c,direction:e,timestamp:p,sender:i,feedback:u,messageId:o,status:s,metadata:d,sendMessage:m,addMessageFeedback:h},renderers:l}),e==="outgoing"&&g&&S.jsx(xp,{authorId:a,sender:i}),r]})})})),xp=({authorId:e,sender:t})=>{const{message:{avatar:n}}=ge,[r,i]=O.useState("idle"),o=Rs(e??"",15);return S.jsxs(Ms,{"data-color":o,"data-loading-status":r,...n==null?void 0:n.container,children:[S.jsx(Ps,{...n==null?void 0:n.image,onLoadingStatusChange:i,src:t==null?void 0:t.avatar}),S.jsxs(Ns,{...n==null?void 0:n.fallback,children:[t==null?void 0:t.name[0]," "]})]})};function jC({botAvatar:e,botDescription:t,botName:n}){const{messageList:{marquee:r}}=ge;return S.jsxs("li",{...r.container,children:[S.jsx(Fn,{src:e,...r.avatar,children:(n||"Bot").slice(0,1)}),S.jsxs("div",{...r.content,children:[S.jsx("h1",{...r.title,children:n||"Bot"}),S.jsx("p",{...r.description,children:t})]})]})}let kp=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");/*!---------------------------------------------------------------------------------------------
294
+ `]})]})},za=({children:e,className:t,uploadFile:n,allowFileUpload:r,storageKey:i,connected:o,...a})=>{const{container:s}=ge,l=sn(g=>g.setMessageContainerRef),f=Yu(i)(g=>g.uploadFile),[u,p]=O.useState(0),d=O.useRef(null);O.useEffect(()=>{l(d)},[d,l]);const m=O.useCallback(g=>{n&&(g.forEach(y=>f(y,n)),p(0))},[f,n]),{getRootProps:h}=np({noClick:!0,noKeyboard:!0,onDrop:m,disabled:!(r&&n),onDragEnter:()=>p(g=>g+1),onDragLeave:()=>p(g=>g-1)});return S.jsxs("div",{...a,className:ur(s.className,t),...h(),ref:d,children:[S.jsxs("div",{"data-hover":u>0,...s.dropzone.overlay,children:["Drop files to upload",S.jsx(E0,{style:{width:"50px"}})]}),S.jsx(ip,{children:e})]})};za.displayName="Container";const ap=O.forwardRef(({onClick:e,imgUrl:t,...n},r)=>{const{fab:i}=ge,{container:o,icon:a,image:s}=i??{};return t?S.jsx("img",{src:t,role:"button",tabIndex:0,...s,draggable:"false",onClick:e}):S.jsx("div",{...n,...o,ref:r,onClick:e,children:S.jsx("div",{...a})})});ap.displayName="Fab";function kC(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function SC(e,t){const n=A.createContext(t),r=o=>{const{children:a,...s}=o,l=A.useMemo(()=>s,Object.values(s));return S.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function i(o){const a=A.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function sp(e,t=[]){let n=[];function r(o,a){const s=A.createContext(a),l=n.length;n=[...n,a];const c=u=>{var y;const{scope:p,children:d,...m}=u,h=((y=p==null?void 0:p[e])==null?void 0:y[l])||s,g=A.useMemo(()=>m,Object.values(m));return S.jsx(h.Provider,{value:g,children:d})};c.displayName=o+"Provider";function f(u,p){var h;const d=((h=p==null?void 0:p[e])==null?void 0:h[l])||s,m=A.useContext(d);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,f]}const i=()=>{const o=n.map(a=>A.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return A.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,EC(i,...t)]}function EC(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const u=l(o)[`__scope${c}`];return{...s,...u}},{});return A.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Gt(e){const t=A.useRef(e);return A.useEffect(()=>{t.current=e}),A.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function lp({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=CC({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=Gt(n),l=A.useCallback(c=>{if(o){const u=typeof c=="function"?c(e):c;u!==e&&s(u)}else i(c)},[o,e,i,s]);return[a,l]}function CC({defaultProp:e,onChange:t}){const n=A.useState(e),[r]=n,i=A.useRef(r),o=Gt(t);return A.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var vn=globalThis!=null&&globalThis.document?A.useLayoutEffect:()=>{};function AC(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function cp(...e){return t=>e.forEach(n=>AC(n,t))}function up(...e){return A.useCallback(cp(...e),e)}var fp=A.forwardRef((e,t)=>{const{children:n,...r}=e,i=A.Children.toArray(n),o=i.find(TC);if(o){const a=o.props.children,s=i.map(l=>l===o?A.Children.count(a)>1?A.Children.only(null):A.isValidElement(a)?a.props.children:null:l);return S.jsx(ja,{...r,ref:t,children:A.isValidElement(a)?A.cloneElement(a,void 0,s):null})}return S.jsx(ja,{...r,ref:t,children:n})});fp.displayName="Slot";var ja=A.forwardRef((e,t)=>{const{children:n,...r}=e;if(A.isValidElement(n)){const i=DC(n);return A.cloneElement(n,{...OC(r,n.props),ref:t?cp(t,i):i})}return A.Children.count(n)>1?A.Children.only(null):null});ja.displayName="SlotClone";var IC=({children:e})=>S.jsx(S.Fragment,{children:e});function TC(e){return A.isValidElement(e)&&e.type===IC}function OC(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function DC(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var MC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ua=MC.reduce((e,t)=>{const n=A.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?fp:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(s,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function PC(e,t){return A.useReducer((n,r)=>t[n][r]??n,e)}var dp=e=>{const{present:t,children:n}=e,r=NC(t),i=typeof n=="function"?n({present:r.isPresent}):A.Children.only(n),o=up(r.ref,_C(i));return typeof n=="function"||r.isPresent?A.cloneElement(i,{ref:o}):null};dp.displayName="Presence";function NC(e){const[t,n]=A.useState(),r=A.useRef({}),i=A.useRef(e),o=A.useRef("none"),a=e?"mounted":"unmounted",[s,l]=PC(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return A.useEffect(()=>{const c=bi(r.current);o.current=s==="mounted"?c:"none"},[s]),vn(()=>{const c=r.current,f=i.current;if(f!==e){const p=o.current,d=bi(c);e?l("MOUNT"):d==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(f&&p!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),vn(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,u=d=>{const h=bi(r.current).includes(d.animationName);if(d.target===t&&h&&(l("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},p=d=>{d.target===t&&(o.current=bi(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:A.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function bi(e){return(e==null?void 0:e.animationName)||"none"}function _C(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var LC=A.useId||(()=>{}),FC=0;function vi(e){const[t,n]=A.useState(LC());return vn(()=>{n(r=>r??String(FC++))},[e]),e||(t?`radix-${t}`:"")}var Ha="Collapsible",[RC]=sp(Ha),[BC,Wa]=RC(Ha),pp=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:a,...s}=e,[l=!1,c]=lp({prop:r,defaultProp:i,onChange:a});return S.jsx(BC,{scope:n,disabled:o,contentId:vi(),open:l,onOpenToggle:A.useCallback(()=>c(f=>!f),[c]),children:S.jsx(Ua.div,{"data-state":qa(l),"data-disabled":o?"":void 0,...s,ref:t})})});pp.displayName=Ha;var hp="CollapsibleTrigger",mp=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Wa(hp,n);return S.jsx(Ua.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":qa(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:kC(e.onClick,i.onOpenToggle)})});mp.displayName=hp;var Va="CollapsibleContent",gp=A.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Wa(Va,e.__scopeCollapsible);return S.jsx(dp,{present:n||i.open,children:({present:o})=>S.jsx($C,{...r,ref:t,present:o})})});gp.displayName=Va;var $C=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,a=Wa(Va,n),[s,l]=A.useState(r),c=A.useRef(null),f=up(t,c),u=A.useRef(0),p=u.current,d=A.useRef(0),m=d.current,h=a.open||s,g=A.useRef(h),y=A.useRef();return A.useEffect(()=>{const b=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(b)},[]),vn(()=>{const b=c.current;if(b){y.current=y.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const w=b.getBoundingClientRect();u.current=w.height,d.current=w.width,g.current||(b.style.transitionDuration=y.current.transitionDuration,b.style.animationName=y.current.animationName),l(r)}},[a.open,r]),S.jsx(Ua.div,{"data-state":qa(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!h,...o,ref:f,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function qa(e){return e?"open":"closed"}var zC=pp,jC=gp;const Ka=({restartConversation:e,...t})=>{var o,a;const{header:n}=ge,{showInputModal:r}=Go(),i=async s=>{s.stopPropagation(),r?r({title:"Create New Conversation",description:"This will clear the current conversation and start a new one.",confirmButtonText:"New conversation",cancelButtonText:"Cancel"}).then(()=>e()):e()};return S.jsx(B0,{...t,...(a=(o=n==null?void 0:n.content)==null?void 0:o.actions)==null?void 0:a.icons,"aria-label":"Restart Conversation Button",tabIndex:0,role:"button",onClick:i})},yp=({onClick:e,...t})=>{const{header:n}=ge,r=i=>{i.stopPropagation(),e==null||e()};return S.jsx(Au,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":"Close Chatbot Button",onClick:r,onKeyDown:i=>{i.key==="Enter"&&r(i)}})},pr=({icon:e,title:t,link:n,...r})=>{var a,s,l,c,f,u,p,d,m,h,g,y;const{header:i}=ge,o=e??C0;return t?n?S.jsxs("a",{...r,...(s=(a=i.expandedContent)==null?void 0:a.descriptionItems)==null?void 0:s.container,href:n,target:"_blank",rel:"noreferrer noopener",children:[S.jsx(o,{...(c=(l=i.expandedContent)==null?void 0:l.descriptionItems)==null?void 0:c.icon}),S.jsx("p",{...(u=(f=i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:u.link,children:t})]}):S.jsxs("div",{...r,...(d=(p=i.expandedContent)==null?void 0:p.descriptionItems)==null?void 0:d.container,children:[S.jsx(o,{...(h=(m=i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:h.icon}),S.jsx("p",{...(y=(g=i.expandedContent)==null?void 0:g.descriptionItems)==null?void 0:y.text,children:t})]}):null},UC=({soundOn:e,toggleSound:t})=>{const n=o=>{o.stopPropagation(),t==null||t()},{header:r}=ge,i=e?Cu:H0;return S.jsx("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n(o))},title:e?"Disable chat sounds":"Enable chat sounds",...r.content.actions.icons,children:S.jsx(i,{size:16})})},bp=({defaultOpen:e,closeWindow:t,configuration:n,restartConversation:r,disabled:i,soundOn:o,toggleSound:a,clientId:s,...l})=>{var m,h,g,y,b,w,C,x,E,T,_,$,I,D,z,P,L,M,R,U,B,V,v,N;const{header:c}=ge,[f,u]=O.useState(e),p=!!((m=n.email)!=null&&m.title)||!!((h=n.phone)!=null&&h.title)||!!((g=n.website)!=null&&g.title)||!!((y=n.termsOfService)!=null&&y.link)||!!((b=n.privacyPolicy)!=null&&b.link),d=p&&!i;return S.jsxs(zC,{open:d?f:!1,onOpenChange:u,"data-disabled":d?void 0:"",...c.container,...l,children:[S.jsxs(mp,{"aria-label":"Expand Header Button",...c.content.container,children:[S.jsx(Fn,{userId:s,src:n.botAvatar,...c.content.avatar,children:n.botName||"Bot"}),S.jsx("h2",{...c.content.title,children:n.botName||"Bot"}),n.botDescription&&S.jsx("p",{...c.content.description,children:n.botDescription}),S.jsxs("div",{...c.content.actions.container,children:[n.soundEnabled&&o!==void 0&&a&&S.jsx(UC,{soundOn:o,toggleSound:a})," ",r&&S.jsx(Ka,{restartConversation:r}),t&&S.jsx(yp,{onClick:t})]})]}),p&&S.jsxs(jC,{...c.expandedContent.container,children:[S.jsxs("div",{"data-links":"",...c.expandedContent.group,children:[S.jsx(pr,{"data-email":"",icon:P0,title:(w=n.email)==null?void 0:w.title,link:(x=(C=n.email)==null?void 0:C.link)!=null&&x.startsWith("mailto:")?(E=n.email)==null?void 0:E.link:`mailto:${(T=n.email)==null?void 0:T.link}`}),S.jsx(pr,{"data-phone":"",icon:F0,title:(_=n.phone)==null?void 0:_.title,link:(I=($=n.phone)==null?void 0:$.link)!=null&&I.startsWith("tel:")?(D=n.phone)==null?void 0:D.link:`tel:${(z=n.phone)==null?void 0:z.link}`}),S.jsx(pr,{"data-website":"",link:(P=n.website)==null?void 0:P.link,icon:T0,title:(L=n.website)==null?void 0:L.title})]}),S.jsxs("div",{"data-legal":"",...(M=c.expandedContent)==null?void 0:M.group,children:[((R=n.termsOfService)==null?void 0:R.link)&&S.jsx(pr,{"data-terms":"",link:(U=n.termsOfService)==null?void 0:U.link,icon:Su,title:(B=n.termsOfService)==null?void 0:B.title}),((V=n.privacyPolicy)==null?void 0:V.link)&&S.jsx(pr,{"data-privacy":"",link:(v=n.privacyPolicy)==null?void 0:v.link,icon:M0,title:(N=n.privacyPolicy)==null?void 0:N.title})]})]})]})},Ya=O.memo(({...e})=>{const{typingIndicator:t}=ge;return S.jsx("div",{...e,...t==null?void 0:t.container,children:S.jsx("div",{...t==null?void 0:t.loader})})});Ya.displayName="TypingIndicator";const Ga=O.memo(O.forwardRef(({direction:e,block:t,disableInput:n,children:r,sender:i,id:o,authorId:a,status:s,renderers:l,isReadOnly:c,isLastDeliveredMessage:f,feedback:u,timestamp:p,metadata:d,sendMessage:m,addMessageFeedback:h,showAvatar:g},y)=>{const[b,w]=O.useState([]),{message:{container:C,deliveryStatus:x}}=ge;return g=g??e==="incoming",S.jsx(Ko.Provider,{value:{isLoading:b,setIsLoading:w},children:S.jsxs("div",{...C,className:ur(C==null?void 0:C.className,f&&(x==null?void 0:x.className)),"data-loaded":b.length===0,"data-disable-input":!!n,"data-direction":e,dir:"auto",ref:y,children:[e==="incoming"&&g&&S.jsx(vp,{authorId:a,sender:i}),t&&S.jsx(Kt,{block:{...t,isReadOnly:c,direction:e,timestamp:p,sender:i,feedback:u,messageId:o,status:s,metadata:d,sendMessage:m,addMessageFeedback:h},renderers:l}),e==="outgoing"&&g&&S.jsx(vp,{authorId:a,sender:i}),r]})})})),vp=({authorId:e,sender:t})=>{const{message:{avatar:n}}=ge,[r,i]=O.useState("idle"),o=Ls(e??"",15);return S.jsxs(Ps,{"data-color":o,"data-loading-status":r,...n==null?void 0:n.container,children:[S.jsx(Ns,{...n==null?void 0:n.image,onLoadingStatusChange:i,src:t==null?void 0:t.avatar}),S.jsxs(_s,{...n==null?void 0:n.fallback,children:[t==null?void 0:t.name[0]," "]})]})};function HC({botAvatar:e,botDescription:t,botName:n}){const{messageList:{marquee:r}}=ge;return S.jsxs("li",{...r.container,children:[S.jsx(Fn,{src:e,...r.avatar,children:(n||"Bot").slice(0,1)}),S.jsxs("div",{...r.content,children:[S.jsx("h1",{...r.title,children:n||"Bot"}),S.jsx("p",{...r.description,children:t})]})]})}let Qa=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");/*!---------------------------------------------------------------------------------------------
289
295
  * Copyright (c) StackBlitz. All rights reserved.
290
296
  * Licensed under the MIT License. See License.txt in the project root for license information.
291
- *--------------------------------------------------------------------------------------------*/const UC={damping:.7,stiffness:.05,mass:1.25},HC=70,WC=1e3/60,VC=350;let wi=!1;(Lh=globalThis.document)==null||Lh.addEventListener("mousedown",()=>{wi=!0}),(Fh=globalThis.document)==null||Fh.addEventListener("mouseup",()=>{wi=!1}),(Rh=globalThis.document)==null||Rh.addEventListener("click",()=>{wi=!1});const qC=(e={})=>{const[t,n]=O.useState(!1),[r,i]=O.useState(e.initial!==!1),[o,a]=O.useState(!1),s=O.useRef(null);s.current=e;const l=O.useCallback(()=>{var E;if(!wi)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const w=b.getRangeAt(0);return w.commonAncestorContainer.contains(g.current)||((E=g.current)==null?void 0:E.contains(w.commonAncestorContainer))},[]),c=O.useCallback(b=>{u.isAtBottom=b,i(b)},[]),f=O.useCallback(b=>{u.escapedFromLock=b,n(b)},[]),u=O.useMemo(()=>{let b;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){var w;return((w=g.current)==null?void 0:w.scrollTop)??0},set scrollTop(w){g.current&&(g.current.scrollTop=w,u.ignoreScrollToTop=g.current.scrollTop)},get targetScrollTop(){return!g.current||!y.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!y.current)return 0;const{targetScrollTop:w}=this;if(!e.targetScrollTop)return w;if((b==null?void 0:b.targetScrollTop)===w)return b.calculatedScrollTop;const E=Math.max(Math.min(e.targetScrollTop(w,{scrollElement:g.current,contentElement:y.current}),w),0);return b={targetScrollTop:w,calculatedScrollTop:E},requestAnimationFrame(()=>{b=void 0}),E},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=HC}}},[]),p=O.useCallback((b={})=>{var $;typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||c(!0);const w=Date.now()+(Number(b.wait)||0),E=Ja(s.current,b.animation),{ignoreEscapes:x=!1}=b;let C,T=u.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{C=Date.now()}):C=w+(b.duration??0);const N=async()=>{const I=new Promise(requestAnimationFrame).then(()=>{var R;if(!u.isAtBottom)return u.animation=void 0,!1;const{scrollTop:D}=u,F=performance.now(),_=(F-(u.lastTick??F))/WC;if(u.animation||(u.animation={behavior:E,promise:I,ignoreEscapes:x}),u.animation.behavior===E&&(u.lastTick=F),l()||w>Date.now())return N();if(D<Math.min(T,u.calculatedTargetScrollTop)){if(((R=u.animation)==null?void 0:R.behavior)===E){if(E==="instant")return u.scrollTop=u.calculatedTargetScrollTop,N();u.velocity=(E.damping*u.velocity+E.stiffness*u.scrollDifference)/E.mass,u.accumulated+=u.velocity*_,u.scrollTop+=u.accumulated,u.scrollTop!==D&&(u.accumulated=0)}return N()}return C>Date.now()?(T=u.calculatedTargetScrollTop,N()):(u.animation=void 0,u.scrollTop<u.calculatedTargetScrollTop?p({animation:Ja(s.current,s.current.resize),ignoreEscapes:x,duration:Math.max(0,C-Date.now())||void 0}):u.isAtBottom)});return I.then(D=>(requestAnimationFrame(()=>{u.animation||(u.lastTick=void 0,u.velocity=0)}),D))};return b.wait!==!0&&(u.animation=void 0),(($=u.animation)==null?void 0:$.behavior)===E?u.animation.promise:N()},[c,l,u]),d=O.useCallback(()=>{f(!0),c(!1)},[f,c]),m=O.useCallback(({target:b})=>{if(b!==g.current)return;const{scrollTop:w,ignoreScrollToTop:E}=u;let{lastScrollTop:x=w}=u;u.lastScrollTop=w,u.ignoreScrollToTop=void 0,E&&E>w&&(x=E),a(u.isNearBottom),setTimeout(()=>{var N;if(u.resizeDifference||w===E)return;if(l()){f(!0),c(!1);return}const C=w>x,T=w<x;if((N=u.animation)!=null&&N.ignoreEscapes){u.scrollTop=x;return}T&&(f(!0),c(!1)),C&&f(!1),!u.escapedFromLock&&u.isNearBottom&&c(!0)},1)},[f,c,l,u]),h=O.useCallback(({target:b,deltaY:w})=>{var x;let E=b;for(;!["scroll","auto"].includes(getComputedStyle(E).overflow);){if(!E.parentElement)return;E=E.parentElement}E===g.current&&w<0&&g.current.scrollHeight>g.current.clientHeight&&!((x=u.animation)!=null&&x.ignoreEscapes)&&(f(!0),c(!1))},[f,c,u]),g=Sp(b=>{var w,E;(w=g.current)==null||w.removeEventListener("scroll",m),(E=g.current)==null||E.removeEventListener("wheel",h),b==null||b.addEventListener("scroll",m,{passive:!0}),b==null||b.addEventListener("wheel",h,{passive:!0})},[]),y=Sp(b=>{var E,x;if((E=u.resizeObserver)==null||E.disconnect(),!b)return;let w;u.resizeObserver=new ResizeObserver(([C])=>{const{height:T}=C.contentRect,N=T-(w??T);if(u.resizeDifference=N,u.scrollTop>u.targetScrollTop&&(u.scrollTop=u.targetScrollTop),a(u.isNearBottom),N>=0){const $=Ja(s.current,w?s.current.resize:s.current.initial);p({animation:$,wait:!0,preserveScrollPosition:!0,duration:$==="instant"?void 0:VC})}else u.isNearBottom&&(f(!1),c(!0));w=T,requestAnimationFrame(()=>{setTimeout(()=>{u.resizeDifference===N&&(u.resizeDifference=0)},1)})}),(x=u.resizeObserver)==null||x.observe(b)},[]);return{contentRef:y,scrollRef:g,scrollToBottom:p,stopScroll:d,isAtBottom:r||o,isNearBottom:o,escapedFromLock:t,state:u}};function Sp(e,t){const n=O.useCallback(r=>(n.current=r,e(r)),t);return n}const Qa=new Map;function Ja(...e){const t={...UC};let n=!1;for(const i of e){if(i==="instant"){n=!0;continue}typeof i=="object"&&(n=!1,t.damping=i.damping??t.damping,t.stiffness=i.stiffness??t.stiffness,t.mass=i.mass??t.mass)}const r=JSON.stringify(t);return Qa.has(r)||Qa.set(r,Object.freeze(t)),n?"instant":Qa.get(r)}const Ep=O.createContext(null),KC=typeof window<"u"?O.useLayoutEffect:O.useEffect;function xi({instance:e,children:t,resize:n,initial:r,mass:i,damping:o,stiffness:a,targetScrollTop:s,contextRef:l,...c}){const f=O.useRef(null),u=A.useCallback((x,C)=>{const T=(E==null?void 0:E.targetScrollTop)??s;return(T==null?void 0:T(x,C))??x},[s]),p=qC({mass:i,damping:o,stiffness:a,resize:n,initial:r,targetScrollTop:u}),{scrollRef:d,contentRef:m,scrollToBottom:h,stopScroll:g,isAtBottom:y,escapedFromLock:b,state:w}=e??p,E=O.useMemo(()=>({scrollToBottom:h,stopScroll:g,scrollRef:d,isAtBottom:y,escapedFromLock:b,contentRef:m,state:w,get targetScrollTop(){return f.current},set targetScrollTop(x){f.current=x}}),[h,y,m,d,g,b,w]);return O.useImperativeHandle(l,()=>E,[E]),KC(()=>{d.current&&getComputedStyle(d.current).overflow==="visible"&&(d.current.style.overflow="auto")},[]),S.jsx(Ep.Provider,{value:E,children:S.jsx("div",{...c,children:typeof t=="function"?t(E):t})})}(function(e){function t({children:n,...r}){const i=Cp();return S.jsx("div",{ref:i.scrollRef,style:{height:"100%",width:"100%"},children:S.jsx("div",{...r,ref:i.contentRef,children:typeof n=="function"?n(i):n})})}e.Content=t})(xi||(xi={}));function Cp(){const e=O.useContext(Ep);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}const Za=O.memo(({className:e,messages:t=[],isTyping:n,headerMessage:r,renderers:i,botAvatar:o,botDescription:a,botName:s,sendMessage:l,addMessageFeedback:c,showMarquee:f=!0,showDateSystemMessage:u=!0,showMessageStatus:p=!0,showIncomingMessageAvatar:d=!0,showOutgoingMessageAvatar:m=!1,...h})=>{var E;const{messageList:g}=ge,y=O.useMemo(()=>u?fm(t):t,[t]),b=O.useMemo(()=>{var C;const x=y.filter(T=>T.direction==="outgoing"&&T.status!=="pending");return(C=x[x.length-1])==null?void 0:C.id},[y]),w=x=>{if(x.direction==="incoming")return d;if(x.direction==="outgoing")return m};return S.jsxs(xi,{...h,resize:"smooth",initial:"instant",className:ur(g.container.className,e),children:[S.jsxs(xi.Content,{className:g.viewPort.className,children:[r&&S.jsx("span",{...g.headerMessage,children:r}),f&&S.jsx(jC,{botAvatar:o,botDescription:a,botName:s}),y.map(x=>{var C;return S.jsx(Ga,{renderers:i,sendMessage:l,addMessageFeedback:c,isLastDeliveredMessage:p&&x.id===b,showAvatar:w(x),...x},((C=x.metadata)==null?void 0:C.clientMessageId)||x.id)}),n&&S.jsx(Ga,{id:kp(),renderers:i,sendMessage:l,direction:"incoming",timestamp:new Date,showAvatar:d,block:void 0,sender:((E=t.filter(x=>x.direction==="incoming").at(-1))==null?void 0:E.sender)??{name:s||"Bot",avatar:o},children:S.jsx(Ya,{})})]}),S.jsx(YC,{})]})}),YC=()=>{const{isAtBottom:e,scrollToBottom:t}=Cp(),{messageList:n}=ge;return e?null:S.jsx("button",{className:n.scrollDownButton.className,onClick:()=>t()})};Za.displayName="MessageList";const GC=({className:e,...t})=>{const{className:n}=ge.loader;return S.jsx("div",{...t,className:ur(e,n)})};function Ap({error:e,restartConversation:t,closeWindow:n}){let r,i;const{error:o}=ge;return e.type==="configuration"?(r="Configuration error",i=S.jsx(N0,{...o.icon})):e.type==="bot"?(r="Bot error",i=S.jsx(Su,{...o.icon})):e.type==="network"?(r="Network error",i=S.jsx(U0,{...o.icon})):e.type==="disconnected"?(r="Disconnected",i=S.jsx($0,{...o.icon})):(r="Unexpected error",i=S.jsx(Su,{...o.icon})),S.jsx(QC,{error:e,title:r,icon:i,restartConversation:t,closeWindow:n})}function QC({error:e,title:t,icon:n,restartConversation:r,closeWindow:i}){const{error:o}=ge;return S.jsxs("div",{...o.container,children:[S.jsxs("div",{...o.header.container,children:[`Webchat ${e.type} error`,S.jsxs("div",{...o.header.actions,children:[r&&S.jsx(Ka,{restartConversation:r,style:{color:"white",backgroundColor:"transparent"}}),i&&S.jsx(vp,{onClick:i,style:{color:"white",backgroundColor:"transparent"}})]})]}),S.jsxs("div",{...o.content,children:[n,S.jsx("div",{...o.errorTitle,children:t}),S.jsx("div",{...o.errorMessage,children:e.message}),e.id&&S.jsx("div",{...o.id,children:e.id})]})]})}const Ip=({connected:e,configuration:t,isTyping:n,messages:r,user:i,isLoading:o,renderers:a,isReadOnly:s,disableComposer:l,allowFileUpload:c,error:f,participants:u,closeWindow:p,sendMessage:d,uploadFile:m,addMessageFeedback:h,restartConversation:g,clientId:y,storageKey:b,soundOn:w,toggleSound:E,...x})=>{const{color:C,fontFamily:T,radius:N,themeMode:$,variant:I,headerVariant:D,botAvatar:F,botDescription:_,botName:R,composerPlaceholder:P,footer:L,feedbackEnabled:U,additionalStylesheetUrl:z}=t,q={color:C,fontFamily:T,radius:N,themeMode:$,variant:I,headerVariant:D,additionalStylesheetUrl:z};U||(h=void 0);const v=O.useMemo(()=>i?il(r,u,i.id,R,F):[],[F,R,r,i,u]),M=O.useRef(null),H=sn(k=>k.setPortalContainer);return O.useEffect(()=>(H(M.current),()=>{H(null)}),[H]),S.jsxs(S.Fragment,{children:[S.jsx(sp,{...q}),S.jsx("div",{ref:M,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}}),S.jsx(za,{connected:e,allowFileUpload:c,uploadFile:m,storageKey:b,...x,children:f?S.jsx(Ap,{error:f,restartConversation:g,closeWindow:p}):S.jsxs(S.Fragment,{children:[S.jsx(wp,{closeWindow:p,configuration:t,restartConversation:g,clientId:y,soundOn:w,toggleSound:E}),o?S.jsx(GC,{}):S.jsx(Za,{botAvatar:F,botDescription:_,botName:R,renderers:a,isTyping:n,sendMessage:d,addMessageFeedback:h,messages:v}),S.jsx(Id,{sendMessage:d,uploadFile:m,connected:e,isReadOnly:s,disableComposer:l,footer:L,composerPlaceholder:P,allowFileUpload:c,storageKey:b})]})})]})};function JC(){const[e,t]=O.useState(!1),n=O.useRef(null);return{isTyping:e,setIsTyping:(r,i)=>{if(t(r),!r)return()=>{};if(n.current=new Date,!i)return()=>{};const o=setTimeout(()=>{const a=n.current;a&&new Date().getTime()-a.getTime()>i&&t(!1)},i+100);return()=>clearTimeout(o)}}}const Tp={chatMessageNotification:new URL("data:audio/ogg;base64,T2dnUwACAAAAAAAAAAAVJAEzAAAAAOU+A6UBHgF2b3JiaXMAAAAAASJWAAD/////AH0AAP////+pAU9nZ1MAAAAAAAAAAAAAFSQBMwEAAAD3T/UfDpz////////////////FA3ZvcmJpcwwAAABMYXZmNjEuNy4xMDAEAAAAHwAAAGVuY29kZXI9TGF2YzYxLjE5LjEwMSBsaWJ2b3JiaXMrAAAAZW5jb2RlZF9ieT1BZG9iZSBQcmVtaWVyZSBQcm8gMjAyNS4wIChNYWNpbhcAAAB0aW1lX3JlZmVyZW5jZT0xMjExMDQwMA8AAABkYXRlPTIwMjUtMDgtMDUBBXZvcmJpcyJCQ1YBAEAAABhCECoFrWOOOsgVIYwZoqBCyinHHULQIaMkQ4g6xjXHGGNHuWSKQsmB0JBVAABAAACkHFdQckkt55xzoxhXzHHoIOecc+UgZ8xxCSXnnHOOOeeSco4x55xzoxhXDnIpLeecc4EUR4pxpxjnnHOkHEeKcagY55xzbTG3knLOOeecc+Ygh1JyrjXnnHOkGGcOcgsl55xzxiBnzHHrIOecc4w1t9RyzjnnnHPOOeecc84555xzjDHnnHPOOeecc24x5xZzrjnnnHPOOeccc84555xzIDRkFQCQAACgoSiK4igOEBqyCgDIAAAQQHEUR5EUS7Ecy9EkDQgNWQUAAAEACAAAoEiGpEiKpViOZmmeJnqiKJqiKquyacqyLMuy67ouEBqyCgBIAABQURTFcBQHCA1ZBQBkAAAIYCiKoziO5FiSpVmeB4SGrAIAgAAABAAAUAxHsRRN8STP8jzP8zzP8zzP8zzP8zzP8zzP8zwNCA1ZBQAgAAAAgihkGANCQ1YBAEAAAAghGhlDnVISXAoWQhwRQx1CzkOppYPgKYUlY9JTrEEIIXzvPffee++B0JBVAAAQAABhFDiIgcckCCGEYhQnRHGmIAghhOUkWMp56CQI3YMQQrice8u59957IDRkFQAACADAIIQQQgghhBBCCCmklFJIKaaYYoopxxxzzDHHIIMMMuigk046yaSSTjrKJKOOUmsptRRTTLHlFmOttdacc69BKWOMMcYYY4wxxhhjjDHGGCMIDVkFAIAAABAGGWSQQQghhBRSSCmmmHLMMcccA0JDVgEAgAAAAgAAABxFUiRHciRHkiTJkixJkzzLszzLszxN1ERNFVXVVW3X9m1f9m3f1WXf9mXb1WVdlmXdtW1d1l1d13Vd13Vd13Vd13Vd13Vd14HQkFUAgAQAgI7kOI7kOI7kSI6kSAoQGrIKAJABABAAgKM4iuNIjuRYjiVZkiZplmd5lqd5mqiJHhAasgoAAAQAEAAAAAAAgKIoiqM4jiRZlqZpnqd6oiiaqqqKpqmqqmqapmmapmmapmmapmmapmmapmmapmmapmmapmmapmmapmkCoSGrAAAJAAAdx3EcR3Ecx3EkR5IkIDRkFQAgAwAgAABDURxFcizHkjRLszzL00TP9FxRNnVTV20gNGQVAAAIACAAAAAAAADHczzHczzJkzzLczzHkzxJ0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRNA0JDVgIAZAAAEJOQSk6xV0YpxiS0XiqkFJPUe6iYYkw67alCBikHuYdKIaWg094ypZBSDHunmELIGOqhg5AxhbDX2nPPvfceCA1ZEQBEAQAAxiDGEGPIMSYlgxIxxyRkUiLnnJROSialpFZazKSEmEqLkXNOSiclk1JaC6llkkprJaYCAAACHAAAAiyEQkNWBABRAACIMUgppBRSSjGnmENKKceUY0gp5ZxyTjnHmHQQKucYdA5KpJRyjjmnnHMSMgeVcw5CJp0AAIAABwCAAAuh0JAVAUCcAACAkHOKMQgRYxBCCSmFUFKqnJPSQUmpg5JSSanFklKMlXNSOgkpdRJSKinFWFKKLaRUY2kt19JSjS3GnFuMvYaUYi2p1Vpaq7nFWHOLNffIOUqdlNY6Ka2l1mpNrdXaSWktpNZiaS3G1mLNKcacMymthZZiK6nF2GLLNbWYc2kt1xRjzynGnmusucecgzCt1ZxayznFmHvMseeYcw+Sc5Q6Ka11UlpLrdWaWqs1k9Jaaa3GkFqLLcacW4sxZ1JaLKnFWFqKMcWYc4st19BarinGnFOLOcdag5Kx9l5aqznFmHuKreeYczA2x547SrmW1nourfVecy5C1tyLaC3n1GoPKsaec87B2NyDEK3lnGrsPcXYe+45GNtz8K3W4FvNRcicg9C5+KZ7MEbV2oPMtQiZcxA66CJ08Ml4lGoureVcWus91hp8zTkI0VruKcbeU4u9156bsL0HIVrLPcXYg4ox+JpzMDrnYlStwcecg5C1FqF7L0rnIJSqtQeZa1Ay1yJ08MXooIsvAABgwAEAIMCEMlBoyIoAIE4AgEHIOaUYhEopCKGElEIoKVWMSciYg5IxJ6WUUloIJbWKMQiZY1Iyx6SEEloqJbQSSmmplNJaKKW1llqMKbUWQymphVJaK6W0llqqMbVWY8SYlMw5KZljUkoprZVSWqsck5IxKKmDkEopKcVSUouVc1Iy6Kh0EEoqqcRUUmmtpNJSKaXFklJsKcVUW4u1hlJaLKnEVlJqMbVUW4sx14gxKRlzUjLnpJRSUiultJY5J6WDjkrmoKSSUmulpBQz5qR0DkrKIKNSUootpRJTKKW1klJspaTWWoy1ptRaLSW1VlJqsZQSW4sx1xZLTZ2U1koqMYZSWmsx5ppaizGUElspKcaSSmytxZpbbDmGUlosqcRWSmqx1ZZja7Hm1FKNKbWaW2y5xpRTj7X2nFqrNbVUY2ux5lhbb7XWnDsprYVSWislxZhai7HFWHMoJbaSUmylpBhbbLm2FmMPobRYSmqxpBJjazHmGFuOqbVaW2y5ptRirbX2HFtuPaUWa4ux5tJSjTXX3mNNORUAADDgAAAQYEIZKDRkJQAQBQAAGMMYYxAapZxzTkqDlHPOScmcgxBCSplzEEJIKXNOQkotZc5BSKm1UEpKrcUWSkmptRYLAAAocAAACLBBU2JxgEJDVgIAUQAAiDFKMQahMUYp5yA0xijFGIRKKcack1ApxZhzUDLHnINQSuaccxBKCSGUUkpKIYRSSkmpAACAAgcAgAAbNCUWByg0ZEUAEAUAABhjnDPOIQqdpc5SJKmj1lFrKKUaS4ydxlZ767nTGnttuTeUSo2p1o5ry7nV3mlNPbccCwAAO3AAADuwEAoNWQkA5AEAEMYoxZhzzhmFGHPOOecMUow555xzijHnnIMQQsWYc85BCCFzzjkIoYSSOecchBBK6JyDUEoppXTOQQihlFI65yCEUkopnXMQSimllAIAgAocAAACbBTZnGAkqNCQlQBAHgAAYAxCzklprWHMOQgt1dgwxhyUlGKLnIOQUou5RsxBSCnGoDsoKbUYbPCdhJRaizkHk1KLNefeg0iptZqDzj3VVnPPvfecYqw1595zLwAAd8EBAOzARpHNCUaCCg1ZCQDkAQAQCCnFmHPOGaUYc8w554xSjDHmnHOKMcacc85BxRhjzjkHIWPMOecghJAx5pxzEELonHMOQgghdM45ByGEEDrnoIMQQgidcxBCCCGEAgCAChwAAAJsFNmcYCSo0JCVAEA4AAAAIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEELonHPOOeecc84555xzzjnnnHPOOScAyLfCAcD/wcYZVpLOCkeDCw1ZCQCEAwAACkEopWIQSiklkk46KZ2TUEopkYNSSumklFJKCaWUUkoIpZRSSggdlFJCKaWUUkoppZRSSimllFI6KaWUUkoppZTKOSmlk1JKKaVEzkkpIZRSSimlhFJKKaWUUkoppZRSSimllFJKKaWEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQCALgbHAAgEmycYSXprHA0uNCQlQBASAAAoBRzjkoIKZSQUqiYoo5CKSmkUkoKEWPOSeochVBSKKmDyjkIpaSUQiohdc5BByWFkFIJIZWOOugolFBSKiWU0jkopYQUSkoplZBCSKl0lFIoJZWUQiohlVJKSCWVEEoKnaRUSgqppFRSCJ10kEInJaSSSgqpk5RSKiWllEpKJXRSQioppRBCSqmUEEpIKaVOUkmppBRCKCGFlFJKJaWSSkohlVRCCaWklFIooaRUUkoppZJSKQAA4MABACDACDrJqLIIG0248AAUGrISACADAECUdNZpp0kiCDFFmScNKcYgtaQswxBTkonxFGOMOShGQw4x5JQYF0oIoYNiPCaVQ8pQUbm31DkFxRZjfO+xFwEAAAgCAASEBAAYICiYAQAGBwgjBwIdAQQObQCAgQiZCQwKocFBJgA8QERIBQCJCYrShS4IIYJ0EWTxwIUTN5644YQObRAAAAAAABAA8AEAkFAAERHRzFVYXGBkaGxwdHh8gIQEAAAAAAAIAHwAACQiQERENHMVFhcYGRobHB0eHyAhAQAAAAAAAAAAQEBAAAAAAAAgAAAAQEBPZ2dTAASuMwAAAAAAABUkATMCAAAACYS6sR4BAUQxGR89NxobGiEkKCknJiYmJSUhISEaFgwBAQEAAnyfvULHAlAEJgh2vpgQBMHIyMjIyNhIQOjz+ePz58+fL89xAwYBAFaH//3//7/xNw0MBoNB6qlPfWrUKQng+/0FABAAhLEjKuHFBwA4AHC9Fx4Oh7EwDEOgvnJ3RtV+Op0+nU6n5cyzEwAoltTpwed5dgVKMPoru90zNHGA7F0CP98BAAAAAHl9ePviAgCW+3rugPIDwC6BbWoTAFEAAADh5GpCCACgc+0zxlAAVKddkjDsA14GDoJtf7R+NkE4W23hI5mF3d74iVGvzg9PpA4cCQs66joePTmOfhgl7vNZzYzQADDyz30FAGSvVUZ6wJ4MAKbCGeb4+v5NLIdK3YvrLkCu98uV//FpXQNyKAKAV7r186fTktcJJgjAlVp1fUmaGgtrdAAuDXYJSPs/AAAAAHDnAeHxciEUAB76CvfarGjDzIjALoEd+/0EAAAAQNYeMrkBAF6ZKm8xuw94NtgloHDUCAAAAIAMJ5Qz2iUAvjhKL8lkfmA6wi6BWfNHgiAAAABq4eeqGgCg8+LAAXQAfhgqz2RKHzAVYJeAynEAIQEAALwq6tFbIQAEEIIO8iULngMAXhgajrw3D5iFWhe7BLZNrwCVKAAA0t2TfT8mADx0aMfS4CULeACvA14YWnasNht80ZpdAhv8BEiiAADgcbm4jo0JANAVCTRV6JqQS0OTADoAXhg6zWy+AZ3GsiDRAYJzgiQAAICnb9FLAQAUNQFd44AioMNJICUAfhi67ZRjA2IMSHTAJK0KkgAAAG7W0uLlEgC6KnQdDkgBlAAdJAB+GHpL40hATAASHSC5CZIAAAAGZ3J60ioBoKsBTQKE5KFJIJFAAp4Y+jp7cg4qINEBi+MASQAAAM8rmdZcAKApwFhNPHQkQEBRQwIAnhj6OZ8KIBwDiQ4Q9ApIFAAAQHRFd6FEALA0NaApQAegnPrDA54Y+nN+AYAIJDoAfgIkCgAAcLRlPVsLALqmKqFpHIwUwQEJCwCeKPpzEQA8kOgAyTlBAgAAgPnK3q8jAWAuJFBYOsbAAgCeKPolEQA8rMFCohQAAMxD2BdSAJYFdNThKcCkBQCOgwKeGPpzEQA8rEEhCQAAoCz4MRGA41gaQMBRjACexHugAACeGPqFCAAeugQAAHryFgBdRYGFhGeow8x7AJ4Y+iURADyIigIAliFAAcYWCQC11gGeGPolEQA8UAAAABoODg4=",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Fi&&Fi.tagName.toUpperCase()==="SCRIPT"&&Fi.src||new URL("index.umd.cjs",document.baseURI).href).href};var ZC=Object.defineProperty,XC=(e,t,n)=>t in e?ZC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eA=(e,t,n)=>XC(e,t+"",n),tA=async(e,t)=>{let n=typeof t=="function"?await t(e):t;if(n)return e.scheme==="bearer"?`Bearer ${n}`:e.scheme==="basic"?`Basic ${btoa(n)}`:n},nA={bodySerializer:e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString():n)},rA=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},iA=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},oA=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Op=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let s=(e?i:i.map(l=>encodeURIComponent(l))).join(iA(r));switch(r){case"label":return`.${s}`;case"matrix":return`;${n}=${s}`;case"simple":return s;default:return`${n}=${s}`}}let o=rA(r),a=i.map(s=>r==="label"||r==="simple"?e?s:encodeURIComponent(s):ki({allowReserved:e,name:n,value:s})).join(o);return r==="label"||r==="matrix"?o+a:a},ki=({allowReserved:e,name:t,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},Dp=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(i instanceof Date)return`${n}=${i.toISOString()}`;if(r!=="deepObject"&&!t){let s=[];Object.entries(i).forEach(([c,f])=>{s=[...s,c,e?f:encodeURIComponent(f)]});let l=s.join(",");switch(r){case"form":return`${n}=${l}`;case"label":return`.${l}`;case"matrix":return`;${n}=${l}`;default:return l}}let o=oA(r),a=Object.entries(i).map(([s,l])=>ki({allowReserved:e,name:r==="deepObject"?`${n}[${s}]`:s,value:l})).join(o);return r==="label"||r==="matrix"?o+a:a},aA=/\{[^{}]+\}/g,sA=({path:e,url:t})=>{let n=t,r=t.match(aA);if(r)for(let i of r){let o=!1,a=i.substring(1,i.length-1),s="simple";a.endsWith("*")&&(o=!0,a=a.substring(0,a.length-1)),a.startsWith(".")?(a=a.substring(1),s="label"):a.startsWith(";")&&(a=a.substring(1),s="matrix");let l=e[a];if(l==null)continue;if(Array.isArray(l)){n=n.replace(i,Op({explode:o,name:a,style:s,value:l}));continue}if(typeof l=="object"){n=n.replace(i,Dp({explode:o,name:a,style:s,value:l}));continue}if(s==="matrix"){n=n.replace(i,`;${ki({name:a,value:l})}`);continue}let c=encodeURIComponent(s==="label"?`.${l}`:l);n=n.replace(i,c)}return n},Mp=({allowReserved:e,array:t,object:n}={})=>r=>{let i=[];if(r&&typeof r=="object")for(let o in r){let a=r[o];if(a!=null){if(Array.isArray(a)){i=[...i,Op({allowReserved:e,explode:!0,name:o,style:"form",value:a,...t})];continue}if(typeof a=="object"){i=[...i,Dp({allowReserved:e,explode:!0,name:o,style:"deepObject",value:a,...n})];continue}i=[...i,ki({allowReserved:e,name:o,value:a})]}}return i.join("&")},lA=e=>{var t;if(!e)return"stream";let n=(t=e.split(";")[0])==null?void 0:t.trim();if(n){if(n.startsWith("application/json")||n.endsWith("+json"))return"json";if(n==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>n.startsWith(r)))return"blob";if(n.startsWith("text/"))return"text"}},cA=async({security:e,...t})=>{for(let n of e){let r=await tA(n,t.auth);if(!r)continue;let i=n.name??"Authorization";switch(n.in){case"query":t.query||(t.query={}),t.query[i]=r;break;case"cookie":t.headers.append("Cookie",`${i}=${r}`);break;case"header":default:t.headers.set(i,r);break}return}},Pp=e=>uA({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:Mp(e.querySerializer),url:e.url}),uA=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,a=(e??"")+o;t&&(a=sA({path:t,url:a}));let s=n?r(n):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(a+=`?${s}`),a},Np=(e,t)=>{var n;let r={...e,...t};return(n=r.baseUrl)!=null&&n.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=_p(e.headers,t.headers),r},_p=(...e)=>{let t=new Headers;for(let n of e){if(!n||typeof n!="object")continue;let r=n instanceof Headers?n.entries():Object.entries(n);for(let[i,o]of r)if(o===null)t.delete(i);else if(Array.isArray(o))for(let a of o)t.append(i,a);else o!==void 0&&t.set(i,typeof o=="object"?JSON.stringify(o):o)}return t},Xa=class{constructor(){eA(this,"_fns"),this._fns=[]}clear(){this._fns=[]}exists(t){return this._fns.indexOf(t)!==-1}eject(t){let n=this._fns.indexOf(t);n!==-1&&(this._fns=[...this._fns.slice(0,n),...this._fns.slice(n+1)])}use(t){this._fns=[...this._fns,t]}},fA=()=>({error:new Xa,request:new Xa,response:new Xa}),dA=Mp({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),pA={"Content-Type":"application/json"},Lp=(e={})=>({...nA,headers:pA,parseAs:"auto",querySerializer:dA,...e}),hA=(e={})=>{let t=Np(Lp(),e),n=()=>({...t}),r=a=>(t=Np(t,a),n()),i=fA(),o=async a=>{let s={...t,...a,fetch:a.fetch??t.fetch??globalThis.fetch,headers:_p(t.headers,a.headers)};s.security&&await cA({...s,security:s.security}),s.body&&s.bodySerializer&&(s.body=s.bodySerializer(s.body)),(s.body===void 0||s.body==="")&&s.headers.delete("Content-Type");let l=Pp(s),c={redirect:"follow",...s},f=new Request(l,c);for(let g of i.request._fns)f=await g(f,s);let u=s.fetch,p=await u(f);for(let g of i.response._fns)p=await g(p,f,s);let d={request:f,response:p};if(p.ok){if(p.status===204||p.headers.get("Content-Length")==="0")return{data:{},...d};let g=(s.parseAs==="auto"?lA(p.headers.get("Content-Type")):s.parseAs)??"json";if(g==="stream")return{data:p.body,...d};let y=await p[g]();return g==="json"&&(s.responseValidator&&await s.responseValidator(y),s.responseTransformer&&(y=await s.responseTransformer(y))),{data:y,...d}}let m=await p.text();try{m=JSON.parse(m)}catch{}let h=m;for(let g of i.error._fns)h=await g(m,p,f,s);if(h=h||{},s.throwOnError)throw h;return{error:h,...d}};return{buildUrl:Pp,connect:a=>o({...a,method:"CONNECT"}),delete:a=>o({...a,method:"DELETE"}),get:a=>o({...a,method:"GET"}),getConfig:n,head:a=>o({...a,method:"HEAD"}),interceptors:i,options:a=>o({...a,method:"OPTIONS"}),patch:a=>o({...a,method:"PATCH"}),post:a=>o({...a,method:"POST"}),put:a=>o({...a,method:"PUT"}),request:o,setConfig:r,trace:a=>o({...a,method:"TRACE"})}},mA=hA,gA=Lp;const Ae=mA((e=>({...e,withCredentials:!0,timeout:6e4,maxBodyLength:104857600,maxContentLength:104857600,throwOnError:!0}))(gA({baseUrl:"https://webchat.botpress.cloud/"}))),yA=e=>(e.client??Ae).delete({url:"/conversations/{id}",...e}),bA=e=>(e.client??Ae).get({url:"/conversations/{id}",...e}),vA=e=>(e.client??Ae).get({url:"/conversations",...e}),wA=e=>(e.client??Ae).post({url:"/conversations",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),xA=e=>(e.client??Ae).get({url:"/conversations/{id}/messages",...e}),kA=e=>(e.client??Ae).get({url:"/conversations/{id}/participants",...e}),SA=e=>(e.client??Ae).post({url:"/conversations/{id}/participants",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),EA=e=>(e.client??Ae).delete({url:"/conversations/{id}/participants/{userId}",...e}),CA=e=>(e.client??Ae).get({url:"/conversations/{id}/participants/{userId}",...e}),AA=e=>(e.client??Ae).delete({url:"/messages/{id}",...e}),IA=e=>(e.client??Ae).get({url:"/messages/{id}",...e}),TA=e=>(e.client??Ae).put({url:"/messages/{id}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),OA=e=>(e.client??Ae).post({url:"/messages",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),DA=e=>(e.client??Ae).delete({url:"/messages/{id}/feedback",...e}),MA=e=>(e.client??Ae).put({url:"/messages/{id}/feedback",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),PA=e=>(e.client??Ae).delete({url:"/users/me",...e}),NA=e=>(e.client??Ae).get({url:"/users/me",...e}),_A=e=>(e.client??Ae).put({url:"/users/me",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),LA=e=>((e==null?void 0:e.client)??Ae).post({url:"/users/key",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),FA=e=>(e.client??Ae).get({url:"/events/{id}",...e}),RA=e=>(e.client??Ae).post({url:"/events",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),BA=e=>(e.client??Ae).post({url:"/files",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}});let Fp=class extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}};function es(e){}function $A(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=es,onError:n=es,onRetry:r=es,onComment:i}=e;let o="",a=!0,s,l="",c="";function f(h){const g=a?h.replace(/^\xEF\xBB\xBF/,""):h,[y,b]=zA(`${o}${g}`);for(const w of y)u(w);o=b,a=!1}function u(h){if(h===""){d();return}if(h.startsWith(":")){i&&i(h.slice(h.startsWith(": ")?2:1));return}const g=h.indexOf(":");if(g!==-1){const y=h.slice(0,g),b=h[g+1]===" "?2:1,w=h.slice(g+b);p(y,w,h);return}p(h,"",h)}function p(h,g,y){switch(h){case"event":c=g;break;case"data":l=`${l}${g}
292
- `;break;case"id":s=g.includes("\0")?void 0:g;break;case"retry":/^\d+$/.test(g)?r(parseInt(g,10)):n(new Fp(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:y}));break;default:n(new Fp(`Unknown field "${h.length>20?`${h.slice(0,20)}…`:h}"`,{type:"unknown-field",field:h,value:g,line:y}));break}}function d(){l.length>0&&t({id:s,event:c||void 0,data:l.endsWith(`
293
- `)?l.slice(0,-1):l}),s=void 0,l="",c=""}function m(h={}){o&&h.consume&&u(o),a=!0,s=void 0,l="",c="",o=""}return{feed:f,reset:m}}function zA(e){const t=[];let n="",r=0;for(;r<e.length;){const i=e.indexOf("\r",r),o=e.indexOf(`
297
+ *--------------------------------------------------------------------------------------------*/const WC={damping:.7,stiffness:.05,mass:1.25},VC=70,qC=1e3/60,KC=350;let wi=!1;(Nh=globalThis.document)==null||Nh.addEventListener("mousedown",()=>{wi=!0}),(_h=globalThis.document)==null||_h.addEventListener("mouseup",()=>{wi=!1}),(Lh=globalThis.document)==null||Lh.addEventListener("click",()=>{wi=!1});const YC=(e={})=>{const[t,n]=O.useState(!1),[r,i]=O.useState(e.initial!==!1),[o,a]=O.useState(!1),s=O.useRef(null);s.current=e;const l=O.useCallback(()=>{var C;if(!wi)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const w=b.getRangeAt(0);return w.commonAncestorContainer.contains(g.current)||((C=g.current)==null?void 0:C.contains(w.commonAncestorContainer))},[]),c=O.useCallback(b=>{u.isAtBottom=b,i(b)},[]),f=O.useCallback(b=>{u.escapedFromLock=b,n(b)},[]),u=O.useMemo(()=>{let b;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){var w;return((w=g.current)==null?void 0:w.scrollTop)??0},set scrollTop(w){g.current&&(g.current.scrollTop=w,u.ignoreScrollToTop=g.current.scrollTop)},get targetScrollTop(){return!g.current||!y.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!y.current)return 0;const{targetScrollTop:w}=this;if(!e.targetScrollTop)return w;if((b==null?void 0:b.targetScrollTop)===w)return b.calculatedScrollTop;const C=Math.max(Math.min(e.targetScrollTop(w,{scrollElement:g.current,contentElement:y.current}),w),0);return b={targetScrollTop:w,calculatedScrollTop:C},requestAnimationFrame(()=>{b=void 0}),C},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=VC}}},[]),p=O.useCallback((b={})=>{var $;typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||c(!0);const w=Date.now()+(Number(b.wait)||0),C=Za(s.current,b.animation),{ignoreEscapes:x=!1}=b;let E,T=u.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{E=Date.now()}):E=w+(b.duration??0);const _=async()=>{const I=new Promise(requestAnimationFrame).then(()=>{var L;if(!u.isAtBottom)return u.animation=void 0,!1;const{scrollTop:D}=u,z=performance.now(),P=(z-(u.lastTick??z))/qC;if(u.animation||(u.animation={behavior:C,promise:I,ignoreEscapes:x}),u.animation.behavior===C&&(u.lastTick=z),l()||w>Date.now())return _();if(D<Math.min(T,u.calculatedTargetScrollTop)){if(((L=u.animation)==null?void 0:L.behavior)===C){if(C==="instant")return u.scrollTop=u.calculatedTargetScrollTop,_();u.velocity=(C.damping*u.velocity+C.stiffness*u.scrollDifference)/C.mass,u.accumulated+=u.velocity*P,u.scrollTop+=u.accumulated,u.scrollTop!==D&&(u.accumulated=0)}return _()}return E>Date.now()?(T=u.calculatedTargetScrollTop,_()):(u.animation=void 0,u.scrollTop<u.calculatedTargetScrollTop?p({animation:Za(s.current,s.current.resize),ignoreEscapes:x,duration:Math.max(0,E-Date.now())||void 0}):u.isAtBottom)});return I.then(D=>(requestAnimationFrame(()=>{u.animation||(u.lastTick=void 0,u.velocity=0)}),D))};return b.wait!==!0&&(u.animation=void 0),(($=u.animation)==null?void 0:$.behavior)===C?u.animation.promise:_()},[c,l,u]),d=O.useCallback(()=>{f(!0),c(!1)},[f,c]),m=O.useCallback(({target:b})=>{if(b!==g.current)return;const{scrollTop:w,ignoreScrollToTop:C}=u;let{lastScrollTop:x=w}=u;u.lastScrollTop=w,u.ignoreScrollToTop=void 0,C&&C>w&&(x=C),a(u.isNearBottom),setTimeout(()=>{var _;if(u.resizeDifference||w===C)return;if(l()){f(!0),c(!1);return}const E=w>x,T=w<x;if((_=u.animation)!=null&&_.ignoreEscapes){u.scrollTop=x;return}T&&(f(!0),c(!1)),E&&f(!1),!u.escapedFromLock&&u.isNearBottom&&c(!0)},1)},[f,c,l,u]),h=O.useCallback(({target:b,deltaY:w})=>{var x;let C=b;for(;!["scroll","auto"].includes(getComputedStyle(C).overflow);){if(!C.parentElement)return;C=C.parentElement}C===g.current&&w<0&&g.current.scrollHeight>g.current.clientHeight&&!((x=u.animation)!=null&&x.ignoreEscapes)&&(f(!0),c(!1))},[f,c,u]),g=wp(b=>{var w,C;(w=g.current)==null||w.removeEventListener("scroll",m),(C=g.current)==null||C.removeEventListener("wheel",h),b==null||b.addEventListener("scroll",m,{passive:!0}),b==null||b.addEventListener("wheel",h,{passive:!0})},[]),y=wp(b=>{var C,x;if((C=u.resizeObserver)==null||C.disconnect(),!b)return;let w;u.resizeObserver=new ResizeObserver(([E])=>{const{height:T}=E.contentRect,_=T-(w??T);if(u.resizeDifference=_,u.scrollTop>u.targetScrollTop&&(u.scrollTop=u.targetScrollTop),a(u.isNearBottom),_>=0){const $=Za(s.current,w?s.current.resize:s.current.initial);p({animation:$,wait:!0,preserveScrollPosition:!0,duration:$==="instant"?void 0:KC})}else u.isNearBottom&&(f(!1),c(!0));w=T,requestAnimationFrame(()=>{setTimeout(()=>{u.resizeDifference===_&&(u.resizeDifference=0)},1)})}),(x=u.resizeObserver)==null||x.observe(b)},[]);return{contentRef:y,scrollRef:g,scrollToBottom:p,stopScroll:d,isAtBottom:r||o,isNearBottom:o,escapedFromLock:t,state:u}};function wp(e,t){const n=O.useCallback(r=>(n.current=r,e(r)),t);return n}const Ja=new Map;function Za(...e){const t={...WC};let n=!1;for(const i of e){if(i==="instant"){n=!0;continue}typeof i=="object"&&(n=!1,t.damping=i.damping??t.damping,t.stiffness=i.stiffness??t.stiffness,t.mass=i.mass??t.mass)}const r=JSON.stringify(t);return Ja.has(r)||Ja.set(r,Object.freeze(t)),n?"instant":Ja.get(r)}const xp=O.createContext(null),GC=typeof window<"u"?O.useLayoutEffect:O.useEffect;function xi({instance:e,children:t,resize:n,initial:r,mass:i,damping:o,stiffness:a,targetScrollTop:s,contextRef:l,...c}){const f=O.useRef(null),u=A.useCallback((x,E)=>{const T=(C==null?void 0:C.targetScrollTop)??s;return(T==null?void 0:T(x,E))??x},[s]),p=YC({mass:i,damping:o,stiffness:a,resize:n,initial:r,targetScrollTop:u}),{scrollRef:d,contentRef:m,scrollToBottom:h,stopScroll:g,isAtBottom:y,escapedFromLock:b,state:w}=e??p,C=O.useMemo(()=>({scrollToBottom:h,stopScroll:g,scrollRef:d,isAtBottom:y,escapedFromLock:b,contentRef:m,state:w,get targetScrollTop(){return f.current},set targetScrollTop(x){f.current=x}}),[h,y,m,d,g,b,w]);return O.useImperativeHandle(l,()=>C,[C]),GC(()=>{d.current&&getComputedStyle(d.current).overflow==="visible"&&(d.current.style.overflow="auto")},[]),S.jsx(xp.Provider,{value:C,children:S.jsx("div",{...c,children:typeof t=="function"?t(C):t})})}(function(e){function t({children:n,...r}){const i=kp();return S.jsx("div",{ref:i.scrollRef,style:{height:"100%",width:"100%"},children:S.jsx("div",{...r,ref:i.contentRef,children:typeof n=="function"?n(i):n})})}e.Content=t})(xi||(xi={}));function kp(){const e=O.useContext(xp);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}const Xa=O.memo(({className:e,messages:t=[],isTyping:n,headerMessage:r,renderers:i,botAvatar:o,botDescription:a,botName:s,sendMessage:l,addMessageFeedback:c,showMarquee:f=!0,showDateSystemMessage:u=!0,showMessageStatus:p=!0,showIncomingMessageAvatar:d=!0,showOutgoingMessageAvatar:m=!1,...h})=>{var C;const{messageList:g}=ge,y=O.useMemo(()=>u?rm(t):t,[t]),b=O.useMemo(()=>{var E;const x=y.filter(T=>T.direction==="outgoing"&&T.status!=="pending");return(E=x[x.length-1])==null?void 0:E.id},[y]),w=x=>{if(x.direction==="incoming")return d;if(x.direction==="outgoing")return m};return S.jsxs(xi,{...h,resize:"smooth",initial:"instant",className:ur(g.container.className,e),children:[S.jsxs(xi.Content,{className:g.viewPort.className,children:[r&&S.jsx("span",{...g.headerMessage,children:r}),f&&S.jsx(HC,{botAvatar:o,botDescription:a,botName:s}),y.map(x=>{var E;return S.jsx(Ga,{renderers:i,sendMessage:l,addMessageFeedback:c,isLastDeliveredMessage:p&&x.id===b,showAvatar:w(x),...x},((E=x.metadata)==null?void 0:E.clientMessageId)||x.id)}),n&&S.jsx(Ga,{id:Qa(),renderers:i,sendMessage:l,direction:"incoming",timestamp:new Date,showAvatar:d,block:void 0,sender:((C=t.filter(x=>x.direction==="incoming").at(-1))==null?void 0:C.sender)??{name:s||"Bot",avatar:o},children:S.jsx(Ya,{})})]}),S.jsx(QC,{})]})}),QC=()=>{const{isAtBottom:e,scrollToBottom:t}=kp(),{messageList:n}=ge;return e?null:S.jsx("button",{className:n.scrollDownButton.className,onClick:()=>t()})};Xa.displayName="MessageList";function Sp({error:e,restartConversation:t,closeWindow:n}){let r,i;const{error:o}=ge;return e.type==="configuration"?(r="Configuration error",i=S.jsx(L0,{...o.icon})):e.type==="bot"?(r="Bot error",i=S.jsx(xu,{...o.icon})):e.type==="network"?(r="Network error",i=S.jsx(W0,{...o.icon})):e.type==="disconnected"?(r="Disconnected",i=S.jsx(j0,{...o.icon})):(r="Unexpected error",i=S.jsx(xu,{...o.icon})),S.jsx(JC,{error:e,title:r,icon:i,restartConversation:t,closeWindow:n})}function JC({error:e,title:t,icon:n,restartConversation:r,closeWindow:i}){const{error:o}=ge;return S.jsxs("div",{...o.container,children:[S.jsxs("div",{...o.header.container,children:[`Webchat ${e.type} error`,S.jsxs("div",{...o.header.actions,children:[r&&S.jsx(Ka,{restartConversation:r,style:{color:"white",backgroundColor:"transparent"}}),i&&S.jsx(yp,{onClick:i,style:{color:"white",backgroundColor:"transparent"}})]})]}),S.jsxs("div",{...o.content,children:[n,S.jsx("div",{...o.errorTitle,children:t}),S.jsx("div",{...o.errorMessage,children:e.message}),e.id&&S.jsx("div",{...o.id,children:e.id})]})]})}const ZC=({className:e,...t})=>{const{className:n}=ge.loader;return S.jsx("div",{...t,className:ur(e,n)})},Ep=({connected:e,configuration:t,isTyping:n,messages:r,user:i,isLoading:o,renderers:a,isReadOnly:s,disableComposer:l,allowFileUpload:c,error:f,participants:u,closeWindow:p,sendMessage:d,uploadFile:m,addMessageFeedback:h,restartConversation:g,clientId:y,storageKey:b,soundOn:w,toggleSound:C,disableSendButton:x,...E})=>{const{color:T,fontFamily:_,radius:$,themeMode:I,variant:D,headerVariant:z,botAvatar:P,botDescription:L,botName:M,composerPlaceholder:R,footer:U,feedbackEnabled:B,additionalStylesheetUrl:V}=t,v={color:T,fontFamily:_,radius:$,themeMode:I,variant:D,headerVariant:z,additionalStylesheetUrl:V};B||(h=void 0);const N=O.useMemo(()=>i?$s(r,u,i.id,M,P):[],[P,M,r,i,u]),H=O.useRef(null),k=sn(W=>W.setPortalContainer);return O.useEffect(()=>(k(H.current),()=>{k(null)}),[k]),S.jsxs(S.Fragment,{children:[S.jsx(op,{...v}),S.jsx("div",{ref:H,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}}),S.jsx(za,{connected:e,allowFileUpload:c,uploadFile:m,storageKey:b,...E,children:f?S.jsx(Sp,{error:f,restartConversation:g,closeWindow:p}):S.jsxs(S.Fragment,{children:[S.jsx(bp,{closeWindow:p,configuration:t,restartConversation:g,clientId:y,soundOn:w,toggleSound:C}),o?S.jsx(ZC,{}):S.jsx(Xa,{botAvatar:P,botDescription:L,botName:M,renderers:a,isTyping:n,sendMessage:d,addMessageFeedback:h,messages:N}),S.jsx(Cd,{sendMessage:d,uploadFile:m,connected:e,isReadOnly:s,disableComposer:l,footer:U,composerPlaceholder:R,allowFileUpload:c,disableSendButton:x,storageKey:b})]})})]})};function Cp(){const[e,t]=O.useState(!1),n=O.useRef(null);return{state:e,setState:(r,i)=>{if(t(r),!r)return()=>{};if(n.current=new Date,!i)return()=>{};const o=setTimeout(()=>{const a=n.current;a&&new Date().getTime()-a.getTime()>i&&t(!1)},i+100);return()=>clearTimeout(o)}}}var XC=Object.defineProperty,eA=(e,t,n)=>t in e?XC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tA=(e,t,n)=>eA(e,t+"",n),nA=async(e,t)=>{let n=typeof t=="function"?await t(e):t;if(n)return e.scheme==="bearer"?`Bearer ${n}`:e.scheme==="basic"?`Basic ${btoa(n)}`:n},rA={bodySerializer:e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString():n)},iA=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},oA=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},aA=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Ap=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let s=(e?i:i.map(l=>encodeURIComponent(l))).join(oA(r));switch(r){case"label":return`.${s}`;case"matrix":return`;${n}=${s}`;case"simple":return s;default:return`${n}=${s}`}}let o=iA(r),a=i.map(s=>r==="label"||r==="simple"?e?s:encodeURIComponent(s):ki({allowReserved:e,name:n,value:s})).join(o);return r==="label"||r==="matrix"?o+a:a},ki=({allowReserved:e,name:t,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},Ip=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(i instanceof Date)return`${n}=${i.toISOString()}`;if(r!=="deepObject"&&!t){let s=[];Object.entries(i).forEach(([c,f])=>{s=[...s,c,e?f:encodeURIComponent(f)]});let l=s.join(",");switch(r){case"form":return`${n}=${l}`;case"label":return`.${l}`;case"matrix":return`;${n}=${l}`;default:return l}}let o=aA(r),a=Object.entries(i).map(([s,l])=>ki({allowReserved:e,name:r==="deepObject"?`${n}[${s}]`:s,value:l})).join(o);return r==="label"||r==="matrix"?o+a:a},sA=/\{[^{}]+\}/g,lA=({path:e,url:t})=>{let n=t,r=t.match(sA);if(r)for(let i of r){let o=!1,a=i.substring(1,i.length-1),s="simple";a.endsWith("*")&&(o=!0,a=a.substring(0,a.length-1)),a.startsWith(".")?(a=a.substring(1),s="label"):a.startsWith(";")&&(a=a.substring(1),s="matrix");let l=e[a];if(l==null)continue;if(Array.isArray(l)){n=n.replace(i,Ap({explode:o,name:a,style:s,value:l}));continue}if(typeof l=="object"){n=n.replace(i,Ip({explode:o,name:a,style:s,value:l}));continue}if(s==="matrix"){n=n.replace(i,`;${ki({name:a,value:l})}`);continue}let c=encodeURIComponent(s==="label"?`.${l}`:l);n=n.replace(i,c)}return n},Tp=({allowReserved:e,array:t,object:n}={})=>r=>{let i=[];if(r&&typeof r=="object")for(let o in r){let a=r[o];if(a!=null){if(Array.isArray(a)){i=[...i,Ap({allowReserved:e,explode:!0,name:o,style:"form",value:a,...t})];continue}if(typeof a=="object"){i=[...i,Ip({allowReserved:e,explode:!0,name:o,style:"deepObject",value:a,...n})];continue}i=[...i,ki({allowReserved:e,name:o,value:a})]}}return i.join("&")},cA=e=>{var t;if(!e)return"stream";let n=(t=e.split(";")[0])==null?void 0:t.trim();if(n){if(n.startsWith("application/json")||n.endsWith("+json"))return"json";if(n==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>n.startsWith(r)))return"blob";if(n.startsWith("text/"))return"text"}},uA=async({security:e,...t})=>{for(let n of e){let r=await nA(n,t.auth);if(!r)continue;let i=n.name??"Authorization";switch(n.in){case"query":t.query||(t.query={}),t.query[i]=r;break;case"cookie":t.headers.append("Cookie",`${i}=${r}`);break;case"header":default:t.headers.set(i,r);break}return}},Op=e=>fA({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:Tp(e.querySerializer),url:e.url}),fA=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,a=(e??"")+o;t&&(a=lA({path:t,url:a}));let s=n?r(n):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(a+=`?${s}`),a},Dp=(e,t)=>{var n;let r={...e,...t};return(n=r.baseUrl)!=null&&n.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=Mp(e.headers,t.headers),r},Mp=(...e)=>{let t=new Headers;for(let n of e){if(!n||typeof n!="object")continue;let r=n instanceof Headers?n.entries():Object.entries(n);for(let[i,o]of r)if(o===null)t.delete(i);else if(Array.isArray(o))for(let a of o)t.append(i,a);else o!==void 0&&t.set(i,typeof o=="object"?JSON.stringify(o):o)}return t},es=class{constructor(){tA(this,"_fns"),this._fns=[]}clear(){this._fns=[]}exists(t){return this._fns.indexOf(t)!==-1}eject(t){let n=this._fns.indexOf(t);n!==-1&&(this._fns=[...this._fns.slice(0,n),...this._fns.slice(n+1)])}use(t){this._fns=[...this._fns,t]}},dA=()=>({error:new es,request:new es,response:new es}),pA=Tp({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),hA={"Content-Type":"application/json"},Pp=(e={})=>({...rA,headers:hA,parseAs:"auto",querySerializer:pA,...e}),mA=(e={})=>{let t=Dp(Pp(),e),n=()=>({...t}),r=a=>(t=Dp(t,a),n()),i=dA(),o=async a=>{let s={...t,...a,fetch:a.fetch??t.fetch??globalThis.fetch,headers:Mp(t.headers,a.headers)};s.security&&await uA({...s,security:s.security}),s.body&&s.bodySerializer&&(s.body=s.bodySerializer(s.body)),(s.body===void 0||s.body==="")&&s.headers.delete("Content-Type");let l=Op(s),c={redirect:"follow",...s},f=new Request(l,c);for(let g of i.request._fns)f=await g(f,s);let u=s.fetch,p=await u(f);for(let g of i.response._fns)p=await g(p,f,s);let d={request:f,response:p};if(p.ok){if(p.status===204||p.headers.get("Content-Length")==="0")return{data:{},...d};let g=(s.parseAs==="auto"?cA(p.headers.get("Content-Type")):s.parseAs)??"json";if(g==="stream")return{data:p.body,...d};let y=await p[g]();return g==="json"&&(s.responseValidator&&await s.responseValidator(y),s.responseTransformer&&(y=await s.responseTransformer(y))),{data:y,...d}}let m=await p.text();try{m=JSON.parse(m)}catch{}let h=m;for(let g of i.error._fns)h=await g(m,p,f,s);if(h=h||{},s.throwOnError)throw h;return{error:h,...d}};return{buildUrl:Op,connect:a=>o({...a,method:"CONNECT"}),delete:a=>o({...a,method:"DELETE"}),get:a=>o({...a,method:"GET"}),getConfig:n,head:a=>o({...a,method:"HEAD"}),interceptors:i,options:a=>o({...a,method:"OPTIONS"}),patch:a=>o({...a,method:"PATCH"}),post:a=>o({...a,method:"POST"}),put:a=>o({...a,method:"PUT"}),request:o,setConfig:r,trace:a=>o({...a,method:"TRACE"})}},gA=mA,yA=Pp;const De=gA((e=>({...e,withCredentials:!0,timeout:6e4,maxBodyLength:104857600,maxContentLength:104857600,throwOnError:!0}))(yA({baseUrl:"https://webchat.botpress.cloud/"}))),bA=e=>(e.client??De).delete({url:"/conversations/{id}",...e}),vA=e=>(e.client??De).get({url:"/conversations/{id}",...e}),wA=e=>(e.client??De).get({url:"/conversations",...e}),xA=e=>(e.client??De).post({url:"/conversations",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),kA=e=>(e.client??De).get({url:"/conversations/{id}/messages",...e}),SA=e=>(e.client??De).get({url:"/conversations/{id}/participants",...e}),EA=e=>(e.client??De).post({url:"/conversations/{id}/participants",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),CA=e=>(e.client??De).delete({url:"/conversations/{id}/participants/{userId}",...e}),AA=e=>(e.client??De).get({url:"/conversations/{id}/participants/{userId}",...e}),IA=e=>(e.client??De).delete({url:"/messages/{id}",...e}),TA=e=>(e.client??De).get({url:"/messages/{id}",...e}),OA=e=>(e.client??De).put({url:"/messages/{id}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),DA=e=>(e.client??De).post({url:"/messages",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),MA=e=>(e.client??De).delete({url:"/messages/{id}/feedback",...e}),PA=e=>(e.client??De).put({url:"/messages/{id}/feedback",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),NA=e=>(e.client??De).delete({url:"/users/me",...e}),_A=e=>(e.client??De).get({url:"/users/me",...e}),LA=e=>(e.client??De).put({url:"/users/me",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),FA=e=>((e==null?void 0:e.client)??De).post({url:"/users/key",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),RA=e=>(e.client??De).get({url:"/events/{id}",...e}),BA=e=>(e.client??De).post({url:"/events",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),$A=e=>(e.client??De).post({url:"/files",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}});let Np=class extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}};function ts(e){}function zA(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=ts,onError:n=ts,onRetry:r=ts,onComment:i}=e;let o="",a=!0,s,l="",c="";function f(h){const g=a?h.replace(/^\xEF\xBB\xBF/,""):h,[y,b]=jA(`${o}${g}`);for(const w of y)u(w);o=b,a=!1}function u(h){if(h===""){d();return}if(h.startsWith(":")){i&&i(h.slice(h.startsWith(": ")?2:1));return}const g=h.indexOf(":");if(g!==-1){const y=h.slice(0,g),b=h[g+1]===" "?2:1,w=h.slice(g+b);p(y,w,h);return}p(h,"",h)}function p(h,g,y){switch(h){case"event":c=g;break;case"data":l=`${l}${g}
298
+ `;break;case"id":s=g.includes("\0")?void 0:g;break;case"retry":/^\d+$/.test(g)?r(parseInt(g,10)):n(new Np(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:y}));break;default:n(new Np(`Unknown field "${h.length>20?`${h.slice(0,20)}…`:h}"`,{type:"unknown-field",field:h,value:g,line:y}));break}}function d(){l.length>0&&t({id:s,event:c||void 0,data:l.endsWith(`
299
+ `)?l.slice(0,-1):l}),s=void 0,l="",c=""}function m(h={}){o&&h.consume&&u(o),a=!0,s=void 0,l="",c="",o=""}return{feed:f,reset:m}}function jA(e){const t=[];let n="",r=0;for(;r<e.length;){const i=e.indexOf("\r",r),o=e.indexOf(`
294
300
  `,r);let a=-1;if(i!==-1&&o!==-1?a=Math.min(i,o):i!==-1?i===e.length-1?a=-1:a=i:o!==-1&&(a=o),a===-1){n=e.slice(r);break}else{const s=e.slice(r,a);t.push(s),r=a+1,e[r-1]==="\r"&&e[r]===`
295
- `&&r++}}return[t,n]}class Rp extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n==null?void 0:n.code)!=null?r:void 0,this.message=(i=n==null?void 0:n.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(Bp(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(Bp(this),n)}}function jA(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ts(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ts).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ts(e.cause)}`:e.message:`${e}`}function Bp(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var $p=e=>{throw TypeError(e)},ns=(e,t,n)=>t.has(e)||$p("Cannot "+n),be=(e,t,n)=>(ns(e,t,"read from private field"),n?n.call(e):t.get(e)),Le=(e,t,n)=>t.has(e)?$p("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ie=(e,t,n,r)=>(ns(e,t,"write to private field"),t.set(e,n),n),Ct=(e,t,n)=>(ns(e,t,"access private method"),n),Qe,Qt,wn,Si,Ei,hr,xn,mr,Ft,kn,Sn,En,gr,ut,rs,is,os,zp,as,ss,yr,ls,cs;class Ci extends EventTarget{constructor(t,n){var r,i;super(),Le(this,ut),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Le(this,Qe),Le(this,Qt),Le(this,wn),Le(this,Si),Le(this,Ei),Le(this,hr),Le(this,xn),Le(this,mr,null),Le(this,Ft),Le(this,kn),Le(this,Sn,null),Le(this,En,null),Le(this,gr,null),Le(this,is,async o=>{var a;be(this,kn).reset();const{body:s,redirected:l,status:c,headers:f}=o;if(c===204){Ct(this,ut,yr).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?Ie(this,wn,new URL(o.url)):Ie(this,wn,void 0),c!==200){Ct(this,ut,yr).call(this,`Non-200 status code (${c})`,c);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){Ct(this,ut,yr).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(be(this,Qe)===this.CLOSED)return;Ie(this,Qe,this.OPEN);const u=new Event("open");if((a=be(this,gr))==null||a.call(this,u),this.dispatchEvent(u),typeof s!="object"||!s||!("getReader"in s)){Ct(this,ut,yr).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const p=new TextDecoder,d=s.getReader();let m=!0;do{const{done:h,value:g}=await d.read();g&&be(this,kn).feed(p.decode(g,{stream:!h})),h&&(m=!1,be(this,kn).reset(),Ct(this,ut,ls).call(this))}while(m)}),Le(this,os,o=>{Ie(this,Ft,void 0),!(o.name==="AbortError"||o.type==="aborted")&&Ct(this,ut,ls).call(this,ts(o))}),Le(this,as,o=>{typeof o.id=="string"&&Ie(this,mr,o.id);const a=new MessageEvent(o.event||"message",{data:o.data,origin:be(this,wn)?be(this,wn).origin:be(this,Qt).origin,lastEventId:o.id||""});be(this,En)&&(!o.event||o.event==="message")&&be(this,En).call(this,a),this.dispatchEvent(a)}),Le(this,ss,o=>{Ie(this,hr,o)}),Le(this,cs,()=>{Ie(this,xn,void 0),be(this,Qe)===this.CONNECTING&&Ct(this,ut,rs).call(this)});try{if(t instanceof URL)Ie(this,Qt,t);else if(typeof t=="string")Ie(this,Qt,new URL(t,UA()));else throw new Error("Invalid URL")}catch{throw jA("An invalid or illegal string was specified")}Ie(this,kn,$A({onEvent:be(this,as),onRetry:be(this,ss)})),Ie(this,Qe,this.CONNECTING),Ie(this,hr,3e3),Ie(this,Ei,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),Ie(this,Si,(i=n==null?void 0:n.withCredentials)!=null?i:!1),Ct(this,ut,rs).call(this)}get readyState(){return be(this,Qe)}get url(){return be(this,Qt).href}get withCredentials(){return be(this,Si)}get onerror(){return be(this,Sn)}set onerror(t){Ie(this,Sn,t)}get onmessage(){return be(this,En)}set onmessage(t){Ie(this,En,t)}get onopen(){return be(this,gr)}set onopen(t){Ie(this,gr,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){be(this,xn)&&clearTimeout(be(this,xn)),be(this,Qe)!==this.CLOSED&&(be(this,Ft)&&be(this,Ft).abort(),Ie(this,Qe,this.CLOSED),Ie(this,Ft,void 0))}}Qe=new WeakMap,Qt=new WeakMap,wn=new WeakMap,Si=new WeakMap,Ei=new WeakMap,hr=new WeakMap,xn=new WeakMap,mr=new WeakMap,Ft=new WeakMap,kn=new WeakMap,Sn=new WeakMap,En=new WeakMap,gr=new WeakMap,ut=new WeakSet,rs=function(){Ie(this,Qe,this.CONNECTING),Ie(this,Ft,new AbortController),be(this,Ei)(be(this,Qt),Ct(this,ut,zp).call(this)).then(be(this,is)).catch(be(this,os))},is=new WeakMap,os=new WeakMap,zp=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...be(this,mr)?{"Last-Event-ID":be(this,mr)}:void 0},cache:"no-store",signal:(e=be(this,Ft))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},as=new WeakMap,ss=new WeakMap,yr=function(e,t){var n;be(this,Qe)!==this.CLOSED&&Ie(this,Qe,this.CLOSED);const r=new Rp("error",{code:t,message:e});(n=be(this,Sn))==null||n.call(this,r),this.dispatchEvent(r)},ls=function(e,t){var n;if(be(this,Qe)===this.CLOSED)return;Ie(this,Qe,this.CONNECTING);const r=new Rp("error",{code:t,message:e});(n=be(this,Sn))==null||n.call(this,r),this.dispatchEvent(r),Ie(this,xn,setTimeout(be(this,cs),be(this,hr)))},cs=new WeakMap,Ci.CONNECTING=0,Ci.OPEN=1,Ci.CLOSED=2;function UA(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}async function HA(e){var t;const n=await e.clone().json();if((t=n==null?void 0:n.id)!=null&&t.startsWith("err_")){const r=new Error(n.message);throw r.id=n.id,r.code=n.code,r.type=n.type,r}return e}const jp=()=>{const e={};return{on:(t,n)=>{var r;return e[t]||(e[t]=new Set),(r=e[t])==null||r.add(n),()=>{var i;return(i=e[t])==null?void 0:i.delete(n)}},emit:(t,n)=>{var r,i;(r=e[t])==null||r.forEach(o=>o(n)),(i=e["*"])==null||i.forEach(o=>o({type:t,payload:n}))}}},Pe=e=>e.data,Up=10,Hp=3e3,WA="60000",VA={throwOnError:!0},qA=({conversationId:e,userToken:t,clientId:n,apiUrl:r,adminSecret:i})=>{let o=0,a=null;const s=jp(),l=()=>{a&&a.close();const c=`${`${r||Ae.getConfig().baseUrl}/${n}`}/initialize${e?`?conversationId=${e}`:""}`,f={...i?{"x-admin-secret":i}:{},...t?{"x-user-key":t}:{}};a=Vp(c,f),a.onopen=()=>s.emit("open"),a.onerror=u=>{o<Up?(o++,setTimeout(()=>l(),Hp)):s.emit("error",u)},a.onmessage=u=>{const p=Wp(u.data);s.emit(p.type,p.data)}};return l(),s.on},KA=({userKey:e,clientId:t,apiUrl:n,customHeaders:r})=>{const i={"x-user-key":e,...r},o=`${n||Ae.getConfig().baseUrl}/${t}`,a={...VA,baseUrl:o};return Ae.interceptors.response._fns.length===0&&Ae.interceptors.response.use(HA),{createConversation:()=>wA({...a,headers:i,body:{}}).then(Pe),getConversation:({conversationId:s})=>bA({...a,headers:i,path:{id:s}}).then(Pe),deleteConversation:({conversationId:s})=>yA({...a,headers:i,path:{id:s}}).then(Pe),listConversations:({nextToken:s})=>vA({...a,headers:i,query:{nextToken:s}}).then(Pe),listConversationMessages:({conversationId:s,nextToken:l})=>xA({...a,headers:i,path:{id:s},query:{nextToken:l}}).then(Pe),addParticipant:({conversationId:s,userId:l})=>SA({...a,headers:i,path:{id:s},body:{userId:l}}).then(Pe),removeParticipant:({conversationId:s,userId:l})=>EA({...a,headers:i,path:{id:s,userId:l}}).then(Pe),getParticipant:({conversationId:s,userId:l})=>CA({...a,headers:i,path:{id:s,userId:l}}).then(Pe),listParticipants:({conversationId:s,nextToken:l})=>kA({...a,headers:i,path:{id:s},query:{nextToken:l}}).then(Pe),createMessage:s=>OA({...a,headers:i,body:s}).then(Pe),updateMessage:({messageId:s,...l})=>TA({...a,headers:i,path:{id:s},body:l}).then(Pe),getMessage:({messageId:s})=>IA({...a,headers:i,path:{id:s}}).then(Pe),deleteMessage:({messageId:s})=>AA({...a,headers:i,path:{id:s}}).then(Pe),createFile:s=>BA({...a,headers:i,body:s}).then(Pe),getUser:()=>NA({...a,headers:i}).then(Pe),updateUser:s=>_A({...a,headers:i,body:s}).then(Pe),deleteUser:()=>PA({...a,headers:i}).then(Pe),createEvent:s=>RA({...a,headers:i,body:s}).then(Pe),getEvent:({eventId:s})=>FA({...a,headers:i,path:{id:s}}).then(Pe),addMessageFeedback:({messageId:s,...l})=>MA({...a,headers:i,path:{id:s},body:l}).then(Pe),removeMessageFeedback:({messageId:s})=>DA({...a,headers:i,path:{id:s}}).then(Pe),generateUserKey:({adminSecret:s,...l})=>LA({...a,headers:{"x-admin-secret":s},body:l}).then(Pe),listenConversation:({conversationId:s})=>{let l=0,c=null;const f=jp(),u=()=>{c&&c.close();const p=`${o}/conversations/${s}/listen`;c=Vp(p,i),c.onopen=()=>f.emit("open"),c.onerror=d=>{l<Up?(l++,setTimeout(()=>u(),Hp)):f.emit("error",d)},c.onmessage=d=>{const m=Wp(d.data);f.emit(m.type,m.data)}};return u(),f.on}}},Wp=e=>{try{return JSON.parse(e)}catch{return e}},Vp=(e,t)=>new Ci(e,{fetch:(n,r)=>fetch(n,{...r,headers:{...r==null?void 0:r.headers,...t,timeout:WA}})});function qp({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,soundEnabled:o,...a}){var se;const s=Gu(n,r),l=s(K=>K.conversationId),c=s(K=>K.user),f=s(K=>K.setConversationId),u=s(K=>K.setUser),p=s(K=>K.clearConversationId),d=an(K=>K.messages),m=an(K=>K.saveMessage),h=an(K=>K.updateMessage),g=an(K=>K.fetchMessages),y=an(K=>K.setMessages),b=an(K=>K.clearMessages),w=Jn(K=>K.participants),E=Jn(K=>K.setParticipants),x=Jn(K=>K.addParticipant),C=Jn(K=>K.removeParticipant),T=Jn(K=>K.clearParticipants),N=Ju(`webchat-sound-${t}`),$=N(K=>K.soundOn),I=N(K=>K.toggleSound),{isTyping:D,setIsTyping:F}=JC(),_=O.useMemo(()=>ll(),[]),[R,P]=O.useState("connecting"),[L,U]=O.useState(a.conversationId),[z,q]=O.useState(a.user),[v,M]=O.useState(void 0),[H,k]=O.useState(!1),[W,te]=O.useState(void 0),Y=O.useRef(!1),X=O.useRef(null),oe=O.useRef(o??!1);O.useEffect(()=>{oe.current=o??!1},[o]);const ae=O.useRef($);O.useEffect(()=>{ae.current=$},[$]),O.useEffect(()=>{var De,Ue,He,qe;const K=YA(t,e);if(K){te(K),P("error");return}if(Y.current)return;Y.current=!0,F(!1),P("connecting"),X.current=new Audio,X.current.preload="auto",X.current.src=Tp.chatMessageNotification,X.current.volume=.9;let G;(De=a.user)!=null&&De.userToken&&a.conversationId?G={conversationId:a.conversationId,userToken:(Ue=a.user)==null?void 0:Ue.userToken}:(He=a.user)!=null&&He.userToken?G={conversationId:void 0,userToken:(qe=a.user)==null?void 0:qe.userToken}:G={conversationId:l,userToken:c==null?void 0:c.userToken};const ue=qA({apiUrl:e,clientId:t,userToken:G.userToken,conversationId:G.conversationId,adminSecret:i});let pe=[];const me=ue("init",({conversation:ee,messages:ce,participants:B,user:V})=>{const le=KA({clientId:t,apiUrl:e,userKey:V.userKey});le.createEvent({conversationId:ee.id,payload:{type:"conversation_started",data:{}}}).then(({event:re})=>{var de,Te;(Te=(de=re.payload.data)==null?void 0:de.status)!=null&&Te.isInitial&&_.emit("conversation",ee.id)}),pe=[...pe,ue("error",re=>{te(de=>de||br(re)),P("error"),_.emit("error",new Error(`Connection to conversation lost: ${re==null?void 0:re.message}`))}),ue("message_created",re=>{const de=Gn(re);V.id!==de.authorId&&(oe.current&&ae.current&&X.current&&X.current.play().catch(()=>{}),F(!1),_.emit("isTyping",{isTyping:!1,timeout:0})),m(de),_.emit("message",de)}),ue("message_status_changed",re=>{var de;re.newStatus==="processing"&&h((de=re.message.metadata)==null?void 0:de.clientMessageId,{status:re.newStatus})}),ue("typing_started",()=>{F(!0),_.emit("isTyping",{isTyping:!0,timeout:5e3})}),ue("participant_added",re=>{x(re.participant),_.emit("participantAdded",re.participant)}),ue("participant_removed",re=>{C(re.participantId),_.emit("participantRemoved",re.participantId)}),ue("webchat_visibility",re=>_.emit("webchatVisibility",re.visibility)),ue("webchat_config",re=>_.emit("webchatConfig",re.config)),ue("custom",re=>_.emit("customEvent",re.event))],U(ee.id),f(ee.id),q({userId:V.id,userToken:V.userKey}),u({userId:V.id,userToken:V.userKey}),E(B),y(ce.reverse().map(re=>Gn(re)).filter(Boolean)),te(void 0),P("connected"),M(le)});return pe.push(me),()=>{Y.current=!1,pe.forEach(ee=>ee())}},[a.conversationId,(se=a.user)==null?void 0:se.userToken,H]);const J=async(K,G)=>{const ue=G||L;if(!K||!ue)return;const pe=await g({client:K,conversationId:ue});y(pe);const{participants:me}=await K.listParticipants({conversationId:ue});E(me)},Q=async K=>{if(!K)throw new Error("Cannot start new conversation: client is not initialized");p(),b(),T(),U(void 0),k(G=>!G)};async function j(K,G){const pe=[{predicate:me=>me.message===$i||me.type==="ResourceNotFound",recover:()=>Q(G)},{predicate:me=>me.type==="network"||me.type==="disconnected"||me.message===Nn,recover:()=>J(G,L)}].find(me=>me.predicate(K));if(!pe){P("error"),te(K);return}try{await Zs(pe.recover,3,5e3),te(void 0),P("connected")}catch(me){te(br(me)),P("error")}}if(R!=="connected"||!z||!L||!v)return{clientState:R,on:_.on,client:void 0,messages:[],conversationId:void 0,newConversation:async()=>{await Q(v)},user:void 0,isTyping:void 0,participants:[],toggleSound:I,soundOn:$,error:W};const ne={sendMessage:async K=>{const G=kp(),ue={id:G,createdAt:new Date().toISOString(),userId:z.userId,conversationId:L,payload:K,metadata:{clientMessageId:G,delivered:!1}},pe=Gn(ue);pe.status="pending",m(pe);try{await v.createMessage({conversationId:L,payload:K,metadata:{clientMessageId:G}})}catch(me){await j(br(me),v),_.emit("error",me)}},sendEvent:async(K,G)=>{await v.createEvent({conversationId:L,payload:{type:"custom",data:K},bindConversation:(G==null?void 0:G.bindConversation)??!0,bindUser:(G==null?void 0:G.bindUser)??!0})},uploadFile:async K=>{const{size:G,name:ue}=K,me=await(B=>new Promise((V,le)=>{const re=new FileReader;re.onload=de=>{var Te;return V((Te=de.target)==null?void 0:Te.result)},re.onerror=de=>{var Te;return le((Te=de.target)==null?void 0:Te.error)},re.readAsArrayBuffer(B)}))(K),De=new Date;De.setDate(De.getDate()+30);const{file:{uploadUrl:Ue,contentType:He,url:qe}}=await v.createFile({size:G,key:ue,accessPolicies:["public_content"],index:!1,tags:{source:"integration",integrationName:"webchat"},expiresAt:De.toISOString()});await fetch(Ue,{method:"PUT",headers:{"x-amz-tagging":"public=true","content-type":He},body:me});const ee=He.split("/").shift()??"",ce=$s(ee)?ee:"file";return{fileUrl:qe,name:ue,type:ce}},addMessageFeedback:async(K,G)=>{h(K,{feedback:G.value}),await v.addMessageFeedback({messageId:K,...G})},getUser:async()=>{const{user:K}=await v.getUser();return K},updateUser:async K=>{const{user:G}=await v.updateUser({name:K.name,pictureUrl:K.pictureUrl,userData:K.data});return G}};return{clientState:"connected",on:_.on,client:ne,messages:d,conversationId:L,newConversation:async()=>{await Q(v)},user:z,isTyping:D,participants:w,error:W,soundOn:$,toggleSound:I}}const YA=(e,t)=>{if(!e)return{type:"configuration",message:zs};if(!URL.canParse(t))return{type:"configuration",message:js}},GA=({clientId:e,storageKey:t,configuration:n,allowFileUpload:r,apiUrl:i,user:o,conversationId:a,...s})=>{const l=t||`bp-webchat-${e}`,{clientState:c,client:f,isTyping:u,newConversation:p,messages:d,participants:m,user:h,error:g,soundOn:y,toggleSound:b}=qp({clientId:e,apiUrl:i,conversationId:a,user:o,storageKey:l,storageLocation:n==null?void 0:n.storageLocation,adminSecret:n==null?void 0:n.adminSecret,soundEnabled:n==null?void 0:n.soundEnabled}),{sendMessage:w,uploadFile:E,addMessageFeedback:x}=f??{};return S.jsx(Ip,{configuration:n??{},user:h!=null&&h.userId?{id:h==null?void 0:h.userId}:void 0,isLoading:c==="connecting",isTyping:u,connected:c==="connected"?!0:c==="disconnected"?!1:void 0,messages:d,sendMessage:w,uploadFile:E,addMessageFeedback:x,allowFileUpload:r,restartConversation:p,...s,participants:m,error:g,clientId:e,soundOn:y,toggleSound:b})};function Rt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Kp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Yp(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Kp(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():Kp(e[i],null)}}}}function Jt(...e){return A.useCallback(Yp(...e),e)}var us=A.forwardRef((e,t)=>{const{children:n,...r}=e,i=A.Children.toArray(n),o=i.find(JA);if(o){const a=o.props.children,s=i.map(l=>l===o?A.Children.count(a)>1?A.Children.only(null):A.isValidElement(a)?a.props.children:null:l);return S.jsx(fs,{...r,ref:t,children:A.isValidElement(a)?A.cloneElement(a,void 0,s):null})}return S.jsx(fs,{...r,ref:t,children:n})});us.displayName="Slot";var fs=A.forwardRef((e,t)=>{const{children:n,...r}=e;if(A.isValidElement(n)){const i=XA(n);return A.cloneElement(n,{...ZA(r,n.props),ref:t?Yp(t,i):i})}return A.Children.count(n)>1?A.Children.only(null):null});fs.displayName="SlotClone";var QA=({children:e})=>S.jsx(S.Fragment,{children:e});function JA(e){return A.isValidElement(e)&&e.type===QA}function ZA(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function XA(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var eI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Bt=eI.reduce((e,t)=>{const n=A.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?us:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(s,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function tI(e,t){e&&Is.flushSync(()=>e.dispatchEvent(t))}function nI(e,t=globalThis==null?void 0:globalThis.document){const n=Gt(e);A.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var rI="DismissableLayer",ds="dismissableLayer.update",iI="dismissableLayer.pointerDownOutside",oI="dismissableLayer.focusOutside",Gp,Qp=A.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jp=A.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=e,c=A.useContext(Qp),[f,u]=A.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=A.useState({}),m=Jt(t,T=>u(T)),h=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=h.indexOf(g),b=f?h.indexOf(f):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,E=b>=y,x=lI(T=>{const N=T.target,$=[...c.branches].some(I=>I.contains(N));!E||$||(i==null||i(T),a==null||a(T),T.defaultPrevented||s==null||s())},p),C=cI(T=>{const N=T.target;[...c.branches].some(I=>I.contains(N))||(o==null||o(T),a==null||a(T),T.defaultPrevented||s==null||s())},p);return nI(T=>{b===c.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},p),A.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Gp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),Zp(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Gp)}},[f,p,n,c]),A.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),Zp())},[f,c]),A.useEffect(()=>{const T=()=>d({});return document.addEventListener(ds,T),()=>document.removeEventListener(ds,T)},[]),S.jsx(Bt.div,{...l,ref:m,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:Rt(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Rt(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Rt(e.onPointerDownCapture,x.onPointerDownCapture)})});Jp.displayName=rI;var aI="DismissableLayerBranch",sI=A.forwardRef((e,t)=>{const n=A.useContext(Qp),r=A.useRef(null),i=Jt(t,r);return A.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),S.jsx(Bt.div,{...e,ref:i})});sI.displayName=aI;function lI(e,t=globalThis==null?void 0:globalThis.document){const n=Gt(e),r=A.useRef(!1),i=A.useRef(()=>{});return A.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){Xp(iI,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function cI(e,t=globalThis==null?void 0:globalThis.document){const n=Gt(e),r=A.useRef(!1);return A.useEffect(()=>{const i=o=>{o.target&&!r.current&&Xp(oI,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Zp(){const e=new CustomEvent(ds);document.dispatchEvent(e)}function Xp(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?tI(i,o):i.dispatchEvent(o)}var ps="focusScope.autoFocusOnMount",hs="focusScope.autoFocusOnUnmount",eh={bubbles:!1,cancelable:!0},uI="FocusScope",th=A.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=A.useState(null),c=Gt(i),f=Gt(o),u=A.useRef(null),p=Jt(t,h=>l(h)),d=A.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;A.useEffect(()=>{if(r){let h=function(w){if(d.paused||!s)return;const E=w.target;s.contains(E)?u.current=E:$t(u.current,{select:!0})},g=function(w){if(d.paused||!s)return;const E=w.relatedTarget;E!==null&&(s.contains(E)||$t(u.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const x of w)x.removedNodes.length>0&&$t(s)};document.addEventListener("focusin",h),document.addEventListener("focusout",g);const b=new MutationObserver(y);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",g),b.disconnect()}}},[r,s,d.paused]),A.useEffect(()=>{if(s){ih.add(d);const h=document.activeElement;if(!s.contains(h)){const y=new CustomEvent(ps,eh);s.addEventListener(ps,c),s.dispatchEvent(y),y.defaultPrevented||(fI(gI(nh(s)),{select:!0}),document.activeElement===h&&$t(s))}return()=>{s.removeEventListener(ps,c),setTimeout(()=>{const y=new CustomEvent(hs,eh);s.addEventListener(hs,f),s.dispatchEvent(y),y.defaultPrevented||$t(h??document.body,{select:!0}),s.removeEventListener(hs,f),ih.remove(d)},0)}}},[s,c,f,d]);const m=A.useCallback(h=>{if(!n&&!r||d.paused)return;const g=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,y=document.activeElement;if(g&&y){const b=h.currentTarget,[w,E]=dI(b);w&&E?!h.shiftKey&&y===E?(h.preventDefault(),n&&$t(w,{select:!0})):h.shiftKey&&y===w&&(h.preventDefault(),n&&$t(E,{select:!0})):y===b&&h.preventDefault()}},[n,r,d.paused]);return S.jsx(Bt.div,{tabIndex:-1,...a,ref:p,onKeyDown:m})});th.displayName=uI;function fI(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if($t(r,{select:t}),document.activeElement!==n)return}function dI(e){const t=nh(e),n=rh(t,e),r=rh(t.reverse(),e);return[n,r]}function nh(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function rh(e,t){for(const n of e)if(!pI(n,{upTo:t}))return n}function pI(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function hI(e){return e instanceof HTMLInputElement&&"select"in e}function $t(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&hI(e)&&t&&e.select()}}var ih=mI();function mI(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=oh(e,t),e.unshift(t)},remove(t){var n;e=oh(e,t),(n=e[0])==null||n.resume()}}}function oh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function gI(e){return e.filter(t=>t.tagName!=="A")}function yI(e,t){return A.useReducer((n,r)=>t[n][r]??n,e)}var ms=e=>{const{present:t,children:n}=e,r=bI(t),i=typeof n=="function"?n({present:r.isPresent}):A.Children.only(n),o=Jt(r.ref,vI(i));return typeof n=="function"||r.isPresent?A.cloneElement(i,{ref:o}):null};ms.displayName="Presence";function bI(e){const[t,n]=A.useState(),r=A.useRef({}),i=A.useRef(e),o=A.useRef("none"),a=e?"mounted":"unmounted",[s,l]=yI(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return A.useEffect(()=>{const c=Ai(r.current);o.current=s==="mounted"?c:"none"},[s]),vn(()=>{const c=r.current,f=i.current;if(f!==e){const p=o.current,d=Ai(c);e?l("MOUNT"):d==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(f&&p!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),vn(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,u=d=>{const h=Ai(r.current).includes(d.animationName);if(d.target===t&&h&&(l("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},p=d=>{d.target===t&&(o.current=Ai(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:A.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Ai(e){return(e==null?void 0:e.animationName)||"none"}function vI(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gs=0;function wI(){A.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ah()),document.body.insertAdjacentElement("beforeend",e[1]??ah()),gs++,()=>{gs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),gs--}},[])}function ah(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ii="right-scroll-bar-position",Ti="width-before-scroll-bar",xI="with-scroll-bars-hidden",kI="--removed-body-scroll-bar-size";function ys(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function SI(e,t){var n=O.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var EI=typeof window<"u"?A.useLayoutEffect:A.useEffect,sh=new WeakMap;function CI(e,t){var n=SI(null,function(r){return e.forEach(function(i){return ys(i,r)})});return EI(function(){var r=sh.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(s){o.has(s)||ys(s,null)}),o.forEach(function(s){i.has(s)||ys(s,a)})}sh.set(n,e)},[e]),n}function AI(e){return e}function II(e,t){t===void 0&&(t=AI);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var f=a;a=[],f.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(f){a.push(f),c()},filter:function(f){return a=a.filter(f),n}}}};return i}function TI(e){e===void 0&&(e={});var t=II(null);return t.options=it({async:!0,ssr:!1},e),t}var lh=function(e){var t=e.sideCar,n=tf(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return A.createElement(r,it({},n))};lh.isSideCarExport=!0;function OI(e,t){return e.useMedium(t),lh}var ch=TI(),bs=function(){},Oi=A.forwardRef(function(e,t){var n=A.useRef(null),r=A.useState({onScrollCapture:bs,onWheelCapture:bs,onTouchMoveCapture:bs}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,f=e.enabled,u=e.shards,p=e.sideCar,d=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,w=e.gapMode,E=tf(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=p,C=CI([n,t]),T=it(it({},E),i);return A.createElement(A.Fragment,null,f&&A.createElement(x,{sideCar:ch,removeScrollBar:c,shards:u,noRelative:d,noIsolation:m,inert:h,setCallbacks:o,allowPinchZoom:!!g,lockRef:n,gapMode:w}),a?A.cloneElement(A.Children.only(s),it(it({},T),{ref:C})):A.createElement(b,it({},T,{className:l,ref:C}),s))});Oi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Oi.classNames={fullWidth:Ti,zeroRight:Ii};var DI=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function MI(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=DI();return t&&e.setAttribute("nonce",t),e}function PI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function NI(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var _I=function(){var e=0,t=null;return{add:function(n){e==0&&(t=MI())&&(PI(t,n),NI(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},LI=function(){var e=_I();return function(t,n){A.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},uh=function(){var e=LI(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},FI={left:0,top:0,right:0,gap:0},vs=function(e){return parseInt(e||"",10)||0},RI=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[vs(n),vs(r),vs(i)]},BI=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return FI;var t=RI(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},$I=uh(),Cn="data-scroll-locked",zI=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
296
- .`.concat(xI,` {
301
+ `&&r++}}return[t,n]}class _p extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n==null?void 0:n.code)!=null?r:void 0,this.message=(i=n==null?void 0:n.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(Lp(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(Lp(this),n)}}function UA(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ns(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ns).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ns(e.cause)}`:e.message:`${e}`}function Lp(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var Fp=e=>{throw TypeError(e)},rs=(e,t,n)=>t.has(e)||Fp("Cannot "+n),ve=(e,t,n)=>(rs(e,t,"read from private field"),n?n.call(e):t.get(e)),Be=(e,t,n)=>t.has(e)?Fp("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Me=(e,t,n,r)=>(rs(e,t,"write to private field"),t.set(e,n),n),Ct=(e,t,n)=>(rs(e,t,"access private method"),n),Ze,Qt,wn,Si,Ei,hr,xn,mr,Ft,kn,Sn,En,gr,ft,is,os,as,Rp,ss,ls,yr,cs,us;class Ci extends EventTarget{constructor(t,n){var r,i;super(),Be(this,ft),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Be(this,Ze),Be(this,Qt),Be(this,wn),Be(this,Si),Be(this,Ei),Be(this,hr),Be(this,xn),Be(this,mr,null),Be(this,Ft),Be(this,kn),Be(this,Sn,null),Be(this,En,null),Be(this,gr,null),Be(this,os,async o=>{var a;ve(this,kn).reset();const{body:s,redirected:l,status:c,headers:f}=o;if(c===204){Ct(this,ft,yr).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?Me(this,wn,new URL(o.url)):Me(this,wn,void 0),c!==200){Ct(this,ft,yr).call(this,`Non-200 status code (${c})`,c);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){Ct(this,ft,yr).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(ve(this,Ze)===this.CLOSED)return;Me(this,Ze,this.OPEN);const u=new Event("open");if((a=ve(this,gr))==null||a.call(this,u),this.dispatchEvent(u),typeof s!="object"||!s||!("getReader"in s)){Ct(this,ft,yr).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const p=new TextDecoder,d=s.getReader();let m=!0;do{const{done:h,value:g}=await d.read();g&&ve(this,kn).feed(p.decode(g,{stream:!h})),h&&(m=!1,ve(this,kn).reset(),Ct(this,ft,cs).call(this))}while(m)}),Be(this,as,o=>{Me(this,Ft,void 0),!(o.name==="AbortError"||o.type==="aborted")&&Ct(this,ft,cs).call(this,ns(o))}),Be(this,ss,o=>{typeof o.id=="string"&&Me(this,mr,o.id);const a=new MessageEvent(o.event||"message",{data:o.data,origin:ve(this,wn)?ve(this,wn).origin:ve(this,Qt).origin,lastEventId:o.id||""});ve(this,En)&&(!o.event||o.event==="message")&&ve(this,En).call(this,a),this.dispatchEvent(a)}),Be(this,ls,o=>{Me(this,hr,o)}),Be(this,us,()=>{Me(this,xn,void 0),ve(this,Ze)===this.CONNECTING&&Ct(this,ft,is).call(this)});try{if(t instanceof URL)Me(this,Qt,t);else if(typeof t=="string")Me(this,Qt,new URL(t,HA()));else throw new Error("Invalid URL")}catch{throw UA("An invalid or illegal string was specified")}Me(this,kn,zA({onEvent:ve(this,ss),onRetry:ve(this,ls)})),Me(this,Ze,this.CONNECTING),Me(this,hr,3e3),Me(this,Ei,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),Me(this,Si,(i=n==null?void 0:n.withCredentials)!=null?i:!1),Ct(this,ft,is).call(this)}get readyState(){return ve(this,Ze)}get url(){return ve(this,Qt).href}get withCredentials(){return ve(this,Si)}get onerror(){return ve(this,Sn)}set onerror(t){Me(this,Sn,t)}get onmessage(){return ve(this,En)}set onmessage(t){Me(this,En,t)}get onopen(){return ve(this,gr)}set onopen(t){Me(this,gr,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){ve(this,xn)&&clearTimeout(ve(this,xn)),ve(this,Ze)!==this.CLOSED&&(ve(this,Ft)&&ve(this,Ft).abort(),Me(this,Ze,this.CLOSED),Me(this,Ft,void 0))}}Ze=new WeakMap,Qt=new WeakMap,wn=new WeakMap,Si=new WeakMap,Ei=new WeakMap,hr=new WeakMap,xn=new WeakMap,mr=new WeakMap,Ft=new WeakMap,kn=new WeakMap,Sn=new WeakMap,En=new WeakMap,gr=new WeakMap,ft=new WeakSet,is=function(){Me(this,Ze,this.CONNECTING),Me(this,Ft,new AbortController),ve(this,Ei)(ve(this,Qt),Ct(this,ft,Rp).call(this)).then(ve(this,os)).catch(ve(this,as))},os=new WeakMap,as=new WeakMap,Rp=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...ve(this,mr)?{"Last-Event-ID":ve(this,mr)}:void 0},cache:"no-store",signal:(e=ve(this,Ft))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},ss=new WeakMap,ls=new WeakMap,yr=function(e,t){var n;ve(this,Ze)!==this.CLOSED&&Me(this,Ze,this.CLOSED);const r=new _p("error",{code:t,message:e});(n=ve(this,Sn))==null||n.call(this,r),this.dispatchEvent(r)},cs=function(e,t){var n;if(ve(this,Ze)===this.CLOSED)return;Me(this,Ze,this.CONNECTING);const r=new _p("error",{code:t,message:e});(n=ve(this,Sn))==null||n.call(this,r),this.dispatchEvent(r),Me(this,xn,setTimeout(ve(this,us),ve(this,hr)))},us=new WeakMap,Ci.CONNECTING=0,Ci.OPEN=1,Ci.CLOSED=2;function HA(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}async function WA(e){var t;const n=await e.clone().json();if((t=n==null?void 0:n.id)!=null&&t.startsWith("err_")){const r=new Error(n.message);throw r.id=n.id,r.code=n.code,r.type=n.type,r}return e}const Bp=()=>{const e={};return{on:(t,n)=>{var r;return e[t]||(e[t]=new Set),(r=e[t])==null||r.add(n),()=>{var i;return(i=e[t])==null?void 0:i.delete(n)}},emit:(t,n)=>{var r,i;(r=e[t])==null||r.forEach(o=>o(n)),(i=e["*"])==null||i.forEach(o=>o({type:t,payload:n}))}}},_e=e=>e.data,$p=10,zp=3e3,VA="60000",qA={throwOnError:!0},KA=({conversationId:e,userToken:t,clientId:n,apiUrl:r,adminSecret:i})=>{let o=0,a=null;const s=Bp(),l=()=>{a&&a.close();const c=`${`${r||De.getConfig().baseUrl}/${n}`}/initialize${e?`?conversationId=${e}`:""}`,f={...i?{"x-admin-secret":i}:{},...t?{"x-user-key":t}:{}};a=Up(c,f),a.onopen=()=>s.emit("open"),a.onerror=u=>{o<$p?(o++,setTimeout(()=>l(),zp)):s.emit("error",u)},a.onmessage=u=>{const p=jp(u.data);s.emit(p.type,p.data)}};return l(),s.on},YA=({userKey:e,clientId:t,apiUrl:n,customHeaders:r})=>{const i={"x-user-key":e,...r},o=`${n||De.getConfig().baseUrl}/${t}`,a={...qA,baseUrl:o};return De.interceptors.response._fns.length===0&&De.interceptors.response.use(WA),{createConversation:()=>xA({...a,headers:i,body:{}}).then(_e),getConversation:({conversationId:s})=>vA({...a,headers:i,path:{id:s}}).then(_e),deleteConversation:({conversationId:s})=>bA({...a,headers:i,path:{id:s}}).then(_e),listConversations:({nextToken:s})=>wA({...a,headers:i,query:{nextToken:s}}).then(_e),listConversationMessages:({conversationId:s,nextToken:l})=>kA({...a,headers:i,path:{id:s},query:{nextToken:l}}).then(_e),addParticipant:({conversationId:s,userId:l})=>EA({...a,headers:i,path:{id:s},body:{userId:l}}).then(_e),removeParticipant:({conversationId:s,userId:l})=>CA({...a,headers:i,path:{id:s,userId:l}}).then(_e),getParticipant:({conversationId:s,userId:l})=>AA({...a,headers:i,path:{id:s,userId:l}}).then(_e),listParticipants:({conversationId:s,nextToken:l})=>SA({...a,headers:i,path:{id:s},query:{nextToken:l}}).then(_e),createMessage:s=>DA({...a,headers:i,body:s}).then(_e),updateMessage:({messageId:s,...l})=>OA({...a,headers:i,path:{id:s},body:l}).then(_e),getMessage:({messageId:s})=>TA({...a,headers:i,path:{id:s}}).then(_e),deleteMessage:({messageId:s})=>IA({...a,headers:i,path:{id:s}}).then(_e),createFile:s=>$A({...a,headers:i,body:s}).then(_e),getUser:()=>_A({...a,headers:i}).then(_e),updateUser:s=>LA({...a,headers:i,body:s}).then(_e),deleteUser:()=>NA({...a,headers:i}).then(_e),createEvent:s=>BA({...a,headers:i,body:s}).then(_e),getEvent:({eventId:s})=>RA({...a,headers:i,path:{id:s}}).then(_e),addMessageFeedback:({messageId:s,...l})=>PA({...a,headers:i,path:{id:s},body:l}).then(_e),removeMessageFeedback:({messageId:s})=>MA({...a,headers:i,path:{id:s}}).then(_e),generateUserKey:({adminSecret:s,...l})=>FA({...a,headers:{"x-admin-secret":s},body:l}).then(_e),listenConversation:({conversationId:s})=>{let l=0,c=null;const f=Bp(),u=()=>{c&&c.close();const p=`${o}/conversations/${s}/listen`;c=Up(p,i),c.onopen=()=>f.emit("open"),c.onerror=d=>{l<$p?(l++,setTimeout(()=>u(),zp)):f.emit("error",d)},c.onmessage=d=>{const m=jp(d.data);f.emit(m.type,m.data)}};return u(),f.on}}},jp=e=>{try{return JSON.parse(e)}catch{return e}},Up=(e,t)=>new Ci(e,{fetch:(n,r)=>fetch(n,{...r,headers:{...r==null?void 0:r.headers,...t,timeout:VA}})}),Hp={chatMessageNotification:new URL("data:audio/ogg;base64,T2dnUwACAAAAAAAAAAAVJAEzAAAAAOU+A6UBHgF2b3JiaXMAAAAAASJWAAD/////AH0AAP////+pAU9nZ1MAAAAAAAAAAAAAFSQBMwEAAAD3T/UfDpz////////////////FA3ZvcmJpcwwAAABMYXZmNjEuNy4xMDAEAAAAHwAAAGVuY29kZXI9TGF2YzYxLjE5LjEwMSBsaWJ2b3JiaXMrAAAAZW5jb2RlZF9ieT1BZG9iZSBQcmVtaWVyZSBQcm8gMjAyNS4wIChNYWNpbhcAAAB0aW1lX3JlZmVyZW5jZT0xMjExMDQwMA8AAABkYXRlPTIwMjUtMDgtMDUBBXZvcmJpcyJCQ1YBAEAAABhCECoFrWOOOsgVIYwZoqBCyinHHULQIaMkQ4g6xjXHGGNHuWSKQsmB0JBVAABAAACkHFdQckkt55xzoxhXzHHoIOecc+UgZ8xxCSXnnHOOOeeSco4x55xzoxhXDnIpLeecc4EUR4pxpxjnnHOkHEeKcagY55xzbTG3knLOOeecc+Ygh1JyrjXnnHOkGGcOcgsl55xzxiBnzHHrIOecc4w1t9RyzjnnnHPOOeecc84555xzjDHnnHPOOeecc24x5xZzrjnnnHPOOeccc84555xzIDRkFQCQAACgoSiK4igOEBqyCgDIAAAQQHEUR5EUS7Ecy9EkDQgNWQUAAAEACAAAoEiGpEiKpViOZmmeJnqiKJqiKquyacqyLMuy67ouEBqyCgBIAABQURTFcBQHCA1ZBQBkAAAIYCiKoziO5FiSpVmeB4SGrAIAgAAABAAAUAxHsRRN8STP8jzP8zzP8zzP8zzP8zzP8zzP8zwNCA1ZBQAgAAAAgihkGANCQ1YBAEAAAAghGhlDnVISXAoWQhwRQx1CzkOppYPgKYUlY9JTrEEIIXzvPffee++B0JBVAAAQAABhFDiIgcckCCGEYhQnRHGmIAghhOUkWMp56CQI3YMQQrice8u59957IDRkFQAACADAIIQQQgghhBBCCCmklFJIKaaYYoopxxxzzDHHIIMMMuigk046yaSSTjrKJKOOUmsptRRTTLHlFmOttdacc69BKWOMMcYYY4wxxhhjjDHGGCMIDVkFAIAAABAGGWSQQQghhBRSSCmmmHLMMcccA0JDVgEAgAAAAgAAABxFUiRHciRHkiTJkixJkzzLszzLszxN1ERNFVXVVW3X9m1f9m3f1WXf9mXb1WVdlmXdtW1d1l1d13Vd13Vd13Vd13Vd13Vd14HQkFUAgAQAgI7kOI7kOI7kSI6kSAoQGrIKAJABABAAgKM4iuNIjuRYjiVZkiZplmd5lqd5mqiJHhAasgoAAAQAEAAAAAAAgKIoiqM4jiRZlqZpnqd6oiiaqqqKpqmqqmqapmmapmmapmmapmmapmmapmmapmmapmmapmmapmmapmkCoSGrAAAJAAAdx3EcR3Ecx3EkR5IkIDRkFQAgAwAgAABDURxFcizHkjRLszzL00TP9FxRNnVTV20gNGQVAAAIACAAAAAAAADHczzHczzJkzzLczzHkzxJ0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRNA0JDVgIAZAAAEJOQSk6xV0YpxiS0XiqkFJPUe6iYYkw67alCBikHuYdKIaWg094ypZBSDHunmELIGOqhg5AxhbDX2nPPvfceCA1ZEQBEAQAAxiDGEGPIMSYlgxIxxyRkUiLnnJROSialpFZazKSEmEqLkXNOSiclk1JaC6llkkprJaYCAAACHAAAAiyEQkNWBABRAACIMUgppBRSSjGnmENKKceUY0gp5ZxyTjnHmHQQKucYdA5KpJRyjjmnnHMSMgeVcw5CJp0AAIAABwCAAAuh0JAVAUCcAACAkHOKMQgRYxBCCSmFUFKqnJPSQUmpg5JSSanFklKMlXNSOgkpdRJSKinFWFKKLaRUY2kt19JSjS3GnFuMvYaUYi2p1Vpaq7nFWHOLNffIOUqdlNY6Ka2l1mpNrdXaSWktpNZiaS3G1mLNKcacMymthZZiK6nF2GLLNbWYc2kt1xRjzynGnmusucecgzCt1ZxayznFmHvMseeYcw+Sc5Q6Ka11UlpLrdWaWqs1k9Jaaa3GkFqLLcacW4sxZ1JaLKnFWFqKMcWYc4st19BarinGnFOLOcdag5Kx9l5aqznFmHuKreeYczA2x547SrmW1nourfVecy5C1tyLaC3n1GoPKsaec87B2NyDEK3lnGrsPcXYe+45GNtz8K3W4FvNRcicg9C5+KZ7MEbV2oPMtQiZcxA66CJ08Ml4lGoureVcWus91hp8zTkI0VruKcbeU4u9156bsL0HIVrLPcXYg4ox+JpzMDrnYlStwcecg5C1FqF7L0rnIJSqtQeZa1Ay1yJ08MXooIsvAABgwAEAIMCEMlBoyIoAIE4AgEHIOaUYhEopCKGElEIoKVWMSciYg5IxJ6WUUloIJbWKMQiZY1Iyx6SEEloqJbQSSmmplNJaKKW1llqMKbUWQymphVJaK6W0llqqMbVWY8SYlMw5KZljUkoprZVSWqsck5IxKKmDkEopKcVSUouVc1Iy6Kh0EEoqqcRUUmmtpNJSKaXFklJsKcVUW4u1hlJaLKnEVlJqMbVUW4sx14gxKRlzUjLnpJRSUiultJY5J6WDjkrmoKSSUmulpBQz5qR0DkrKIKNSUootpRJTKKW1klJspaTWWoy1ptRaLSW1VlJqsZQSW4sx1xZLTZ2U1koqMYZSWmsx5ppaizGUElspKcaSSmytxZpbbDmGUlosqcRWSmqx1ZZja7Hm1FKNKbWaW2y5xpRTj7X2nFqrNbVUY2ux5lhbb7XWnDsprYVSWislxZhai7HFWHMoJbaSUmylpBhbbLm2FmMPobRYSmqxpBJjazHmGFuOqbVaW2y5ptRirbX2HFtuPaUWa4ux5tJSjTXX3mNNORUAADDgAAAQYEIZKDRkJQAQBQAAGMMYYxAapZxzTkqDlHPOScmcgxBCSplzEEJIKXNOQkotZc5BSKm1UEpKrcUWSkmptRYLAAAocAAACLBBU2JxgEJDVgIAUQAAiDFKMQahMUYp5yA0xijFGIRKKcack1ApxZhzUDLHnINQSuaccxBKCSGUUkpKIYRSSkmpAACAAgcAgAAbNCUWByg0ZEUAEAUAABhjnDPOIQqdpc5SJKmj1lFrKKUaS4ydxlZ767nTGnttuTeUSo2p1o5ry7nV3mlNPbccCwAAO3AAADuwEAoNWQkA5AEAEMYoxZhzzhmFGHPOOecMUow555xzijHnnIMQQsWYc85BCCFzzjkIoYSSOecchBBK6JyDUEoppXTOQQihlFI65yCEUkopnXMQSimllAIAgAocAAACbBTZnGAkqNCQlQBAHgAAYAxCzklprWHMOQgt1dgwxhyUlGKLnIOQUou5RsxBSCnGoDsoKbUYbPCdhJRaizkHk1KLNefeg0iptZqDzj3VVnPPvfecYqw1595zLwAAd8EBAOzARpHNCUaCCg1ZCQDkAQAQCCnFmHPOGaUYc8w554xSjDHmnHOKMcacc85BxRhjzjkHIWPMOecghJAx5pxzEELonHMOQgghdM45ByGEEDrnoIMQQgidcxBCCCGEAgCAChwAAAJsFNmcYCSo0JCVAEA4AAAAIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEELonHPOOeecc84555xzzjnnnHPOOScAyLfCAcD/wcYZVpLOCkeDCw1ZCQCEAwAACkEopWIQSiklkk46KZ2TUEopkYNSSumklFJKCaWUUkoIpZRSSggdlFJCKaWUUkoppZRSSimllFI6KaWUUkoppZTKOSmlk1JKKaVEzkkpIZRSSimlhFJKKaWUUkoppZRSSimllFJKKaWEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQCALgbHAAgEmycYSXprHA0uNCQlQBASAAAoBRzjkoIKZSQUqiYoo5CKSmkUkoKEWPOSeochVBSKKmDyjkIpaSUQiohdc5BByWFkFIJIZWOOugolFBSKiWU0jkopYQUSkoplZBCSKl0lFIoJZWUQiohlVJKSCWVEEoKnaRUSgqppFRSCJ10kEInJaSSSgqpk5RSKiWllEpKJXRSQioppRBCSqmUEEpIKaVOUkmppBRCKCGFlFJKJaWSSkohlVRCCaWklFIooaRUUkoppZJSKQAA4MABACDACDrJqLIIG0248AAUGrISACADAECUdNZpp0kiCDFFmScNKcYgtaQswxBTkonxFGOMOShGQw4x5JQYF0oIoYNiPCaVQ8pQUbm31DkFxRZjfO+xFwEAAAgCAASEBAAYICiYAQAGBwgjBwIdAQQObQCAgQiZCQwKocFBJgA8QERIBQCJCYrShS4IIYJ0EWTxwIUTN5644YQObRAAAAAAABAA8AEAkFAAERHRzFVYXGBkaGxwdHh8gIQEAAAAAAAIAHwAACQiQERENHMVFhcYGRobHB0eHyAhAQAAAAAAAAAAQEBAAAAAAAAgAAAAQEBPZ2dTAASuMwAAAAAAABUkATMCAAAACYS6sR4BAUQxGR89NxobGiEkKCknJiYmJSUhISEaFgwBAQEAAnyfvULHAlAEJgh2vpgQBMHIyMjIyNhIQOjz+ePz58+fL89xAwYBAFaH//3//7/xNw0MBoNB6qlPfWrUKQng+/0FABAAhLEjKuHFBwA4AHC9Fx4Oh7EwDEOgvnJ3RtV+Op0+nU6n5cyzEwAoltTpwed5dgVKMPoru90zNHGA7F0CP98BAAAAAHl9ePviAgCW+3rugPIDwC6BbWoTAFEAAADh5GpCCACgc+0zxlAAVKddkjDsA14GDoJtf7R+NkE4W23hI5mF3d74iVGvzg9PpA4cCQs66joePTmOfhgl7vNZzYzQADDyz30FAGSvVUZ6wJ4MAKbCGeb4+v5NLIdK3YvrLkCu98uV//FpXQNyKAKAV7r186fTktcJJgjAlVp1fUmaGgtrdAAuDXYJSPs/AAAAAHDnAeHxciEUAB76CvfarGjDzIjALoEd+/0EAAAAQNYeMrkBAF6ZKm8xuw94NtgloHDUCAAAAIAMJ5Qz2iUAvjhKL8lkfmA6wi6BWfNHgiAAAABq4eeqGgCg8+LAAXQAfhgqz2RKHzAVYJeAynEAIQEAALwq6tFbIQAEEIIO8iULngMAXhgajrw3D5iFWhe7BLZNrwCVKAAA0t2TfT8mADx0aMfS4CULeACvA14YWnasNht80ZpdAhv8BEiiAADgcbm4jo0JANAVCTRV6JqQS0OTADoAXhg6zWy+AZ3GsiDRAYJzgiQAAICnb9FLAQAUNQFd44AioMNJICUAfhi67ZRjA2IMSHTAJK0KkgAAAG7W0uLlEgC6KnQdDkgBlAAdJAB+GHpL40hATAASHSC5CZIAAAAGZ3J60ioBoKsBTQKE5KFJIJFAAp4Y+jp7cg4qINEBi+MASQAAAM8rmdZcAKApwFhNPHQkQEBRQwIAnhj6OZ8KIBwDiQ4Q9ApIFAAAQHRFd6FEALA0NaApQAegnPrDA54Y+nN+AYAIJDoAfgIkCgAAcLRlPVsLALqmKqFpHIwUwQEJCwCeKPpzEQA8kOgAyTlBAgAAgPnK3q8jAWAuJFBYOsbAAgCeKPolEQA8rMFCohQAAMxD2BdSAJYFdNThKcCkBQCOgwKeGPpzEQA8rEEhCQAAoCz4MRGA41gaQMBRjACexHugAACeGPqFCAAeugQAAHryFgBdRYGFhGeow8x7AJ4Y+iURADyIigIAliFAAcYWCQC11gGeGPolEQA8UAAAABoODg4=",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Fi&&Fi.tagName.toUpperCase()==="SCRIPT"&&Fi.src||new URL("index.umd.cjs",document.baseURI).href).href};function Wp({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,soundEnabled:o,...a}){var ie;const s=Ku(n,r),l=s(K=>K.conversationId),c=s(K=>K.user),f=s(K=>K.setConversationId),u=s(K=>K.setUser),p=s(K=>K.clearConversationId),d=an(K=>K.messages),m=an(K=>K.saveMessage),h=an(K=>K.updateMessage),g=an(K=>K.fetchMessages),y=an(K=>K.setMessages),b=an(K=>K.clearMessages),w=Jn(K=>K.participants),C=Jn(K=>K.setParticipants),x=Jn(K=>K.addParticipant),E=Jn(K=>K.removeParticipant),T=Jn(K=>K.clearParticipants),_=Gu(`webchat-sound-${t}`),$=_(K=>K.soundOn),I=_(K=>K.toggleSound),{state:D,setState:z}=Cp(),{state:P,setState:L}=Cp(),M=O.useMemo(()=>Hs(),[]),[R,U]=O.useState("connecting"),[B,V]=O.useState(a.conversationId),[v,N]=O.useState(a.user),[H,k]=O.useState(void 0),[W,te]=O.useState(!1),[Y,Z]=O.useState(void 0),re=O.useRef(!1),oe=O.useRef(null),G=O.useRef(o??!1);O.useEffect(()=>{G.current=o??!1},[o]);const Q=O.useRef($);O.useEffect(()=>{Q.current=$},[$]),O.useEffect(()=>{var je,Ye,ee,se;const K=GA(t,e);if(K){Z(K),U("error");return}if(re.current)return;re.current=!0,z(!1),U("connecting");try{oe.current=new Audio,oe.current.preload="auto",oe.current.src=Hp.chatMessageNotification,oe.current.volume=.9}catch(F){console.error("Error loading sound effect:",F),oe.current=null}let ce;(je=a.user)!=null&&je.userToken&&a.conversationId?ce={conversationId:a.conversationId,userToken:(Ye=a.user)==null?void 0:Ye.userToken}:(ee=a.user)!=null&&ee.userToken?ce={conversationId:void 0,userToken:(se=a.user)==null?void 0:se.userToken}:ce={conversationId:l,userToken:c==null?void 0:c.userToken};const he=KA({apiUrl:e,clientId:t,userToken:ce.userToken,conversationId:ce.conversationId,adminSecret:i});let Ce=[];const ke=he("init",({conversation:F,messages:q,participants:le,user:ue})=>{const ye=YA({clientId:t,apiUrl:e,userKey:ue.userKey});ye.createEvent({conversationId:F.id,payload:{type:"conversation_started",data:{}}}).then(({event:de})=>{var Te,Le;(Le=(Te=de.payload.data)==null?void 0:Te.status)!=null&&Le.isInitial&&M.emit("conversation",F.id)}),Ce=[...Ce,he("error",de=>{Z(Te=>Te||wr(de)),U("error"),M.emit("error",new Error(`Connection to conversation lost: ${de==null?void 0:de.message}`))}),he("message_created",de=>{const Te=Gn(de);ue.id!==Te.authorId&&(G.current&&Q.current&&oe.current&&oe.current.play().catch(()=>{}),z(!1),L(!1),M.emit("isTyping",{isTyping:!1,timeout:0})),m(Te),M.emit("message",Te)}),he("message_status_changed",de=>{var Te;de.newStatus==="processing"&&h((Te=de.message.metadata)==null?void 0:Te.clientMessageId,{status:de.newStatus})}),he("typing_stopped",()=>{z(!1),L(!1)}),he("typing_started",()=>{z(!0,5e3),L(!0,5e3),M.emit("isTyping",{isTyping:!0,timeout:5e3})}),he("participant_added",de=>{x(de.participant),M.emit("participantAdded",de.participant)}),he("participant_removed",de=>{E(de.participantId),M.emit("participantRemoved",de.participantId)}),he("webchat_visibility",de=>M.emit("webchatVisibility",de.visibility)),he("webchat_config",de=>M.emit("webchatConfig",de.config)),he("custom",de=>M.emit("customEvent",de.event))],V(F.id),f(F.id),N({userId:ue.id,userToken:ue.userKey}),u({userId:ue.id,userToken:ue.userKey}),C(le),y(q.reverse().map(de=>Gn(de)).filter(Boolean)),Z(void 0),U("connected"),k(ye)});return Ce.push(ke),()=>{re.current=!1,Ce.forEach(F=>F())}},[a.conversationId,(ie=a.user)==null?void 0:ie.userToken,W]);const j=async(K,ce)=>{const he=ce||B;if(!K||!he)return;const Ce=await g({client:K,conversationId:he});y(Ce);const{participants:ke}=await K.listParticipants({conversationId:he});C(ke)},X=async K=>{if(!K)throw new Error("Cannot start new conversation: client is not initialized");p(),b(),T(),V(void 0),te(ce=>!ce)};async function ae(K,ce){const Ce=[{predicate:ke=>ke.message===zi||ke.type==="ResourceNotFound",recover:()=>X(ce)},{predicate:ke=>ke.type==="network"||ke.type==="disconnected"||ke.message===Ln,recover:()=>j(ce,B)}].find(ke=>ke.predicate(K));if(!Ce){U("error"),Z(K);return}try{await pl(Ce.recover,3,5e3),Z(void 0),U("connected")}catch(ke){Z(wr(ke)),U("error")}}if(R!=="connected"||!v||!B||!H)return{clientState:R,on:M.on,client:void 0,messages:[],conversationId:void 0,newConversation:async()=>{await X(H)},user:void 0,isTyping:void 0,participants:[],toggleSound:I,soundOn:$,error:Y,disableSendButton:P};const pe={sendMessage:async K=>{const ce=Qa(),he={id:ce,createdAt:new Date().toISOString(),userId:v.userId,conversationId:B,payload:K,metadata:{clientMessageId:ce,delivered:!1}},Ce=Gn(he);Ce.status="pending",m(Ce),L(!0,5e3);try{await H.createMessage({conversationId:B,payload:K,metadata:{clientMessageId:ce}})}catch(ke){await ae(wr(ke),H),M.emit("error",ke)}},sendEvent:async(K,ce)=>{await H.createEvent({conversationId:B,payload:{type:"custom",data:K},bindConversation:(ce==null?void 0:ce.bindConversation)??!0,bindUser:(ce==null?void 0:ce.bindUser)??!0})},uploadFile:async K=>{const{size:ce,name:he}=K,ke=await(le=>new Promise((ue,ye)=>{const de=new FileReader;de.onload=Te=>{var Le;return ue((Le=Te.target)==null?void 0:Le.result)},de.onerror=Te=>{var Le;return ye((Le=Te.target)==null?void 0:Le.error)},de.readAsArrayBuffer(le)}))(K),je=new Date;je.setDate(je.getDate()+30);const{file:{uploadUrl:Ye,contentType:ee,url:se}}=await H.createFile({size:ce,key:`${Qa(6)}-${K.name}`,accessPolicies:["public_content"],index:!1,tags:{source:"integration",integrationName:"webchat",conversation:B,user:v.userId},expiresAt:je.toISOString()});await fetch(Ye,{method:"PUT",headers:{"x-amz-tagging":"public=true","content-type":ee},body:ke});const F=ee.split("/").shift()??"",q=el(F)?F:"file";return{fileUrl:se,name:he,type:q}},addMessageFeedback:async(K,ce)=>{h(K,{feedback:ce.value}),await H.addMessageFeedback({messageId:K,...ce})},getUser:async()=>{const{user:K}=await H.getUser();return K},updateUser:async K=>{const{user:ce}=await H.updateUser({name:K.name,pictureUrl:K.pictureUrl,userData:K.data});return ce}};return{clientState:"connected",on:M.on,client:pe,messages:d,conversationId:B,newConversation:async()=>{await X(H)},user:v,isTyping:D,participants:w,error:Y,soundOn:$,toggleSound:I,disableSendButton:P}}const GA=(e,t)=>{if(!e)return{type:"configuration",message:tl};if(!Am(t))return{type:"configuration",message:nl}},QA=({clientId:e,storageKey:t,configuration:n,allowFileUpload:r,apiUrl:i,user:o,conversationId:a,...s})=>{const l=t||`bp-webchat-${e}`,{clientState:c,client:f,isTyping:u,newConversation:p,messages:d,participants:m,user:h,error:g,soundOn:y,toggleSound:b,disableSendButton:w}=Wp({clientId:e,apiUrl:i,conversationId:a,user:o,storageKey:l,storageLocation:n==null?void 0:n.storageLocation,adminSecret:n==null?void 0:n.adminSecret,soundEnabled:n==null?void 0:n.soundEnabled}),{sendMessage:C,uploadFile:x,addMessageFeedback:E}=f??{};return S.jsx(Ep,{configuration:n??{},user:h!=null&&h.userId?{id:h==null?void 0:h.userId}:void 0,isLoading:c==="connecting",isTyping:u,connected:c==="connected"?!0:c==="disconnected"?!1:void 0,messages:d,sendMessage:C,uploadFile:x,addMessageFeedback:E,allowFileUpload:r,restartConversation:p,...s,participants:m,error:g,clientId:e,soundOn:y,toggleSound:b,disableSendButton:w})};function Rt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Vp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qp(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Vp(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():Vp(e[i],null)}}}}function Jt(...e){return A.useCallback(qp(...e),e)}var fs=A.forwardRef((e,t)=>{const{children:n,...r}=e,i=A.Children.toArray(n),o=i.find(ZA);if(o){const a=o.props.children,s=i.map(l=>l===o?A.Children.count(a)>1?A.Children.only(null):A.isValidElement(a)?a.props.children:null:l);return S.jsx(ds,{...r,ref:t,children:A.isValidElement(a)?A.cloneElement(a,void 0,s):null})}return S.jsx(ds,{...r,ref:t,children:n})});fs.displayName="Slot";var ds=A.forwardRef((e,t)=>{const{children:n,...r}=e;if(A.isValidElement(n)){const i=eI(n);return A.cloneElement(n,{...XA(r,n.props),ref:t?qp(t,i):i})}return A.Children.count(n)>1?A.Children.only(null):null});ds.displayName="SlotClone";var JA=({children:e})=>S.jsx(S.Fragment,{children:e});function ZA(e){return A.isValidElement(e)&&e.type===JA}function XA(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function eI(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Bt=tI.reduce((e,t)=>{const n=A.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?fs:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(s,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function nI(e,t){e&&Ts.flushSync(()=>e.dispatchEvent(t))}function rI(e,t=globalThis==null?void 0:globalThis.document){const n=Gt(e);A.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var iI="DismissableLayer",ps="dismissableLayer.update",oI="dismissableLayer.pointerDownOutside",aI="dismissableLayer.focusOutside",Kp,Yp=A.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gp=A.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=e,c=A.useContext(Yp),[f,u]=A.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=A.useState({}),m=Jt(t,T=>u(T)),h=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=h.indexOf(g),b=f?h.indexOf(f):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,C=b>=y,x=cI(T=>{const _=T.target,$=[...c.branches].some(I=>I.contains(_));!C||$||(i==null||i(T),a==null||a(T),T.defaultPrevented||s==null||s())},p),E=uI(T=>{const _=T.target;[...c.branches].some(I=>I.contains(_))||(o==null||o(T),a==null||a(T),T.defaultPrevented||s==null||s())},p);return rI(T=>{b===c.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},p),A.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Kp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),Qp(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Kp)}},[f,p,n,c]),A.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),Qp())},[f,c]),A.useEffect(()=>{const T=()=>d({});return document.addEventListener(ps,T),()=>document.removeEventListener(ps,T)},[]),S.jsx(Bt.div,{...l,ref:m,style:{pointerEvents:w?C?"auto":"none":void 0,...e.style},onFocusCapture:Rt(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Rt(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Rt(e.onPointerDownCapture,x.onPointerDownCapture)})});Gp.displayName=iI;var sI="DismissableLayerBranch",lI=A.forwardRef((e,t)=>{const n=A.useContext(Yp),r=A.useRef(null),i=Jt(t,r);return A.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),S.jsx(Bt.div,{...e,ref:i})});lI.displayName=sI;function cI(e,t=globalThis==null?void 0:globalThis.document){const n=Gt(e),r=A.useRef(!1),i=A.useRef(()=>{});return A.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){Jp(oI,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function uI(e,t=globalThis==null?void 0:globalThis.document){const n=Gt(e),r=A.useRef(!1);return A.useEffect(()=>{const i=o=>{o.target&&!r.current&&Jp(aI,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Qp(){const e=new CustomEvent(ps);document.dispatchEvent(e)}function Jp(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?nI(i,o):i.dispatchEvent(o)}var hs="focusScope.autoFocusOnMount",ms="focusScope.autoFocusOnUnmount",Zp={bubbles:!1,cancelable:!0},fI="FocusScope",Xp=A.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=A.useState(null),c=Gt(i),f=Gt(o),u=A.useRef(null),p=Jt(t,h=>l(h)),d=A.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;A.useEffect(()=>{if(r){let h=function(w){if(d.paused||!s)return;const C=w.target;s.contains(C)?u.current=C:$t(u.current,{select:!0})},g=function(w){if(d.paused||!s)return;const C=w.relatedTarget;C!==null&&(s.contains(C)||$t(u.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const x of w)x.removedNodes.length>0&&$t(s)};document.addEventListener("focusin",h),document.addEventListener("focusout",g);const b=new MutationObserver(y);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",g),b.disconnect()}}},[r,s,d.paused]),A.useEffect(()=>{if(s){nh.add(d);const h=document.activeElement;if(!s.contains(h)){const y=new CustomEvent(hs,Zp);s.addEventListener(hs,c),s.dispatchEvent(y),y.defaultPrevented||(dI(yI(eh(s)),{select:!0}),document.activeElement===h&&$t(s))}return()=>{s.removeEventListener(hs,c),setTimeout(()=>{const y=new CustomEvent(ms,Zp);s.addEventListener(ms,f),s.dispatchEvent(y),y.defaultPrevented||$t(h??document.body,{select:!0}),s.removeEventListener(ms,f),nh.remove(d)},0)}}},[s,c,f,d]);const m=A.useCallback(h=>{if(!n&&!r||d.paused)return;const g=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,y=document.activeElement;if(g&&y){const b=h.currentTarget,[w,C]=pI(b);w&&C?!h.shiftKey&&y===C?(h.preventDefault(),n&&$t(w,{select:!0})):h.shiftKey&&y===w&&(h.preventDefault(),n&&$t(C,{select:!0})):y===b&&h.preventDefault()}},[n,r,d.paused]);return S.jsx(Bt.div,{tabIndex:-1,...a,ref:p,onKeyDown:m})});Xp.displayName=fI;function dI(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if($t(r,{select:t}),document.activeElement!==n)return}function pI(e){const t=eh(e),n=th(t,e),r=th(t.reverse(),e);return[n,r]}function eh(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function th(e,t){for(const n of e)if(!hI(n,{upTo:t}))return n}function hI(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function mI(e){return e instanceof HTMLInputElement&&"select"in e}function $t(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&mI(e)&&t&&e.select()}}var nh=gI();function gI(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=rh(e,t),e.unshift(t)},remove(t){var n;e=rh(e,t),(n=e[0])==null||n.resume()}}}function rh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function yI(e){return e.filter(t=>t.tagName!=="A")}function bI(e,t){return A.useReducer((n,r)=>t[n][r]??n,e)}var gs=e=>{const{present:t,children:n}=e,r=vI(t),i=typeof n=="function"?n({present:r.isPresent}):A.Children.only(n),o=Jt(r.ref,wI(i));return typeof n=="function"||r.isPresent?A.cloneElement(i,{ref:o}):null};gs.displayName="Presence";function vI(e){const[t,n]=A.useState(),r=A.useRef({}),i=A.useRef(e),o=A.useRef("none"),a=e?"mounted":"unmounted",[s,l]=bI(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return A.useEffect(()=>{const c=Ai(r.current);o.current=s==="mounted"?c:"none"},[s]),vn(()=>{const c=r.current,f=i.current;if(f!==e){const p=o.current,d=Ai(c);e?l("MOUNT"):d==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(f&&p!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),vn(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,u=d=>{const h=Ai(r.current).includes(d.animationName);if(d.target===t&&h&&(l("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},p=d=>{d.target===t&&(o.current=Ai(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:A.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Ai(e){return(e==null?void 0:e.animationName)||"none"}function wI(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ys=0;function xI(){A.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ih()),document.body.insertAdjacentElement("beforeend",e[1]??ih()),ys++,()=>{ys===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ys--}},[])}function ih(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ii="right-scroll-bar-position",Ti="width-before-scroll-bar",kI="with-scroll-bars-hidden",SI="--removed-body-scroll-bar-size";function bs(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function EI(e,t){var n=O.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var CI=typeof window<"u"?A.useLayoutEffect:A.useEffect,oh=new WeakMap;function AI(e,t){var n=EI(null,function(r){return e.forEach(function(i){return bs(i,r)})});return CI(function(){var r=oh.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(s){o.has(s)||bs(s,null)}),o.forEach(function(s){i.has(s)||bs(s,a)})}oh.set(n,e)},[e]),n}function II(e){return e}function TI(e,t){t===void 0&&(t=II);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var f=a;a=[],f.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(f){a.push(f),c()},filter:function(f){return a=a.filter(f),n}}}};return i}function OI(e){e===void 0&&(e={});var t=TI(null);return t.options=ot({async:!0,ssr:!1},e),t}var ah=function(e){var t=e.sideCar,n=Xu(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return A.createElement(r,ot({},n))};ah.isSideCarExport=!0;function DI(e,t){return e.useMedium(t),ah}var sh=OI(),vs=function(){},Oi=A.forwardRef(function(e,t){var n=A.useRef(null),r=A.useState({onScrollCapture:vs,onWheelCapture:vs,onTouchMoveCapture:vs}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,f=e.enabled,u=e.shards,p=e.sideCar,d=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,w=e.gapMode,C=Xu(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=p,E=AI([n,t]),T=ot(ot({},C),i);return A.createElement(A.Fragment,null,f&&A.createElement(x,{sideCar:sh,removeScrollBar:c,shards:u,noRelative:d,noIsolation:m,inert:h,setCallbacks:o,allowPinchZoom:!!g,lockRef:n,gapMode:w}),a?A.cloneElement(A.Children.only(s),ot(ot({},T),{ref:E})):A.createElement(b,ot({},T,{className:l,ref:E}),s))});Oi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Oi.classNames={fullWidth:Ti,zeroRight:Ii};var MI=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function PI(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=MI();return t&&e.setAttribute("nonce",t),e}function NI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function _I(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var LI=function(){var e=0,t=null;return{add:function(n){e==0&&(t=PI())&&(NI(t,n),_I(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},FI=function(){var e=LI();return function(t,n){A.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},lh=function(){var e=FI(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},RI={left:0,top:0,right:0,gap:0},ws=function(e){return parseInt(e||"",10)||0},BI=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[ws(n),ws(r),ws(i)]},$I=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return RI;var t=BI(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},zI=lh(),Cn="data-scroll-locked",jI=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
302
+ .`.concat(kI,` {
297
303
  overflow: hidden `).concat(r,`;
298
304
  padding-right: `).concat(s,"px ").concat(r,`;
299
305
  }
@@ -327,13 +333,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
327
333
  }
328
334
 
329
335
  body[`).concat(Cn,`] {
330
- `).concat(kI,": ").concat(s,`px;
336
+ `).concat(SI,": ").concat(s,`px;
331
337
  }
332
- `)},fh=function(){var e=parseInt(document.body.getAttribute(Cn)||"0",10);return isFinite(e)?e:0},jI=function(){A.useEffect(function(){return document.body.setAttribute(Cn,(fh()+1).toString()),function(){var e=fh()-1;e<=0?document.body.removeAttribute(Cn):document.body.setAttribute(Cn,e.toString())}},[])},UI=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;jI();var o=A.useMemo(function(){return BI(i)},[i]);return A.createElement($I,{styles:zI(o,!t,i,n?"":"!important")})},ws=!1;if(typeof window<"u")try{var Di=Object.defineProperty({},"passive",{get:function(){return ws=!0,!0}});window.addEventListener("test",Di,Di),window.removeEventListener("test",Di,Di)}catch{ws=!1}var An=ws?{passive:!1}:!1,HI=function(e){return e.tagName==="TEXTAREA"},dh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!HI(e)&&n[t]==="visible")},WI=function(e){return dh(e,"overflowY")},VI=function(e){return dh(e,"overflowX")},ph=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=hh(e,r);if(i){var o=mh(e,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},qI=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},KI=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},hh=function(e,t){return e==="v"?WI(t):VI(t)},mh=function(e,t){return e==="v"?qI(t):KI(t)},YI=function(e,t){return e==="h"&&t==="rtl"?-1:1},GI=function(e,t,n,r,i){var o=YI(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),c=!1,f=a>0,u=0,p=0;do{if(!s)break;var d=mh(e,s),m=d[0],h=d[1],g=d[2],y=h-g-o*m;(m||y)&&hh(e,s)&&(u+=y,p+=m);var b=s.parentNode;s=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(f&&Math.abs(u)<1||!f&&Math.abs(p)<1)&&(c=!0),c},Mi=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gh=function(e){return[e.deltaX,e.deltaY]},yh=function(e){return e&&"current"in e?e.current:e},QI=function(e,t){return e[0]===t[0]&&e[1]===t[1]},JI=function(e){return`
338
+ `)},ch=function(){var e=parseInt(document.body.getAttribute(Cn)||"0",10);return isFinite(e)?e:0},UI=function(){A.useEffect(function(){return document.body.setAttribute(Cn,(ch()+1).toString()),function(){var e=ch()-1;e<=0?document.body.removeAttribute(Cn):document.body.setAttribute(Cn,e.toString())}},[])},HI=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;UI();var o=A.useMemo(function(){return $I(i)},[i]);return A.createElement(zI,{styles:jI(o,!t,i,n?"":"!important")})},xs=!1;if(typeof window<"u")try{var Di=Object.defineProperty({},"passive",{get:function(){return xs=!0,!0}});window.addEventListener("test",Di,Di),window.removeEventListener("test",Di,Di)}catch{xs=!1}var An=xs?{passive:!1}:!1,WI=function(e){return e.tagName==="TEXTAREA"},uh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!WI(e)&&n[t]==="visible")},VI=function(e){return uh(e,"overflowY")},qI=function(e){return uh(e,"overflowX")},fh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=dh(e,r);if(i){var o=ph(e,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},KI=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},YI=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},dh=function(e,t){return e==="v"?VI(t):qI(t)},ph=function(e,t){return e==="v"?KI(t):YI(t)},GI=function(e,t){return e==="h"&&t==="rtl"?-1:1},QI=function(e,t,n,r,i){var o=GI(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),c=!1,f=a>0,u=0,p=0;do{if(!s)break;var d=ph(e,s),m=d[0],h=d[1],g=d[2],y=h-g-o*m;(m||y)&&dh(e,s)&&(u+=y,p+=m);var b=s.parentNode;s=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(f&&Math.abs(u)<1||!f&&Math.abs(p)<1)&&(c=!0),c},Mi=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},hh=function(e){return[e.deltaX,e.deltaY]},mh=function(e){return e&&"current"in e?e.current:e},JI=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ZI=function(e){return`
333
339
  .block-interactivity-`.concat(e,` {pointer-events: none;}
334
340
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
335
- `)},ZI=0,In=[];function XI(e){var t=A.useRef([]),n=A.useRef([0,0]),r=A.useRef(),i=A.useState(ZI++)[0],o=A.useState(uh)[0],a=A.useRef(e);A.useEffect(function(){a.current=e},[e]),A.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var h=Qo([e.lockRef.current],(e.shards||[]).map(yh),!0).filter(Boolean);return h.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),h.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=A.useCallback(function(h,g){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var y=Mi(h),b=n.current,w="deltaX"in h?h.deltaX:b[0]-y[0],E="deltaY"in h?h.deltaY:b[1]-y[1],x,C=h.target,T=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in h&&T==="h"&&C.type==="range")return!1;var N=ph(T,C);if(!N)return!0;if(N?x=T:(x=T==="v"?"h":"v",N=ph(T,C)),!N)return!1;if(!r.current&&"changedTouches"in h&&(w||E)&&(r.current=x),!x)return!0;var $=r.current||x;return GI($,g,h,$==="h"?w:E)},[]),l=A.useCallback(function(h){var g=h;if(!(!In.length||In[In.length-1]!==o)){var y="deltaY"in g?gh(g):Mi(g),b=t.current.filter(function(x){return x.name===g.type&&(x.target===g.target||g.target===x.shadowParent)&&QI(x.delta,y)})[0];if(b&&b.should){g.cancelable&&g.preventDefault();return}if(!b){var w=(a.current.shards||[]).map(yh).filter(Boolean).filter(function(x){return x.contains(g.target)}),E=w.length>0?s(g,w[0]):!a.current.noIsolation;E&&g.cancelable&&g.preventDefault()}}},[]),c=A.useCallback(function(h,g,y,b){var w={name:h,delta:g,target:y,should:b,shadowParent:eT(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(E){return E!==w})},1)},[]),f=A.useCallback(function(h){n.current=Mi(h),r.current=void 0},[]),u=A.useCallback(function(h){c(h.type,gh(h),h.target,s(h,e.lockRef.current))},[]),p=A.useCallback(function(h){c(h.type,Mi(h),h.target,s(h,e.lockRef.current))},[]);A.useEffect(function(){return In.push(o),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",l,An),document.addEventListener("touchmove",l,An),document.addEventListener("touchstart",f,An),function(){In=In.filter(function(h){return h!==o}),document.removeEventListener("wheel",l,An),document.removeEventListener("touchmove",l,An),document.removeEventListener("touchstart",f,An)}},[]);var d=e.removeScrollBar,m=e.inert;return A.createElement(A.Fragment,null,m?A.createElement(o,{styles:JI(i)}):null,d?A.createElement(UI,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function eT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const tT=OI(ch,XI);var bh=A.forwardRef(function(e,t){return A.createElement(Oi,it({},e,{ref:t,sideCar:tT}))});bh.classNames=Oi.classNames;var nT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Tn=new WeakMap,Pi=new WeakMap,Ni={},xs=0,vh=function(e){return e&&(e.host||vh(e.parentNode))},rT=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=vh(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},iT=function(e,t,n,r){var i=rT(t,Array.isArray(e)?e:[e]);Ni[n]||(Ni[n]=new WeakMap);var o=Ni[n],a=[],s=new Set,l=new Set(i),c=function(u){!u||s.has(u)||(s.add(u),c(u.parentNode))};i.forEach(c);var f=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(p){if(s.has(p))f(p);else try{var d=p.getAttribute(r),m=d!==null&&d!=="false",h=(Tn.get(p)||0)+1,g=(o.get(p)||0)+1;Tn.set(p,h),o.set(p,g),a.push(p),h===1&&m&&Pi.set(p,!0),g===1&&p.setAttribute(n,"true"),m||p.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return f(t),s.clear(),xs++,function(){a.forEach(function(u){var p=Tn.get(u)-1,d=o.get(u)-1;Tn.set(u,p),o.set(u,d),p||(Pi.has(u)||u.removeAttribute(r),Pi.delete(u)),d||u.removeAttribute(n)}),xs--,xs||(Tn=new WeakMap,Tn=new WeakMap,Pi=new WeakMap,Ni={})}},oT=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=nT(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),iT(r,i,n,"aria-hidden")):function(){return null}},ks="Dialog",[wh]=cp(ks),[aT,bt]=wh(ks),xh=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=A.useRef(null),l=A.useRef(null),[c=!1,f]=up({prop:r,defaultProp:i,onChange:o});return S.jsx(aT,{scope:t,triggerRef:s,contentRef:l,contentId:vi(),titleId:vi(),descriptionId:vi(),open:c,onOpenChange:f,onOpenToggle:A.useCallback(()=>f(u=>!u),[f]),modal:a,children:n})};xh.displayName=ks;var kh="DialogTrigger",Sh=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bt(kh,n),o=Jt(t,i.triggerRef);return S.jsx(Bt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Es(i.open),...r,ref:o,onClick:Rt(e.onClick,i.onOpenToggle)})});Sh.displayName=kh;var sT="DialogPortal",[SO,Eh]=wh(sT,{forceMount:void 0}),_i="DialogOverlay",lT=A.forwardRef((e,t)=>{const n=Eh(_i,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=bt(_i,e.__scopeDialog);return o.modal?S.jsx(ms,{present:r||o.open,children:S.jsx(cT,{...i,ref:t})}):null});lT.displayName=_i;var cT=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bt(_i,n);return S.jsx(bh,{as:us,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(Bt.div,{"data-state":Es(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Zt="DialogContent",Ch=A.forwardRef((e,t)=>{const n=Eh(Zt,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=bt(Zt,e.__scopeDialog);return S.jsx(ms,{present:r||o.open,children:o.modal?S.jsx(uT,{...i,ref:t}):S.jsx(fT,{...i,ref:t})})});Ch.displayName=Zt;var uT=A.forwardRef((e,t)=>{const n=bt(Zt,e.__scopeDialog),r=A.useRef(null),i=Jt(t,n.contentRef,r);return A.useEffect(()=>{const o=r.current;if(o)return oT(o)},[]),S.jsx(Ah,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Rt(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Rt(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Rt(e.onFocusOutside,o=>o.preventDefault())})}),fT=A.forwardRef((e,t)=>{const n=bt(Zt,e.__scopeDialog),r=A.useRef(!1),i=A.useRef(!1);return S.jsx(Ah,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Ah=A.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=bt(Zt,n),l=A.useRef(null),c=Jt(t,l);return wI(),S.jsxs(S.Fragment,{children:[S.jsx(th,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(Jp,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Es(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),S.jsxs(S.Fragment,{children:[S.jsx(dT,{titleId:s.titleId}),S.jsx(hT,{contentRef:l,descriptionId:s.descriptionId})]})]})}),Ss="DialogTitle",Ih=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bt(Ss,n);return S.jsx(Bt.h2,{id:i.titleId,...r,ref:t})});Ih.displayName=Ss;var Th="DialogDescription",Oh=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bt(Th,n);return S.jsx(Bt.p,{id:i.descriptionId,...r,ref:t})});Oh.displayName=Th;var Dh="DialogClose",Mh=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bt(Dh,n);return S.jsx(Bt.button,{type:"button",...r,ref:t,onClick:Rt(e.onClick,()=>i.onOpenChange(!1))})});Mh.displayName=Dh;function Es(e){return e?"open":"closed"}var Ph="DialogTitleWarning",[EO,Nh]=xC(Ph,{contentName:Zt,titleName:Ss,docsSlug:"dialog"}),dT=({titleId:e})=>{const t=Nh(Ph),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
341
+ `)},XI=0,In=[];function eT(e){var t=A.useRef([]),n=A.useRef([0,0]),r=A.useRef(),i=A.useState(XI++)[0],o=A.useState(lh)[0],a=A.useRef(e);A.useEffect(function(){a.current=e},[e]),A.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var h=Qo([e.lockRef.current],(e.shards||[]).map(mh),!0).filter(Boolean);return h.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),h.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=A.useCallback(function(h,g){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var y=Mi(h),b=n.current,w="deltaX"in h?h.deltaX:b[0]-y[0],C="deltaY"in h?h.deltaY:b[1]-y[1],x,E=h.target,T=Math.abs(w)>Math.abs(C)?"h":"v";if("touches"in h&&T==="h"&&E.type==="range")return!1;var _=fh(T,E);if(!_)return!0;if(_?x=T:(x=T==="v"?"h":"v",_=fh(T,E)),!_)return!1;if(!r.current&&"changedTouches"in h&&(w||C)&&(r.current=x),!x)return!0;var $=r.current||x;return QI($,g,h,$==="h"?w:C)},[]),l=A.useCallback(function(h){var g=h;if(!(!In.length||In[In.length-1]!==o)){var y="deltaY"in g?hh(g):Mi(g),b=t.current.filter(function(x){return x.name===g.type&&(x.target===g.target||g.target===x.shadowParent)&&JI(x.delta,y)})[0];if(b&&b.should){g.cancelable&&g.preventDefault();return}if(!b){var w=(a.current.shards||[]).map(mh).filter(Boolean).filter(function(x){return x.contains(g.target)}),C=w.length>0?s(g,w[0]):!a.current.noIsolation;C&&g.cancelable&&g.preventDefault()}}},[]),c=A.useCallback(function(h,g,y,b){var w={name:h,delta:g,target:y,should:b,shadowParent:tT(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(C){return C!==w})},1)},[]),f=A.useCallback(function(h){n.current=Mi(h),r.current=void 0},[]),u=A.useCallback(function(h){c(h.type,hh(h),h.target,s(h,e.lockRef.current))},[]),p=A.useCallback(function(h){c(h.type,Mi(h),h.target,s(h,e.lockRef.current))},[]);A.useEffect(function(){return In.push(o),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",l,An),document.addEventListener("touchmove",l,An),document.addEventListener("touchstart",f,An),function(){In=In.filter(function(h){return h!==o}),document.removeEventListener("wheel",l,An),document.removeEventListener("touchmove",l,An),document.removeEventListener("touchstart",f,An)}},[]);var d=e.removeScrollBar,m=e.inert;return A.createElement(A.Fragment,null,m?A.createElement(o,{styles:ZI(i)}):null,d?A.createElement(HI,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function tT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const nT=DI(sh,eT);var gh=A.forwardRef(function(e,t){return A.createElement(Oi,ot({},e,{ref:t,sideCar:nT}))});gh.classNames=Oi.classNames;var rT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Tn=new WeakMap,Pi=new WeakMap,Ni={},ks=0,yh=function(e){return e&&(e.host||yh(e.parentNode))},iT=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=yh(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},oT=function(e,t,n,r){var i=iT(t,Array.isArray(e)?e:[e]);Ni[n]||(Ni[n]=new WeakMap);var o=Ni[n],a=[],s=new Set,l=new Set(i),c=function(u){!u||s.has(u)||(s.add(u),c(u.parentNode))};i.forEach(c);var f=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(p){if(s.has(p))f(p);else try{var d=p.getAttribute(r),m=d!==null&&d!=="false",h=(Tn.get(p)||0)+1,g=(o.get(p)||0)+1;Tn.set(p,h),o.set(p,g),a.push(p),h===1&&m&&Pi.set(p,!0),g===1&&p.setAttribute(n,"true"),m||p.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return f(t),s.clear(),ks++,function(){a.forEach(function(u){var p=Tn.get(u)-1,d=o.get(u)-1;Tn.set(u,p),o.set(u,d),p||(Pi.has(u)||u.removeAttribute(r),Pi.delete(u)),d||u.removeAttribute(n)}),ks--,ks||(Tn=new WeakMap,Tn=new WeakMap,Pi=new WeakMap,Ni={})}},aT=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=rT(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),oT(r,i,n,"aria-hidden")):function(){return null}},Ss="Dialog",[bh]=sp(Ss),[sT,bt]=bh(Ss),vh=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=A.useRef(null),l=A.useRef(null),[c=!1,f]=lp({prop:r,defaultProp:i,onChange:o});return S.jsx(sT,{scope:t,triggerRef:s,contentRef:l,contentId:vi(),titleId:vi(),descriptionId:vi(),open:c,onOpenChange:f,onOpenToggle:A.useCallback(()=>f(u=>!u),[f]),modal:a,children:n})};vh.displayName=Ss;var wh="DialogTrigger",xh=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bt(wh,n),o=Jt(t,i.triggerRef);return S.jsx(Bt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Cs(i.open),...r,ref:o,onClick:Rt(e.onClick,i.onOpenToggle)})});xh.displayName=wh;var lT="DialogPortal",[CO,kh]=bh(lT,{forceMount:void 0}),_i="DialogOverlay",cT=A.forwardRef((e,t)=>{const n=kh(_i,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=bt(_i,e.__scopeDialog);return o.modal?S.jsx(gs,{present:r||o.open,children:S.jsx(uT,{...i,ref:t})}):null});cT.displayName=_i;var uT=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bt(_i,n);return S.jsx(gh,{as:fs,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(Bt.div,{"data-state":Cs(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Zt="DialogContent",Sh=A.forwardRef((e,t)=>{const n=kh(Zt,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=bt(Zt,e.__scopeDialog);return S.jsx(gs,{present:r||o.open,children:o.modal?S.jsx(fT,{...i,ref:t}):S.jsx(dT,{...i,ref:t})})});Sh.displayName=Zt;var fT=A.forwardRef((e,t)=>{const n=bt(Zt,e.__scopeDialog),r=A.useRef(null),i=Jt(t,n.contentRef,r);return A.useEffect(()=>{const o=r.current;if(o)return aT(o)},[]),S.jsx(Eh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Rt(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Rt(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Rt(e.onFocusOutside,o=>o.preventDefault())})}),dT=A.forwardRef((e,t)=>{const n=bt(Zt,e.__scopeDialog),r=A.useRef(!1),i=A.useRef(!1);return S.jsx(Eh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Eh=A.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=bt(Zt,n),l=A.useRef(null),c=Jt(t,l);return xI(),S.jsxs(S.Fragment,{children:[S.jsx(Xp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(Gp,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Cs(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),S.jsxs(S.Fragment,{children:[S.jsx(pT,{titleId:s.titleId}),S.jsx(mT,{contentRef:l,descriptionId:s.descriptionId})]})]})}),Es="DialogTitle",Ch=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bt(Es,n);return S.jsx(Bt.h2,{id:i.titleId,...r,ref:t})});Ch.displayName=Es;var Ah="DialogDescription",Ih=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bt(Ah,n);return S.jsx(Bt.p,{id:i.descriptionId,...r,ref:t})});Ih.displayName=Ah;var Th="DialogClose",Oh=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bt(Th,n);return S.jsx(Bt.button,{type:"button",...r,ref:t,onClick:Rt(e.onClick,()=>i.onOpenChange(!1))})});Oh.displayName=Th;function Cs(e){return e?"open":"closed"}var Dh="DialogTitleWarning",[AO,Mh]=SC(Dh,{contentName:Zt,titleName:Es,docsSlug:"dialog"}),pT=({titleId:e})=>{const t=Mh(Dh),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
336
342
 
337
343
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
338
344
 
339
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return A.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},pT="DialogDescriptionWarning",hT=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Nh(pT).contentName}}.`;return A.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},mT=xh,gT=Sh,yT=Ch,bT=Ih,vT=Oh,wT=Mh;function On({open:e,onOpenChange:t,children:n}){const{modal:r}=ge;return S.jsxs(mT,{open:e,modal:!1,onOpenChange:t,children:[e&&S.jsx("div",{...r==null?void 0:r.overlay}),n]})}function xT({title:e,description:t,onConfirm:n,onCancel:r,confirmButtonText:i,cancelButtonText:o,children:a}){const{modal:s}=ge;return S.jsx(S.Fragment,{children:S.jsxs(yT,{...s.dialog.container,children:[S.jsx(bT,{...s.dialog.title,children:e}),S.jsx(vT,{...s.dialog.description,children:t}),S.jsx("div",{...s.dialog.content.container,children:a}),S.jsxs("div",{...s.dialog.button.container,children:[i&&S.jsx("button",{...s.dialog.button.confirm,type:"button",onClick:n,children:i}),o&&S.jsx("button",{...s.dialog.button.cancel,type:"button",onClick:r,children:o})]})]})})}On.Button=gT,On.Close=wT,On.Content=xT;const _h=O.forwardRef(({children:e,onClick:t,avatarUrl:n,botName:r,description:i,onClose:o,...a},s)=>{const{messagePreview:l}=ge,{container:c,closeButton:f,message:u,avatar:p,description:d}=l??{};return S.jsxs("div",{...a,...c,ref:s,onClick:t,children:[S.jsx(Fn,{src:n,...p,children:r||"Bot"}),S.jsx("p",{...u,children:e}),S.jsx("p",{...d,children:i}),S.jsx(Tu,{...f,onClick:m=>{m.stopPropagation(),o==null||o()}})]})});_h.displayName="MessagePreview",ie.Avatar=Fn,ie.BOT_IS_BLOCKED=Ws,ie.Block=Kt,ie.CONFIG_ACCESS_DENIED=im,ie.Chat=Ip,ie.Composer=Id,ie.Container=za,ie.ErrorState=Ap,ie.Fab=lp,ie.Header=wp,ie.INVALID_API_URL=js,ie.INVALID_BOTPRESS_URL=Hs,ie.INVALID_CLIENT_ID=Us,ie.INVALID_CONFIGURATION=rm,ie.INVALID_CONFIG_URL=nm,ie.INVALID_MESSAGE_CONTENT_TYPE=Ks,ie.MISSING_API_URL=Xh,ie.MISSING_BOT_ID=em,ie.MISSING_CLIENT_ID=zs,ie.MISSING_CONFIG_URL=tm,ie.Message=Ga,ie.MessageContext=Ko,ie.MessageList=Za,ie.MessagePreview=_h,ie.Modal=On,ie.ModalContext=Yo,ie.ModalProvider=ap,ie.NETWORK_ERROR=Nn,ie.NOT_A_PARTICIPANT=$i,ie.QUOTA_EXCEEDED=Vs,ie.RestartConversationButton=Ka,ie.SOUND_EFFECTS=Tp,ie.SSE_DISCONNECTED_ERROR=qs,ie.StylesheetProvider=sp,ie.TypingIndicator=Ya,ie.Webchat=GA,ie.commonApiErrorMap=ji,ie.enrichMessage=il,ie.fileTypes=Bs,ie.generateThemeOverride=yl,ie.generateThemeStylesheet=gl,ie.getUseChatSoundStore=Ju,ie.getUseWebchatClientStore=Gu,ie.integrationMessagePayloadToBlockPayload=zu,ie.integrationMessageToBlockMessage=Gn,ie.isCommonApiErrorType=Gs,ie.isEventError=Js,ie.isFileType=$s,ie.isIntegrationError=Qs,ie.isWebhookHandlerErrorType=Ys,ie.mapToWebchatError=br,ie.renderers=bd,ie.retryWithBackoff=Zs,ie.useMessageContext=Zu,ie.useModalContext=Go,ie.useWebchat=qp,ie.useWebchatStore=sn,ie.webchatClasses=ge,ie.webhookHandlerErrorMap=zi,Object.defineProperty(ie,Symbol.toStringTag,{value:"Module"})});
345
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return A.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},hT="DialogDescriptionWarning",mT=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Mh(hT).contentName}}.`;return A.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},gT=vh,yT=xh,bT=Sh,vT=Ch,wT=Ih,xT=Oh;function On({open:e,onOpenChange:t,children:n}){const{modal:r}=ge;return S.jsxs(gT,{open:e,modal:!1,onOpenChange:t,children:[e&&S.jsx("div",{...r==null?void 0:r.overlay}),n]})}function kT({title:e,description:t,onConfirm:n,onCancel:r,confirmButtonText:i,cancelButtonText:o,children:a}){const{modal:s}=ge;return S.jsx(S.Fragment,{children:S.jsxs(bT,{...s.dialog.container,children:[S.jsx(vT,{...s.dialog.title,children:e}),S.jsx(wT,{...s.dialog.description,children:t}),S.jsx("div",{...s.dialog.content.container,children:a}),S.jsxs("div",{...s.dialog.button.container,children:[i&&S.jsx("button",{...s.dialog.button.confirm,type:"button",onClick:n,children:i}),o&&S.jsx("button",{...s.dialog.button.cancel,type:"button",onClick:r,children:o})]})]})})}On.Button=yT,On.Close=xT,On.Content=kT;const Ph=O.forwardRef(({children:e,onClick:t,avatarUrl:n,botName:r,description:i,onClose:o,...a},s)=>{const{messagePreview:l}=ge,{container:c,closeButton:f,message:u,avatar:p,description:d}=l??{};return S.jsxs("div",{...a,...c,ref:s,onClick:t,children:[S.jsx(Fn,{src:n,...p,children:r||"Bot"}),S.jsx("p",{...u,children:e}),S.jsx("p",{...d,children:i}),S.jsx(Au,{...f,onClick:m=>{m.stopPropagation(),o==null||o()}})]})});Ph.displayName="MessagePreview",ne.Avatar=Fn,ne.BOT_IS_BLOCKED=ol,ne.Block=Kt,ne.CONFIG_ACCESS_DENIED=Pm,ne.Chat=Ep,ne.Composer=Cd,ne.Container=za,ne.ErrorState=Sp,ne.Fab=ap,ne.Header=bp,ne.INVALID_API_URL=nl,ne.INVALID_BOTPRESS_URL=il,ne.INVALID_CLIENT_ID=rl,ne.INVALID_CONFIGURATION=Mm,ne.INVALID_CONFIG_URL=Dm,ne.INVALID_MESSAGE_CONTENT_TYPE=ll,ne.MISSING_API_URL=Im,ne.MISSING_BOT_ID=Tm,ne.MISSING_CLIENT_ID=tl,ne.MISSING_CONFIG_URL=Om,ne.Message=Ga,ne.MessageContext=Ko,ne.MessageList=Xa,ne.MessagePreview=Ph,ne.Modal=On,ne.ModalContext=Yo,ne.ModalProvider=ip,ne.NETWORK_ERROR=Ln,ne.NOT_A_PARTICIPANT=zi,ne.QUOTA_EXCEEDED=al,ne.RestartConversationButton=Ka,ne.SOUND_EFFECTS=Hp,ne.SSE_DISCONNECTED_ERROR=sl,ne.StylesheetProvider=op,ne.TypingIndicator=Ya,ne.Webchat=QA,ne.commonApiErrorMap=Ui,ne.enrichMessage=$s,ne.fileTypes=Xs,ne.generateThemeOverride=Zs,ne.generateThemeStylesheet=Js,ne.getUseChatSoundStore=Gu,ne.getUseWebchatClientStore=Ku,ne.integrationMessagePayloadToBlockPayload=Bu,ne.integrationMessageToBlockMessage=Gn,ne.isCommonApiErrorType=ul,ne.isEventError=dl,ne.isFileType=el,ne.isIntegrationError=fl,ne.isWebhookHandlerErrorType=cl,ne.mapToWebchatError=wr,ne.renderers=gd,ne.retryWithBackoff=pl,ne.useMessageContext=Qu,ne.useModalContext=Go,ne.useWebchat=Wp,ne.useWebchatStore=sn,ne.webchatClasses=ge,ne.webhookHandlerErrorMap=ji,Object.defineProperty(ne,Symbol.toStringTag,{value:"Module"})});