@botpress/webchat 4.0.4 → 4.2.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,242 @@
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=`
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:`
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:`
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:`
20
- `});++r<e.length;)r&&n.push({type:"text",value:`
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:`
28
- `,encode:["`"],...s.current()})),u()}return f+=s.move(`
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:`
32
- `,after:`
33
- `});return u(),f(),p+`
34
- `+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
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:`
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"}}};/**
39
- * @license lucide-react v0.525.0 - ISC
1
+ (function(re,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):(re=typeof globalThis<"u"?globalThis:re||self,S(re.Webchat={},re.ReactJsxRuntime,re.React,re.ReactDOM))})(this,function(re,S,F,Ns){"use strict";var FT=Object.defineProperty;var RT=(re,S,F)=>S in re?FT(re,S,{enumerable:!0,configurable:!0,writable:!0,value:F}):re[S]=F;var $i=(re,S,F)=>RT(re,typeof S!="symbol"?S+"":S,F);var Rh,Bh,zh;var ji=typeof document<"u"?document.currentScript:null;function Ls(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 E=Ls(F),Fs=Ls(Ns);function Vh(e,t=[]){let n=[];function r(o,a){const s=E.createContext(a);s.displayName=o+"Context";const l=n.length;n=[...n,a];const u=c=>{var g;const{scope:p,children:d,...m}=c,h=((g=p==null?void 0:p[e])==null?void 0:g[l])||s,y=E.useMemo(()=>m,Object.values(m));return S.jsx(h.Provider,{value:y,children:d})};u.displayName=o+"Provider";function f(c,p){var h;const d=((h=p==null?void 0:p[e])==null?void 0:h[l])||s,m=E.useContext(d);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(a=>E.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return E.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,qh(i,...t)]}function qh(...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:u})=>{const c=l(o)[`__scope${u}`];return{...s,...c}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Zt(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var Tt=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{};function Rs(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ui(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Rs(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():Rs(e[i],null)}}}}function Ot(...e){return E.useCallback(Ui(...e),e)}var Kh=Symbol.for("react.lazy"),xr=E[" use ".trim().toString()];function Yh(e){return typeof e=="object"&&e!==null&&"then"in e}function Bs(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Kh&&"_payload"in e&&Yh(e._payload)}function Gh(e){const t=Qh(e),n=E.forwardRef((r,i)=>{let{children:o,...a}=r;Bs(o)&&typeof xr=="function"&&(o=xr(o._payload));const s=E.Children.toArray(o),l=s.find(Zh);if(l){const u=l.props.children,f=s.map(c=>c===l?E.Children.count(u)>1?E.Children.only(null):E.isValidElement(u)?u.props.children:null:c);return S.jsx(t,{...a,ref:i,children:E.isValidElement(u)?E.cloneElement(u,void 0,f):null})}return S.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function Qh(e){const t=E.forwardRef((n,r)=>{let{children:i,...o}=n;if(Bs(i)&&typeof xr=="function"&&(i=xr(i._payload)),E.isValidElement(i)){const a=em(i),s=Xh(o,i.props);return i.type!==E.Fragment&&(s.ref=r?Ui(r,a):a),E.cloneElement(i,s)}return E.Children.count(i)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Jh=Symbol("radix.slottable");function Zh(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Jh}function Xh(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)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function em(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 tm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Hi=tm.reduce((e,t)=>{const n=Gh(`Primitive.${t}`),r=E.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),$t=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 Wi={exports:{}},Vi={};/**
2
+ * @license React
3
+ * use-sync-external-store-shim.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var zs;function nm(){if(zs)return Vi;zs=1;var e=F;function t(c,p){return c===p&&(c!==0||1/c===1/p)||c!==c&&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(c,p){var d=p(),m=r({inst:{value:d,getSnapshot:p}}),h=m[0].inst,y=m[1];return o(function(){h.value=d,h.getSnapshot=p,l(h)&&y({inst:h})},[c,d,p]),i(function(){return l(h)&&y({inst:h}),c(function(){l(h)&&y({inst:h})})},[c]),a(d),d}function l(c){var p=c.getSnapshot;c=c.value;try{var d=p();return!n(c,d)}catch{return!0}}function u(c,p){return p()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:s;return Vi.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Vi}var qi={};/**
10
+ * @license React
11
+ * use-sync-external-store-shim.development.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var $s;function rm(){return $s||($s=1,process.env.NODE_ENV!=="production"&&function(){function e(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}function t(d,m){f||i.startTransition===void 0||(f=!0,console.error("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 h=m();if(!c){var y=m();o(h,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}y=a({inst:{value:h,getSnapshot:m}});var g=y[0].inst,v=y[1];return l(function(){g.value=h,g.getSnapshot=m,n(g)&&v({inst:g})},[d,h,m]),s(function(){return n(g)&&v({inst:g}),d(function(){n(g)&&v({inst:g})})},[d]),u(h),h}function n(d){var m=d.getSnapshot;d=d.value;try{var h=m();return!o(d,h)}catch{return!0}}function r(d,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=F,o=typeof Object.is=="function"?Object.is:e,a=i.useState,s=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,f=!1,c=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;qi.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),qi}process.env.NODE_ENV==="production"?Wi.exports=nm():Wi.exports=rm();var im=Wi.exports;function om(){return im.useSyncExternalStore(am,()=>!0,()=>!1)}function am(){return()=>{}}var Ki="Avatar",[sm]=Vh(Ki),[lm,js]=sm(Ki),Yi=E.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=E.useState("idle");return S.jsx(lm,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:S.jsx(Hi.span,{...r,ref:t})})});Yi.displayName=Ki;var Us="AvatarImage",Gi=E.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,a=js(Us,n),s=um(r,o),l=Zt(u=>{i(u),a.onImageLoadingStatusChange(u)});return Tt(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?S.jsx(Hi.img,{...o,ref:t,src:r}):null});Gi.displayName=Us;var Hs="AvatarFallback",Qi=E.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=js(Hs,n),[a,s]=E.useState(r===void 0);return E.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&o.imageLoadingStatus!=="loaded"?S.jsx(Hi.span,{...i,ref:t}):null});Qi.displayName=Hs;function Ws(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function um(e,{referrerPolicy:t,crossOrigin:n}){const r=om(),i=E.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[a,s]=E.useState(()=>Ws(o,e));return Tt(()=>{s(Ws(o,e))},[o,e]),Tt(()=>{const l=c=>()=>{s(c)};if(!o)return;const u=l("loaded"),f=l("error");return o.addEventListener("load",u),o.addEventListener("error",f),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",u),o.removeEventListener("error",f)}},[o,n,t]),a}function Vs(e,t){let n=`${e} {`;for(const[r,i]of Object.entries(t))n+=`${r}: ${i}; `;return n+="}",n}function qs(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 cm=(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 Ks={exports:{}};(function(e,t){(function(n,r){e.exports=r()})($t,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",s="minute",l="hour",u="day",f="week",c="month",p="quarter",d="year",m="date",h="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|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,v={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(N){var D=["th","st","nd","rd"],z=N%100;return"["+N+(D[(z-20)%10]||D[z]||D[0])+"]"}},x=function(N,D,z){var U=String(N);return!U||U.length>=D?N:""+Array(D+1-U.length).join(z)+N},A={s:x,z:function(N){var D=-N.utcOffset(),z=Math.abs(D),U=Math.floor(z/60),$=z%60;return(D<=0?"+":"-")+x(U,2,"0")+":"+x($,2,"0")},m:function N(D,z){if(D.date()<z.date())return-N(z,D);var U=12*(z.year()-D.year())+(z.month()-D.month()),$=D.clone().add(U,c),V=z-$<0,b=D.clone().add(U+(V?-1:1),c);return+(-(U+(z-$)/(V?$-b:b-$))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:c,y:d,w:f,d:u,D:m,h:l,m:s,s:a,ms:o,Q:p}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},k="en",C={};C[k]=v;var T="$isDayjsObject",M=function(N){return N instanceof j||!(!N||!N[T])},R=function N(D,z,U){var $;if(!D)return k;if(typeof D=="string"){var V=D.toLowerCase();C[V]&&($=V),z&&(C[V]=z,$=V);var b=D.split("-");if(!$&&b.length>1)return N(b[0])}else{var P=D.name;C[P]=D,$=P}return!U&&$&&(k=$),$||!U&&k},I=function(N,D){if(M(N))return N.clone();var z=typeof D=="object"?D:{};return z.date=N,z.args=arguments,new j(z)},O=A;O.l=R,O.i=M,O.w=function(N,D){return I(N,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var j=function(){function N(z){this.$L=R(z.locale,null,!0),this.parse(z),this.$x=this.$x||z.x||{},this[T]=!0}var D=N.prototype;return D.parse=function(z){this.$d=function(U){var $=U.date,V=U.utc;if($===null)return new Date(NaN);if(O.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var b=$.match(y);if(b){var P=b[2]-1||0,H=(b[7]||"0").substring(0,3);return V?new Date(Date.UTC(b[1],P,b[3]||1,b[4]||0,b[5]||0,b[6]||0,H)):new Date(b[1],P,b[3]||1,b[4]||0,b[5]||0,b[6]||0,H)}}return new Date($)}(z),this.init()},D.init=function(){var z=this.$d;this.$y=z.getFullYear(),this.$M=z.getMonth(),this.$D=z.getDate(),this.$W=z.getDay(),this.$H=z.getHours(),this.$m=z.getMinutes(),this.$s=z.getSeconds(),this.$ms=z.getMilliseconds()},D.$utils=function(){return O},D.isValid=function(){return this.$d.toString()!==h},D.isSame=function(z,U){var $=I(z);return this.startOf(U)<=$&&$<=this.endOf(U)},D.isAfter=function(z,U){return I(z)<this.startOf(U)},D.isBefore=function(z,U){return this.endOf(U)<I(z)},D.$g=function(z,U,$){return O.u(z)?this[U]:this.set($,z)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(z,U){var $=this,V=!!O.u(U)||U,b=O.p(z),P=function(ie,K){var te=O.w($.$u?Date.UTC($.$y,K,ie):new Date($.$y,K,ie),$);return V?te:te.endOf(u)},H=function(ie,K){return O.w($.toDate()[ie].apply($.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(K)),$)},w=this.$W,W=this.$M,X=this.$D,Y="set"+(this.$u?"UTC":"");switch(b){case d:return V?P(1,0):P(31,11);case c:return V?P(1,W):P(0,W+1);case f:var J=this.$locale().weekStart||0,ee=(w<J?w+7:w)-J;return P(V?X-ee:X+(6-ee),W);case u: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()}},D.endOf=function(z){return this.startOf(z,!1)},D.$set=function(z,U){var $,V=O.p(z),b="set"+(this.$u?"UTC":""),P=($={},$[u]=b+"Date",$[m]=b+"Date",$[c]=b+"Month",$[d]=b+"FullYear",$[l]=b+"Hours",$[s]=b+"Minutes",$[a]=b+"Seconds",$[o]=b+"Milliseconds",$)[V],H=V===u?this.$D+(U-this.$W):U;if(V===c||V===d){var w=this.clone().set(m,1);w.$d[P](H),w.init(),this.$d=w.set(m,Math.min(this.$D,w.daysInMonth())).$d}else P&&this.$d[P](H);return this.init(),this},D.set=function(z,U){return this.clone().$set(z,U)},D.get=function(z){return this[O.p(z)]()},D.add=function(z,U){var $,V=this;z=Number(z);var b=O.p(U),P=function(W){var X=I(V);return O.w(X.date(X.date()+Math.round(W*z)),V)};if(b===c)return this.set(c,this.$M+z);if(b===d)return this.set(d,this.$y+z);if(b===u)return P(1);if(b===f)return P(7);var H=($={},$[s]=r,$[l]=i,$[a]=n,$)[b]||1,w=this.$d.getTime()+z*H;return O.w(w,this)},D.subtract=function(z,U){return this.add(-1*z,U)},D.format=function(z){var U=this,$=this.$locale();if(!this.isValid())return $.invalidDate||h;var V=z||"YYYY-MM-DDTHH:mm:ssZ",b=O.z(this),P=this.$H,H=this.$m,w=this.$M,W=$.weekdays,X=$.months,Y=$.meridiem,J=function(K,te,L,ne){return K&&(K[te]||K(U,V))||L[te].slice(0,ne)},ee=function(K){return O.s(P%12||12,K,"0")},ie=Y||function(K,te,L){var ne=K<12?"AM":"PM";return L?ne.toLowerCase():ne};return V.replace(g,function(K,te){return te||function(L){switch(L){case"YY":return String(U.$y).slice(-2);case"YYYY":return O.s(U.$y,4,"0");case"M":return w+1;case"MM":return O.s(w+1,2,"0");case"MMM":return J($.monthsShort,w,X,3);case"MMMM":return J(X,w);case"D":return U.$D;case"DD":return O.s(U.$D,2,"0");case"d":return String(U.$W);case"dd":return J($.weekdaysMin,U.$W,W,2);case"ddd":return J($.weekdaysShort,U.$W,W,3);case"dddd":return W[U.$W];case"H":return String(P);case"HH":return O.s(P,2,"0");case"h":return ee(1);case"hh":return ee(2);case"a":return ie(P,H,!0);case"A":return ie(P,H,!1);case"m":return String(H);case"mm":return O.s(H,2,"0");case"s":return String(U.$s);case"ss":return O.s(U.$s,2,"0");case"SSS":return O.s(U.$ms,3,"0");case"Z":return b}return null}(K)||b.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(z,U,$){var V,b=this,P=O.p(U),H=I(z),w=(H.utcOffset()-this.utcOffset())*r,W=this-H,X=function(){return O.m(b,H)};switch(P){case d:V=X()/12;break;case c:V=X();break;case p:V=X()/3;break;case f:V=(W-w)/6048e5;break;case u:V=(W-w)/864e5;break;case l:V=W/i;break;case s:V=W/r;break;case a:V=W/n;break;default:V=W}return $?V:O.a(V)},D.daysInMonth=function(){return this.endOf(c).$D},D.$locale=function(){return C[this.$L]},D.locale=function(z,U){if(!z)return this.$L;var $=this.clone(),V=R(z,U,!0);return V&&($.$L=V),$},D.clone=function(){return O.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},N}(),_=j.prototype;return I.prototype=_,[["$ms",o],["$s",a],["$m",s],["$H",l],["$W",u],["$M",c],["$y",d],["$D",m]].forEach(function(N){_[N[1]]=function(D){return this.$g(D,N[0],N[1])}}),I.extend=function(N,D){return N.$i||(N(D,j,I),N.$i=!0),I},I.locale=R,I.isDayjs=M,I.unix=function(N){return I(1e3*N)},I.en=C[k],I.Ls=C,I.p={},I})})(Ks);var fm=Ks.exports;const wr=jt(fm);var Ys={exports:{}};(function(e,t){(function(n,r){e.exports=r()})($t,function(){return function(n,r,i){r.prototype.isToday=function(){var o="YYYY-MM-DD",a=i();return this.format(o)===a.format(o)}}})})(Ys);var dm=Ys.exports;const pm=jt(dm);var Gs={exports:{}};(function(e,t){(function(n,r){e.exports=r()})($t,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)}}})})(Gs);var hm=Gs.exports;const mm=jt(hm);wr.extend(pm),wr.extend(mm);function Qs(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 u;return l&&l.id===n?u={name:l.name||"You",avatar:l.pictureUrl}:l?u={name:l.name||"Agent",avatar:l.pictureUrl}:u={name:r||"Bot",avatar:i},{...o,direction:s,sender:u}})}function gm(e,t="day"){var r,i,o;if(!e||e.length===0)return[];const n=[];(r=e[0])!=null&&r.timestamp&&n.push(Js(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;!wr(s).isSame(l,t)&&l&&n.push(Js(l))}return n}function Js(e){return{id:Zs(e),direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:Zs(e)}}}function Zs(e,t=!1){const n=wr(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 ym(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 vm(e){return"#"+e.map(t=>`0${t.toString(16).toUpperCase()}`.slice(-2)).join("")}function bm(e,t){return e.map(n=>Math.round(n+(255-n)*t))}function xm(e,t){return e.map(n=>Math.round(n*t))}const Mn=e=>t=>bm(t,e),_n=e=>t=>xm(t,e),wm={50:Mn(.95),100:Mn(.9),200:Mn(.75),300:Mn(.6),400:Mn(.3),500:e=>e,600:_n(.9),700:_n(.6),800:_n(.45),900:_n(.3),950:_n(.2)};function Xs(e,t=wm){const n={},r=ym(e);for(const[i,o]of Object.entries(t))n[i]=vm(o(r));return n}const el=()=>{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 Ji(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 km(e){return`#${((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}`}const Sm=(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 tl(e){return Object.entries(e).reduce((t,[n,r])=>{const i=n.replace(/(\d+)/,o=>(1e3-parseInt(o)).toString());return{...t,[i]:r}},{})}const Em=2.4,Cm=.2126729,Am=.7151522,Im=.072175,Tm=.56,Om=.57,Dm=.62,Mm=.65,kr=.022,nl=1.414,_m=1.14,Pm=1.14,Nm=.035991,Lm=27.7847239587675,Fm=27.7847239587675,rl=.027,il=.027,ol=.001,Rm=5e-4;function al(e){const{r:t,g:n,b:r}=e,i=o=>(o/255)**Em;return Cm*i(t)+Am*i(n)+Im*i(r)}function sl(e,t){if(!e||!t)return 0;let n=al(Ji(e)),r=al(Ji(t)),i=0,o=0;return n=n>kr?n:n+(kr-n)**nl,r=r>kr?r:r+(kr-r)**nl,Math.abs(r-n)<Rm?0:(r>n?(i=(r**Tm-n**Om)*_m,o=i<ol?0:i<Nm?i-i*Lm*rl:i-rl):(i=(r**Mm-n**Dm)*Pm,o=i>-ol?0:i>-.035991?i-i*Fm*il:i+il),Math.abs(o*100))}const Bm=(e,t,n)=>{const r=e;let i=0;for(;t.some(o=>n(o)===e);)i+=1,e=`${r} (${i})`;return e};function ll(e){const{fontFamily:t,...n}=e,r=ul(n);return Vs(".bpReset",{...r,"font-family":`'${t}', sans-serif`})+Vs(":host, :root",{...r})}function ul(e){const{radius:t,themeMode:n,color:r,variant:i,headerVariant:o}=e;let a={},s={};if(r){const p=Xs(r),d=n==="dark"?tl(p):p,m=Xs(km(Sm(Ji(r)))),h=n==="dark"?tl(m):m,y=n==="dark"?"#101010":"#fdfdfd";s=Object.entries({...d,1:y}).reduce((v,[x,A])=>({...v,[`--bpPrimary-${x}`]:A}),{});const g=Object.entries({...h,1:y}).reduce((v,[x,A])=>({...v,[`--bpGray-${x}`]:A}),{});a={...s,...g}}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)"},u=s?sl(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":u,"--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":u,"--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?sl(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)"},c=o==="solid"?{"--header-bg":"var(--bpPrimary-600)","--header-bg-hover":"var(--bpPrimary-700)","--header-hover-dark":"var(--bpPrimary-800)","--header-title":u,"--header-description":u,"--header-description-icon":u,"--header-description-link":u,"--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,...c}}const zm=e=>{if(typeof URL.canParse=="function")return URL.canParse(e);try{return new URL(e),!0}catch{return!1}},cl=["audio","file","image","video"],fl=e=>cl.includes(e),dl="The Client ID is required to initialize the webchat.",$m="The API url is required to initialize the webchat.",jm="The Bot ID is required to initialize the webchat.",Um="No config URL provided.",pl=`Invalid API URL.
18
+ Please use a valid API URL.`,hl=`Invalid Client ID.
19
+ Please use a valid Botpress Client ID.`,ml=`Invalid URL.
20
+ Please make sure your client ID and API URL are valid`,Hm=`Invalid config URL.
21
+ Please make sure your config URL is valid`,Wm=`Invalid webchat configuration.
22
+ Please make sure your config file is valid`,Vm="Access denied to configuration file. Please check your credentials or your configuration URL and try again.",gl=`This bot has temporarily paused.
23
+ Please check back later.`,yl=`This bot has temporarily paused.
24
+ 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",Pn="Please check your internet connection and refresh the page.",vl=`You've been disconnected from the conversation.
25
+ Please refresh the page.`,bl=`Unable to process the message.
26
+ Please start a new conversation.`,Xi={ResourceNotFound:{type:"configuration",message:hl},Forbidden:{type:"bot",message:gl}},eo={MethodNotFound:{type:"configuration",message:ml},QuotaExceeded:{type:"bot",message:yl},Forbidden:{type:"bot",message:Zi}};function xl(e){return e in Xi}function wl(e){return e in eo}function kl(e){return e!==null&&typeof e=="object"&&"id"in e&&"code"in e&&"type"in e}function Sl(e){return e!==null&&typeof e=="object"&&"type"in e&&e.type==="error"&&"message"in e&&typeof e.message=="string"}const El=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")},qm=["networkerror","failedtofetch","errorininputstream"],Sr=e=>{var n;console.error("An error occurred:",e);let t={type:"unknown",message:"An unexpected error occurred"};if(kl(e))e.type==="network"?t={id:e.id,type:"network",message:Pn}:(n=e.message)!=null&&n.includes("[Webhook Handler]")&&xl(e.type)?t={id:e.id,...Xi[e.type]}:wl(e.type)?t={id:e.id,...eo[e.type]}:t={id:e.id,type:e.type,message:e.message||"An error occurred"};else if(Sl(e))Cl(e.message)?t={type:"disconnected",message:vl}:Al(e.message).includes("invalidcontenttype")?t={type:"bot",message:bl}:t={type:"event",message:e.message};else if(e instanceof Error&&Cl(e.message))t={type:"network",message:Pn};else if(e&&typeof e=="object"&&"type"in e&&"message"in e){const r=e;r.type==="network"?t={type:"network",message:Pn}:t={type:r.type,message:r.message}}return t};function Cl(e){return qm.some(t=>Al(e).includes(t))}function Al(e){return e.replaceAll(" ","").toLowerCase()}const Nn=({userId:e,src:t,container:n,image:r,fallback:i,...o})=>{const a=qs(e??"",15);return S.jsxs(Yi,{"data-color":a,...n,...o,children:[S.jsx(Gi,{src:t,...r}),S.jsx(Qi,{...i,children:typeof o.children=="string"?o.children[0]:o.children})]})};Nn.displayName="Avatar";/**
27
+ * @license lucide-react v0.554.0 - ISC
40
28
  *
41
29
  * This source code is licensed under the ISC license.
42
30
  * 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};/**
44
- * @license lucide-react v0.525.0 - ISC
31
+ */const Km=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ym=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Il=e=>{const t=Ym(e);return t.charAt(0).toUpperCase()+t.slice(1)},Tl=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Gm=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
32
+ * @license lucide-react v0.554.0 - ISC
45
33
  *
46
34
  * This source code is licensed under the ISC license.
47
35
  * 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"};/**
49
- * @license lucide-react v0.525.0 - ISC
36
+ */var Qm={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"};/**
37
+ * @license lucide-react v0.554.0 - ISC
50
38
  *
51
39
  * This source code is licensed under the ISC license.
52
40
  * 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]]));/**
54
- * @license lucide-react v0.525.0 - ISC
41
+ */const Jm=F.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},l)=>F.createElement("svg",{ref:l,...Qm,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Tl("lucide",i),...!o&&!Gm(s)&&{"aria-hidden":"true"},...s},[...a.map(([u,f])=>F.createElement(u,f)),...Array.isArray(o)?o:[o]]));/**
42
+ * @license lucide-react v0.554.0 - ISC
55
43
  *
56
44
  * This source code is licensed under the ISC license.
57
45
  * 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};/**
59
- * @license lucide-react v0.525.0 - ISC
46
+ */const we=(e,t)=>{const n=F.forwardRef(({className:r,...i},o)=>F.createElement(Jm,{ref:o,iconNode:t,className:Tl(`lucide-${Km(Il(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Il(e),n};/**
47
+ * @license lucide-react v0.554.0 - ISC
60
48
  *
61
49
  * This source code is licensed under the ISC license.
62
50
  * 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"}]]);/**
64
- * @license lucide-react v0.525.0 - ISC
51
+ */const Zm=we("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
52
+ * @license lucide-react v0.554.0 - ISC
65
53
  *
66
54
  * This source code is licensed under the ISC license.
67
55
  * 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"}]]);/**
69
- * @license lucide-react v0.525.0 - ISC
56
+ */const Ol=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"}]]);/**
57
+ * @license lucide-react v0.554.0 - ISC
70
58
  *
71
59
  * This source code is licensed under the ISC license.
72
60
  * 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"}]]);/**
74
- * @license lucide-react v0.525.0 - ISC
61
+ */const Xm=we("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
62
+ * @license lucide-react v0.554.0 - ISC
75
63
  *
76
64
  * This source code is licensed under the ISC license.
77
65
  * 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"}]]);/**
79
- * @license lucide-react v0.525.0 - ISC
66
+ */const eg=we("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
67
+ * @license lucide-react v0.554.0 - ISC
80
68
  *
81
69
  * This source code is licensed under the ISC license.
82
70
  * 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"}]]);/**
84
- * @license lucide-react v0.525.0 - ISC
71
+ */const tg=we("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
72
+ * @license lucide-react v0.554.0 - ISC
85
73
  *
86
74
  * This source code is licensed under the ISC license.
87
75
  * 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"}]]);/**
89
- * @license lucide-react v0.525.0 - ISC
76
+ */const ng=we("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
77
+ * @license lucide-react v0.554.0 - ISC
90
78
  *
91
79
  * This source code is licensed under the ISC license.
92
80
  * 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"}]]);/**
94
- * @license lucide-react v0.525.0 - ISC
81
+ */const rg=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"}]]);/**
82
+ * @license lucide-react v0.554.0 - ISC
95
83
  *
96
84
  * This source code is licensed under the ISC license.
97
85
  * 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"}]]);/**
99
- * @license lucide-react v0.525.0 - ISC
86
+ */const Dl=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"}]]);/**
87
+ * @license lucide-react v0.554.0 - ISC
100
88
  *
101
89
  * This source code is licensed under the ISC license.
102
90
  * 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"}]]);/**
104
- * @license lucide-react v0.525.0 - ISC
91
+ */const ig=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"}]]);/**
92
+ * @license lucide-react v0.554.0 - ISC
105
93
  *
106
94
  * This source code is licensed under the ISC license.
107
95
  * 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"}]]);/**
109
- * @license lucide-react v0.525.0 - ISC
96
+ */const og=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"}]]);/**
97
+ * @license lucide-react v0.554.0 - ISC
110
98
  *
111
99
  * This source code is licensed under the ISC license.
112
100
  * 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"}]]);/**
114
- * @license lucide-react v0.525.0 - ISC
101
+ */const ag=we("file-down",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
102
+ * @license lucide-react v0.554.0 - ISC
115
103
  *
116
104
  * This source code is licensed under the ISC license.
117
105
  * 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"}]]);/**
119
- * @license lucide-react v0.525.0 - ISC
106
+ */const Ml=we("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
107
+ * @license lucide-react v0.554.0 - ISC
120
108
  *
121
109
  * This source code is licensed under the ISC license.
122
110
  * 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"}]]);/**
124
- * @license lucide-react v0.525.0 - ISC
111
+ */const sg=we("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]);/**
112
+ * @license lucide-react v0.554.0 - ISC
125
113
  *
126
114
  * This source code is licensed under the ISC license.
127
115
  * 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"}]]);/**
129
- * @license lucide-react v0.525.0 - ISC
116
+ */const lg=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"}]]);/**
117
+ * @license lucide-react v0.554.0 - ISC
130
118
  *
131
119
  * This source code is licensed under the ISC license.
132
120
  * 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"}]]);/**
134
- * @license lucide-react v0.525.0 - ISC
121
+ */const _l=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"}]]);/**
122
+ * @license lucide-react v0.554.0 - ISC
135
123
  *
136
124
  * This source code is licensed under the ISC license.
137
125
  * 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"}]]);/**
139
- * @license lucide-react v0.525.0 - ISC
126
+ */const ug=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"}]]);/**
127
+ * @license lucide-react v0.554.0 - ISC
140
128
  *
141
129
  * This source code is licensed under the ISC license.
142
130
  * 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"}]]);/**
144
- * @license lucide-react v0.525.0 - ISC
131
+ */const cg=we("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"}]]);/**
132
+ * @license lucide-react v0.554.0 - ISC
145
133
  *
146
134
  * This source code is licensed under the ISC license.
147
135
  * 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"}]]);/**
149
- * @license lucide-react v0.525.0 - ISC
136
+ */const fg=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"}]]);/**
137
+ * @license lucide-react v0.554.0 - ISC
150
138
  *
151
139
  * This source code is licensed under the ISC license.
152
140
  * 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"}]]);/**
154
- * @license lucide-react v0.525.0 - ISC
141
+ */const dg=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"}]]);/**
142
+ * @license lucide-react v0.554.0 - ISC
155
143
  *
156
144
  * This source code is licensed under the ISC license.
157
145
  * 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"}]]);/**
159
- * @license lucide-react v0.525.0 - ISC
146
+ */const pg=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"}]]);/**
147
+ * @license lucide-react v0.554.0 - ISC
160
148
  *
161
149
  * This source code is licensed under the ISC license.
162
150
  * 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"}]]);/**
164
- * @license lucide-react v0.525.0 - ISC
151
+ */const hg=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"}]]);/**
152
+ * @license lucide-react v0.554.0 - ISC
165
153
  *
166
154
  * This source code is licensed under the ISC license.
167
155
  * 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"}]]);/**
169
- * @license lucide-react v0.525.0 - ISC
156
+ */const mg=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"}]]);/**
157
+ * @license lucide-react v0.554.0 - ISC
170
158
  *
171
159
  * This source code is licensed under the ISC license.
172
160
  * 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"}]]);/**
174
- * @license lucide-react v0.525.0 - ISC
161
+ */const gg=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"}]]);/**
162
+ * @license lucide-react v0.554.0 - ISC
175
163
  *
176
164
  * This source code is licensed under the ISC license.
177
165
  * 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"}]]);/**
179
- * @license lucide-react v0.525.0 - ISC
166
+ */const yg=we("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
167
+ * @license lucide-react v0.554.0 - ISC
180
168
  *
181
169
  * This source code is licensed under the ISC license.
182
170
  * 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"}]]);/**
184
- * @license lucide-react v0.525.0 - ISC
171
+ */const vg=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"}]]);/**
172
+ * @license lucide-react v0.554.0 - ISC
185
173
  *
186
174
  * This source code is licensed under the ISC license.
187
175
  * 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"}]]);/**
189
- * @license lucide-react v0.525.0 - ISC
176
+ */const bg=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"}]]);/**
177
+ * @license lucide-react v0.554.0 - ISC
190
178
  *
191
179
  * This source code is licensed under the ISC license.
192
180
  * 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"}]]);/**
194
- * @license lucide-react v0.525.0 - ISC
181
+ */const xg=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"}]]);/**
182
+ * @license lucide-react v0.554.0 - ISC
195
183
  *
196
184
  * This source code is licensed under the ISC license.
197
185
  * 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"}]]);/**
199
- * @license lucide-react v0.525.0 - ISC
186
+ */const wg=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"}]]);/**
187
+ * @license lucide-react v0.554.0 - ISC
200
188
  *
201
189
  * This source code is licensed under the ISC license.
202
190
  * 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"}]]);/**
204
- * @license lucide-react v0.525.0 - ISC
191
+ */const kg=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"}]]);/**
192
+ * @license lucide-react v0.554.0 - ISC
205
193
  *
206
194
  * This source code is licensed under the ISC license.
207
195
  * 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"}]]);/**
209
- * @license lucide-react v0.525.0 - ISC
196
+ */const Pl=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"}]]);/**
197
+ * @license lucide-react v0.554.0 - ISC
210
198
  *
211
199
  * This source code is licensed under the ISC license.
212
200
  * 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"}]]);/**
214
- * @license lucide-react v0.525.0 - ISC
201
+ */const Sg=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"}]]);/**
202
+ * @license lucide-react v0.554.0 - ISC
215
203
  *
216
204
  * This source code is licensed under the ISC license.
217
205
  * 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={};/**
206
+ */const Eg=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"}]]);/**
207
+ * @license lucide-react v0.554.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const Nl=we("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function yO(){}function vO(){}function Cg(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ag=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ig=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Tg={};function Ll(e,t){return(Tg.jsx?Ig:Ag).test(e)}const Og=/[ \t\n\f\r]/g;function Dg(e){return typeof e=="object"?e.type==="text"?Fl(e.value):!1:Fl(e)}function Fl(e){return e.replace(Og,"")===""}class Ln{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ln.prototype.normal={},Ln.prototype.property={},Ln.prototype.space=void 0;function Rl(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ln(n,r,t)}function to(e){return e.toLowerCase()}class Qe{constructor(t,n){this.attribute=n,this.property=t}}Qe.prototype.attribute="",Qe.prototype.booleanish=!1,Qe.prototype.boolean=!1,Qe.prototype.commaOrSpaceSeparated=!1,Qe.prototype.commaSeparated=!1,Qe.prototype.defined=!1,Qe.prototype.mustUseProperty=!1,Qe.prototype.number=!1,Qe.prototype.overloadedBoolean=!1,Qe.prototype.property="",Qe.prototype.spaceSeparated=!1,Qe.prototype.space=void 0;let Mg=0;const he=Ut(),Fe=Ut(),no=Ut(),Q=Ut(),De=Ut(),Xt=Ut(),et=Ut();function Ut(){return 2**++Mg}const ro=Object.freeze(Object.defineProperty({__proto__:null,boolean:he,booleanish:Fe,commaOrSpaceSeparated:et,commaSeparated:Xt,number:Q,overloadedBoolean:no,spaceSeparated:De},Symbol.toStringTag,{value:"Module"})),io=Object.keys(ro);class oo extends Qe{constructor(t,n,r,i){let o=-1;if(super(t,n),Bl(this,"space",i),typeof r=="number")for(;++o<io.length;){const a=io[o];Bl(this,io[o],(r&ro[a])===ro[a])}}}oo.prototype.defined=!0;function Bl(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 oo(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[to(r)]=r,n[to(o.attribute)]=r}return new Ln(t,n,e.space)}const zl=en({properties:{ariaActiveDescendant:null,ariaAtomic:Fe,ariaAutoComplete:null,ariaBusy:Fe,ariaChecked:Fe,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:De,ariaCurrent:null,ariaDescribedBy:De,ariaDetails:null,ariaDisabled:Fe,ariaDropEffect:De,ariaErrorMessage:null,ariaExpanded:Fe,ariaFlowTo:De,ariaGrabbed:Fe,ariaHasPopup:null,ariaHidden:Fe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:De,ariaLevel:Q,ariaLive:null,ariaModal:Fe,ariaMultiLine:Fe,ariaMultiSelectable:Fe,ariaOrientation:null,ariaOwns:De,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:Fe,ariaReadOnly:Fe,ariaRelevant:null,ariaRequired:Fe,ariaRoleDescription:De,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:Fe,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function $l(e,t){return t in e?e[t]:t}function jl(e,t){return $l(e,t.toLowerCase())}const _g=en({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Xt,acceptCharset:De,accessKey:De,action:null,allow:null,allowFullScreen:he,allowPaymentRequest:he,allowUserMedia:he,alt:null,as:null,async:he,autoCapitalize:null,autoComplete:De,autoFocus:he,autoPlay:he,blocking:De,capture:null,charSet:null,checked:he,cite:null,className:De,cols:Q,colSpan:null,content:null,contentEditable:Fe,controls:he,controlsList:De,coords:Q|Xt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:he,defer:he,dir:null,dirName:null,disabled:he,download:no,draggable:Fe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:he,formTarget:null,headers:De,height:Q,hidden:no,high:Q,href:null,hrefLang:null,htmlFor:De,httpEquiv:De,id:null,imageSizes:null,imageSrcSet:null,inert:he,inputMode:null,integrity:null,is:null,isMap:he,itemId:null,itemProp:De,itemRef:De,itemScope:he,itemType:De,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:he,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,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:Q,pattern:null,ping:De,placeholder:null,playsInline:he,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:he,referrerPolicy:null,rel:De,required:he,reversed:he,rows:Q,rowSpan:Q,sandbox:De,scope:null,scoped:he,seamless:he,selected:he,shadowRootClonable:he,shadowRootDelegatesFocus:he,shadowRootMode:null,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:Fe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:he,useMap:null,value:Fe,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:De,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,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:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:he,noHref:he,noShade:he,noWrap:he,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:Fe,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:he,disableRemotePlayback:he,prefix:null,property:null,results:Q,security:null,unselectable:null},space:"html",transform:jl}),Pg=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:et,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:De,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:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:he,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,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:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:et,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,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:Q,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:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:De,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:et,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:et,rev:et,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:et,requiredFeatures:et,requiredFonts:et,requiredFormats:et,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:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:et,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:et,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:et,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$l}),Ul=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()}}),Hl=en({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:jl}),Wl=en({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Ng={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"},Lg=/[A-Z]/g,Vl=/-[a-z]/g,Fg=/^data[-\w.:]+$/i;function Rg(e,t){const n=to(t);let r=t,i=Qe;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Fg.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Vl,zg);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Vl.test(o)){let a=o.replace(Lg,Bg);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=oo}return new i(r,t)}function Bg(e){return"-"+e.toLowerCase()}function zg(e){return e.charAt(1).toUpperCase()}const $g=Rl([zl,_g,Ul,Hl,Wl],"html"),ao=Rl([zl,Pg,Ul,Hl,Wl],"svg");function jg(e){return e.join(" ").trim()}var so={},ql=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ug=/\n/g,Hg=/^\s*/,Wg=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Vg=/^:\s*/,qg=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Kg=/^[;\s]*/,Yg=/^\s+|\s+$/g,Gg=`
212
+ `,Kl="/",Yl="*",Ht="",Qg="comment",Jg="declaration";function Zg(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(Ug);h&&(n+=h.length);var y=m.lastIndexOf(Gg);r=~y?m.length-y:r+m.length}function o(){var m={line:n,column:r};return function(h){return h.position=new a(m),u(),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 y=h[0];return i(y),e=e.slice(y.length),h}}function u(){l(Hg)}function f(m){var h;for(m=m||[];h=c();)h!==!1&&m.push(h);return m}function c(){var m=o();if(!(Kl!=e.charAt(0)||Yl!=e.charAt(1))){for(var h=2;Ht!=e.charAt(h)&&(Yl!=e.charAt(h)||Kl!=e.charAt(h+1));)++h;if(h+=2,Ht===e.charAt(h-1))return s("End of comment missing");var y=e.slice(2,h-2);return r+=2,i(y),e=e.slice(h),r+=2,m({type:Qg,comment:y})}}function p(){var m=o(),h=l(Wg);if(h){if(c(),!l(Vg))return s("property missing ':'");var y=l(qg),g=m({type:Jg,property:Gl(h[0].replace(ql,Ht)),value:y?Gl(y[0].replace(ql,Ht)):Ht});return l(Kg),g}}function d(){var m=[];f(m);for(var h;h=p();)h!==!1&&(m.push(h),f(m));return m}return u(),d()}function Gl(e){return e?e.replace(Yg,Ht):Ht}var Xg=Zg,ey=$t&&$t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(so,"__esModule",{value:!0}),so.default=ny;const ty=ey(Xg);function ny(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,ty.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 Er={};Object.defineProperty(Er,"__esModule",{value:!0}),Er.camelCase=void 0;var ry=/^--[a-zA-Z0-9_-]+$/,iy=/-([a-z])/g,oy=/^[^-]+$/,ay=/^-(webkit|moz|ms|o|khtml)-/,sy=/^-(ms)-/,ly=function(e){return!e||oy.test(e)||ry.test(e)},uy=function(e,t){return t.toUpperCase()},Ql=function(e,t){return"".concat(t,"-")},cy=function(e,t){return t===void 0&&(t={}),ly(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(sy,Ql):e=e.replace(ay,Ql),e.replace(iy,uy))};Er.camelCase=cy;var fy=$t&&$t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},dy=fy(so),py=Er;function lo(e,t){var n={};return!e||typeof e!="string"||(0,dy.default)(e,function(r,i){r&&i&&(n[(0,py.camelCase)(r,t)]=i)}),n}lo.default=lo;var hy=lo;const my=jt(hy),Jl=Zl("end"),uo=Zl("start");function Zl(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 gy(e){const t=uo(e),n=Jl(e);if(t&&n)return{start:t,end:n}}function Fn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Xl(e.position):"start"in e||"end"in e?Xl(e):"line"in e||"column"in e?co(e):""}function co(e){return eu(e&&e.line)+":"+eu(e&&e.column)}function Xl(e){return co(e&&e.start)+"-"+co(e&&e.end)}function eu(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=Fn(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 fo={}.hasOwnProperty,yy=new Map,vy=/[A-Z]/g,by=new Set(["table","tbody","thead","tfoot","tr"]),xy=new Set(["td","th"]),tu="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function wy(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=Oy(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=Ty(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"?ao:$g,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=nu(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function nu(e,t,n){if(t.type==="element")return ky(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Sy(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Cy(e,t,n);if(t.type==="mdxjsEsm")return Ey(e,t);if(t.type==="root")return Ay(e,t,n);if(t.type==="text")return Iy(e,t)}function ky(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ao,e.schema=i),e.ancestors.push(t);const o=iu(e,t.tagName,!1),a=Dy(e,t);let s=ho(e,t);return by.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!Dg(l):!0})),ru(e,a,o,t),po(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function Sy(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)}Rn(e,t.position)}function Ey(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rn(e,t.position)}function Cy(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ao,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:iu(e,t.name,!0),a=My(e,t),s=ho(e,t);return ru(e,a,o,t),po(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function Ay(e,t,n){const r={};return po(r,ho(e,t)),e.create(t,e.Fragment,r,n)}function Iy(e,t){return t.value}function ru(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function po(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ty(e,t,n){return r;function r(i,o,a,s){const u=Array.isArray(a.children)?n:t;return s?u(o,a,s):u(o,a)}}function Oy(e,t){return n;function n(r,i,o,a){const s=Array.isArray(o.children),l=uo(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 Dy(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&fo.call(t.properties,i)){const o=_y(e,i,t.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&xy.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 My(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 Rn(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 Rn(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function ho(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:yy;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 u=i.get(l)||0;a=l+"-"+u,i.set(l,u+1)}}const s=nu(e,o,a);s!==void 0&&n.push(s)}return n}function _y(e,t,n){const r=Rg(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Cg(n):jg(n)),r.property==="style"){let i=typeof n=="object"?n:Py(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Ny(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Ng[r.property]||r.property:r.attribute,n]}}function Py(e,t){try{return my(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=tu+"#cannot-parse-style-attribute",i}}function iu(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=Ll(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=Ll(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return fo.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Rn(e)}function Rn(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=tu+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Ny(e){const t={};let n;for(n in e)fo.call(e,n)&&(t[Ly(n)]=e[n]);return t}function Ly(e){let t=e.replace(vy,Fy);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Fy(e){return"-"+e.toLowerCase()}const mo={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"]},Ry={};function go(e,t){const n=Ry,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ou(e,r,i)}function ou(e,t,n){if(By(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 au(e.children,t,n)}return Array.isArray(e)?au(e,t,n):""}function au(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=ou(e[i],t,n);return r.join("")}function By(e){return!!(e&&typeof e=="object")}const su=document.createElement("i");function yo(e){const t="&"+e+";";su.innerHTML=t;const n=su.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function tt(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?(tt(e,e.length,0,t),e):t}const lu={}.hasOwnProperty;function uu(e){const t={};let n=-1;for(;++n<e.length;)zy(t,e[n]);return t}function zy(e,t){let n;for(n in t){const i=(lu.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){lu.call(i,a)||(i[a]=[]);const s=o[a];$y(i[a],Array.isArray(s)?s:s?[s]:[])}}}function $y(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);tt(e,0,0,r)}function cu(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 ut(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const qe=Dt(/[A-Za-z]/),We=Dt(/[\dA-Za-z]/),jy=Dt(/[#-'*+\--9=?A-Z^-~]/);function Cr(e){return e!==null&&(e<32||e===127)}const vo=Dt(/\d/),Uy=Dt(/[\dA-Fa-f]/),Hy=Dt(/[!-/:-@[-`{-~]/);function ce(e){return e!==null&&e<-2}function Ie(e){return e!==null&&(e<0||e===32)}function ye(e){return e===-2||e===-1||e===32}const Ar=Dt(new RegExp("\\p{P}|\\p{S}","u")),Wt=Dt(/\s/);function Dt(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 be(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 Wy={tokenize:Vy};function Vy(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"),be(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 ce(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}const qy={tokenize:Ky},fu={tokenize:Yy};function Ky(e){const t=this,n=[];let r=0,i,o,a;return s;function s(x){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,l,u)(x)}return u(x)}function l(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const A=t.events.length;let k=A,C;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){C=t.events[k][1].end;break}g(r);let T=A;for(;T<t.events.length;)t.events[T][1].end={...C},T++;return tt(t.events,k+1,0,t.events.slice(A)),t.events.length=T,u(x)}return s(x)}function u(x){if(r===n.length){if(!i)return p(x);if(i.currentConstruct&&i.currentConstruct.concrete)return m(x);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(fu,f,c)(x)}function f(x){return i&&v(),g(r),p(x)}function c(x){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,m(x)}function p(x){return t.containerState={},e.attempt(fu,d,m)(x)}function d(x){return r++,n.push([t.currentConstruct,t.containerState]),p(x)}function m(x){if(x===null){i&&v(),g(0),e.consume(x);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),h(x)}function h(x){if(x===null){y(e.exit("chunkFlow"),!0),g(0),e.consume(x);return}return ce(x)?(e.consume(x),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(x),h)}function y(x,A){const k=t.sliceStream(x);if(A&&k.push(null),x.previous=o,o&&(o.next=x),o=x,i.defineSkip(x.start),i.write(k),t.parser.lazy[x.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 M=T,R,I;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(R){I=t.events[M][1].end;break}R=!0}for(g(r),C=T;C<t.events.length;)t.events[C][1].end={...I},C++;tt(t.events,M+1,0,t.events.slice(T)),t.events.length=C}}function g(x){let A=n.length;for(;A-- >x;){const k=n[A];t.containerState=k[1],k[0].exit.call(t,e)}n.length=x}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Yy(e,t,n){return be(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||Ie(e)||Wt(e))return 1;if(Ar(e))return 2}function Ir(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 bo={name:"attention",resolveAll:Gy,tokenize:Qy};function Gy(e,t){let n=-1,r,i,o,a,s,l,u,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 c={...e[r][1].end},p={...e[n][1].start};du(c,-l),du(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:c,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},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=it(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=it(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),u=it(u,Ir(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=it(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=it(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,tt(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Qy(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 u=e.exit("attentionSequence"),f=nn(l),c=!f||f===2&&i||n.includes(l),p=!i||i===2&&f||n.includes(r);return u._open=!!(o===42?c:c&&(i||!p)),u._close=!!(o===42?p:p&&(f||!c)),t(l)}}function du(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Jy={name:"autolink",tokenize:Zy};function Zy(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):u(d)}function a(d){return d===43||d===45||d===46||We(d)?(r=1,s(d)):u(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,u(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||Cr(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),f):jy(d)?(e.consume(d),u):n(d)}function f(d){return We(d)?c(d):n(d)}function c(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:c;return e.consume(d),m}return n(d)}}const Bn={partial:!0,tokenize:Xy};function Xy(e,t,n){return r;function r(o){return ye(o)?be(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ce(o)?t(o):n(o)}}const pu={continuation:{tokenize:tv},exit:nv,name:"blockQuote",tokenize:ev};function ev(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 tv(e,t,n){const r=this;return i;function i(a){return ye(a)?be(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(pu,t,n)(a)}}function nv(e){e.exit("blockQuote")}const hu={name:"characterEscape",tokenize:rv};function rv(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 Hy(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const mu={name:"characterReference",tokenize:iv};function iv(e,t,n){const r=this;let i=0,o,a;return s;function s(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,a=We,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=Uy,f):(e.enter("characterReferenceValue"),o=7,a=vo,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return a===We&&!yo(r.sliceSerialize(p))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(c)&&i++<o?(e.consume(c),f):n(c)}}const gu={partial:!0,tokenize:av},yu={concrete:!0,name:"codeFenced",tokenize:ov};function ov(e,t,n){const r=this,i={partial:!0,tokenize:k};let o=0,a=0,s;return l;function l(C){return u(C)}function u(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)?be(e,c,"whitespace")(C):c(C))}function c(C){return C===null||ce(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(gu,h,A)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||ce(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(C)):ye(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),be(e,d,"whitespace")(C)):C===96&&C===s?n(C):(e.consume(C),p)}function d(C){return C===null||ce(C)?c(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||ce(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(C)):C===96&&C===s?n(C):(e.consume(C),m)}function h(C){return e.attempt(i,A,y)(C)}function y(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),g}function g(C){return o>0&&ye(C)?be(e,v,"linePrefix",o+1)(C):v(C)}function v(C){return C===null||ce(C)?e.check(gu,h,A)(C):(e.enter("codeFlowValue"),x(C))}function x(C){return C===null||ce(C)?(e.exit("codeFlowValue"),v(C)):(e.consume(C),x)}function A(C){return e.exit("codeFenced"),t(C)}function k(C,T,M){let R=0;return I;function I(D){return C.enter("lineEnding"),C.consume(D),C.exit("lineEnding"),O}function O(D){return C.enter("codeFencedFence"),ye(D)?be(C,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):j(D)}function j(D){return D===s?(C.enter("codeFencedFenceSequence"),_(D)):M(D)}function _(D){return D===s?(R++,C.consume(D),_):R>=a?(C.exit("codeFencedFenceSequence"),ye(D)?be(C,N,"whitespace")(D):N(D)):M(D)}function N(D){return D===null||ce(D)?(C.exit("codeFencedFence"),T(D)):M(D)}}}function av(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 xo={name:"codeIndented",tokenize:lv},sv={partial:!0,tokenize:uv};function lv(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),be(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):ce(u)?e.attempt(sv,a,l)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||ce(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),s)}function l(u){return e.exit("codeIndented"),t(u)}}function uv(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):ce(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):be(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):ce(a)?i(a):n(a)}}const cv={name:"codeText",previous:dv,resolve:fv,tokenize:pv};function fv(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 dv(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function pv(e,t,n){let r=0,i,o;return a;function a(c){return e.enter("codeText"),e.enter("codeTextSequence"),s(c)}function s(c){return c===96?(e.consume(c),r++,s):(e.exit("codeTextSequence"),l(c))}function l(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),l):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):ce(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||ce(c)?(e.exit("codeTextData"),l(c)):(e.consume(c),u)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",u(c))}}class hv{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&&zn(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),zn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),zn(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);zn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);zn(this.left,n.reverse())}}}function zn(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 vu(e){const t={};let n=-1,r,i,o,a,s,l,u;const f=new hv(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,mv(f,n)),n=t[n],u=!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 tt(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function mv(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=[],u={};let f,c,p=-1,d=n,m=0,h=0;const y=[h];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(f=r.sliceStream(d),d.next||f.push(null),c&&a.defineSkip(d.start),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(f),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),c=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,y.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):y.pop(),p=y.length;p--;){const g=s.slice(y[p],y[p+1]),v=o.pop();l.push([v,v+g.length-1]),e.splice(v,2,g)}for(l.reverse(),p=-1;++p<l.length;)u[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return u}const gv={resolve:vv,tokenize:bv},yv={partial:!0,tokenize:xv};function vv(e){return vu(e),e}function bv(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):ce(s)?e.check(yv,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 xv(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),be(e,o,"linePrefix")}function o(a){if(a===null||ce(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 bu(e,t,n,r,i,o,a,s,l){const u=l||Number.POSITIVE_INFINITY;let f=0;return c;function c(g){return g===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(g),e.exit(o),p):g===null||g===32||g===41||Cr(g)?n(g):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(g))}function p(g){return g===62?(e.enter(o),e.consume(g),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===62?(e.exit("chunkString"),e.exit(s),p(g)):g===null||g===60||ce(g)?n(g):(e.consume(g),g===92?m:d)}function m(g){return g===60||g===62||g===92?(e.consume(g),d):d(g)}function h(g){return!f&&(g===null||g===41||Ie(g))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(g)):f<u&&g===40?(e.consume(g),f++,h):g===41?(e.consume(g),f--,h):g===null||g===32||g===40||Cr(g)?n(g):(e.consume(g),g===92?y:h)}function y(g){return g===40||g===41||g===92?(e.consume(g),h):h(g)}}function xu(e,t,n,r,i,o){const a=this;let s=0,l;return u;function u(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):ce(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===null||d===91||d===93||ce(d)||s++>999?(e.exit("chunkString"),f(d)):(e.consume(d),l||(l=!ye(d)),d===92?p:c)}function p(d){return d===91||d===92||d===93?(e.consume(d),s++,c):c(d)}}function wu(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),u(p))}function u(p){return p===a?(e.exit(o),l(a)):p===null?n(p):ce(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),be(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===a||p===null||ce(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:f)}function c(p){return p===a||p===92?(e.consume(p),f):f(p)}}function $n(e,t){let n;return r;function r(i){return ce(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ye(i)?be(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const wv={name:"definition",tokenize:Sv},kv={partial:!0,tokenize:Ev};function Sv(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),a(d)}function a(d){return xu.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function s(d){return i=ut(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 Ie(d)?$n(e,u)(d):u(d)}function u(d){return bu(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function f(d){return e.attempt(kv,c,c)(d)}function c(d){return ye(d)?be(e,p,"whitespace")(d):p(d)}function p(d){return d===null||ce(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function Ev(e,t,n){return r;function r(s){return Ie(s)?$n(e,i)(s):n(s)}function i(s){return wu(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return ye(s)?be(e,a,"whitespace")(s):a(s)}function a(s){return s===null||ce(s)?t(s):n(s)}}const Cv={name:"hardBreakEscape",tokenize:Av};function Av(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ce(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Iv={name:"headingAtx",resolve:Tv,tokenize:Ov};function Tv(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"},tt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Ov(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||Ie(f)?(e.exit("atxHeadingSequence"),s(f)):n(f)}function s(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||ce(f)?(e.exit("atxHeading"),t(f)):ye(f)?be(e,s,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),s(f))}function u(f){return f===null||f===35||Ie(f)?(e.exit("atxHeadingText"),s(f)):(e.consume(f),u)}}const Dv=["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"],ku=["pre","script","style","textarea"],Mv={concrete:!0,name:"htmlFlow",resolveTo:Nv,tokenize:Lv},_v={partial:!0,tokenize:Rv},Pv={partial:!0,tokenize:Fv};function Nv(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 Lv(e,t,n){const r=this;let i,o,a,s,l;return u;function u(w){return f(w)}function f(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),c}function c(w){return w===33?(e.consume(w),p):w===47?(e.consume(w),o=!0,h):w===63?(e.consume(w),i=3,r.interrupt?t:b):qe(w)?(e.consume(w),a=String.fromCharCode(w),y):n(w)}function p(w){return w===45?(e.consume(w),i=2,d):w===91?(e.consume(w),i=5,s=0,m):qe(w)?(e.consume(w),i=4,r.interrupt?t:b):n(w)}function d(w){return w===45?(e.consume(w),r.interrupt?t:b):n(w)}function m(w){const W="CDATA[";return w===W.charCodeAt(s++)?(e.consume(w),s===W.length?r.interrupt?t:j:m):n(w)}function h(w){return qe(w)?(e.consume(w),a=String.fromCharCode(w),y):n(w)}function y(w){if(w===null||w===47||w===62||Ie(w)){const W=w===47,X=a.toLowerCase();return!W&&!o&&ku.includes(X)?(i=1,r.interrupt?t(w):j(w)):Dv.includes(a.toLowerCase())?(i=6,W?(e.consume(w),g):r.interrupt?t(w):j(w)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(w):o?v(w):x(w))}return w===45||We(w)?(e.consume(w),a+=String.fromCharCode(w),y):n(w)}function g(w){return w===62?(e.consume(w),r.interrupt?t:j):n(w)}function v(w){return ye(w)?(e.consume(w),v):I(w)}function x(w){return w===47?(e.consume(w),I):w===58||w===95||qe(w)?(e.consume(w),A):ye(w)?(e.consume(w),x):I(w)}function A(w){return w===45||w===46||w===58||w===95||We(w)?(e.consume(w),A):k(w)}function k(w){return w===61?(e.consume(w),C):ye(w)?(e.consume(w),k):x(w)}function C(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),l=w,T):ye(w)?(e.consume(w),C):M(w)}function T(w){return w===l?(e.consume(w),l=null,R):w===null||ce(w)?n(w):(e.consume(w),T)}function M(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||Ie(w)?k(w):(e.consume(w),M)}function R(w){return w===47||w===62||ye(w)?x(w):n(w)}function I(w){return w===62?(e.consume(w),O):n(w)}function O(w){return w===null||ce(w)?j(w):ye(w)?(e.consume(w),O):n(w)}function j(w){return w===45&&i===2?(e.consume(w),z):w===60&&i===1?(e.consume(w),U):w===62&&i===4?(e.consume(w),P):w===63&&i===3?(e.consume(w),b):w===93&&i===5?(e.consume(w),V):ce(w)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(_v,H,_)(w)):w===null||ce(w)?(e.exit("htmlFlowData"),_(w)):(e.consume(w),j)}function _(w){return e.check(Pv,N,H)(w)}function N(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),D}function D(w){return w===null||ce(w)?_(w):(e.enter("htmlFlowData"),j(w))}function z(w){return w===45?(e.consume(w),b):j(w)}function U(w){return w===47?(e.consume(w),a="",$):j(w)}function $(w){if(w===62){const W=a.toLowerCase();return ku.includes(W)?(e.consume(w),P):j(w)}return qe(w)&&a.length<8?(e.consume(w),a+=String.fromCharCode(w),$):j(w)}function V(w){return w===93?(e.consume(w),b):j(w)}function b(w){return w===62?(e.consume(w),P):w===45&&i===2?(e.consume(w),b):j(w)}function P(w){return w===null||ce(w)?(e.exit("htmlFlowData"),H(w)):(e.consume(w),P)}function H(w){return e.exit("htmlFlow"),t(w)}}function Fv(e,t,n){const r=this;return i;function i(a){return ce(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 Rv(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Bn,t,n)}}const Bv={name:"htmlText",tokenize:zv};function zv(e,t,n){const r=this;let i,o,a;return s;function s(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),l}function l(b){return b===33?(e.consume(b),u):b===47?(e.consume(b),k):b===63?(e.consume(b),x):qe(b)?(e.consume(b),M):n(b)}function u(b){return b===45?(e.consume(b),f):b===91?(e.consume(b),o=0,m):qe(b)?(e.consume(b),v):n(b)}function f(b){return b===45?(e.consume(b),d):n(b)}function c(b){return b===null?n(b):b===45?(e.consume(b),p):ce(b)?(a=c,U(b)):(e.consume(b),c)}function p(b){return b===45?(e.consume(b),d):c(b)}function d(b){return b===62?z(b):b===45?p(b):c(b)}function m(b){const P="CDATA[";return b===P.charCodeAt(o++)?(e.consume(b),o===P.length?h:m):n(b)}function h(b){return b===null?n(b):b===93?(e.consume(b),y):ce(b)?(a=h,U(b)):(e.consume(b),h)}function y(b){return b===93?(e.consume(b),g):h(b)}function g(b){return b===62?z(b):b===93?(e.consume(b),g):h(b)}function v(b){return b===null||b===62?z(b):ce(b)?(a=v,U(b)):(e.consume(b),v)}function x(b){return b===null?n(b):b===63?(e.consume(b),A):ce(b)?(a=x,U(b)):(e.consume(b),x)}function A(b){return b===62?z(b):x(b)}function k(b){return qe(b)?(e.consume(b),C):n(b)}function C(b){return b===45||We(b)?(e.consume(b),C):T(b)}function T(b){return ce(b)?(a=T,U(b)):ye(b)?(e.consume(b),T):z(b)}function M(b){return b===45||We(b)?(e.consume(b),M):b===47||b===62||Ie(b)?R(b):n(b)}function R(b){return b===47?(e.consume(b),z):b===58||b===95||qe(b)?(e.consume(b),I):ce(b)?(a=R,U(b)):ye(b)?(e.consume(b),R):z(b)}function I(b){return b===45||b===46||b===58||b===95||We(b)?(e.consume(b),I):O(b)}function O(b){return b===61?(e.consume(b),j):ce(b)?(a=O,U(b)):ye(b)?(e.consume(b),O):R(b)}function j(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,_):ce(b)?(a=j,U(b)):ye(b)?(e.consume(b),j):(e.consume(b),N)}function _(b){return b===i?(e.consume(b),i=void 0,D):b===null?n(b):ce(b)?(a=_,U(b)):(e.consume(b),_)}function N(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||Ie(b)?R(b):(e.consume(b),N)}function D(b){return b===47||b===62||Ie(b)?R(b):n(b)}function z(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function U(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),$}function $(b){return ye(b)?be(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):V(b)}function V(b){return e.enter("htmlTextData"),a(b)}}const wo={name:"labelEnd",resolveAll:Hv,resolveTo:Wv,tokenize:Vv},$v={tokenize:qv},jv={tokenize:Kv},Uv={tokenize:Yv};function Hv(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&&tt(e,0,e.length,n),e}function Wv(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}},u={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",u,t]],s=it(s,e.slice(o+1,o+r+3)),s=it(s,[["enter",f,t]]),s=it(s,Ir(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",u,t]]),s=it(s,e.slice(a+1)),s=it(s,[["exit",l,t]]),tt(e,o,e.length,s),e}function Vv(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?c(p):(a=r.parser.defined.includes(ut(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($v,f,a?f:c)(p):p===91?e.attempt(jv,f,a?u:c)(p):a?f(p):c(p)}function u(p){return e.attempt(Uv,f,c)(p)}function f(p){return t(p)}function c(p){return o._balanced=!0,n(p)}}function qv(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return Ie(c)?$n(e,o)(c):o(c)}function o(c){return c===41?f(c):bu(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function a(c){return Ie(c)?$n(e,l)(c):f(c)}function s(c){return n(c)}function l(c){return c===34||c===39||c===40?wu(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return Ie(c)?$n(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function Kv(e,t,n){const r=this;return i;function i(s){return xu.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(ut(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function Yv(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 Gv={name:"labelStartImage",resolveAll:wo.resolveAll,tokenize:Qv};function Qv(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 Jv={name:"labelStartLink",resolveAll:wo.resolveAll,tokenize:Zv};function Zv(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 ko={name:"lineEnding",tokenize:Xv};function Xv(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),be(e,t,"linePrefix")}}const Tr={name:"thematicBreak",tokenize:eb};function eb(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),a(u)}function a(u){return i=u,s(u)}function s(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||ce(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),ye(u)?be(e,s,"whitespace")(u):s(u))}}const Je={continuation:{tokenize:ib},exit:ab,name:"list",tokenize:rb},tb={partial:!0,tokenize:sb},nb={partial:!0,tokenize:ob};function rb(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:vo(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(Tr,n,u)(d):u(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return vo(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"),u(d)):n(d)}function u(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(Bn,r.interrupt?n:f,e.attempt(tb,p,c))}function f(d){return r.containerState.initialBlankLine=!0,o++,p(d)}function c(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 ib(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Bn,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,be(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(nb,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,be(e,e.attempt(Je,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function ob(e,t,n){const r=this;return be(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 ab(e){e.exit(this.containerState.type)}function sb(e,t,n){const r=this;return be(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 Su={name:"setextUnderline",resolveTo:lb,tokenize:ub};function lb(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 ub(e,t,n){const r=this;let i;return o;function o(u){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),ye(u)?be(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ce(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const cb={tokenize:fb};function fb(e){const t=this,n=e.attempt(Bn,r,e.attempt(this.parser.constructs.flowInitial,i,be(e,e.attempt(this.parser.constructs.flow,i,e.attempt(gv,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 db={resolveAll:Cu()},pb=Eu("string"),hb=Eu("text");function Eu(e){return{resolveAll:Cu(e==="text"?mb: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 u(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 u(f)?(n.exit("data"),o(f)):(n.consume(f),l)}function u(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p<c.length;){const d=c[p];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function Cu(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 mb(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 u=i[o];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(u===-2)l=!0,s++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const u={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={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const gb=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:wv},disable:{null:[]},document:{42:Je,43:Je,45:Je,48:Je,49:Je,50:Je,51:Je,52:Je,53:Je,54:Je,55:Je,56:Je,57:Je,62:pu},flow:{35:Iv,42:Tr,45:[Su,Tr],60:Mv,61:Su,95:Tr,96:yu,126:yu},flowInitial:{[-2]:xo,[-1]:xo,32:xo},insideSpan:{null:[bo,db]},string:{38:mu,92:hu},text:{[-5]:ko,[-4]:ko,[-3]:ko,33:Gv,38:mu,42:bo,60:[Jy,Bv],91:Jv,92:[Cv,hu],93:wo,95:bo,96:cv}},Symbol.toStringTag,{value:"Module"}));function yb(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(k),check:T(C),consume:v,enter:x,exit:A,interrupt:T(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:d,write:c};let f=t.tokenize.call(u,l);return t.resolveAll&&o.push(t),u;function c(O){return a=it(a,O),y(),a[a.length-1]!==null?[]:(M(t,0),u.events=Ir(o,u.events,u),u.events)}function p(O,j){return bb(d(O),j)}function d(O){return vb(a,O)}function m(){const{_bufferIndex:O,_index:j,line:_,column:N,offset:D}=r;return{_bufferIndex:O,_index:j,line:_,column:N,offset:D}}function h(O){i[O.line]=O.column,I()}function y(){let O;for(;r._index<a.length;){const j=a[r._index];if(typeof j=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<j.length;)g(j.charCodeAt(r._bufferIndex));else g(j)}}function g(O){f=f(O)}function v(O){ce(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,I()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function x(O,j){const _=j||{};return _.type=O,_.start=m(),u.events.push(["enter",_,u]),s.push(_),_}function A(O){const j=s.pop();return j.end=m(),u.events.push(["exit",j,u]),j}function k(O,j){M(O,j.from)}function C(O,j){j.restore()}function T(O,j){return _;function _(N,D,z){let U,$,V,b;return Array.isArray(N)?H(N):"tokenize"in N?H([N]):P(N);function P(Y){return J;function J(ee){const ie=ee!==null&&Y[ee],K=ee!==null&&Y.null,te=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(K)?K:K?[K]:[]];return H(te)(ee)}}function H(Y){return U=Y,$=0,Y.length===0?z:w(Y[$])}function w(Y){return J;function J(ee){return b=R(),V=Y,Y.partial||(u.currentConstruct=Y),Y.name&&u.parser.constructs.disable.null.includes(Y.name)?X():Y.tokenize.call(j?Object.assign(Object.create(u),j):u,l,W,X)(ee)}}function W(Y){return O(V,b),D}function X(Y){return b.restore(),++$<U.length?w(U[$]):z}}}function M(O,j){O.resolveAll&&!o.includes(O)&&o.push(O),O.resolve&&tt(u.events,j,u.events.length-j,O.resolve(u.events.slice(j),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function R(){const O=m(),j=u.previous,_=u.currentConstruct,N=u.events.length,D=Array.from(s);return{from:N,restore:z};function z(){r=O,u.previous=j,u.currentConstruct=_,u.events.length=N,s=D,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function vb(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 bb(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=`
213
+ `;break}case-3:{a=`\r
214
+ `;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 xb(e){const r={constructs:uu([gb,...(e||{}).extensions||[]]),content:i(Wy),defined:[],document:i(qy),flow:i(cb),lazy:{},string:i(pb),text:i(hb)};return r;function i(o){return a;function a(s){return yb(r,o,s)}}}function wb(e){for(;!vu(e););return e}const Au=/[\0\t\n\r]/g;function kb(){let e=1,t="",n=!0,r;return i;function i(o,a,s){const l=[];let u,f,c,p,d;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(Au.lastIndex=c,u=Au.exec(o),p=u&&u.index!==void 0?u.index:o.length,d=o.charCodeAt(p),!u){t=o.slice(c);break}if(d===10&&c===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<p&&(l.push(o.slice(c,p)),e+=p-c),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}c=p+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Sb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Eb(e){return e.replace(Sb,Cb)}function Cb(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return cu(n.slice(o?2:1),o?16:10)}return yo(n)||e}const Iu={}.hasOwnProperty;function Ab(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Ib(n)(wb(xb(n).document().write(kb()(e,t,!0))))}function Ib(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(de),autolinkProtocol:R,autolinkEmail:R,atxHeading:o(ke),blockQuote:o(K),characterEscape:R,characterReference:R,codeFenced:o(te),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(te,a),codeText:o(L,a),codeTextData:R,data:R,codeFlowValue:R,definition:o(ne),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(me),hardBreakEscape:o(oe),hardBreakTrailing:o(oe),htmlFlow:o(G,a),htmlFlowData:R,htmlText:o(G,a),htmlTextData:R,image:o(ue),label:a,link:o(de),listItem:o(Se),listItemValue:p,listOrdered:o(xe,c),listUnordered:o(xe),paragraph:o(Ue),reference:w,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(ke),strong:o(Ye),thematicBreak:o(se)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:ie,autolinkProtocol:ee,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:Y,characterReference:J,codeFenced:l(y),codeFencedFence:h,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:I,codeIndented:l(g),codeText:l(D),codeTextData:I,data:I,definition:l(),definitionDestinationString:A,definitionLabelString:v,definitionTitleString:x,emphasis:l(),hardBreakEscape:l(j),hardBreakTrailing:l(j),htmlFlow:l(_),htmlFlowData:I,htmlText:l(N),htmlTextData:I,image:l(U),label:V,labelText:$,lineEnding:O,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:W,resourceDestinationString:b,resourceTitleString:P,resource:H,setextHeading:l(M),setextHeadingLineSequence:T,setextHeadingText:C,strong:l(),thematicBreak:l()}};Tu(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(B){let q={type:"root",children:[]};const ae={stack:[q],tokenStack:[],config:t,enter:s,exit:u,buffer:a,resume:f,data:n},le=[];let pe=-1;for(;++pe<B.length;)if(B[pe][1].type==="listOrdered"||B[pe][1].type==="listUnordered")if(B[pe][0]==="enter")le.push(pe);else{const fe=le.pop();pe=i(B,fe,pe)}for(pe=-1;++pe<B.length;){const fe=t[B[pe][0]];Iu.call(fe,B[pe][1].type)&&fe[B[pe][1].type].call(Object.assign({sliceSerialize:B[pe][2].sliceSerialize},ae),B[pe][1])}if(ae.tokenStack.length>0){const fe=ae.tokenStack[ae.tokenStack.length-1];(fe[1]||Ou).call(ae,void 0,fe[0])}for(q.position={start:Mt(B.length>0?B[0][1].start:{line:1,column:1,offset:0}),end:Mt(B.length>0?B[B.length-2][1].end:{line:1,column:1,offset:0})},pe=-1;++pe<t.transforms.length;)q=t.transforms[pe](q)||q;return q}function i(B,q,ae){let le=q-1,pe=-1,fe=!1,Ee,Oe,st,gt;for(;++le<=ae;){const ze=B[le];switch(ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ze[0]==="enter"?pe++:pe--,gt=void 0;break}case"lineEndingBlank":{ze[0]==="enter"&&(Ee&&!gt&&!pe&&!st&&(st=le),gt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:gt=void 0}if(!pe&&ze[0]==="enter"&&ze[1].type==="listItemPrefix"||pe===-1&&ze[0]==="exit"&&(ze[1].type==="listUnordered"||ze[1].type==="listOrdered")){if(Ee){let lt=le;for(Oe=void 0;lt--;){const Ge=B[lt];if(Ge[1].type==="lineEnding"||Ge[1].type==="lineEndingBlank"){if(Ge[0]==="exit")continue;Oe&&(B[Oe][1].type="lineEndingBlank",fe=!0),Ge[1].type="lineEnding",Oe=lt}else if(!(Ge[1].type==="linePrefix"||Ge[1].type==="blockQuotePrefix"||Ge[1].type==="blockQuotePrefixWhitespace"||Ge[1].type==="blockQuoteMarker"||Ge[1].type==="listItemIndent"))break}st&&(!Oe||st<Oe)&&(Ee._spread=!0),Ee.end=Object.assign({},Oe?B[Oe][1].start:ze[1].end),B.splice(Oe||le,0,["exit",Ee,ze[2]]),le++,ae++}if(ze[1].type==="listItemPrefix"){const lt={type:"listItem",_spread:!1,start:Object.assign({},ze[1].start),end:void 0};Ee=lt,B.splice(le,0,["enter",lt,ze[2]]),le++,ae++,st=void 0,gt=!0}}}return B[q][1]._spread=fe,ae}function o(B,q){return ae;function ae(le){s.call(this,B(le),le),q&&q.call(this,le)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(B,q,ae){this.stack[this.stack.length-1].children.push(B),this.stack.push(B),this.tokenStack.push([q,ae||void 0]),B.position={start:Mt(q.start),end:void 0}}function l(B){return q;function q(ae){B&&B.call(this,ae),u.call(this,ae)}}function u(B,q){const ae=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==B.type&&(q?q.call(this,B,le[0]):(le[1]||Ou).call(this,B,le[0]));else throw new Error("Cannot close `"+B.type+"` ("+Fn({start:B.start,end:B.end})+"): it’s not open");ae.position.end=Mt(B.end)}function f(){return go(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(B){if(this.data.expectingFirstListItemValue){const q=this.stack[this.stack.length-2];q.start=Number.parseInt(this.sliceSerialize(B),10),this.data.expectingFirstListItemValue=void 0}}function d(){const B=this.resume(),q=this.stack[this.stack.length-1];q.lang=B}function m(){const B=this.resume(),q=this.stack[this.stack.length-1];q.meta=B}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const B=this.resume(),q=this.stack[this.stack.length-1];q.value=B.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const B=this.resume(),q=this.stack[this.stack.length-1];q.value=B.replace(/(\r?\n|\r)$/g,"")}function v(B){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.label=q,ae.identifier=ut(this.sliceSerialize(B)).toLowerCase()}function x(){const B=this.resume(),q=this.stack[this.stack.length-1];q.title=B}function A(){const B=this.resume(),q=this.stack[this.stack.length-1];q.url=B}function k(B){const q=this.stack[this.stack.length-1];if(!q.depth){const ae=this.sliceSerialize(B).length;q.depth=ae}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function T(B){const q=this.stack[this.stack.length-1];q.depth=this.sliceSerialize(B).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function R(B){const ae=this.stack[this.stack.length-1].children;let le=ae[ae.length-1];(!le||le.type!=="text")&&(le=Z(),le.position={start:Mt(B.start),end:void 0},ae.push(le)),this.stack.push(le)}function I(B){const q=this.stack.pop();q.value+=this.sliceSerialize(B),q.position.end=Mt(B.end)}function O(B){const q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ae=q.children[q.children.length-1];ae.position.end=Mt(B.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(q.type)&&(R.call(this,B),I.call(this,B))}function j(){this.data.atHardBreak=!0}function _(){const B=this.resume(),q=this.stack[this.stack.length-1];q.value=B}function N(){const B=this.resume(),q=this.stack[this.stack.length-1];q.value=B}function D(){const B=this.resume(),q=this.stack[this.stack.length-1];q.value=B}function z(){const B=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=q,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 q=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=q,delete B.url,delete B.title}else delete B.identifier,delete B.label;this.data.referenceType=void 0}function $(B){const q=this.sliceSerialize(B),ae=this.stack[this.stack.length-2];ae.label=Eb(q),ae.identifier=ut(q).toLowerCase()}function V(){const B=this.stack[this.stack.length-1],q=this.resume(),ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,ae.type==="link"){const le=B.children;ae.children=le}else ae.alt=q}function b(){const B=this.resume(),q=this.stack[this.stack.length-1];q.url=B}function P(){const B=this.resume(),q=this.stack[this.stack.length-1];q.title=B}function H(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function W(B){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.label=q,ae.identifier=ut(this.sliceSerialize(B)).toLowerCase(),this.data.referenceType="full"}function X(B){this.data.characterReferenceType=B.type}function Y(B){const q=this.sliceSerialize(B),ae=this.data.characterReferenceType;let le;ae?(le=cu(q,ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=yo(q);const pe=this.stack[this.stack.length-1];pe.value+=le}function J(B){const q=this.stack.pop();q.position.end=Mt(B.end)}function ee(B){I.call(this,B);const q=this.stack[this.stack.length-1];q.url=this.sliceSerialize(B)}function ie(B){I.call(this,B);const q=this.stack[this.stack.length-1];q.url="mailto:"+this.sliceSerialize(B)}function K(){return{type:"blockquote",children:[]}}function te(){return{type:"code",lang:null,meta:null,value:""}}function L(){return{type:"inlineCode",value:""}}function ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function me(){return{type:"emphasis",children:[]}}function ke(){return{type:"heading",depth:0,children:[]}}function oe(){return{type:"break"}}function G(){return{type:"html",value:""}}function ue(){return{type:"image",title:null,url:"",alt:null}}function de(){return{type:"link",title:null,url:"",children:[]}}function xe(B){return{type:"list",ordered:B.type==="listOrdered",start:null,spread:B._spread,children:[]}}function Se(B){return{type:"listItem",spread:B._spread,checked:null,children:[]}}function Ue(){return{type:"paragraph",children:[]}}function Ye(){return{type:"strong",children:[]}}function Z(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}function Mt(e){return{line:e.line,column:e.column,offset:e.offset}}function Tu(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Tu(e,r):Tb(e,r)}}function Tb(e,t){let n;for(n in t)if(Iu.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 Ou(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Fn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Fn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Fn({start:t.start,end:t.end})+") is still open")}function Ob(e){const t=this;t.parser=n;function n(r){return Ab(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Db(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 Mb(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
215
+ `}]}function _b(e,t){const n=t.value?t.value+`
216
+ `:"",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 Pb(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nb(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Lb(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 u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function Fb(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 Rb(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Du(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 Bb(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Du(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 zb(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 $b(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 jb(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Du(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 Ub(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 Hb(e,t,n){const r=e.all(t),i=n?Wb(n):Mu(t),o={},a=[];if(typeof t.checked=="boolean"){const f=r[0];let c;f&&f.type==="element"&&f.tagName==="p"?c=f:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.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:`
217
+ `}),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:`
218
+ `});const u={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,u),e.applyData(t,u)}function Wb(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=Mu(n[r])}return t}function Mu(e){const t=e.spread;return t??e.children.length>1}function Vb(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 qb(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Kb(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Yb(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Gb(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=uo(t.children[1]),l=Jl(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 Qb(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 u=[];for(;++l<s;){const c=t.children[l],p={},d=a?a[l]:void 0;d&&(p.align=d);let m={type:"element",tagName:o,properties:p,children:[]};c&&(m.children=e.all(c),e.patch(c,m),m=e.applyData(c,m)),u.push(m)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,f),e.applyData(t,f)}function Jb(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const _u=9,Pu=32;function Zb(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(Nu(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Nu(t.slice(i),i>0,!1)),o.join("")}function Nu(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===_u||o===Pu;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===_u||o===Pu;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Xb(e,t){const n={type:"text",value:Zb(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function ex(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const tx={blockquote:Db,break:Mb,code:_b,delete:Pb,emphasis:Nb,footnoteReference:Lb,heading:Fb,html:Rb,imageReference:Bb,image:zb,inlineCode:$b,linkReference:jb,link:Ub,listItem:Hb,list:Vb,paragraph:qb,root:Kb,strong:Yb,table:Gb,tableCell:Jb,tableRow:Qb,text:Xb,thematicBreak:ex,toml:Or,yaml:Or,definition:Or,footnoteDefinition:Or};function Or(){}const Lu=-1,Dr=0,jn=1,Mr=2,So=3,Eo=4,Co=5,Ao=6,Fu=7,Ru=8,Bu=typeof self=="object"?self:globalThis,nx=(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 Dr:case Lu:return n(a,i);case jn:{const s=n([],i);for(const l of a)s.push(r(l));return s}case Mr:{const s=n({},i);for(const[l,u]of a)s[r(l)]=r(u);return s}case So:return n(new Date(a),i);case Eo:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case Co:{const s=n(new Map,i);for(const[l,u]of a)s.set(r(l),r(u));return s}case Ao:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case Fu:{const{name:s,message:l}=a;return n(new Bu[s](l),i)}case Ru: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 Bu[o](a),i)};return r},zu=e=>nx(new Map,e)(0),rn="",{toString:rx}={},{keys:ix}=Object,Un=e=>{const t=typeof e;if(t!=="object"||!e)return[Dr,t];const n=rx.call(e).slice(8,-1);switch(n){case"Array":return[jn,rn];case"Object":return[Mr,rn];case"Date":return[So,rn];case"RegExp":return[Eo,rn];case"Map":return[Co,rn];case"Set":return[Ao,rn];case"DataView":return[jn,n]}return n.includes("Array")?[jn,n]:n.includes("Error")?[Fu,n]:[Mr,n]},_r=([e,t])=>e===Dr&&(t==="function"||t==="symbol"),ox=(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]=Un(a);switch(s){case Dr:{let f=a;switch(l){case"bigint":s=Ru,f=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([Lu],a)}return i([s,f],a)}case jn:{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=[],c=i([s,f],a);for(const p of a)f.push(o(p));return c}case Mr:{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=[],c=i([s,f],a);for(const p of ix(a))(e||!_r(Un(a[p])))&&f.push([o(p),o(a[p])]);return c}case So:return i([s,a.toISOString()],a);case Eo:{const{source:f,flags:c}=a;return i([s,{source:f,flags:c}],a)}case Co:{const f=[],c=i([s,f],a);for(const[p,d]of a)(e||!(_r(Un(p))||_r(Un(d))))&&f.push([o(p),o(d)]);return c}case Ao:{const f=[],c=i([s,f],a);for(const p of a)(e||!_r(Un(p)))&&f.push(o(p));return c}}const{message:u}=a;return i([s,{name:l,message:u}],a)};return o},$u=(e,{json:t,lossy:n}={})=>{const r=[];return ox(!(t||n),!!t,new Map,r)(e),r},Pr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?zu($u(e,t)):structuredClone(e):(e,t)=>zu($u(e,t));function ax(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 sx(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function lx(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ax,r=e.options.footnoteBackLabel||sx,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 u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const f=e.all(u),c=String(u.identifier).toUpperCase(),p=tn(c.toLowerCase());let d=0;const m=[],h=e.footnoteCounts.get(c);for(;h!==void 0&&++d<=h;){m.length>0&&m.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,d);typeof v=="string"&&(v={type:"text",value:v}),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(v)?v:[v]})}const y=f[f.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const v=y.children[y.children.length-1];v&&v.type==="text"?v.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...m)}else f.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(u,g),s.push(g)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Pr(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
219
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
220
+ `}]}}const Nr=function(e){if(e==null)return dx;if(typeof e=="function")return Lr(e);if(typeof e=="object")return Array.isArray(e)?ux(e):cx(e);if(typeof e=="string")return fx(e);throw new Error("Expected function, string, or object as test")};function ux(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Nr(e[n]);return Lr(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function cx(e){const t=e;return Lr(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function fx(e){return Lr(t);function t(n){return n&&n.type===e}}function Lr(e){return t;function t(n,r,i){return!!(px(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function dx(){return!0}function px(e){return e!==null&&typeof e=="object"&&"type"in e}function TO(e){return e}const ju=[],hx=!0,Io=!1,mx="skip";function Uu(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Nr(i),a=r?-1:1;s(e,void 0,[])();function s(l,u,f){const c=l&&typeof l=="object"?l:{};if(typeof c.type=="string"){const d=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return p;function p(){let d=ju,m,h,y;if((!t||o(l,u,f[f.length-1]||void 0))&&(d=gx(n(l,f)),d[0]===Io))return d;if("children"in l&&l.children){const g=l;if(g.children&&d[0]!==mx)for(h=(r?g.children.length:-1)+a,y=f.concat(g);h>-1&&h<g.children.length;){const v=g.children[h];if(m=s(v,h,y)(),m[0]===Io)return m;h=typeof m[1]=="number"?m[1]:h+a}}return d}}}function gx(e){return Array.isArray(e)?e:typeof e=="number"?[hx,e]:e==null?ju:[e]}function To(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),Uu(e,o,s,i);function s(l,u){const f=u[u.length-1],c=f?f.children.indexOf(l):void 0;return a(l,c,f)}}const Oo={}.hasOwnProperty,yx={};function vx(e,t){const n=t||yx,r=new Map,i=new Map,o=new Map,a={...tx,...n.handlers},s={all:u,applyData:xx,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:l,options:n,patch:bx,wrap:kx};return To(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();c.has(p)||c.set(p,f)}}),s;function l(f,c){const p=f.type,d=s.handlers[p];if(Oo.call(s.handlers,p)&&d)return d(s,f,c);if(s.options.passThrough&&s.options.passThrough.includes(p)){if("children"in f){const{children:h,...y}=f,g=Pr(y);return g.children=s.all(f),g}return Pr(f)}return(s.options.unknownHandler||wx)(s,f,c)}function u(f){const c=[];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=Hu(m.value)),!Array.isArray(m)&&m.type==="element")){const h=m.children[0];h&&h.type==="text"&&(h.value=Hu(h.value))}Array.isArray(m)?c.push(...m):c.push(m)}}}return c}}function bx(e,t){e.position&&(t.position=gy(e))}function xx(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,Pr(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function wx(e,t){const n=t.data||{},r="value"in t&&!(Oo.call(n,"hProperties")||Oo.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 kx(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
221
+ `});++r<e.length;)r&&n.push({type:"text",value:`
222
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
223
+ `}),n}function Hu(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Wu(e,t){const n=vx(e,t),r=n.one(e,void 0),i=lx(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
224
+ `},i),o}function Sx(e,t){return e&&"run"in e?async function(n,r){const i=Wu(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Wu(n,{file:r,...e||t})}}function Vu(e){if(e)throw e}var Fr=Object.prototype.hasOwnProperty,qu=Object.prototype.toString,Ku=Object.defineProperty,Yu=Object.getOwnPropertyDescriptor,Gu=function(t){return typeof Array.isArray=="function"?Array.isArray(t):qu.call(t)==="[object Array]"},Qu=function(t){if(!t||qu.call(t)!=="[object Object]")return!1;var n=Fr.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Fr.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Fr.call(t,i)},Ju=function(t,n){Ku&&n.name==="__proto__"?Ku(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Zu=function(t,n){if(n==="__proto__")if(Fr.call(t,n)){if(Yu)return Yu(t,n).value}else return;return t[n]},Ex=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=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<u;++l)if(t=arguments[l],t!=null)for(n in t)r=Zu(s,n),i=Zu(t,n),s!==i&&(f&&i&&(Qu(i)||(o=Gu(i)))?(o?(o=!1,a=r&&Gu(r)?r:[]):a=r&&Qu(r)?r:{},Ju(s,{name:n,newValue:e(f,a,i)})):typeof i<"u"&&Ju(s,{name:n,newValue:i}));return s};const Do=jt(Ex);function Mo(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 Cx(){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,...u){const f=e[++o];let c=-1;if(l){a(l);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?Ax(f,s)(...u):a(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Ax(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(u){const f=u;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 yt={basename:Ix,dirname:Tx,extname:Ox,join:Dx,sep:"/"};function Ix(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Hn(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 Tx(e){if(Hn(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 Ox(e){Hn(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 Dx(...e){let t=-1,n;for(;++t<e.length;)Hn(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Mx(n)}function Mx(e){Hn(e);const t=e.codePointAt(0)===47;let n=_x(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function _x(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 Hn(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Px={cwd:Nx};function Nx(){return"/"}function _o(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Lx(e){if(typeof e=="string")e=new URL(e);else if(!_o(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 Fx(e)}function Fx(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 Po=["history","path","basename","stem","extname","dirname"];class Xu{constructor(t){let n;t?_o(t)?n={path:t}:typeof t=="string"||Rx(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Px.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Po.length;){const o=Po[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)Po.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?yt.basename(this.path):void 0}set basename(t){Lo(t,"basename"),No(t,"basename"),this.path=yt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?yt.dirname(this.path):void 0}set dirname(t){ec(this.basename,"dirname"),this.path=yt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?yt.extname(this.path):void 0}set extname(t){if(No(t,"extname"),ec(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=yt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){_o(t)&&(t=Lx(t)),Lo(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?yt.basename(this.path,this.extname):void 0}set stem(t){Lo(t,"stem"),No(t,"stem"),this.path=yt.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 No(e,t){if(e&&e.includes(yt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+yt.sep+"`")}function Lo(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ec(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Rx(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Bx=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},zx={}.hasOwnProperty;class Fo extends Bx{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=Cx()}copy(){const t=new Fo;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Do(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(zo("data",this.frozen),this.namespace[t]=n,this):zx.call(this.namespace,t)&&this.namespace[t]||void 0:t?(zo("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=Rr(t),r=this.parser||this.Parser;return Ro("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Ro("process",this.parser||this.Parser),Bo("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const s=Rr(t),l=r.parse(s);r.run(l,s,function(f,c,p){if(f||!c||!p)return u(f);const d=c,m=r.stringify(d,p);Ux(m)?p.value=m:p.result=m,u(f,p)});function u(f,c){f||!c?a(f):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),Ro("processSync",this.parser||this.Parser),Bo("processSync",this.compiler||this.Compiler),this.process(t,i),nc("processSync","process",n),r;function i(o,a){n=!0,Vu(o),r=a}}run(t,n,r){tc(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=Rr(n);i.run(t,l,u);function u(f,c,p){const d=c||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),nc("runSync","run",r),i;function o(a,s){Vu(a),i=s,r=!0}}stringify(t,n){this.freeze();const r=Rr(n),i=this.compiler||this.Compiler;return Bo("stringify",i),tc(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(zo("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(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...c]=u;l(f,c)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))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(u.plugins),u.settings&&(i.settings=Do(!0,i.settings,u.settings))}function s(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const c=u[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,f){let c=-1,p=-1;for(;++c<r.length;)if(r[c][0]===u){p=c;break}if(p===-1)r.push([u,...f]);else if(f.length>0){let[d,...m]=f;const h=r[p][1];Mo(h)&&Mo(d)&&(d=Do(!0,h,d)),r[p]=[u,d,...m]}}}}const $x=new Fo().freeze();function Ro(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Bo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function zo(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 tc(e){if(!Mo(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function nc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Rr(e){return jx(e)?e:new Xu(e)}function jx(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ux(e){return typeof e=="string"||Hx(e)}function Hx(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Wx="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",rc=[],ic={allowDangerousHtml:!0},Vx=/^(https?|ircs?|mailto|xmpp)$/i,qx=[{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 oc(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,a=e.disallowedElements,s=e.rehypePlugins||rc,l=e.remarkPlugins||rc,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ic}:ic,f=e.skipHtml,c=e.unwrapDisallowed,p=e.urlTransform||ac,d=$x().use(Ob).use(l).use(Sx,u).use(s),m=new Xu;typeof r=="string"&&(m.value=r);for(const v of qx)Object.hasOwn(e,v.from)&&(""+v.from+(v.to?"use `"+v.to+"` instead":"remove it")+Wx+v.id,void 0);const h=d.parse(m);let y=d.runSync(h,m);return i&&(y={type:"element",tagName:"div",properties:{className:i},children:y.type==="root"?y.children:[y]}),To(y,g),wy(y,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function g(v,x,A){if(v.type==="raw"&&A&&typeof x=="number")return f?A.children.splice(x,1):A.children[x]={type:"text",value:v.value},x;if(v.type==="element"){let k;for(k in mo)if(Object.hasOwn(mo,k)&&Object.hasOwn(v.properties,k)){const C=v.properties[k],T=mo[k];(T===null||T.includes(v.tagName))&&(v.properties[k]=p(String(C||""),k,v))}}if(v.type==="element"){let k=t?!t.includes(v.tagName):a?a.includes(v.tagName):!1;if(!k&&n&&typeof x=="number"&&(k=!n(v,x,A)),k&&A&&typeof x=="number")return c&&v.children?A.children.splice(x,1,...v.children):A.children.splice(x,1),x}}}function ac(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||Vx.test(e.slice(0,t))?e:""}function Kx(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function sc(e,t,n){const i=Nr((n||{}).ignore||[]),o=Yx(t);let a=-1;for(;++a<o.length;)Uu(e,"text",s);function s(u,f){let c=-1,p;for(;++c<f.length;){const d=f[c],m=p?p.children:void 0;if(i(d,m?m.indexOf(d):void 0,p))return;p=d}if(p)return l(u,f)}function l(u,f){const c=f[f.length-1],p=o[a][0],d=o[a][1];let m=0;const y=c.children.indexOf(u);let g=!1,v=[];p.lastIndex=0;let x=p.exec(u.value);for(;x;){const A=x.index,k={index:x.index,input:x.input,stack:[...f,u]};let C=d(...x,k);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?p.lastIndex=A+1:(m!==A&&v.push({type:"text",value:u.value.slice(m,A)}),Array.isArray(C)?v.push(...C):C&&v.push(C),m=A+x[0].length,g=!0),!p.global)break;x=p.exec(u.value)}return g?(m<u.value.length&&v.push({type:"text",value:u.value.slice(m)}),c.children.splice(y,1,...v)):v=[u],y+v.length}}function Yx(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([Gx(i[0]),Qx(i[1])])}return t}function Gx(e){return typeof e=="string"?new RegExp(Kx(e),"g"):e}function Qx(e){return typeof e=="function"?e:function(){return e}}function Jx(e){sc(e,[/\r?\n|\r/g,Zx])}function Zx(){return{type:"break"}}function Xx(){return function(e){Jx(e)}}function lc(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 $o="phrasing",jo=["autolink","link","image","label"];function ew(){return{transforms:[sw],enter:{literalAutolink:nw,literalAutolinkEmail:Uo,literalAutolinkHttp:Uo,literalAutolinkWww:Uo},exit:{literalAutolink:aw,literalAutolinkEmail:ow,literalAutolinkHttp:rw,literalAutolinkWww:iw}}}function tw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:$o,notInConstruct:jo},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:$o,notInConstruct:jo},{character:":",before:"[ps]",after:"\\/",inConstruct:$o,notInConstruct:jo}]}}function nw(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Uo(e){this.config.enter.autolinkProtocol.call(this,e)}function rw(e){this.config.exit.autolinkProtocol.call(this,e)}function iw(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 ow(e){this.config.exit.autolinkEmail.call(this,e)}function aw(e){this.exit(e)}function sw(e){sc(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,lw],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),uw]],{ignore:["link","linkReference"]})}function lw(e,t,n,r,i){let o="";if(!uc(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!cw(n)))return!1;const a=fw(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 uw(e,t,n,r){return!uc(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function cw(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 fw(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=lc(e,"(");let o=lc(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 uc(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Wt(n)||Ar(n))&&(!t||n!==47)}cc.peek=xw;function dw(){this.buffer()}function pw(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function hw(){this.buffer()}function mw(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function gw(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ut(this.sliceSerialize(e)).toLowerCase(),n.label=t}function yw(e){this.exit(e)}function vw(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ut(this.sliceSerialize(e)).toLowerCase(),n.label=t}function bw(e){this.exit(e)}function xw(){return"["}function cc(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 ww(){return{enter:{gfmFootnoteCallString:dw,gfmFootnoteCall:pw,gfmFootnoteDefinitionLabelString:hw,gfmFootnoteDefinition:mw},exit:{gfmFootnoteCallString:gw,gfmFootnoteCall:yw,gfmFootnoteDefinitionLabelString:vw,gfmFootnoteDefinition:bw}}}function kw(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:cc},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,a){const s=o.createTracker(a);let l=s.move("[^");const u=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?`
225
+ `:" ")+o.indentLines(o.containerFlow(r,s.current()),t?fc:Sw))),u(),l}}function Sw(e,t,n){return t===0?e:fc(e,t,n)}function fc(e,t,n){return(n?"":" ")+e}const Ew=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];dc.peek=Ow;function Cw(){return{canContainEols:["delete"],enter:{strikethrough:Iw},exit:{strikethrough:Tw}}}function Aw(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ew}],handlers:{delete:dc}}}function Iw(e){this.enter({type:"delete",children:[]},e)}function Tw(e){this.exit(e)}function dc(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 Ow(){return"~"}function Dw(e){return e.length}function Mw(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Dw,o=[],a=[],s=[],l=[];let u=0,f=-1;for(;++f<e.length;){const h=[],y=[];let g=-1;for(e[f].length>u&&(u=e[f].length);++g<e[f].length;){const v=_w(e[f][g]);if(n.alignDelimiters!==!1){const x=i(v);y[g]=x,(l[g]===void 0||x>l[g])&&(l[g]=x)}h.push(v)}a[f]=h,s[f]=y}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)o[c]=pc(r[c]);else{const h=pc(r);for(;++c<u;)o[c]=h}c=-1;const p=[],d=[];for(;++c<u;){const h=o[c];let y="",g="";h===99?(y=":",g=":"):h===108?y=":":h===114&&(g=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[c]-y.length-g.length);const x=y+"-".repeat(v)+g;n.alignDelimiters!==!1&&(v=y.length+v+g.length,v>l[c]&&(l[c]=v),d[c]=v),p[c]=x}a.splice(1,0,p),s.splice(1,0,d),f=-1;const m=[];for(;++f<a.length;){const h=a[f],y=s[f];c=-1;const g=[];for(;++c<u;){const v=h[c]||"";let x="",A="";if(n.alignDelimiters!==!1){const k=l[c]-(y[c]||0),C=o[c];C===114?x=" ".repeat(k):C===99?k%2?(x=" ".repeat(k/2+.5),A=" ".repeat(k/2-.5)):(x=" ".repeat(k/2),A=x):A=" ".repeat(k)}n.delimiterStart!==!1&&!c&&g.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||c)&&g.push(" "),n.alignDelimiters!==!1&&g.push(x),g.push(v),n.alignDelimiters!==!1&&g.push(A),n.padding!==!1&&g.push(" "),(n.delimiterEnd!==!1||c!==u-1)&&g.push("|")}m.push(n.delimiterEnd===!1?g.join("").replace(/ +$/,""):g.join(""))}return m.join(`
226
+ `)}function _w(e){return e==null?"":String(e)}function pc(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 Pw(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()),Nw);return i(),a}function Nw(e,t,n){return">"+(n?"":" ")+e}function Lw(e,t){return hc(e,t.inConstruct,!0)&&!hc(e,t.notInConstruct,!1)}function hc(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 mc(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
227
+ `&&Lw(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
228
+ `}function Fw(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 Rw(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 Bw(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 zw(e,t,n,r){const i=Bw(n),o=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(Rw(e,n)){const c=n.enter("codeIndented"),p=n.indentLines(o,$w);return c(),p}const s=n.createTracker(r),l=i.repeat(Math.max(Fw(o,i)+1,3)),u=n.enter("codeFenced");let f=s.move(l);if(e.lang){const c=n.enter(`codeFencedLang${a}`);f+=s.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...s.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${a}`);f+=s.move(" "),f+=s.move(n.safe(e.meta,{before:f,after:`
229
+ `,encode:["`"],...s.current()})),c()}return f+=s.move(`
230
+ `),o&&(f+=s.move(o+`
231
+ `)),f+=s.move(l),u(),f}function $w(e,t,n){return(n?"":" ")+e}function Ho(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 jw(e,t,n,r){const i=Ho(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
232
+ `,...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),s()),a(),u}function Uw(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 Wn(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Br(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}}gc.peek=Hw;function gc(e,t,n,r){const i=Uw(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 u=l.charCodeAt(0),f=Br(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Wn(u)+l.slice(1));const c=l.charCodeAt(l.length-1),p=Br(r.after.charCodeAt(0),c,i);p.inside&&(l=l.slice(0,-1)+Wn(c));const d=a.move(i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},s+l+d}function Hw(e,t,n){return n.options.emphasis||"*"}function Ww(e,t){let n=!1;return To(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Io}),!!((!e.depth||e.depth<3)&&go(e)&&(t.options.setext||n))}function Vw(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(Ww(e,n)){const f=n.enter("headingSetext"),c=n.enter("phrasing"),p=n.containerPhrasing(e,{...o.current(),before:`
233
+ `,after:`
234
+ `});return c(),f(),p+`
235
+ `+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
236
+ `))+1))}const a="#".repeat(i),s=n.enter("headingAtx"),l=n.enter("phrasing");o.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
237
+ `,...o.current()});return/^[\t ]/.test(u)&&(u=Wn(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),l(),s(),u}yc.peek=qw;function yc(e){return e.value||""}function qw(){return"<"}vc.peek=Kw;function vc(e,t,n,r){const i=Ho(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),s()),u+=l.move(")"),a(),u}function Kw(){return"!"}bc.peek=Yw;function bc(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 u=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=f,o(),i==="full"||!u||u!==c?l+=s.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function Yw(){return"!"}xc.peek=Gw;function xc(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 u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function Gw(){return"`"}function wc(e,t){const n=go(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))}kc.peek=Qw;function kc(e,t,n,r){const i=Ho(n),o=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(wc(e,n)){const f=n.stack;n.stack=[],s=n.enter("autolink");let c=a.move("<");return c+=a.move(n.containerPhrasing(e,{before:c,after:">",...a.current()})),c+=a.move(">"),s(),n.stack=f,c}s=n.enter("link"),l=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${o}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),l()),u+=a.move(")"),s(),u}function Qw(e,t,n){return wc(e,n)?"<":"["}Sc.peek=Jw;function Sc(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 u=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=f,o(),i==="full"||!u||u!==c?l+=s.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function Jw(){return"["}function Wo(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 Zw(e){const t=Wo(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 Xw(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 Ec(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 e0(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?Xw(n):Wo(n);const s=e.ordered?a==="."?")":".":Zw(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),Ec(n)===a&&f){let c=-1;for(;++c<e.children.length;){const p=e.children[c];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 u=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=o,i(),u}function t0(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 n0(e,t,n,r){const i=t0(n);let o=n.bulletCurrent||Wo(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"),u=n.indentLines(n.containerFlow(e,s.current()),f);return l(),u;function f(c,p,d){return p?(d?"":" ".repeat(a))+c:(d?o:o+" ".repeat(a-o.length))+c}}function r0(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),i(),a}const i0=Nr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function o0(e,t,n,r){return(e.children.some(function(a){return i0(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function a0(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Cc.peek=s0;function Cc(e,t,n,r){const i=a0(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 u=l.charCodeAt(0),f=Br(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Wn(u)+l.slice(1));const c=l.charCodeAt(l.length-1),p=Br(r.after.charCodeAt(0),c,i);p.inside&&(l=l.slice(0,-1)+Wn(c));const d=a.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},s+l+d}function s0(e,t,n){return n.options.strong||"*"}function l0(e,t,n,r){return n.safe(e.value,r)}function u0(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 c0(e,t,n){const r=(Ec(n)+(n.options.ruleSpaces?" ":"")).repeat(u0(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Ac={blockquote:Pw,break:mc,code:zw,definition:jw,emphasis:gc,hardBreak:mc,heading:Vw,html:yc,image:vc,imageReference:bc,inlineCode:xc,link:kc,linkReference:Sc,list:e0,listItem:n0,paragraph:r0,root:o0,strong:Cc,text:l0,thematicBreak:c0};function f0(){return{enter:{table:d0,tableData:Ic,tableHeader:Ic,tableRow:h0},exit:{codeText:m0,table:p0,tableData:Vo,tableHeader:Vo,tableRow:Vo}}}function d0(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 p0(e){this.exit(e),this.data.inTable=void 0}function h0(e){this.enter({type:"tableRow",children:[]},e)}function Vo(e){this.exit(e)}function Ic(e){this.enter({type:"tableCell",children:[]},e)}function m0(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,g0));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function g0(e,t){return t==="|"?t:e}function y0(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
238
+ `,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,y){return u(f(d,h,y),d.align)}function s(d,m,h,y){const g=c(d,h,y),v=u([g]);return v.slice(0,v.indexOf(`
239
+ `))}function l(d,m,h,y){const g=h.enter("tableCell"),v=h.enter("phrasing"),x=h.containerPhrasing(d,{...y,before:o,after:o});return v(),g(),x}function u(d,m){return Mw(d,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(d,m,h){const y=d.children;let g=-1;const v=[],x=m.enter("table");for(;++g<y.length;)v[g]=c(y[g],m,h);return x(),v}function c(d,m,h){const y=d.children;let g=-1;const v=[],x=m.enter("tableRow");for(;++g<y.length;)v[g]=l(y[g],d,m,h);return x(),v}function p(d,m,h){let y=Ac.inlineCode(d,m,h);return h.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function v0(){return{exit:{taskListCheckValueChecked:Tc,taskListCheckValueUnchecked:Tc,paragraph:x0}}}function b0(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:w0}}}function Tc(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function x0(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 w0(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=Ac.listItem(e,t,n,{...r,...s.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(f){return f+a}}function k0(){return[ew(),ww(),Cw(),f0(),v0()]}function S0(e){return{extensions:[tw(),kw(e),Aw(),y0(e),b0()]}}const E0={tokenize:D0,partial:!0},Oc={tokenize:M0,partial:!0},Dc={tokenize:_0,partial:!0},Mc={tokenize:P0,partial:!0},C0={tokenize:N0,partial:!0},_c={name:"wwwAutolink",tokenize:T0,previous:Nc},Pc={name:"protocolAutolink",tokenize:O0,previous:Lc},Et={name:"emailAutolink",tokenize:I0,previous:Fc},vt={};function A0(){return{text:vt}}let Vt=48;for(;Vt<123;)vt[Vt]=Et,Vt++,Vt===58?Vt=65:Vt===91&&(Vt=97);vt[43]=Et,vt[45]=Et,vt[46]=Et,vt[95]=Et,vt[72]=[Et,Pc],vt[104]=[Et,Pc],vt[87]=[Et,_c],vt[119]=[Et,_c];function I0(e,t,n){const r=this;let i,o;return a;function a(c){return!qo(c)||!Fc.call(r,r.previous)||Ko(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(c))}function s(c){return qo(c)?(e.consume(c),s):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(C0,f,u)(c):c===45||c===95||We(c)?(o=!0,e.consume(c),l):f(c)}function u(c){return e.consume(c),i=!0,l}function f(c){return o&&i&&qe(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function T0(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Nc.call(r,r.previous)||Ko(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(E0,e.attempt(Oc,e.attempt(Dc,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function O0(e,t,n){const r=this;let i="",o=!1;return a;function a(c){return(c===72||c===104)&&Lc.call(r,r.previous)&&!Ko(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),s):n(c)}function s(c){if(qe(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),s;if(c===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),o?u:(o=!0,l)):n(c)}function u(c){return c===null||Cr(c)||Ie(c)||Wt(c)||Ar(c)?n(c):e.attempt(Oc,e.attempt(Dc,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function D0(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 M0(e,t,n){let r,i,o;return a;function a(u){return u===46||u===95?e.check(Mc,l,s)(u):u===null||Ie(u)||Wt(u)||u!==45&&Ar(u)?l(u):(o=!0,e.consume(u),a)}function s(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function l(u){return i||r||!o?n(u):t(u)}}function _0(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(Mc,t,o)(a):a===null||Ie(a)||Wt(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function P0(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||Ie(s)||Wt(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||Ie(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 N0(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return We(o)?n(o):t(o)}}function Nc(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ie(e)}function Lc(e){return!qe(e)}function Fc(e){return!(e===47||qo(e))}function qo(e){return e===43||e===45||e===46||e===95||We(e)}function Ko(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 L0={tokenize:H0,partial:!0};function F0(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:$0,continuation:{tokenize:j0},exit:U0}},text:{91:{name:"gfmFootnoteCall",tokenize:z0},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:R0,resolveTo:B0}}}}function R0(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 u=ut(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function B0(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 z0(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return s;function s(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!a||c===null||c===91||Ie(c))return n(c);if(c===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(ut(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return Ie(c)||(a=!0),o++,e.consume(c),c===92?f:u}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function $0(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"),u}function u(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||Ie(m))return n(m);if(m===93){e.exit("chunkString");const h=e.exit("gfmFootnoteDefinitionLabelString");return o=ut(r.sliceSerialize(h)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Ie(m)||(s=!0),a++,e.consume(m),m===92?c:f}function c(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),be(e,d,"gfmFootnoteDefinitionWhitespace")):n(m)}function d(m){return t(m)}}function j0(e,t,n){return e.check(Bn,t,e.attempt(L0,t,n))}function U0(e){e.exit("gfmFootnoteDefinition")}function H0(e,t,n){const r=this;return be(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 W0(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 u=l;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[l][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[l][1].end)},c={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[l][1].start)},p=[["enter",f,s],["enter",a[u][1],s],["exit",a[u][1],s],["enter",c,s]],d=s.parser.constructs.insideSpan.null;d&&tt(p,p.length,0,Ir(d,a.slice(u+1,l),s)),tt(p,p.length,0,[["exit",c,s],["enter",a[l][1],s],["exit",a[l][1],s],["exit",f,s]]),tt(a,u-1,l-u+3,p),l=u+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 u=this.previous,f=this.events;let c=0;return p;function p(m){return u===126&&f[f.length-1][1].type!=="characterEscape"?l(m):(a.enter("strikethroughSequenceTemporary"),d(m))}function d(m){const h=nn(u);if(m===126)return c>1?l(m):(a.consume(m),c++,d);if(c<2&&!n)return l(m);const y=a.exit("strikethroughSequenceTemporary"),g=nn(m);return y._open=!g||g===2&&!!h,y._close=!h||h===2&&!!g,s(m)}}}class V0{constructor(){this.map=[]}add(t,n,r){q0(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 q0(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 K0(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 Y0(){return{flow:{null:{name:"table",tokenize:G0,resolveAll:Q0}}}}function G0(e,t,n){const r=this;let i=0,o=0,a;return s;function s(I){let O=r.events.length-1;for(;O>-1;){const N=r.events[O][1].type;if(N==="lineEnding"||N==="linePrefix")O--;else break}const j=O>-1?r.events[O][1].type:null,_=j==="tableHead"||j==="tableRow"?C:l;return _===C&&r.parser.lazy[r.now().line]?n(I):_(I)}function l(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,o+=1),f(I)}function f(I){return I===null?n(I):ce(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)?be(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"),c(I)))}function c(I){return I===null||I===124||Ie(I)?(e.exit("data"),f(I)):(e.consume(I),I===92?p:c)}function p(I){return I===92||I===124?(e.consume(I),c):c(I)}function d(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,ye(I)?be(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?y(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),h):k(I)}function h(I){return ye(I)?be(e,y,"whitespace")(I):y(I)}function y(I){return I===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),g):I===45?(o+=1,g(I)):I===null||ce(I)?A(I):k(I)}function g(I){return I===45?(e.enter("tableDelimiterFiller"),v(I)):k(I)}function v(I){return I===45?(e.consume(I),v):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(I))}function x(I){return ye(I)?be(e,A,"whitespace")(I):A(I)}function A(I){return I===124?m(I):I===null||ce(I)?!a||i!==o?k(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):k(I)}function k(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||ce(I)?(e.exit("tableRow"),t(I)):ye(I)?be(e,T,"whitespace")(I):(e.enter("data"),M(I))}function M(I){return I===null||I===124||Ie(I)?(e.exit("data"),T(I)):(e.consume(I),I===92?R:M)}function R(I){return I===92||I===124?(e.consume(I),M):M(I)}}function Q0(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],a=[0,0,0,0],s=!1,l=0,u,f,c;const p=new V0;for(;++n<e.length;){const d=e[n],m=d[1];d[0]==="enter"?m.type==="tableHead"?(s=!1,l!==0&&(Rc(p,t,l,u,f),f=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,c=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],c=zr(p,t,o,i,void 0,c),o=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(a[0]=a[1],c=zr(p,t,o,i,void 0,c)),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],c=zr(p,t,o,i,n,c)):a[1]!==0&&(c=zr(p,t,a,i,n,c)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Rc(p,t,l,u,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=K0(t.events,n))}return e}function zr(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 u=on(t.events,n[2]),f=on(t.events,n[3]),c={type:s,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",c,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",c,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 Rc(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 J0={name:"tasklistCheck",tokenize:X0};function Z0(){return{text:{91:J0}}}function X0(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 Ie(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 ce(l)?t(l):ye(l)?e.check({tokenize:e1},t,n)(l):n(l)}}function e1(e,t,n){return be(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function t1(e){return uu([A0(),F0(),W0(e),Y0(),Z0()])}const n1={};function r1(e){const t=this,n=e||n1,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(t1(n)),o.push(k0()),a.push(S0(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"}}},i1=({text:e})=>{const{message:{blocks:{text:t}}}=ge,[n,r]=F.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))}}F.useEffect(()=>{const a=/!\[.*?\]\((.*?)\)/g,s=[];let l;for(;(l=a.exec(e))!==null;){const u=l[1];u&&!s.includes(u)&&s.push(u)}s.forEach(u=>{i(u)})},[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,...u})=>S.jsx("a",{...u,...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(_l,{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})=>{const l=a==null?void 0:a.children[0],u=o1((l==null?void 0:l.className)||""),[f,c]=F.useState(!1),p=F.useRef(null),d=()=>{if(!p.current)return;const m=p.current.textContent||"";navigator.clipboard.writeText(m).then(()=>{c(!0),setTimeout(()=>{c(!1)},1500)}).catch(h=>{console.error("Failed to copy code to clipboard:",h)})};return S.jsxs("div",{...t.codeBlockContainer,children:[S.jsxs("div",{...t.codeBlockTitle,children:[u?S.jsx("span",{children:u}):"Code",f?S.jsx(Xm,{...t.codeBlockCopyIcon}):S.jsx(sg,{...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(oc,{urlTransform:a=>a.startsWith("tel:")?a:ac(a),components:o,remarkPlugins:[r1,Xx],children:e})},o1=e=>{if(!e)return"";const t=e.match(/language-(\w+)/);return t?t[1]:""},a1={},Bc=e=>{let t;const n=new Set,r=(l,u)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const c=t;t=u??typeof f!="object"?f:Object.assign({},t,f),n.forEach(p=>p(t,c))}},i=()=>t,s={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(a1?"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},s1=e=>e?Bc(e):Bc;var Yo={exports:{}},Go={},$r={exports:{}},Qo={};/**
219
240
  * @license React
220
241
  * use-sync-external-store-shim.production.min.js
221
242
  *
@@ -223,7 +244,7 @@ Please start a new conversation.`,zi={ResourceNotFound:{type:"configuration",mes
223
244
  *
224
245
  * This source code is licensed under the MIT license found in the
225
246
  * 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={};/**
247
+ */var zc;function l1(){if(zc)return Qo;zc=1;var e=F;function t(c,p){return c===p&&(c!==0||1/c===1/p)||c!==c&&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(c,p){var d=p(),m=r({inst:{value:d,getSnapshot:p}}),h=m[0].inst,y=m[1];return o(function(){h.value=d,h.getSnapshot=p,l(h)&&y({inst:h})},[c,d,p]),i(function(){return l(h)&&y({inst:h}),c(function(){l(h)&&y({inst:h})})},[c]),a(d),d}function l(c){var p=c.getSnapshot;c=c.value;try{var d=p();return!n(c,d)}catch{return!0}}function u(c,p){return p()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:s;return Qo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Qo}var Jo={};/**
227
248
  * @license React
228
249
  * use-sync-external-store-shim.development.js
229
250
  *
@@ -231,7 +252,7 @@ Please start a new conversation.`,zi={ResourceNotFound:{type:"configuration",mes
231
252
  *
232
253
  * This source code is licensed under the MIT license found in the
233
254
  * 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}/**
255
+ */var $c;function u1(){return $c||($c=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=F,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(x){{for(var A=arguments.length,k=new Array(A>1?A-1:0),C=1;C<A;C++)k[C-1]=arguments[C];r("error",x,k)}}function r(x,A,k){{var C=t.ReactDebugCurrentFrame,T=C.getStackAddendum();T!==""&&(A+="%s",k=k.concat([T]));var M=k.map(function(R){return String(R)});M.unshift("Warning: "+A),Function.prototype.apply.call(console[x],console,M)}}function i(x,A){return x===A&&(x!==0||1/x===1/A)||x!==x&&A!==A}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue,f=!1,c=!1;function p(x,A,k){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=A();if(!c){var T=A();o(C,T)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var M=a({inst:{value:C,getSnapshot:A}}),R=M[0].inst,I=M[1];return l(function(){R.value=C,R.getSnapshot=A,d(R)&&I({inst:R})},[x,C,A]),s(function(){d(R)&&I({inst:R});var O=function(){d(R)&&I({inst:R})};return x(O)},[x]),u(C),C}function d(x){var A=x.getSnapshot,k=x.value;try{var C=A();return!o(k,C)}catch{return!0}}function m(x,A,k){return A()}var h=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y=!h,g=y?m:p,v=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g;Jo.useSyncExternalStore=v,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Jo}var jc;function Uc(){return jc||(jc=1,process.env.NODE_ENV==="production"?$r.exports=l1():$r.exports=u1()),$r.exports}/**
235
256
  * @license React
236
257
  * use-sync-external-store-shim/with-selector.production.min.js
237
258
  *
@@ -239,7 +260,7 @@ Please start a new conversation.`,zi={ResourceNotFound:{type:"configuration",mes
239
260
  *
240
261
  * This source code is licensed under the MIT license found in the
241
262
  * 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={};/**
263
+ */var Hc;function c1(){if(Hc)return Go;Hc=1;var e=F,t=Uc();function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&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 Go.useSyncExternalStoreWithSelector=function(u,f,c,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 g(C){if(!v){if(v=!0,x=C,C=p(C),d!==void 0&&h.hasValue){var T=h.value;if(d(T,C))return A=T}return A=C}if(T=A,r(x,C))return T;var M=p(C);return d!==void 0&&d(T,M)?T:(x=C,A=M)}var v=!1,x,A,k=c===void 0?null:c;return[function(){return g(f())},k===null?void 0:function(){return g(k())}]},[f,c,p,d]);var y=i(u,m[0],m[1]);return a(function(){h.hasValue=!0,h.value=y},[y]),l(y),y},Go}var Zo={};/**
243
264
  * @license React
244
265
  * use-sync-external-store-shim/with-selector.development.js
245
266
  *
@@ -247,57 +268,58 @@ Please start a new conversation.`,zi={ResourceNotFound:{type:"configuration",mes
247
268
  *
248
269
  * This source code is licensed under the MIT license found in the
249
270
  * 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(`
271
+ */var Wc;function f1(){return Wc||(Wc=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=F,t=Uc();function n(f,c){return f===c&&(f!==0||1/f===1/c)||f!==f&&c!==c}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 u(f,c,p,d,m){var h=o(null),y;h.current===null?(y={hasValue:!1,value:null},h.current=y):y=h.current;var g=s(function(){var k=!1,C,T,M=function(j){if(!k){k=!0,C=j;var _=d(j);if(m!==void 0&&y.hasValue){var N=y.value;if(m(N,_))return T=N,N}return T=_,_}var D=C,z=T;if(r(D,j))return z;var U=d(j);return m!==void 0&&m(z,U)?z:(C=j,T=U,U)},R=p===void 0?null:p,I=function(){return M(c())},O=R===null?void 0:function(){return M(R())};return[I,O]},[c,p,d,m]),v=g[0],x=g[1],A=i(f,v,x);return a(function(){y.hasValue=!0,y.value=A},[A]),l(A),A}Zo.useSyncExternalStoreWithSelector=u,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"?Yo.exports=c1():Yo.exports=f1();var d1=Yo.exports;const p1=jt(d1),Vc={},{useSyncExternalStoreWithSelector:h1}=p1;let qc=!1;function m1(e,t=e.getState,n){(Vc?"production":void 0)!=="production"&&n&&!qc&&(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"),qc=!0);const r=h1(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return F.useDebugValue(r),r}const g1=e=>{(Vc?"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"?s1(e):e,n=(r,i)=>m1(t,r,i);return Object.assign(n,t),n},_t=e=>g1,jr={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Xo=new Map,Ur=e=>{const t=Xo.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},y1=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=Xo.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return Xo.set(n.name,i),{type:"tracked",store:e,...i}},Vn=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:a,store:s,...l}=t;let u;try{u=(o??(jr?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!u)return(jr?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,i);const{connection:f,...c}=y1(s,u,l);let p=!0;i.setState=(h,y,g)=>{const v=n(h,y);if(!p)return v;const x=g===void 0?{type:a||"anonymous"}:typeof g=="string"?{type:g}:g;return s===void 0?(f==null||f.send(x,r()),v):(f==null||f.send({...x,type:`${s}/${x.type}`},{...Ur(l.name),[s]:i.getState()}),v)};const d=(...h)=>{const y=p;p=!1,n(...h),p=y},m=e(i.setState,r,i);if(c.type==="untracked"?f==null||f.init(m):(c.stores[c.store]=i,f==null||f.init(Object.fromEntries(Object.entries(c.stores).map(([h,y])=>[h,h===c.store?m:y.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let h=!1;const y=i.dispatch;i.dispatch=(...g)=>{(jr?"production":void 0)!=="production"&&g[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),y(...g)}}return f.subscribe(h=>{var y;switch(h.type){case"ACTION":if(typeof h.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return ea(h.payload,g=>{if(g.type==="__setState"){if(s===void 0){d(g.state);return}Object.keys(g.state).length!==1&&console.error(`
251
272
  [zustand devtools middleware] Unsupported __setState action format.
252
273
  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
274
  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]});/*!
275
+ `);const v=g.state[s];if(v==null)return;JSON.stringify(i.getState())!==JSON.stringify(v)&&d(v);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(g)});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(Ur(l.name));case"COMMIT":if(s===void 0){f==null||f.init(i.getState());return}return f==null?void 0:f.init(Ur(l.name));case"ROLLBACK":return ea(h.state,g=>{if(s===void 0){d(g),f==null||f.init(i.getState());return}d(g[s]),f==null||f.init(Ur(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return ea(h.state,g=>{if(s===void 0){d(g);return}JSON.stringify(i.getState())!==JSON.stringify(g[s])&&d(g[s])});case"IMPORT_STATE":{const{nextLiftedState:g}=h.payload,v=(y=g.computedStates.slice(-1)[0])==null?void 0:y.state;if(!v)return;d(s===void 0?v:v[s]),f==null||f.send(null,g);return}case"PAUSE_RECORDING":return p=!p}return}}),m},ea=(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 ta(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 qn=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return qn(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return qn(r)(n)}}}},v1=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:y=>y,version:0,merge:(y,g)=>({...g,...y}),...t},a=!1;const s=new Set,l=new Set;let u;try{u=o.getStorage()}catch{}if(!u)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...y)},r,i);const f=qn(o.serialize),c=()=>{const y=o.partialize({...r()});let g;const v=f({state:y,version:o.version}).then(x=>u.setItem(o.name,x)).catch(x=>{g=x});if(g)throw g;return v},p=i.setState;i.setState=(y,g)=>{p(y,g),c()};const d=e((...y)=>{n(...y),c()},r,i);let m;const h=()=>{var y;if(!u)return;a=!1,s.forEach(v=>v(r()));const g=((y=o.onRehydrateStorage)==null?void 0:y.call(o,r()))||void 0;return qn(u.getItem.bind(u))(o.name).then(v=>{if(v)return o.deserialize(v)}).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return o.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var x;return m=o.merge(v,(x=r())!=null?x:d),n(m,!0),c()}).then(()=>{g==null||g(m,void 0),a=!0,l.forEach(v=>v(m))}).catch(v=>{g==null||g(void 0,v)})};return i.persist={setOptions:y=>{o={...o,...y},y.getStorage&&(u=y.getStorage())},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>h(),hasHydrated:()=>a,onHydrate:y=>(s.add(y),()=>{s.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},h(),m||d},b1=(e,t)=>(n,r,i)=>{let o={storage:ta(()=>localStorage),partialize:h=>h,version:0,merge:(h,y)=>({...y,...h}),...t},a=!1;const s=new Set,l=new Set;let u=o.storage;if(!u)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 u.setItem(o.name,{state:h,version:o.version})},c=i.setState;i.setState=(h,y)=>{c(h,y),f()};const p=e((...h)=>{n(...h),f()},r,i);let d;const m=()=>{var h,y;if(!u)return;a=!1,s.forEach(v=>{var x;return v((x=r())!=null?x:p)});const g=((y=o.onRehydrateStorage)==null?void 0:y.call(o,(h=r())!=null?h:p))||void 0;return qn(u.getItem.bind(u))(o.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return o.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var x;return d=o.merge(v,(x=r())!=null?x:p),n(d,!0),f()}).then(()=>{g==null||g(d,void 0),d=r(),a=!0,l.forEach(v=>v(d))}).catch(v=>{g==null||g(void 0,v)})};return i.persist={setOptions:h=>{o={...o,...h},h.storage&&(u=h.storage)},clearStorage:()=>{u==null||u.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},Hr=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((jr?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),v1(e,t)):b1(e,t),Kc=_t()(Vn(Hr(e=>({messageHistory:[],addMessageToHistory:t=>e(n=>({...n,messageHistory:[t,...(n.messageHistory??[]).slice(0,100).filter(String)]}))}),{name:"botpress-message-history"})));let Wr;const x1=new Uint8Array(16);function w1(){if(!Wr&&(Wr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Wr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Wr(x1)}const $e=[];for(let e=0;e<256;++e)$e.push((e+256).toString(16).slice(1));function k1(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 Yc={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function S1(e,t,n){if(Yc.randomUUID&&!e)return Yc.randomUUID();e=e||{};const r=e.random||(e.rng||w1)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,k1(r)}function Kn(e){var a;const{metadata:t,conversationId:n,userId:r}=e,{payload:i,disableInput:o}=Gc(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 Gc=e=>{switch(e.type){case"audio":return Qc(e);case"card":return E1(e);case"carousel":return C1(e);case"choice":return A1(e);case"dropdown":return I1(e);case"file":return Jc(e);case"image":return Zc(e);case"location":return Xc(e);case"markdown":return ef(e);case"text":return tf(e);case"video":return nf(e);case"bloc":return T1(e);case"custom":return{payload:e};default:{const t=e;throw new Error(`Unsuported message type ${t}`)}}},Yn=e=>({block:e,type:"bubble"}),Qc=e=>({payload:{type:"audio",url:e.audioUrl}}),E1=e=>({payload:Yn(rf(e))}),C1=e=>({payload:{type:"carousel",blocks:e.items.map(t=>rf({...t}))}}),A1=e=>{const t=e.options.map(o=>({title:o.label,value:o.value})),n=e.text,r=S1(),i=Yn({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}))}]}}},I1=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:Yn({type:"column",blocks:r})}},Jc=e=>({payload:{type:"file",url:e.fileUrl,title:e.title}}),Zc=e=>({payload:{type:"image",url:e.imageUrl}}),Xc=e=>({payload:{type:"location",latitude:e.latitude,longitude:e.longitude,title:e.title??e.address??"View on map"}}),ef=e=>({payload:Yn({type:"text",text:e.markdown})}),tf=e=>({payload:Yn({type:"text",text:e.text,value:e.value})}),nf=e=>({payload:{type:"video",url:e.videoUrl}}),T1=e=>({payload:{type:"column",blocks:e.items.map(n=>{switch(n.type){case"audio":return Qc({...n.payload,type:n.type}).payload;case"file":return Jc({...n.payload,type:n.type}).payload;case"image":return Zc({...n.payload,type:n.type}).payload;case"location":return Xc({...n.payload,type:n.type}).payload;case"markdown":return ef({...n.payload,type:n.type}).payload;case"text":return tf({...n.payload,type:n.type}).payload;case"video":return nf({...n.payload,type:n.type}).payload;default:throw new Error("Unsuported message type")}})}}),rf=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=_t()(Vn(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=>Kn(o)).filter(Boolean)}finally{e({isFetching:!1})}}}),{name:"messagesStore"})),O1=(e,t)=>_t()(Vn(Hr(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:ta(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),Tn=class Tn{constructor(){}static getInstance(t="bp-webchat",n){return Tn._instances[t]||(Tn._instances[t]=O1(t,n)),Tn._instances[t]}};$i(Tn,"_instances",{});let na=Tn;const of=na.getInstance,sn=_t()(Vn(e=>({eventEmitter:el(),messageContainerRef:F.createRef(),setMessageContainerRef:t=>e({messageContainerRef:t}),portalContainer:null,setPortalContainer:t=>e({portalContainer:t})}),{name:"webchatStore"})),D1=8,M1=e=>_t()(Hr((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===D1)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):"",u=Bm(s,n().files,p=>p.name),f=u+l,c=new File([r],f,{type:r.type});n().upsertFile({name:u,type:"file",instance:c,status:"loading"});try{const{fileUrl:p,type:d}=await i(c);n().upsertFile({name:u,type:d,url:p,instance:c,status:"uploaded"})}catch{n().upsertFile({name:u,type:"file",instance:c,status:"error"})}},deleteFile:r=>t(({files:i})=>({files:i.filter(o=>o.name!=r)}))}),{name:e,storage:ta(()=>sessionStorage)})),On=class On{constructor(){}static getInstance(t="bp-composer-file-store"){return On._instances[t]||(On._instances[t]=M1(t)),On._instances[t]}};$i(On,"_instances",{});let ra=On;const af=ra.getInstance,Gn=_t()(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:[]})})),_1=e=>_t()(Vn(Hr((t,n)=>({soundOn:!0,setSoundEnabled:r=>t({soundOn:r}),toggleSound:()=>t({soundOn:!n().soundOn})}),{name:e}))),Dn=class Dn{constructor(){}static getInstance(t="webchat:soundEnabled"){return Dn._instances[t]||(Dn._instances[t]=_1(t)),Dn._instances[t]}};$i(Dn,"_instances",{});let ia=Dn;const sf=ia.getInstance,P1=({text:e,buttonValue:t,variant:n,groupId:r,reusable:i,sendMessage:o,isReadOnly:a,...s})=>{const l=sn(x=>x.eventEmitter),[u,f]=F.useState(!1),[c,p]=F.useState(!1),[d,m]=F.useState(!1),{message:{blocks:{button:h}}}=ge;F.useEffect(()=>{if(r)return l.on(`button-group-${r}-click`,()=>{p(!0),i||m(!0)})},[l,r,i]);const g={...s,onClick:x=>{if((d||a)&&n==="link"){x.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":u?"":void 0,"data-group-activated":c?"":void 0,"data-type":n,...h},v=d||a;return n==="link"?S.jsx("a",{...g,style:a?{pointerEvents:"none"}:void 0,href:t,target:"_blank",rel:"noopener noreferrer",children:e}):S.jsx("button",{...g,style:a?{pointerEvents:"none"}:void 0,disabled:v,children:e})},oa=F.createContext(null);function lf(){const e=F.use(oa);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const aa=F.createContext({showInputModal:void 0});function sa(){return F.use(aa)}const uf=({ref:e,block:t,direction:n,sender:r,timestamp:i,messageId:o,feedback:a,metadata:s,isReadOnly:l,sendMessage:u,addMessageFeedback:f,...c})=>{const{showInputModal:p}=sa(),{message:{blocks:{bubble:{container:d,feedbackContainer:m,feedbackIcon:h}}}}=ge;return n=="incoming"?S.jsxs("div",{"data-direction":"incoming","data-feedback":!!a,...c,...d,ref:e,children:[S.jsx(Yt,{block:{...t,direction:n,timestamp:i,sender:r,messageId:o,isReadOnly:l,metadata:s,sendMessage:u}}),f&&p&&t.type==="text"&&S.jsxs("div",{...m,children:[S.jsx(xg,{...h,"data-selected":a==="positive",onClick:()=>f(o,{value:"positive"})}),S.jsx(bg,{...h,"data-selected":a==="negative",onClick:async()=>{const y=await p({title:"Help us improve",description:"Please provide feedback to help us improve.",confirmButtonText:"Send feedback",cancelButtonText:"Cancel",Content:N1});f(o,{value:"negative",comment:y})}})]})]}):S.jsx("div",{"data-direction":"outgoing",...c,...d,ref:e,children:S.jsx(Yt,{block:{...t,direction:n,timestamp:i,sender:r,messageId:o,isReadOnly:l,metadata:s,sendMessage:u,addMessageFeedback:f}})})};uf.displayName="Bubble";const N1=({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)})};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 cf(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{u(r.next(f))}catch(c){a(c)}}function l(f){try{u(r.throw(f))}catch(c){a(c)}}function u(f){f.done?o(f.value):i(f.value).then(s,l)}u((r=r.apply(e,t||[])).next())})}function un(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(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function ff(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 la(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 L1(){var e=F.useRef(!1),t=F.useCallback(function(){return e.current},[]);return F.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function F1(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=F.useRef(0),i=L1(),o=F.useState(n),a=o[0],s=o[1],l=F.useCallback(function(){for(var u=[],f=0;f<arguments.length;f++)u[f]=arguments[f];var c=++r.current;return a.loading||s(function(p){return ot(ot({},p),{loading:!0})}),e.apply(void 0,u).then(function(p){return i()&&c===r.current&&s({value:p,loading:!1}),p},function(p){return i()&&c===r.current&&s({error:p,loading:!1}),p})},t);return[a,l]}function R1(e,t){t===void 0&&(t=[]);var n=F1(e,t,{loading:!0}),r=n[0],i=n[1];return F.useEffect(function(){i()},[i]),r}const df=({className:e,...t})=>S.jsx("div",{"data-slot":"skeleton",className:`bpSkeleton ${e||""}`,...t});df.displayName="Skeleton";const pf=({ref:e,url:t,orientation:n="auto",...r})=>{const i=F.useId(),{setIsLoading:o}=lf(),[a,s]=F.useState(n==="auto"?"square":n),[l,u]=F.useState("initial"),{message:{blocks:{image:f}}}=ge;return F.useLayoutEffect(()=>(o(c=>[...c,i]),()=>{o(c=>c.filter(p=>p!==i))}),[i,o]),R1(async()=>{if(!t)return;const c=new Image;try{const{width:p,height:d}=await cm(t);n==="auto"&&s(B1(p,d)),c.onload=()=>{u("loaded"),o(m=>m.filter(h=>h!==i))},c.onerror=()=>{u("error"),s("square"),o(m=>m.filter(h=>h!==i))},c.src=t,c.complete&&(c.naturalWidth>0?(u("loaded"),o(m=>m.filter(h=>h!==i))):(u("error"),s("square"),o(m=>m.filter(h=>h!==i))))}catch(p){console.error(p),u("error"),o(d=>d.filter(m=>m!==i))}return()=>{c.onload=null,c.onerror=null}},[t,i,o,n]),t?l==="error"?S.jsx("div",{"data-error":"true","data-orientation":a,...r,...f.image,ref:e,children:S.jsx(_l,{size:"25%",strokeWidth:"5%"})}):l==="initial"?S.jsx(df,{"data-orientation":a,...f.placeholder}):S.jsx("img",{"data-orientation":a,"data-loaded":l==="loaded",...r,...f.image,src:t,alt:"",ref:e}):null};pf.displayName="Image";function B1(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 hf=({ref:e,url:t,isReadOnly:n,...r})=>{const{message:{blocks:{video:i}}}=ge;return S.jsx("div",{children:S.jsx("video",{...r,"data-chromatic":"ignore",style:n?{pointerEvents:"none"}:void 0,controls:!0,src:t,...i,ref:e})})};hf.displayName="Video";const mf=({ref:e,url:t,isReadOnly:n,...r})=>{const{message:{blocks:{audio:i}}}=ge;return S.jsx("div",{children:S.jsx("audio",{...r,controls:!0,style:n?{pointerEvents:"none"}:void 0,src:t,...i,ref:e})})};mf.displayName="Audio";const gf=({ref:e,latitude:t,longitude:n,title:r,isReadOnly:i,...o})=>{const a=`https://www.google.com/maps/search/?api=1&query=${t},${n}`,{message:{blocks:{location:s}}}=ge;return S.jsxs("a",{...o,...s.container,style:i?{pointerEvents:"none"}:void 0,href:a,type:"_blank",rel:"noopener",ref:e,children:[S.jsx("p",{...s.title,children:r}),S.jsx(pg,{...s.icon})]})};gf.displayName="Location";const yf=({ref:e,blocks:t,horizontalAlignment:n,verticalAlignment:r,direction:i,sender:o,timestamp:a,messageId:s,isReadOnly:l,sendMessage:u,...f})=>{const{message:{blocks:{column:c}}}=ge;return S.jsx("div",{"data-horizontal":n,"data-vertical":r,...f,...c,ref:e,children:t.map((p,d)=>S.jsx(Yt,{block:{...p,direction:i,timestamp:a,sender:o,messageId:s,isReadOnly:l,sendMessage:u}},d))})};yf.displayName="Column";const vf=({ref:e,blocks:t,horizontalAlignment:n,verticalAlignment:r,direction:i,sender:o,timestamp:a,messageId:s,isReadOnly:l,sendMessage:u,...f})=>{const{message:{blocks:{row:c}}}=ge;return S.jsx("div",{"data-horizontal":n,"data-vertical":r,...f,...c,ref:e,children:t.map((p,d)=>S.jsx(Yt,{block:{...p,direction:i,timestamp:a,sender:o,messageId:s,isReadOnly:l,sendMessage:u}},d))})};vf.displayName="Row";function z1(e){return Object.prototype.toString.call(e)==="[object Object]"}function bf(e){return z1(e)||Array.isArray(e)}function $1(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function ua(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}`:!bf(s)||!bf(l)?s===l:ua(s,l)})}function xf(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function j1(e,t){if(e.length!==t.length)return!1;const n=xf(e),r=xf(t);return n.every((i,o)=>{const a=r[o];return ua(i,a)})}function ca(e){return typeof e=="number"}function fa(e){return typeof e=="string"}function Vr(e){return typeof e=="boolean"}function wf(e){return Object.prototype.toString.call(e)==="[object Object]"}function Pe(e){return Math.abs(e)}function da(e){return Math.sign(e)}function Qn(e,t){return Pe(e-t)}function U1(e,t){if(e===0||t===0||Pe(e)<=Pe(t))return 0;const n=Qn(Pe(e),Pe(t));return Pe(n/e)}function H1(e){return Math.round(e*100)/100}function Jn(e){return Xn(e).map(Number)}function ct(e){return e[Zn(e)]}function Zn(e){return Math.max(0,e.length-1)}function pa(e,t){return t===Zn(e)}function kf(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Xn(e){return Object.keys(e)}function Sf(e,t){return[e,t].reduce((n,r)=>(Xn(r).forEach(i=>{const o=n[i],a=r[i],s=wf(o)&&wf(a);n[i]=s?Sf(o,a):a}),n),{})}function ha(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function W1(e,t){const n={start:r,center:i,end:o};function r(){return 0}function i(l){return o(l)/2}function o(l){return t-l}function a(l,u){return fa(e)?n[e](l):e(t,l,u)}return{measure:a}}function er(){let e=[];function t(i,o,a,s={passive:!0}){let l;if("addEventListener"in i)i.addEventListener(o,a,s),l=()=>i.removeEventListener(o,a,s);else{const u=i;u.addListener(a),l=()=>u.removeListener(a)}return e.push(l),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function V1(e,t,n,r){const i=er(),o=1e3/60;let a=null,s=0,l=0;function u(){i.add(e,"visibilitychange",()=>{e.hidden&&m()})}function f(){d(),i.clear()}function c(y){if(!l)return;a||(a=y,n(),n());const g=y-a;for(a=y,s+=g;s>=o;)n(),s-=o;const v=s/o;r(v),l&&(l=t.requestAnimationFrame(c))}function p(){l||(l=t.requestAnimationFrame(c))}function d(){t.cancelAnimationFrame(l),a=null,s=0,l=0}function m(){a=null,s=0}return{init:u,destroy:f,start:p,stop:d,update:n,render:r}}function q1(e,t){const n=t==="rtl",r=e==="y",i=r?"y":"x",o=r?"x":"y",a=!r&&n?-1:1,s=f(),l=c();function u(m){const{height:h,width:y}=m;return r?h:y}function f(){return r?"top":n?"right":"left"}function c(){return r?"bottom":n?"left":"right"}function p(m){return m*a}return{scroll:i,cross:o,startEdge:s,endEdge:l,measureSize:u,direction:p}}function qt(e=0,t=0){const n=Pe(e-t);function r(u){return u<e}function i(u){return u>t}function o(u){return r(u)||i(u)}function a(u){return o(u)?r(u)?e:t:u}function s(u){return n?u-n*Math.ceil((u-t)/n):u}return{length:n,max:t,min:e,constrain:a,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:s}}function Ef(e,t,n){const{constrain:r}=qt(0,e),i=e+1;let o=a(t);function a(p){return n?Pe((i+p)%i):r(p)}function s(){return o}function l(p){return o=a(p),c}function u(p){return f().set(s()+p)}function f(){return Ef(e,s(),n)}const c={get:s,set:l,add:u,clone:f};return c}function K1(e,t,n,r,i,o,a,s,l,u,f,c,p,d,m,h,y,g,v){const{cross:x,direction:A}=e,k=["INPUT","SELECT","TEXTAREA"],C={passive:!1},T=er(),M=er(),R=qt(50,225).constrain(d.measure(20)),I={mouse:300,touch:400},O={mouse:500,touch:600},j=m?43:25;let _=!1,N=0,D=0,z=!1,U=!1,$=!1,V=!1;function b(L){if(!v)return;function ne(ke){(Vr(v)||v(L,ke))&&Y(ke)}const me=t;T.add(me,"dragstart",ke=>ke.preventDefault(),C).add(me,"touchmove",()=>{},C).add(me,"touchend",()=>{}).add(me,"touchstart",ne).add(me,"mousedown",ne).add(me,"touchcancel",ee).add(me,"contextmenu",ee).add(me,"click",ie,!0)}function P(){T.clear(),M.clear()}function H(){const L=V?n:t;M.add(L,"touchmove",J,C).add(L,"touchend",ee).add(L,"mousemove",J,C).add(L,"mouseup",ee)}function w(L){const ne=L.nodeName||"";return k.includes(ne)}function W(){return(m?O:I)[V?"mouse":"touch"]}function X(L,ne){const me=c.add(da(L)*-1),ke=f.byDistance(L,!m).distance;return m||Pe(L)<R?ke:y&&ne?ke*.5:f.byIndex(me.get(),0).distance}function Y(L){const ne=ha(L,r);V=ne,$=m&&ne&&!L.buttons&&_,_=Qn(i.get(),a.get())>=2,!(ne&&L.button!==0)&&(w(L.target)||(z=!0,o.pointerDown(L),u.useFriction(0).useDuration(0),i.set(a),H(),N=o.readPoint(L),D=o.readPoint(L,x),p.emit("pointerDown")))}function J(L){if(!ha(L,r)&&L.touches.length>=2)return ee(L);const me=o.readPoint(L),ke=o.readPoint(L,x),oe=Qn(me,N),G=Qn(ke,D);if(!U&&!V&&(!L.cancelable||(U=oe>G,!U)))return ee(L);const ue=o.pointerMove(L);oe>h&&($=!0),u.useFriction(.3).useDuration(.75),s.start(),i.add(A(ue)),L.preventDefault()}function ee(L){const me=f.byDistance(0,!1).index!==c.get(),ke=o.pointerUp(L)*W(),oe=X(A(ke),me),G=U1(ke,oe),ue=j-10*G,de=g+G/50;U=!1,z=!1,M.clear(),u.useDuration(ue).useFriction(de),l.distance(oe,!m),V=!1,p.emit("pointerUp")}function ie(L){$&&(L.stopPropagation(),L.preventDefault(),$=!1)}function K(){return z}return{init:b,destroy:P,pointerDown:K}}function Y1(e,t){let r,i;function o(c){return c.timeStamp}function a(c,p){const m=`client${(p||e.scroll)==="x"?"X":"Y"}`;return(ha(c,t)?c:c.touches[0])[m]}function s(c){return r=c,i=c,a(c)}function l(c){const p=a(c)-a(i),d=o(c)-o(r)>170;return i=c,d&&(r=c),p}function u(c){if(!r||!i)return 0;const p=a(i)-a(r),d=o(c)-o(r),m=o(c)-o(i)>170,h=p/d;return d&&!m&&Pe(h)>.1?h:0}return{pointerDown:s,pointerMove:l,pointerUp:u,readPoint:a}}function G1(){function e(n){const{offsetTop:r,offsetLeft:i,offsetWidth:o,offsetHeight:a}=n;return{top:r,right:i+o,bottom:r+a,left:i,width:o,height:a}}return{measure:e}}function Q1(e){function t(r){return e*(r/100)}return{measure:t}}function J1(e,t,n,r,i,o,a){const s=[e].concat(r);let l,u,f=[],c=!1;function p(y){return i.measureSize(a.measure(y))}function d(y){if(!o)return;u=p(e),f=r.map(p);function g(v){for(const x of v){if(c)return;const A=x.target===e,k=r.indexOf(x.target),C=A?u:f[k],T=p(A?e:r[k]);if(Pe(T-C)>=.5){y.reInit(),t.emit("resize");break}}}l=new ResizeObserver(v=>{(Vr(o)||o(y,v))&&g(v)}),n.requestAnimationFrame(()=>{s.forEach(v=>l.observe(v))})}function m(){c=!0,l&&l.disconnect()}return{init:d,destroy:m}}function Z1(e,t,n,r,i,o){let a=0,s=0,l=i,u=o,f=e.get(),c=0;function p(){const C=r.get()-e.get(),T=!l;let M=0;return T?(a=0,n.set(r),e.set(r),M=C):(n.set(e),a+=C/l,a*=u,f+=a,e.add(a),M=f-c),s=da(M),c=f,k}function d(){const C=r.get()-t.get();return Pe(C)<.001}function m(){return l}function h(){return s}function y(){return a}function g(){return x(i)}function v(){return A(o)}function x(C){return l=C,k}function A(C){return u=C,k}const k={direction:h,duration:m,velocity:y,seek:p,settled:d,useBaseFriction:v,useBaseDuration:g,useFriction:A,useDuration:x};return k}function X1(e,t,n,r,i){const o=i.measure(10),a=i.measure(50),s=qt(.1,.99);let l=!1;function u(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function f(d){if(!u())return;const m=e.reachedMin(t.get())?"min":"max",h=Pe(e[m]-t.get()),y=n.get()-t.get(),g=s.constrain(h/a);n.subtract(y*g),!d&&Pe(y)<o&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function c(d){l=!d}return{shouldConstrain:u,constrain:f,toggleActive:c}}function ek(e,t,n,r,i){const o=qt(-t+e,0),a=c(),s=f(),l=p();function u(m,h){return Qn(m,h)<=1}function f(){const m=a[0],h=ct(a),y=a.lastIndexOf(m),g=a.indexOf(h)+1;return qt(y,g)}function c(){return n.map((m,h)=>{const{min:y,max:g}=o,v=o.constrain(m),x=!h,A=pa(n,h);return x?g:A||u(y,v)?y:u(g,v)?g:v}).map(m=>parseFloat(m.toFixed(3)))}function p(){if(t<=e+i)return[o.max];if(r==="keepSnaps")return a;const{min:m,max:h}=s;return a.slice(m,h)}return{snapsContained:l,scrollContainLimit:s}}function tk(e,t,n){const r=t[0],i=n?r-e:ct(t);return{limit:qt(i,r)}}function nk(e,t,n,r){const o=t.min+.1,a=t.max+.1,{reachedMin:s,reachedMax:l}=qt(o,a);function u(p){return p===1?l(n.get()):p===-1?s(n.get()):!1}function f(p){if(!u(p))return;const d=e*(p*-1);r.forEach(m=>m.add(d))}return{loop:f}}function rk(e){const{max:t,length:n}=e;function r(o){const a=o-t;return n?a/-n:0}return{get:r}}function ik(e,t,n,r,i){const{startEdge:o,endEdge:a}=e,{groupSlides:s}=i,l=c().map(t.measure),u=p(),f=d();function c(){return s(r).map(h=>ct(h)[a]-h[0][o]).map(Pe)}function p(){return r.map(h=>n[o]-h[o]).map(h=>-Pe(h))}function d(){return s(u).map(h=>h[0]).map((h,y)=>h+l[y])}return{snaps:u,snapsAligned:f}}function ok(e,t,n,r,i,o){const{groupSlides:a}=i,{min:s,max:l}=r,u=f();function f(){const p=a(o),d=!e||t==="keepSnaps";return n.length===1?[o]:d?p:p.slice(s,l).map((m,h,y)=>{const g=!h,v=pa(y,h);if(g){const x=ct(y[0])+1;return kf(x)}if(v){const x=Zn(o)-ct(y)[0]+1;return kf(x,ct(y)[0])}return m})}return{slideRegistry:u}}function ak(e,t,n,r,i){const{reachedAny:o,removeOffset:a,constrain:s}=r;function l(m){return m.concat().sort((h,y)=>Pe(h)-Pe(y))[0]}function u(m){const h=e?a(m):s(m),y=t.map((v,x)=>({diff:f(v-h,0),index:x})).sort((v,x)=>Pe(v.diff)-Pe(x.diff)),{index:g}=y[0];return{index:g,distance:h}}function f(m,h){const y=[m,m+n,m-n];if(!e)return m;if(!h)return l(y);const g=y.filter(v=>da(v)===h);return g.length?l(g):ct(y)-n}function c(m,h){const y=t[m]-i.get(),g=f(y,h);return{index:m,distance:g}}function p(m,h){const y=i.get()+m,{index:g,distance:v}=u(y),x=!e&&o(y);if(!h||x)return{index:g,distance:m};const A=t[g]-v,k=m+f(A,0);return{index:g,distance:k}}return{byDistance:p,byIndex:c,shortcut:f}}function sk(e,t,n,r,i,o,a){function s(c){const p=c.distance,d=c.index!==t.get();o.add(p),p&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),d&&(n.set(t.get()),t.set(c.index),a.emit("select"))}function l(c,p){const d=i.byDistance(c,p);s(d)}function u(c,p){const d=t.clone().set(c),m=i.byIndex(d.get(),p);s(m)}return{distance:l,index:u}}function lk(e,t,n,r,i,o,a,s){const l={passive:!0,capture:!0};let u=0;function f(d){if(!s)return;function m(h){if(new Date().getTime()-u>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const v=n.findIndex(x=>x.includes(h));ca(v)&&(i.useDuration(0),r.index(v,0),a.emit("slideFocus"))}o.add(document,"keydown",c,!1),t.forEach((h,y)=>{o.add(h,"focus",g=>{(Vr(s)||s(d,g))&&m(y)},l)})}function c(d){d.code==="Tab"&&(u=new Date().getTime())}return{init:f}}function tr(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 ca(l)?l:l.get()}return{get:n,set:r,add:i,subtract:o}}function Cf(e,t){const n=e.scroll==="x"?a:s,r=t.style;let i=null,o=!1;function a(p){return`translate3d(${p}px,0px,0px)`}function s(p){return`translate3d(0px,${p}px,0px)`}function l(p){if(o)return;const d=H1(e.direction(p));d!==i&&(r.transform=n(d),i=d)}function u(p){o=!p}function f(){o||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:f,to:l,toggleActive:u}}function uk(e,t,n,r,i,o,a,s,l){const f=Jn(i),c=Jn(i).reverse(),p=g().concat(v());function d(T,M){return T.reduce((R,I)=>R-i[I],M)}function m(T,M){return T.reduce((R,I)=>d(R,M)>0?R.concat([I]):R,[])}function h(T){return o.map((M,R)=>({start:M-r[R]+.5+T,end:M+t-.5+T}))}function y(T,M,R){const I=h(M);return T.map(O=>{const j=R?0:-n,_=R?n:0,N=R?"end":"start",D=I[O][N];return{index:O,loopPoint:D,slideLocation:tr(-1),translate:Cf(e,l[O]),target:()=>s.get()>D?j:_}})}function g(){const T=a[0],M=m(c,T);return y(M,n,!1)}function v(){const T=t-a[0]-1,M=m(f,T);return y(M,-n,!0)}function x(){return p.every(({index:T})=>{const M=f.filter(R=>R!==T);return d(M,t)<=.1})}function A(){p.forEach(T=>{const{target:M,translate:R,slideLocation:I}=T,O=M();O!==I.get()&&(R.to(O),I.set(O))})}function k(){p.forEach(T=>T.translate.clear())}return{canLoop:x,clear:k,loop:A,loopPoints:p}}function ck(e,t,n){let r,i=!1;function o(l){if(!n)return;function u(f){for(const c of f)if(c.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(f=>{i||(Vr(n)||n(l,f))&&u(f)}),r.observe(e,{childList:!0})}function a(){r&&r.disconnect(),i=!0}return{init:o,destroy:a}}function fk(e,t,n,r){const i={};let o=null,a=null,s,l=!1;function u(){s=new IntersectionObserver(m=>{l||(m.forEach(h=>{const y=t.indexOf(h.target);i[y]=h}),o=null,a=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(m=>s.observe(m))}function f(){s&&s.disconnect(),l=!0}function c(m){return Xn(i).reduce((h,y)=>{const g=parseInt(y),{isIntersecting:v}=i[g];return(m&&v||!m&&!v)&&h.push(g),h},[])}function p(m=!0){if(m&&o)return o;if(!m&&a)return a;const h=c(m);return m&&(o=h),m||(a=h),h}return{init:u,destroy:f,get:p}}function dk(e,t,n,r,i,o){const{measureSize:a,startEdge:s,endEdge:l}=e,u=n[0]&&i,f=m(),c=h(),p=n.map(a),d=y();function m(){if(!u)return 0;const v=n[0];return Pe(t[s]-v[s])}function h(){if(!u)return 0;const v=o.getComputedStyle(ct(r));return parseFloat(v.getPropertyValue(`margin-${l}`))}function y(){return n.map((v,x,A)=>{const k=!x,C=pa(A,x);return k?p[x]+f:C?p[x]+c:A[x+1][s]-v[s]}).map(Pe)}return{slideSizes:p,slideSizesWithGaps:d,startGap:f,endGap:c}}function pk(e,t,n,r,i,o,a,s,l){const{startEdge:u,endEdge:f,direction:c}=e,p=ca(n);function d(g,v){return Jn(g).filter(x=>x%v===0).map(x=>g.slice(x,x+v))}function m(g){return g.length?Jn(g).reduce((v,x,A)=>{const k=ct(v)||0,C=k===0,T=x===Zn(g),M=i[u]-o[k][u],R=i[u]-o[x][f],I=!r&&C?c(a):0,O=!r&&T?c(s):0,j=Pe(R-O-(M+I));return A&&j>t+l&&v.push(x),T&&v.push(g.length),v},[]).map((v,x,A)=>{const k=Math.max(A[x-1]||0);return g.slice(k,v)}):[]}function h(g){return p?d(g,n):m(g)}return{groupSlides:h}}function hk(e,t,n,r,i,o,a){const{align:s,axis:l,direction:u,startIndex:f,loop:c,duration:p,dragFree:d,dragThreshold:m,inViewThreshold:h,slidesToScroll:y,skipSnaps:g,containScroll:v,watchResize:x,watchSlides:A,watchDrag:k,watchFocus:C}=o,T=2,M=G1(),R=M.measure(t),I=n.map(M.measure),O=q1(l,u),j=O.measureSize(R),_=Q1(j),N=W1(s,j),D=!c&&!!v,z=c||!!v,{slideSizes:U,slideSizesWithGaps:$,startGap:V,endGap:b}=dk(O,R,I,n,z,i),P=pk(O,j,y,c,R,I,V,b,T),{snaps:H,snapsAligned:w}=ik(O,N,R,I,P),W=-ct(H)+ct($),{snapsContained:X,scrollContainLimit:Y}=ek(j,W,w,v,T),J=D?X:w,{limit:ee}=tk(W,J,c),ie=Ef(Zn(J),f,c),K=ie.clone(),te=Jn(n),L=({dragHandler:pe,scrollBody:fe,scrollBounds:Ee,options:{loop:Oe}})=>{Oe||Ee.constrain(pe.pointerDown()),fe.seek()},ne=({scrollBody:pe,translate:fe,location:Ee,offsetLocation:Oe,previousLocation:st,scrollLooper:gt,slideLooper:ze,dragHandler:lt,animation:Ge,eventHandler:zi,scrollBounds:PT,options:{loop:$h}},jh)=>{const Uh=pe.settled(),NT=!PT.shouldConstrain(),Hh=$h?Uh:Uh&&NT,Wh=Hh&&!lt.pointerDown();Wh&&Ge.stop();const LT=Ee.get()*jh+st.get()*(1-jh);Oe.set(LT),$h&&(gt.loop(pe.direction()),ze.loop()),fe.to(Oe.get()),Wh&&zi.emit("settle"),Hh||zi.emit("scroll")},me=V1(r,i,()=>L(le),pe=>ne(le,pe)),ke=.68,oe=J[ie.get()],G=tr(oe),ue=tr(oe),de=tr(oe),xe=tr(oe),Se=Z1(G,de,ue,xe,p,ke),Ue=ak(c,J,W,ee,xe),Ye=sk(me,ie,K,Se,Ue,xe,a),Z=rk(ee),se=er(),B=fk(t,n,a,h),{slideRegistry:q}=ok(D,v,J,Y,P,te),ae=lk(e,n,q,Ye,Se,se,a,C),le={ownerDocument:r,ownerWindow:i,eventHandler:a,containerRect:R,slideRects:I,animation:me,axis:O,dragHandler:K1(O,e,r,i,xe,Y1(O,i),G,me,Ye,Se,Ue,ie,a,_,d,m,g,ke,k),eventStore:se,percentOfView:_,index:ie,indexPrevious:K,limit:ee,location:G,offsetLocation:de,previousLocation:ue,options:o,resizeHandler:J1(t,a,i,n,O,x,M),scrollBody:Se,scrollBounds:X1(ee,de,xe,Se,_),scrollLooper:nk(W,ee,de,[G,de,ue,xe]),scrollProgress:Z,scrollSnapList:J.map(Z.get),scrollSnaps:J,scrollTarget:Ue,scrollTo:Ye,slideLooper:uk(O,j,W,U,$,H,J,de,n),slideFocus:ae,slidesHandler:ck(t,a,A),slidesInView:B,slideIndexes:te,slideRegistry:q,slidesToScroll:P,target:xe,translate:Cf(O,t)};return le}function mk(){let e={},t;function n(u){t=u}function r(u){return e[u]||[]}function i(u){return r(u).forEach(f=>f(t,u)),l}function o(u,f){return e[u]=r(u).concat([f]),l}function a(u,f){return e[u]=r(u).filter(c=>c!==f),l}function s(){e={}}const l={init:n,emit:i,off:a,on:o,clear:s};return l}const gk={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function yk(e){function t(o,a){return Sf(o,a||{})}function n(o){const a=o.breakpoints||{},s=Xn(a).filter(l=>e.matchMedia(l).matches).map(l=>a[l]).reduce((l,u)=>t(l,u),{});return t(o,s)}function r(o){return o.map(a=>Xn(a.breakpoints||{})).reduce((a,s)=>a.concat(s),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function vk(e){let t=[];function n(o,a){return t=a.filter(({options:s})=>e.optionsAtMedia(s).active!==!1),t.forEach(s=>s.init(o,e)),a.reduce((s,l)=>Object.assign(s,{[l.name]:l}),{})}function r(){t=t.filter(o=>o.destroy())}return{init:n,destroy:r}}function qr(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=yk(i),a=vk(o),s=er(),l=mk(),{mergeOptions:u,optionsAtMedia:f,optionsMediaQueries:c}=o,{on:p,off:d,emit:m}=l,h=O;let y=!1,g,v=u(gk,qr.globalOptions),x=u(v),A=[],k,C,T;function M(){const{container:te,slides:L}=x;C=(fa(te)?e.querySelector(te):te)||e.children[0];const me=fa(L)?C.querySelectorAll(L):L;T=[].slice.call(me||C.children)}function R(te){const L=hk(e,C,T,r,i,te,l);if(te.loop&&!L.slideLooper.canLoop()){const ne=Object.assign({},te,{loop:!1});return R(ne)}return L}function I(te,L){y||(v=u(v,te),x=f(v),A=L||A,M(),g=R(x),c([v,...A.map(({options:ne})=>ne)]).forEach(ne=>s.add(ne,"change",O)),x.active&&(g.translate.to(g.location.get()),g.animation.init(),g.slidesInView.init(),g.slideFocus.init(K),g.eventHandler.init(K),g.resizeHandler.init(K),g.slidesHandler.init(K),g.options.loop&&g.slideLooper.loop(),C.offsetParent&&T.length&&g.dragHandler.init(K),k=a.init(K,A)))}function O(te,L){const ne=P();j(),I(u({startIndex:ne},te),L),l.emit("reInit")}function j(){g.dragHandler.destroy(),g.eventStore.clear(),g.translate.clear(),g.slideLooper.clear(),g.resizeHandler.destroy(),g.slidesHandler.destroy(),g.slidesInView.destroy(),g.animation.destroy(),a.destroy(),s.clear()}function _(){y||(y=!0,s.clear(),j(),l.emit("destroy"),l.clear())}function N(te,L,ne){!x.active||y||(g.scrollBody.useBaseFriction().useDuration(L===!0?0:x.duration),g.scrollTo.index(te,ne||0))}function D(te){const L=g.index.add(1).get();N(L,te,-1)}function z(te){const L=g.index.add(-1).get();N(L,te,1)}function U(){return g.index.add(1).get()!==P()}function $(){return g.index.add(-1).get()!==P()}function V(){return g.scrollSnapList}function b(){return g.scrollProgress.get(g.offsetLocation.get())}function P(){return g.index.get()}function H(){return g.indexPrevious.get()}function w(){return g.slidesInView.get()}function W(){return g.slidesInView.get(!1)}function X(){return k}function Y(){return g}function J(){return e}function ee(){return C}function ie(){return T}const K={canScrollNext:U,canScrollPrev:$,containerNode:ee,internalEngine:Y,destroy:_,off:d,on:p,emit:m,plugins:X,previousScrollSnap:H,reInit:h,rootNode:J,scrollNext:D,scrollPrev:z,scrollProgress:b,scrollSnapList:V,scrollTo:N,selectedScrollSnap:P,slideNodes:ie,slidesInView:w,slidesNotInView:W};return I(t,n),setTimeout(()=>l.emit("init"),0),K}qr.globalOptions=void 0;function ma(e={},t=[]){const n=F.useRef(e),r=F.useRef(t),[i,o]=F.useState(),[a,s]=F.useState(),l=F.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return F.useEffect(()=>{ua(n.current,e)||(n.current=e,l())},[e,l]),F.useEffect(()=>{j1(r.current,t)||(r.current=t,l())},[t,l]),F.useEffect(()=>{if($1()&&a){qr.globalOptions=ma.globalOptions;const u=qr(a,n.current,r.current);return o(u),()=>u.destroy()}else o(void 0)},[a,o]),[s,i]}ma.globalOptions=void 0;const Af=({ref:e,blocks:t,direction:n,sender:r,timestamp:i,messageId:o,isReadOnly:a,sendMessage:s,addMessageFeedback:l})=>{const[u,f]=ma({skipSnaps:!0,loop:!0}),[c,p]=F.useState(!0),[d,m]=F.useState(!0),h=F.useCallback(()=>f==null?void 0:f.scrollPrev(),[f]),y=F.useCallback(()=>f==null?void 0:f.scrollNext(),[f]),{message:{blocks:{carousel:g}}}=ge,v=F.useCallback(x=>{p(!(x!=null&&x.canScrollPrev())||!1),m(!(x!=null&&x.canScrollNext())||!1)},[f]);return F.useEffect(()=>{f&&(v(f),f.on("reInit",v),f.on("select",v))},[f,v]),S.jsxs("div",{...g==null?void 0:g.container,"data-container":"carousel",ref:u,children:[S.jsx("div",{ref:e,...g==null?void 0:g.slidesContainer,children:t.map((x,A)=>S.jsx(Yt,{block:{...x,direction:n,timestamp:i,sender:r,messageId:o,sendMessage:s,isReadOnly:a}},A))}),t.length>1&&S.jsxs(S.Fragment,{children:[S.jsx(tg,{...g==null?void 0:g.backButton,"data-disabled":c?"":void 0,onClick:h}),S.jsx(ng,{...g==null?void 0:g.nextButton,"data-disabled":d?"":void 0,onClick:y})]})]})};Af.displayName="Carousel";const If=Math.floor;function Tf(e){return Of(e)?(e.nodeName||"").toLowerCase():"#document"}function nr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bk(e){var t;return(t=(Of(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Of(e){return e instanceof Node||e instanceof nr(e).Node}function at(e){return e instanceof Element||e instanceof nr(e).Element}function cn(e){return e instanceof HTMLElement||e instanceof nr(e).HTMLElement}function ga(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof nr(e).ShadowRoot}function xk(e){return["html","body","#document"].includes(Tf(e))}function wk(e){return nr(e).getComputedStyle(e)}function kk(e){if(Tf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ga(e)&&e.host||bk(e);return ga(t)?t.host:t}function Pt(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 Ze(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&ga(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Df(){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 Mf(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Df())||t.test(Sk()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function _f(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 Pf(){return/apple/i.test(navigator.vendor)}function Ek(){return Df().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Nf(e,t){return["mouse","pen"].includes(e)}function Ck(e){return"nativeEvent"in e}function Ak(e){return e.matches("html,body")}function ft(e){return(e==null?void 0:e.ownerDocument)||document}function ya(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 Lf(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Ik="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Ff(e){return cn(e)&&e.matches(Ik)}function je(e){e.preventDefault(),e.stopPropagation()}const fn=Math.min,nt=Math.max,Kr=Math.round,Yr=Math.floor,bt=e=>({x:e,y:e});function Rf(e,t,n){return nt(e,fn(t,n))}function Gr(e,t){return typeof e=="function"?e(t):e}function rr(e){return e.split("-")[0]}function va(e){return e.split("-")[1]}function Bf(e){return e==="x"?"y":"x"}function Tk(e){return e==="y"?"height":"width"}const Ok=new Set(["top","bottom"]);function ir(e){return Ok.has(rr(e))?"y":"x"}function Dk(e){return Bf(ir(e))}function Mk(e){return{top:0,right:0,bottom:0,left:0,...e}}function _k(e){return typeof e!="number"?Mk(e):{top:e,right:e,bottom:e,left:e}}function Qr(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 zf(e,t,n){let{reference:r,floating:i}=e;const o=ir(t),a=Dk(t),s=Tk(a),l=rr(t),u=o==="y",f=r.x+r.width/2-i.width/2,c=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:c};break;case"left":d={x:r.x-i.width,y:c};break;default:d={x:r.x,y:r.y}}switch(va(t)){case"start":d[a]-=p*(n&&u?-1:1);break;case"end":d[a]+=p*(n&&u?-1:1);break}return d}const Pk=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 u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:c}=zf(u,r,l),p=r,d={},m=0;for(let h=0;h<s.length;h++){const{name:y,fn:g}=s[h],{x:v,y:x,data:A,reset:k}=await g({x:f,y:c,initialPlacement:r,placement:p,strategy:i,middlewareData:d,rects:u,platform:a,elements:{reference:e,floating:t}});f=v??f,c=x??c,d={...d,[y]:{...d[y],...A}},k&&m<=50&&(m++,typeof k=="object"&&(k.placement&&(p=k.placement),k.rects&&(u=k.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:f,y:c}=zf(u,p,l)),h=-1)}return{x:f,y:c,placement:p,strategy:i,middlewareData:d}};async function $f(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:c="floating",altBoundary:p=!1,padding:d=0}=Gr(t,e),m=_k(d),y=s[p?c==="floating"?"reference":"floating":c],g=Qr(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:u,rootBoundary:f,strategy:l})),v=c==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),A=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},k=Qr(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:x,strategy:l}):v);return{top:(g.top-k.top+m.top)/A.y,bottom:(k.bottom-g.bottom+m.bottom)/A.y,left:(g.left-k.left+m.left)/A.x,right:(k.right-g.right+m.right)/A.x}}const Nk=new Set(["left","top"]);async function Lk(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=rr(n),s=va(n),l=ir(n)==="y",u=Nk.has(a)?-1:1,f=o&&l?-1:1,c=Gr(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:m}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return s&&typeof m=="number"&&(d=s==="end"?m*-1:m),l?{x:d*f,y:p*u}:{x:p*u,y:d*f}}const Fk=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 Lk(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}}}}},Rk=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:y=>{let{x:g,y:v}=y;return{x:g,y:v}}},...l}=Gr(e,t),u={x:n,y:r},f=await $f(t,l),c=ir(rr(i)),p=Bf(c);let d=u[p],m=u[c];if(o){const y=p==="y"?"top":"left",g=p==="y"?"bottom":"right",v=d+f[y],x=d-f[g];d=Rf(v,d,x)}if(a){const y=c==="y"?"top":"left",g=c==="y"?"bottom":"right",v=m+f[y],x=m-f[g];m=Rf(v,m,x)}const h=s.fn({...t,[p]:d,[c]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:o,[c]:a}}}}}},Bk=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=()=>{},...u}=Gr(e,t),f=await $f(t,u),c=rr(i),p=va(i),d=ir(i)==="y",{width:m,height:h}=o.floating;let y,g;c==="top"||c==="bottom"?(y=c,g=p===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(g=c,y=p==="end"?"top":"bottom");const v=h-f.top-f.bottom,x=m-f.left-f.right,A=fn(h-f[y],v),k=fn(m-f[g],x),C=!t.middlewareData.shift;let T=A,M=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=v),C&&!p){const I=nt(f.left,0),O=nt(f.right,0),j=nt(f.top,0),_=nt(f.bottom,0);d?M=m-2*(I!==0||O!==0?I+O:nt(f.left,f.right)):T=h-2*(j!==0||_!==0?j+_:nt(f.top,f.bottom))}await l({...t,availableWidth:M,availableHeight:T});const R=await a.getDimensions(s.floating);return m!==R.width||h!==R.height?{reset:{rects:!0}}:{}}}};function Jr(){return typeof window<"u"}function dn(e){return jf(e)?(e.nodeName||"").toLowerCase():"#document"}function rt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xt(e){var t;return(t=(jf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function jf(e){return Jr()?e instanceof Node||e instanceof rt(e).Node:!1}function dt(e){return Jr()?e instanceof Element||e instanceof rt(e).Element:!1}function wt(e){return Jr()?e instanceof HTMLElement||e instanceof rt(e).HTMLElement:!1}function Uf(e){return!Jr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof rt(e).ShadowRoot}const zk=new Set(["inline","contents"]);function or(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!zk.has(i)}const $k=new Set(["table","td","th"]);function jk(e){return $k.has(dn(e))}const Uk=[":popover-open",":modal"];function Zr(e){return Uk.some(t=>{try{return e.matches(t)}catch{return!1}})}const Hk=["transform","translate","scale","rotate","perspective"],Wk=["transform","translate","scale","rotate","perspective","filter"],Vk=["paint","layout","strict","content"];function ba(e){const t=xa(),n=dt(e)?pt(e):e;return Hk.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)||Wk.some(r=>(n.willChange||"").includes(r))||Vk.some(r=>(n.contain||"").includes(r))}function qk(e){let t=Nt(e);for(;wt(t)&&!pn(t);){if(ba(t))return t;if(Zr(t))return null;t=Nt(t)}return null}function xa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Kk=new Set(["html","body","#document"]);function pn(e){return Kk.has(dn(e))}function pt(e){return rt(e).getComputedStyle(e)}function Xr(e){return dt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Nt(e){if(dn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Uf(e)&&e.host||xt(e);return Uf(t)?t.host:t}function Hf(e){const t=Nt(e);return pn(t)?e.ownerDocument?e.ownerDocument.body:e.body:wt(t)&&or(t)?t:Hf(t)}function Lt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Hf(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=rt(i);if(o){const s=wa(a);return t.concat(a,a.visualViewport||[],or(i)?i:[],s&&n?Lt(s):[])}return t.concat(i,Lt(i,[],n))}function wa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Wf(e){const t=pt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=wt(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=Kr(n)!==o||Kr(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function ka(e){return dt(e)?e:e.contextElement}function hn(e){const t=ka(e);if(!wt(t))return bt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Wf(t);let a=(o?Kr(n.width):n.width)/r,s=(o?Kr(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Yk=bt(0);function Vf(e){const t=rt(e);return!xa()||!t.visualViewport?Yk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gk(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==rt(e)?!1:t}function Kt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=ka(e);let a=bt(1);t&&(r?dt(r)&&(a=hn(r)):a=hn(e));const s=Gk(o,n,r)?Vf(o):bt(0);let l=(i.left+s.x)/a.x,u=(i.top+s.y)/a.y,f=i.width/a.x,c=i.height/a.y;if(o){const p=rt(o),d=r&&dt(r)?rt(r):r;let m=p,h=wa(m);for(;h&&r&&d!==m;){const y=hn(h),g=h.getBoundingClientRect(),v=pt(h),x=g.left+(h.clientLeft+parseFloat(v.paddingLeft))*y.x,A=g.top+(h.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,u*=y.y,f*=y.x,c*=y.y,l+=x,u+=A,m=rt(h),h=wa(m)}}return Qr({width:f,height:c,x:l,y:u})}function ei(e,t){const n=Xr(e).scrollLeft;return t?t.left+n:Kt(xt(e)).left+n}function qf(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ei(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Qk(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=xt(r),s=t?Zr(t.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},u=bt(1);const f=bt(0),c=wt(r);if((c||!c&&!o)&&((dn(r)!=="body"||or(a))&&(l=Xr(r)),wt(r))){const d=Kt(r);u=hn(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}const p=a&&!c&&!o?qf(a,l):bt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+p.x,y:n.y*u.y-l.scrollTop*u.y+f.y+p.y}}function Jk(e){return Array.from(e.getClientRects())}function Zk(e){const t=xt(e),n=Xr(e),r=e.ownerDocument.body,i=nt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=nt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ei(e);const s=-n.scrollTop;return pt(r).direction==="rtl"&&(a+=nt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}const Kf=25;function Xk(e,t){const n=rt(e),r=xt(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=xa();(!f||f&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const u=ei(r);if(u<=0){const f=r.ownerDocument,c=f.body,p=getComputedStyle(c),d=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(r.clientWidth-c.clientWidth-d);m<=Kf&&(o-=m)}else u<=Kf&&(o+=u);return{width:o,height:a,x:s,y:l}}const eS=new Set(["absolute","fixed"]);function tS(e,t){const n=Kt(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=wt(e)?hn(e):bt(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:a,height:s,x:l,y:u}}function Yf(e,t,n){let r;if(t==="viewport")r=Xk(e,n);else if(t==="document")r=Zk(xt(e));else if(dt(t))r=tS(t,n);else{const i=Vf(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Qr(r)}function Gf(e,t){const n=Nt(e);return n===t||!dt(n)||pn(n)?!1:pt(n).position==="fixed"||Gf(n,t)}function nS(e,t){const n=t.get(e);if(n)return n;let r=Lt(e,[],!1).filter(s=>dt(s)&&dn(s)!=="body"),i=null;const o=pt(e).position==="fixed";let a=o?Nt(e):e;for(;dt(a)&&!pn(a);){const s=pt(a),l=ba(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&eS.has(i.position)||or(a)&&!l&&Gf(e,a))?r=r.filter(f=>f!==a):i=s,a=Nt(a)}return t.set(e,r),r}function rS(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?Zr(t)?[]:nS(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((u,f)=>{const c=Yf(t,f,i);return u.top=nt(c.top,u.top),u.right=fn(c.right,u.right),u.bottom=fn(c.bottom,u.bottom),u.left=nt(c.left,u.left),u},Yf(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function iS(e){const{width:t,height:n}=Wf(e);return{width:t,height:n}}function oS(e,t,n){const r=wt(t),i=xt(t),o=n==="fixed",a=Kt(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=bt(0);function u(){l.x=ei(i)}if(r||!r&&!o)if((dn(t)!=="body"||or(i))&&(s=Xr(t)),r){const d=Kt(t,!0,o,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&u();o&&!r&&i&&u();const f=i&&!r&&!o?qf(i,s):bt(0),c=a.left+s.scrollLeft-l.x-f.x,p=a.top+s.scrollTop-l.y-f.y;return{x:c,y:p,width:a.width,height:a.height}}function Sa(e){return pt(e).position==="static"}function Qf(e,t){if(!wt(e)||pt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return xt(e)===n&&(n=n.ownerDocument.body),n}function Jf(e,t){const n=rt(e);if(Zr(e))return n;if(!wt(e)){let i=Nt(e);for(;i&&!pn(i);){if(dt(i)&&!Sa(i))return i;i=Nt(i)}return n}let r=Qf(e,t);for(;r&&jk(r)&&Sa(r);)r=Qf(r,t);return r&&pn(r)&&Sa(r)&&!ba(r)?n:r||qk(e)||n}const aS=async function(e){const t=this.getOffsetParent||Jf,n=this.getDimensions,r=await n(e.floating);return{reference:oS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sS(e){return pt(e).direction==="rtl"}const lS={convertOffsetParentRelativeRectToViewportRelativeRect:Qk,getDocumentElement:xt,getClippingRect:rS,getOffsetParent:Jf,getElementRects:aS,getClientRects:Jk,getDimensions:iS,getScale:hn,isElement:dt,isRTL:sS};function Zf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uS(e,t){let n=null,r;const i=xt(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 u=e.getBoundingClientRect(),{left:f,top:c,width:p,height:d}=u;if(s||t(),!p||!d)return;const m=Yr(c),h=Yr(i.clientWidth-(f+p)),y=Yr(i.clientHeight-(c+d)),g=Yr(f),x={rootMargin:-m+"px "+-h+"px "+-y+"px "+-g+"px",threshold:nt(0,fn(1,l))||1};let A=!0;function k(C){const T=C[0].intersectionRatio;if(T!==l){if(!A)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!Zf(u,e.getBoundingClientRect())&&a(),A=!1}try{n=new IntersectionObserver(k,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,x)}n.observe(e)}return a(!0),o}function cS(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,u=ka(e),f=i||o?[...u?Lt(u):[],...Lt(t)]:[];f.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),o&&g.addEventListener("resize",n)});const c=u&&s?uS(u,n):null;let p=-1,d=null;a&&(d=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=d)==null||x.observe(t)})),n()}),u&&!l&&d.observe(u),d.observe(t));let m,h=l?Kt(e):null;l&&y();function y(){const g=Kt(e);h&&!Zf(h,g)&&n(),h=g,m=requestAnimationFrame(y)}return n(),()=>{var g;f.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),c==null||c(),(g=d)==null||g.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const fS=Fk,dS=Rk,pS=Bk,hS=(e,t,n)=>{const r=new Map,i={platform:lS,...n},o={...i.platform,_c:r};return Pk(e,t,{...i,platform:o})};var mS=typeof document<"u",gS=function(){},ti=mS?F.useLayoutEffect:gS;function ni(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(!ni(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)&&!ni(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Xf(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ed(e,t){const n=Xf(e);return Math.round(t*n)/n}function Ea(e){const t=E.useRef(e);return ti(()=>{t.current=e}),t}function yS(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:u}=e,[f,c]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=E.useState(r);ni(p,r)||d(r);const[m,h]=E.useState(null),[y,g]=E.useState(null),v=E.useCallback($=>{$!==C.current&&(C.current=$,h($))},[]),x=E.useCallback($=>{$!==T.current&&(T.current=$,g($))},[]),A=o||m,k=a||y,C=E.useRef(null),T=E.useRef(null),M=E.useRef(f),R=l!=null,I=Ea(l),O=Ea(i),j=Ea(u),_=E.useCallback(()=>{if(!C.current||!T.current)return;const $={placement:t,strategy:n,middleware:p};O.current&&($.platform=O.current),hS(C.current,T.current,$).then(V=>{const b={...V,isPositioned:j.current!==!1};N.current&&!ni(M.current,b)&&(M.current=b,Fs.flushSync(()=>{c(b)}))})},[p,t,n,O,j]);ti(()=>{u===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,c($=>({...$,isPositioned:!1})))},[u]);const N=E.useRef(!1);ti(()=>(N.current=!0,()=>{N.current=!1}),[]),ti(()=>{if(A&&(C.current=A),k&&(T.current=k),A&&k){if(I.current)return I.current(A,k,_);_()}},[A,k,_,I,R]);const D=E.useMemo(()=>({reference:C,floating:T,setReference:v,setFloating:x}),[v,x]),z=E.useMemo(()=>({reference:A,floating:k}),[A,k]),U=E.useMemo(()=>{const $={position:n,left:0,top:0};if(!z.floating)return $;const V=ed(z.floating,f.x),b=ed(z.floating,f.y);return s?{...$,transform:"translate("+V+"px, "+b+"px)",...Xf(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:b}},[n,s,z.floating,f.x,f.y]);return E.useMemo(()=>({...f,update:_,refs:D,elements:z,floatingStyles:U}),[f,_,D,z,U])}const vS=(e,t)=>({...fS(e),options:[e,t]}),bS=(e,t)=>({...dS(e),options:[e,t]}),xS=(e,t)=>({...pS(e),options:[e,t]});/*!
255
276
  * tabbable 6.3.0
256
277
  * @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
278
+ */var wS=["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])"],Ca=wS.join(","),td=typeof Element>"u",ar=td?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ri=!td&&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},sr=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&&sr(t.parentNode);return a},kS=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(sr(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Ca));return n&&ar.call(t,Ca)&&i.unshift(t),i=i.filter(r),i},Aa=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var a=o.shift();if(!sr(a,!1))if(a.tagName==="SLOT"){var s=a.assignedElements(),l=s.length?s:a.children,u=Aa(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:a,candidates:u})}else{var f=ar.call(a,Ca);f&&r.filter(a)&&(n||!t.includes(a))&&i.push(a);var c=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),p=!sr(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(c&&p){var d=Aa(c===!0?a.children:c.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},nd=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},rd=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||kS(t))&&!nd(t)?0:t.tabIndex},ES=function(t,n){var r=rd(t);return r<0&&n&&!nd(t)?0:r},CS=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},id=function(t){return t.tagName==="INPUT"},AS=function(t){return id(t)&&t.type==="hidden"},IS=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},TS=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},OS=function(t){if(!t.name)return!0;var n=t.form||ri(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=TS(i,t.form);return!o||o===t},DS=function(t){return id(t)&&t.type==="radio"},MS=function(t){return DS(t)&&!OS(t)},_S=function(t){var n,r=t&&ri(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 u,f,c;r=ri(i),i=(u=r)===null||u===void 0?void 0:u.host,o=!!((f=i)!==null&&f!==void 0&&(c=f.ownerDocument)!==null&&c!==void 0&&c.contains(i))}}return o},od=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},PS=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=ar.call(t,"details>summary:first-of-type"),s=a?t.parentElement:t;if(ar.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 u=t.parentElement,f=ri(t);if(u&&!u.shadowRoot&&i(u)===!0)return od(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=l}if(_S(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return od(t);return!1},NS=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 ar.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},LS=function(t,n){return!(n.disabled||sr(n)||AS(n)||PS(n,t)||IS(n)||NS(n))},ad=function(t,n){return!(MS(n)||rd(n)<0||!LS(t,n))},FS=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},sd=function(t){var n=[],r=[];return t.forEach(function(i,o){var a=!!i.scopeParent,s=a?i.scopeParent:i,l=ES(s,a),u=a?sd(i.candidates):s;l===0?a?n.push.apply(n,u):n.push(s):r.push({documentOrder:o,tabIndex:l,item:i,isScope:a,content:u})}),r.sort(CS).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},Ia=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Aa([t],n.includeContainer,{filter:ad.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:FS}):r=SS(t,n.includeContainer,ad.bind(null,n)),sd(r)};const Ta="ArrowUp",ii="ArrowDown",mn="ArrowLeft",lr="ArrowRight";function oi(e,t,n){return Math.floor(e/t)!==n}function ur(e,t){return t<0||t>=e.current.length}function Oa(e,t){return Ve(e,{disabledIndices:t})}function ld(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,u;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")||((u=a[s])==null?void 0:u.getAttribute("aria-disabled"))==="true"));return s}function RS(e,t){let{event:n,orientation:r,loop:i,cols:o,disabledIndices:a,minIndex:s,maxIndex:l,prevIndex:u,stopEvent:f=!1}=t,c=u;if(n.key===Ta){if(f&&je(n),u===-1)c=l;else if(c=Ve(e,{startingIndex:c,amount:o,decrement:!0,disabledIndices:a}),i&&(u-o<s||c<0)){const p=u%o,d=l%o,m=l-(d-p);d===p?c=l:c=d>p?m:m-o}ur(e,c)&&(c=u)}if(n.key===ii&&(f&&je(n),u===-1?c=s:(c=Ve(e,{startingIndex:u,amount:o,disabledIndices:a}),i&&u+o>l&&(c=Ve(e,{startingIndex:u%o-o,amount:o,disabledIndices:a}))),ur(e,c)&&(c=u)),r==="both"){const p=If(u/o);n.key===lr&&(f&&je(n),u%o!==o-1?(c=Ve(e,{startingIndex:u,disabledIndices:a}),i&&oi(c,o,p)&&(c=Ve(e,{startingIndex:u-u%o-1,disabledIndices:a}))):i&&(c=Ve(e,{startingIndex:u-u%o-1,disabledIndices:a})),oi(c,o,p)&&(c=u)),n.key===mn&&(f&&je(n),u%o!==0?(c=Ve(e,{startingIndex:u,disabledIndices:a,decrement:!0}),i&&oi(c,o,p)&&(c=Ve(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:a}))):i&&(c=Ve(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:a})),oi(c,o,p)&&(c=u));const d=If(l/o)===p;ur(e,c)&&(i&&d?c=n.key===mn?l:Ve(e,{startingIndex:u-u%o-1,disabledIndices:a}):c=u)}return c}let ud=0;function Ct(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(ud);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():ud=requestAnimationFrame(o)}var Re=typeof document<"u"?F.useLayoutEffect:F.useEffect;function ai(){return ai=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},ai.apply(this,arguments)}let Da=!1,BS=0;const cd=()=>"floating-ui-"+BS++;function zS(){const[e,t]=E.useState(()=>Da?cd():void 0);return Re(()=>{e==null&&t(cd())},[]),E.useEffect(()=>{Da||(Da=!0)},[]),e}const Ma=E.useId||zS;function $S(){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 jS=E.createContext(null),US=E.createContext(null),fd=()=>{var e;return((e=E.useContext(jS))==null?void 0:e.id)||null},si=()=>E.useContext(US);function cr(e){return"data-floating-ui-"+e}function Ft(e){const t=F.useRef(e);return Re(()=>{t.current=e}),t}function HS(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 gn(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 WS(e,t){let n,r=-1;function i(o,a){a>r&&(n=o,r=a),gn(e,o).forEach(l=>{i(l.id,a+1)})}return i(t,0),e.find(o=>o.id===n)}let yn=new WeakMap,li=new WeakSet,ui={},_a=0;const VS=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,dd=e=>e&&(e.host||dd(e.parentNode)),qS=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=dd(n);return e.contains(r)?r:null}).filter(n=>n!=null);function KS(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,a=qS(t,e),s=new Set,l=new Set(a),u=[];ui[i]||(ui[i]=new WeakMap);const f=ui[i];a.forEach(c),p(t),s.clear();function c(d){!d||s.has(d)||(s.add(d),d.parentNode&&c(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,y=h!==null&&h!=="false",g=(yn.get(m)||0)+1,v=(f.get(m)||0)+1;yn.set(m,g),f.set(m,v),u.push(m),g===1&&y&&li.add(m),v===1&&m.setAttribute(i,""),!y&&o&&m.setAttribute(o,"true")}})}return _a++,()=>{u.forEach(d=>{const m=(yn.get(d)||0)-1,h=(f.get(d)||0)-1;yn.set(d,m),f.set(d,h),m||(!li.has(d)&&o&&d.removeAttribute(o),li.delete(d)),h||d.removeAttribute(i)}),_a--,_a||(yn=new WeakMap,yn=new WeakMap,li=new WeakSet,ui={})}}function pd(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=ft(e[0]).body;return KS(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Pa=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function hd(e,t){const n=Ia(e,Pa());t==="prev"&&n.reverse();const r=n.indexOf(Pt(ft(e)));return n.slice(r+1)[0]}function md(){return hd(document.body,"next")}function gd(){return hd(document.body,"prev")}function fr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ze(n,r)}function YS(e){Ia(e,Pa()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function GS(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 Na={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 QS;function yd(e){e.key==="Tab"&&(e.target,clearTimeout(QS))}const ci=E.forwardRef(function(t,n){const[r,i]=E.useState();Re(()=>(Pf()&&i("button"),document.addEventListener("keydown",yd),()=>{document.removeEventListener("keydown",yd)}),[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[cr("focus-guard")]:"",style:Na};return E.createElement("span",ai({},t,o))}),vd=E.createContext(null);function JS(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=E.useState(null),o=Ma(),a=bd(),s=E.useMemo(()=>({id:t,root:n,portalContext:a,uniqueId:o}),[t,n,a,o]),l=E.useRef();return Re(()=>()=>{r==null||r.remove()},[r,s]),Re(()=>{if(l.current===s)return;l.current=s;const{id:u,root:f,portalContext:c,uniqueId:p}=s,d=u?document.getElementById(u):null,m=cr("portal");if(d){const h=document.createElement("div");h.id=p,h.setAttribute(m,""),d.appendChild(h),i(h)}else{let h=f||(c==null?void 0:c.portalNode);h&&!at(h)&&(h=h.current),h=h||document.body;let y=null;u&&(y=document.createElement("div"),y.id=u,h.appendChild(y));const g=document.createElement("div");g.id=p,g.setAttribute(m,""),h=y||h,h.appendChild(g),i(g)}},[s]),r}function ZS(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=JS({id:n,root:r}),[a,s]=E.useState(null),l=E.useRef(null),u=E.useRef(null),f=E.useRef(null),c=E.useRef(null),p=!!a&&!a.modal&&a.open&&i&&!!(r||o);return E.useEffect(()=>{if(!o||!i||a!=null&&a.modal)return;function d(m){o&&fr(m)&&(m.type==="focusin"?GS:YS)(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]),E.createElement(vd.Provider,{value:E.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:c,portalNode:o,setFocusManagerState:s}),[i,o])},p&&o&&E.createElement(ci,{"data-type":"outside",ref:l,onFocus:d=>{if(fr(d,o)){var m;(m=f.current)==null||m.focus()}else{const h=gd()||(a==null?void 0:a.refs.domReference.current);h==null||h.focus()}}}),p&&o&&E.createElement("span",{"aria-owns":o.id,style:Na}),o&&Ns.createPortal(t,o),p&&o&&E.createElement(ci,{"data-type":"outside",ref:u,onFocus:d=>{if(fr(d,o)){var m;(m=c.current)==null||m.focus()}else{const h=md()||(a==null?void 0:a.refs.domReference.current);h==null||h.focus(),a!=null&&a.closeOnFocusOut&&(a==null||a.onOpenChange(!1,d.nativeEvent))}}}))}const bd=()=>E.useContext(vd),XS=E.forwardRef(function(t,n){return E.createElement("button",ai({},t,{type:"button",ref:n,tabIndex:-1,style:Na}))});function eE(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:u=!1,closeOnFocusOut:f=!0}=e,{open:c,refs:p,nodeId:d,onOpenChange:m,events:h,dataRef:y,elements:{domReference:g,floating:v}}=t,x=VS()?o:!0,A=Ft(i),k=Ft(a),C=Ft(s),T=si(),M=bd(),R=typeof a=="number"&&a<0,I=E.useRef(null),O=E.useRef(null),j=E.useRef(!1),_=E.useRef(null),N=E.useRef(!1),D=M!=null,z=g&&g.getAttribute("role")==="combobox"&&Ff(g)&&R,U=E.useCallback(function(P){return P===void 0&&(P=v),P?Ia(P,Pa()):[]},[v]),$=E.useCallback(P=>{const H=U(P);return A.current.map(w=>g&&w==="reference"?g:v&&w==="floating"?v:H).filter(Boolean).flat()},[g,v,A,U]);E.useEffect(()=>{if(r||!l)return;function P(w){if(w.key==="Tab"){Ze(v,Pt(ft(v)))&&U().length===0&&!z&&je(w);const W=$(),X=Lf(w);A.current[0]==="reference"&&X===g&&(je(w),w.shiftKey?Ct(W[W.length-1]):Ct(W[1])),A.current[1]==="floating"&&X===v&&w.shiftKey&&(je(w),Ct(W[0]))}}const H=ft(v);return H.addEventListener("keydown",P),()=>{H.removeEventListener("keydown",P)}},[r,g,v,l,A,p,z,U,$]),E.useEffect(()=>{if(r||!f)return;function P(){N.current=!0,setTimeout(()=>{N.current=!1})}function H(w){const W=w.relatedTarget;queueMicrotask(()=>{const X=!(Ze(g,W)||Ze(v,W)||Ze(W,v)||Ze(M==null?void 0:M.portalNode,W)||W!=null&&W.hasAttribute(cr("focus-guard"))||T&&(gn(T.nodesRef.current,d).find(Y=>{var J,ee;return Ze((J=Y.context)==null?void 0:J.elements.floating,W)||Ze((ee=Y.context)==null?void 0:ee.elements.domReference,W)})||HS(T.nodesRef.current,d).find(Y=>{var J,ee;return((J=Y.context)==null?void 0:J.elements.floating)===W||((ee=Y.context)==null?void 0:ee.elements.domReference)===W})));W&&X&&!N.current&&W!==_.current&&(j.current=!0,m(!1,w))})}if(v&&cn(g))return g.addEventListener("focusout",H),g.addEventListener("pointerdown",P),!l&&v.addEventListener("focusout",H),()=>{g.removeEventListener("focusout",H),g.removeEventListener("pointerdown",P),!l&&v.removeEventListener("focusout",H)}},[r,g,v,l,d,T,M,m,f]),E.useEffect(()=>{var P;if(r)return;const H=Array.from((M==null||(P=M.portalNode)==null?void 0:P.querySelectorAll("["+cr("portal")+"]"))||[]);if(v){const w=[v,...H,I.current,O.current,A.current.includes("reference")||z?g:null].filter(X=>X!=null),W=l?pd(w,x,!x):pd(w);return()=>{W()}}},[r,g,v,l,A,M,z,x]),Re(()=>{if(r||!v)return;const P=ft(v),H=Pt(P);queueMicrotask(()=>{const w=$(v),W=k.current,X=(typeof W=="number"?w[W]:W.current)||v,Y=Ze(v,H);!R&&!Y&&c&&Ct(X,{preventScroll:X===v})})},[r,c,v,R,$,k]),Re(()=>{if(r||!v)return;let P=!1;const H=ft(v),w=Pt(H),W=y.current;_.current=w;function X(Y){if(Y.type==="escapeKey"&&p.domReference.current&&(_.current=p.domReference.current),["referencePress","escapeKey"].includes(Y.type))return;const J=Y.data.returnFocus;typeof J=="object"?(j.current=!1,P=J.preventScroll):j.current=!J}return h.on("dismiss",X),()=>{h.off("dismiss",X);const Y=Pt(H);(Ze(v,Y)||T&&gn(T.nodesRef.current,d).some(ee=>{var ie;return Ze((ie=ee.context)==null?void 0:ie.elements.floating,Y)})||W.openEvent&&["click","mousedown"].includes(W.openEvent.type))&&p.domReference.current&&(_.current=p.domReference.current),C.current&&cn(_.current)&&!j.current&&Ct(_.current,{cancelPrevious:!1,preventScroll:P})}},[r,v,C,y,p,h,T,d]),Re(()=>{if(!(r||!M))return M.setFocusManagerState({modal:l,closeOnFocusOut:f,open:c,onOpenChange:m,refs:p}),()=>{M.setFocusManagerState(null)}},[r,M,l,c,m,p,f]),Re(()=>{if(!r&&v&&typeof MutationObserver=="function"&&!R){const P=()=>{const w=v.getAttribute("tabindex");A.current.includes("floating")||Pt(ft(v))!==p.domReference.current&&U().length===0?w!=="0"&&v.setAttribute("tabindex","0"):w!=="-1"&&v.setAttribute("tabindex","-1")};P();const H=new MutationObserver(P);return H.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{H.disconnect()}}},[r,v,p,A,U,R]);function V(P){return r||!u||!l?null:E.createElement(XS,{ref:P==="start"?I:O,onClick:H=>m(!1,H.nativeEvent)},typeof u=="string"?u:"Dismiss")}const b=!r&&x&&!z&&(D||l);return E.createElement(E.Fragment,null,b&&E.createElement(ci,{"data-type":"inside",ref:M==null?void 0:M.beforeInsideRef,onFocus:P=>{if(l){const w=$();Ct(i[0]==="reference"?w[0]:w[w.length-1])}else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(j.current=!1,fr(P,M.portalNode)){const w=md()||g;w==null||w.focus()}else{var H;(H=M.beforeOutsideRef.current)==null||H.focus()}}}),!z&&V("start"),n,V("end"),b&&E.createElement(ci,{"data-type":"inside",ref:M==null?void 0:M.afterInsideRef,onFocus:P=>{if(l)Ct($()[0]);else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(f&&(j.current=!0),fr(P,M.portalNode)){const w=gd()||g;w==null||w.focus()}else{var H;(H=M.afterOutsideRef.current)==null||H.focus()}}}))}function xd(e){return cn(e.target)&&e.target.tagName==="BUTTON"}function wd(e){return Ff(e)}function tE(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:u=!1,keyboardHandlers:f=!0}=t,c=E.useRef(),p=E.useRef(!1);return E.useMemo(()=>a?{reference:{onPointerDown(d){c.current=d.pointerType},onMouseDown(d){d.button===0&&(Nf(c.current)&&u||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"&&c.current){c.current=void 0;return}Nf(c.current)&&u||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,d.nativeEvent):r(!0,d.nativeEvent))},onKeyDown(d){c.current=void 0,!(d.defaultPrevented||!f||xd(d))&&(d.key===" "&&!wd(o)&&(d.preventDefault(),p.current=!0),d.key==="Enter"&&r(!(n&&l),d.nativeEvent))},onKeyUp(d){d.defaultPrevented||!f||xd(d)||wd(o)||d.key===" "&&p.current&&(p.current=!1,r(!(n&&l),d.nativeEvent))}}}:{},[a,i,s,u,f,o,l,n,r])}const nE=E.useInsertionEffect||(e=>e());function Rt(e){const t=E.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return nE(()=>{t.current=e}),E.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 rE={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},iE={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},oE=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 aE(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:o,elements:{reference:a,domReference:s,floating:l},dataRef:u}=e,{enabled:f=!0,escapeKey:c=!0,outsidePress:p=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:h="pointerdown",ancestorScroll:y=!1,bubbles:g}=t,v=si(),x=fd()!=null,A=Rt(typeof p=="function"?p:()=>!1),k=typeof p=="function"?A:p,C=E.useRef(!1),{escapeKeyBubbles:T,outsidePressBubbles:M}=oE(g),R=Rt(O=>{if(!n||!f||!c||O.key!=="Escape")return;const j=v?gn(v.nodesRef.current,o):[];if(!T&&(O.stopPropagation(),j.length>0)){let _=!0;if(j.forEach(N=>{var D;if((D=N.context)!=null&&D.open&&!N.context.dataRef.current.__escapeKeyBubbles){_=!1;return}}),!_)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,Ck(O)?O.nativeEvent:O)}),I=Rt(O=>{const j=C.current;if(C.current=!1,j||typeof k=="function"&&!k(O))return;const _=Lf(O),N="["+cr("inert")+"]",D=ft(l).querySelectorAll(N);let z=at(_)?_:null;for(;z&&!xk(z);){const V=kk(z);if(V===ft(l).body||!at(V))break;z=V}if(D.length&&at(_)&&!Ak(_)&&!Ze(_,l)&&Array.from(D).every(V=>!Ze(z,V)))return;if(cn(_)&&l){const V=_.clientWidth>0&&_.scrollWidth>_.clientWidth,b=_.clientHeight>0&&_.scrollHeight>_.clientHeight;let P=b&&O.offsetX>_.clientWidth;if(b&&wk(_).direction==="rtl"&&(P=O.offsetX<=_.offsetWidth-_.clientWidth),P||V&&O.offsetY>_.clientHeight)return}const U=v&&gn(v.nodesRef.current,o).some(V=>{var b;return ya(O,(b=V.context)==null?void 0:b.elements.floating)});if(ya(O,l)||ya(O,s)||U)return;const $=v?gn(v.nodesRef.current,o):[];if($.length>0){let V=!0;if($.forEach(b=>{var P;if((P=b.context)!=null&&P.open&&!b.context.dataRef.current.__outsidePressBubbles){V=!1;return}}),!V)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:x?{preventScroll:!0}:Mf(O)||_f(O)}}),r(!1,O)});return E.useEffect(()=>{if(!n||!f)return;u.current.__escapeKeyBubbles=T,u.current.__outsidePressBubbles=M;function O(N){r(!1,N)}const j=ft(l);c&&j.addEventListener("keydown",R),k&&j.addEventListener(d,I);let _=[];return y&&(at(s)&&(_=Lt(s)),at(l)&&(_=_.concat(Lt(l))),!at(a)&&a&&a.contextElement&&(_=_.concat(Lt(a.contextElement)))),_=_.filter(N=>{var D;return N!==((D=j.defaultView)==null?void 0:D.visualViewport)}),_.forEach(N=>{N.addEventListener("scroll",O,{passive:!0})}),()=>{c&&j.removeEventListener("keydown",R),k&&j.removeEventListener(d,I),_.forEach(N=>{N.removeEventListener("scroll",O)})}},[u,l,s,a,c,k,d,n,r,y,f,T,M,R,I]),E.useEffect(()=>{C.current=!1},[k,d]),E.useMemo(()=>f?{reference:{onKeyDown:R,[rE[h]]:O=>{m&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,O.nativeEvent))}},floating:{onKeyDown:R,[iE[d]]:()=>{C.current=!0}}}:{},[f,i,m,d,h,r,R])}let La;process.env.NODE_ENV!=="production"&&(La=new Set);function sE(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=La)!=null&&a.has(T))){var s;(s=La)==null||s.add(T),console.error(T)}}}const[l,u]=E.useState(null),f=((t=e.elements)==null?void 0:t.reference)||l,c=yS(e),p=si(),d=Rt((T,M)=>{T&&(h.current.openEvent=M),r==null||r(T,M)}),m=E.useRef(null),h=E.useRef({}),y=E.useState(()=>$S())[0],g=Ma(),v=E.useCallback(T=>{const M=at(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),contextElement:T}:T;c.refs.setReference(M)},[c.refs]),x=E.useCallback(T=>{(at(T)||T===null)&&(m.current=T,u(T)),(at(c.refs.reference.current)||c.refs.reference.current===null||T!==null&&!at(T))&&c.refs.setReference(T)},[c.refs]),A=E.useMemo(()=>({...c.refs,setReference:x,setPositionReference:v,domReference:m}),[c.refs,x,v]),k=E.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),C=E.useMemo(()=>({...c,refs:A,elements:k,dataRef:h,nodeId:i,floatingId:g,events:y,open:n,onOpenChange:d}),[c,i,g,y,n,d,A,k]);return Re(()=>{const T=p==null?void 0:p.nodesRef.current.find(M=>M.id===i);T&&(T.context=C)}),E.useMemo(()=>({...c,context:C,refs:A,elements:k}),[c,A,k,C])}function Fa(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 u;(u=r.get(s))==null||u.push(l),i[s]=function(){for(var f,c=arguments.length,p=new Array(c),d=0;d<c;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 lE(e){e===void 0&&(e=[]);const t=e,n=E.useCallback(o=>Fa(o,e,"reference"),t),r=E.useCallback(o=>Fa(o,e,"floating"),t),i=E.useCallback(o=>Fa(o,e,"item"),e.map(o=>o==null?void 0:o.item));return E.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let kd=!1;function fi(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Sd(e,t){return fi(t,e===Ta||e===ii,e===mn||e===lr)}function Ra(e,t,n){return fi(t,e===ii,n?e===mn:e===lr)||e==="Enter"||e==" "||e===""}function uE(e,t,n){return fi(t,n?e===mn:e===lr,e===ii)}function Ed(e,t,n){return fi(t,n?e===lr:e===mn,e===Ta)}function cE(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:o,floating:a}}=e,{listRef:s,activeIndex:l,onNavigate:u=()=>{},enabled:f=!0,selectedIndex:c=null,allowEscape:p=!1,loop:d=!1,nested:m=!1,rtl:h=!1,virtual:y=!1,focusItemOnOpen:g="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:x=!0,disabledIndices:A=void 0,orientation:k="vertical",cols:C=1,scrollItemIntoView:T=!0,virtualItemRef:M}=t;process.env.NODE_ENV!=="production"&&(p&&(d||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),y||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),k==="vertical"&&C>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const R=fd(),I=si(),O=Rt(u),j=E.useRef(g),_=E.useRef(c??-1),N=E.useRef(null),D=E.useRef(!0),z=E.useRef(O),U=E.useRef(!!a),$=E.useRef(!1),V=E.useRef(!1),b=Ft(A),P=Ft(n),H=Ft(T),[w,W]=E.useState(),[X,Y]=E.useState(),J=Rt(function(K,te,L){L===void 0&&(L=!1);const ne=K.current[te.current];ne&&(y?(W(ne.id),I==null||I.events.emit("virtualfocus",ne),M&&(M.current=ne)):Ct(ne,{preventScroll:!0,sync:Ek()&&Pf()?kd||$.current:!1}),requestAnimationFrame(()=>{const me=H.current;me&&ne&&(L||!D.current)&&(ne.scrollIntoView==null||ne.scrollIntoView(typeof me=="boolean"?{block:"nearest",inline:"nearest"}:me))}))});Re(()=>{document.createElement("div").focus({get preventScroll(){return kd=!0,!1}})},[]),Re(()=>{f&&(n&&a?j.current&&c!=null&&(V.current=!0,O(c)):U.current&&(_.current=-1,z.current(null)))},[f,n,a,c,O]),Re(()=>{if(f&&n&&a)if(l==null){if($.current=!1,c!=null)return;if(U.current&&(_.current=-1,J(s,_)),!U.current&&j.current&&(N.current!=null||j.current===!0&&N.current==null)){let K=0;const te=()=>{s.current[0]==null?(K<2&&(K?requestAnimationFrame:queueMicrotask)(te),K++):(_.current=N.current==null||Ra(N.current,k,h)||m?Oa(s,b.current):ld(s,b.current),N.current=null,O(_.current))};te()}}else ur(s,l)||(_.current=l,J(s,_,V.current),V.current=!1)},[f,n,a,l,c,m,s,k,h,O,J,b]),Re(()=>{var K,te;if(!f||a||!I||y||!U.current)return;const L=I.nodesRef.current,ne=(K=L.find(oe=>oe.id===R))==null||(te=K.context)==null?void 0:te.elements.floating,me=Pt(ft(a)),ke=L.some(oe=>oe.context&&Ze(oe.context.elements.floating,me));ne&&!ke&&D.current&&ne.focus({preventScroll:!0})},[f,a,I,R,y]),Re(()=>{if(!f||!I||!y||R)return;function K(te){Y(te.id),M&&(M.current=te)}return I.events.on("virtualfocus",K),()=>{I.events.off("virtualfocus",K)}},[f,I,y,R,M]),Re(()=>{z.current=O,U.current=!!a}),Re(()=>{n||(N.current=null)},[n]);const ee=l!=null,ie=E.useMemo(()=>{function K(L){if(!n)return;const ne=s.current.indexOf(L);ne!==-1&&O(ne)}return{onFocus(L){let{currentTarget:ne}=L;K(ne)},onClick:L=>{let{currentTarget:ne}=L;return ne.focus({preventScroll:!0})},...v&&{onMouseMove(L){let{currentTarget:ne}=L;K(ne)},onPointerLeave(L){let{pointerType:ne}=L;!D.current||ne==="touch"||(_.current=-1,J(s,_),O(null),y||Ct(i.floating.current,{preventScroll:!0}))}}}},[n,i,J,v,s,O,y]);return E.useMemo(()=>{if(!f)return{};const K=b.current;function te(oe){if(D.current=!1,$.current=!0,!P.current&&oe.currentTarget===i.floating.current)return;if(m&&Ed(oe.key,k,h)){je(oe),r(!1,oe.nativeEvent),cn(o)&&!y&&o.focus();return}const G=_.current,ue=Oa(s,K),de=ld(s,K);if(oe.key==="Home"&&(je(oe),_.current=ue,O(_.current)),oe.key==="End"&&(je(oe),_.current=de,O(_.current)),!(C>1&&(_.current=RS(s,{event:oe,orientation:k,loop:d,cols:C,disabledIndices:K,minIndex:ue,maxIndex:de,prevIndex:_.current,stopEvent:!0}),O(_.current),k==="both"))&&Sd(oe.key,k)){if(je(oe),n&&!y&&Pt(oe.currentTarget.ownerDocument)===oe.currentTarget){_.current=Ra(oe.key,k,h)?ue:de,O(_.current);return}Ra(oe.key,k,h)?d?_.current=G>=de?p&&G!==s.current.length?-1:ue:Ve(s,{startingIndex:G,disabledIndices:K}):_.current=Math.min(de,Ve(s,{startingIndex:G,disabledIndices:K})):d?_.current=G<=ue?p&&G!==-1?s.current.length:de:Ve(s,{startingIndex:G,decrement:!0,disabledIndices:K}):_.current=Math.max(ue,Ve(s,{startingIndex:G,decrement:!0,disabledIndices:K})),ur(s,_.current)?O(null):O(_.current)}}function L(oe){g==="auto"&&Mf(oe.nativeEvent)&&(j.current=!0)}function ne(oe){j.current=g,g==="auto"&&_f(oe.nativeEvent)&&(j.current=!0)}const me=y&&n&&ee&&{"aria-activedescendant":X||w},ke=s.current.find(oe=>(oe==null?void 0:oe.id)===w);return{reference:{...me,onKeyDown(oe){D.current=!1;const G=oe.key.indexOf("Arrow")===0,ue=uE(oe.key,k,h),de=Ed(oe.key,k,h),xe=Sd(oe.key,k),Se=(m?ue:xe)||oe.key==="Enter"||oe.key.trim()==="";if(y&&n){const se=I==null?void 0:I.nodesRef.current.find(q=>q.parentId==null),B=I&&se?WS(I.nodesRef.current,se.id):null;if(G&&B&&M){const q=new KeyboardEvent("keydown",{key:oe.key,bubbles:!0});if(ue||de){var Ue,Ye;const ae=((Ue=B.context)==null?void 0:Ue.elements.domReference)===oe.currentTarget,le=de&&!ae?(Ye=B.context)==null?void 0:Ye.elements.domReference:ue?ke:null;le&&(je(oe),le.dispatchEvent(q),Y(void 0))}if(xe&&B.context&&B.context.open&&B.parentId&&oe.currentTarget!==B.context.elements.domReference){var Z;je(oe),(Z=B.context.elements.domReference)==null||Z.dispatchEvent(q);return}}return te(oe)}if(!(!n&&!x&&G)){if(Se&&(N.current=m&&xe?null:oe.key),m){ue&&(je(oe),n?(_.current=Oa(s,K),O(_.current)):r(!0,oe.nativeEvent));return}xe&&(c!=null&&(_.current=c),je(oe),!n&&x?r(!0,oe.nativeEvent):te(oe),n&&O(_.current))}},onFocus(){n&&O(null)},onPointerDown:ne,onMouseDown:L,onClick:L},floating:{"aria-orientation":k==="both"?void 0:k,...me,onKeyDown:te,onPointerMove(){D.current=!0}},item:ie}},[o,i,w,X,b,P,s,f,k,h,y,n,ee,m,c,x,p,C,d,g,O,r,ie,I,M])}function fE(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:o="dialog"}=t,a=Ma();return E.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 dE(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:a,onMatch:s,onTypingChange:l,enabled:u=!0,findMatch:f=null,resetMs:c=750,ignoreKeys:p=[],selectedIndex:d=null}=t,m=E.useRef(),h=E.useRef(""),y=E.useRef((n=d??a)!=null?n:-1),g=E.useRef(null),v=Rt(s),x=Rt(l),A=Ft(f),k=Ft(p);return Re(()=>{r&&(clearTimeout(m.current),g.current=null,h.current="")},[r]),Re(()=>{if(r&&h.current===""){var C;y.current=(C=d??a)!=null?C:-1}},[r,d,a]),E.useMemo(()=>{if(!u)return{};function C(R){R?i.current.typing||(i.current.typing=R,x(R)):i.current.typing&&(i.current.typing=R,x(R))}function T(R,I,O){const j=A.current?A.current(I,O):I.find(_=>(_==null?void 0:_.toLocaleLowerCase().indexOf(O.toLocaleLowerCase()))===0);return j?R.indexOf(j):-1}function M(R){const I=o.current;if(h.current.length>0&&h.current[0]!==" "&&(T(I,I,h.current)===-1?C(!1):R.key===" "&&je(R)),I==null||k.current.includes(R.key)||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;r&&R.key!==" "&&(je(R),C(!0)),I.every(N=>{var D,z;return N?((D=N[0])==null?void 0:D.toLocaleLowerCase())!==((z=N[1])==null?void 0:z.toLocaleLowerCase()):!0})&&h.current===R.key&&(h.current="",y.current=g.current),h.current+=R.key,clearTimeout(m.current),m.current=setTimeout(()=>{h.current="",y.current=g.current,C(!1)},c);const j=y.current,_=T(I,[...I.slice((j||0)+1),...I.slice(0,(j||0)+1)],h.current);_!==-1?(v(_),g.current=_):R.key!==" "&&(h.current="",C(!1))}return{reference:{onKeyDown:M},floating:{onKeyDown:M,onKeyUp(R){R.key===" "&&C(!1)}}}},[u,r,i,o,c,k,A,v,x])}const pE=({options:e,reusable:t,sendMessage:n,isReadOnly:r})=>{var D,z,U,$,V;const i=sn(b=>b.messageContainerRef),o=sn(b=>b.portalContainer),[a,s]=E.useState(!1),[l,u]=E.useState(null),[f,c]=E.useState(null),{message:{blocks:{dropdown:p}}}=ge,d=e.reduce((b,P)=>(b[P.label]=P.value,b),{}),m=d?Object.keys(d):[],h=b=>{s(f!==null&&!t?!1:b)},{refs:y,floatingStyles:g,context:v}=sE({placement:"bottom-start",open:a,onOpenChange:h,whileElementsMounted:cS,middleware:[vS(5),bS({padding:10,boundary:(i==null?void 0:i.current)??void 0,crossAxis:!0}),xS({apply({rects:b,elements:P,availableHeight:H}){Object.assign(P.floating.style,{maxHeight:`${H}px`,minWidth:`${b.reference.width}px`})},padding:10})]}),x=E.useRef([]),A=E.useRef(m),k=E.useRef(!1),C=tE(v,{event:"mousedown"}),T=aE(v),M=fE(v,{role:"listbox"}),R=cE(v,{listRef:x,activeIndex:l,selectedIndex:f,onNavigate:u,loop:!0}),I=dE(v,{listRef:A,activeIndex:l,selectedIndex:f,onMatch:a?u:c,onTypingChange(b){k.current=b}}),{getReferenceProps:O,getFloatingProps:j,getItemProps:_}=lE([T,M,R,I,C]),N=b=>{c(b),m[b]!==void 0&&(n==null||n({type:"text",text:m[b]??"",value:d[m[b]]??""})),s(!1)};return S.jsxs(S.Fragment,{children:[S.jsxs("div",{tabIndex:0,ref:y.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":f!==null&&!t?"":void 0,style:r?{pointerEvents:"none"}:void 0,...(D=p.button)==null?void 0:D.container,...O(),children:[S.jsx("span",{...(z=p.button)==null?void 0:z.text,children:f?m[f]:"Select..."}),S.jsx(eg,{...(U=p.button)==null?void 0:U.icon})]}),a&&S.jsx(ZS,{root:o??void 0,children:S.jsx(eE,{context:v,modal:!1,children:S.jsx("div",{ref:y.setFloating,className:(V=($=p.content)==null?void 0:$.container)==null?void 0:V.className,style:{...g,pointerEvents:"auto"},...j(),children:m.map((b,P)=>{var H;return S.jsx("div",{ref:w=>{x.current[P]=w},role:"option",tabIndex:P===l?0:-1,"aria-selected":P===f&&P===l,"data-active":P===l?"":void 0,...(H=p.content)==null?void 0:H.item,..._({onClick(){N(P)},onKeyDown(w){w.key==="Enter"&&(w.preventDefault(),N(P)),w.key===" "&&!k.current&&(w.preventDefault(),N(P))}}),children:b},b)})})})})]})},Cd=({ref:e,title:t,url:n,isReadOnly:r,...i})=>{const{message:{blocks:{file:o}}}=ge;return S.jsxs("a",{...i,...o.container,href:n,style:r?{pointerEvents:"none"}:void 0,download:!0,ref:e,target:"_blank",rel:"noreferrer",children:[S.jsx("p",{...o.title,children:t||n}),S.jsx(ag,{...o.icon})]})};Cd.displayName="File";const hE=_t()((e,t)=>({components:{},getCustomComponent:async n=>{const r=t().components[n];if(r)return r;const i=await fetch(n).then(u=>u.text()),o=new Blob([i],{type:"application/javascript"}),s=await import(URL.createObjectURL(o)),l=()=>s.default;return e(u=>({components:{...u.components,[n]:l}})),l}}));globalThis.React=F;const Ad={audio:mf,bubble:uf,button:P1,carousel:Af,column:yf,dropdown:pE,file:Cd,image:pf,location:gf,row:vf,text:i1,video:hf,custom:({url:e,name:t,data:n,...r})=>{const i=hE(u=>u.getCustomComponent),[o,a]=F.useState(null),[s,l]=F.useState(null);return F.useEffect(()=>{i(e).then(a).catch(u=>{l(u.message)})},[e]),s?S.jsx("div",{style:{color:"red"},children:s}):o?S.jsx(o,{...n,...r}):null}},Yt=({block:e,renderers:t,...n})=>{const r=(t==null?void 0:t[e.type])??Ad[e.type],i={...n,...e};return S.jsx(r,{...i})};function Id(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=Id(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function dr(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Id(e))&&(r&&(r+=" "),r+=t);return r}const mE=({disabled:e,onFileSelected:t})=>{const n=F.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(yg,{...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})]})},gE=({name:e,type:t,instance:n,status:r,removeFile:i})=>{const{loader:o,fileIcon:a,removeIcon:s,errorIcon:l,previewImage:u}=ge.composer.fileWidget,f=["PNG","JPEG","JPG"].includes(pi(n.name));return r==="loading"?S.jsx(di,{name:e,status:r,removeButton:S.jsx("div",{...o}),extension:pi(n.name),children:S.jsx("div",{...a.container,children:S.jsx(Ba,{type:t,...a.icon})})}):r==="error"?S.jsx(di,{name:e,status:r,removeButton:S.jsx(Td,{removeFile:()=>i(e)}),extension:"Upload Error",children:S.jsxs("div",{...a.container,children:[S.jsx(rg,{...l}),S.jsx(Ba,{type:t,...a.icon})]})}):r=="uploaded"&&f?S.jsx(di,{name:e,status:r,removeButton:S.jsx(Td,{removeFile:()=>i(e)}),extension:pi(n.name),children:S.jsx("div",{...a.container,children:S.jsx("img",{src:URL.createObjectURL(n),alt:e,...u})})}):S.jsx(di,{name:e,status:r,removeButton:S.jsx(Dl,{onClick:()=>i(e),...s}),extension:pi(n.name),children:S.jsx("div",{...a.container,children:S.jsx(Ba,{type:t,...a.icon})})})},di=({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})]})]})},Ba=({type:e,...t})=>e==="image"?S.jsx(ug,{...t}):e==="video"?S.jsx(kg,{...t}):e==="audio"?S.jsx(Pl,{...t}):S.jsx(Ml,{...t}),pi=e=>{if(!e)return"File";const t=e.split(".").pop();return t?t.toUpperCase():"File"},Td=({removeFile:e})=>{const{composer:{fileWidget:{removeIcon:t}}}=ge;return S.jsx(Dl,{role:"button",tabIndex:0,"aria-label":"Remove File Button",onClick:()=>e(),...t})};function za(){return za=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},za.apply(null,arguments)}function yE(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 vE=F.useLayoutEffect,bE=function(t){var n=F.useRef(t);return vE(function(){n.current=t}),n},Od=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},xE=function(t,n){var r=F.useRef();return F.useCallback(function(i){t.current=i,r.current&&Od(r.current,null),r.current=n,n&&Od(n,i)},[n])},Dd={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},wE=function(t){Object.keys(Dd).forEach(function(n){t.style.setProperty(n,Dd[n],"important")})},Md=wE,Ke=null,_d=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function kE(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"),Md(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]}),Md(Ke),Ke.value=t;var l=_d(Ke,e);Ke.value=t,l=_d(Ke,e),Ke.value="x";var u=Ke.scrollHeight-i,f=u*n;s==="border-box"&&(f=f+i+o),l=Math.max(f,l);var c=u*r;return s==="border-box"&&(c=c+i+o),l=Math.min(c,l),[l,u]}var Pd=function(){},SE=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},EE=["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,AE=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=SE(EE,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}},IE=AE;function Nd(e,t,n){var r=bE(n);E.useLayoutEffect(function(){var i=function(a){return r.current(a)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var TE=function(t){Nd(window,"resize",t)},OE=function(t){Nd(document.fonts,"loadingdone",t)},DE=["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?Pd:a,l=t.onHeightChange,u=l===void 0?Pd:l,f=yE(t,DE),c=f.value!==void 0,p=E.useRef(null),d=xE(p,n),m=E.useRef(0),h=E.useRef(),y=function(){var x=p.current,A=r&&h.current?h.current:IE(x);if(A){h.current=A;var k=kE(A,x.value||x.placeholder||"x",o,i),C=k[0],T=k[1];m.current!==C&&(m.current=C,x.style.setProperty("height",C+"px","important"),u(C,{rowHeight:T}))}},g=function(x){c||y(),s(x)};return E.useLayoutEffect(y),TE(y),OE(y),E.createElement("textarea",za({},f,{onChange:g,ref:d}))},_E=E.forwardRef(ME);const PE=({inputRef:e,composerPlaceholder:t,composerDisabled:n,textInput:r,historyIndex:i,setTextInput:o,setHistoryIndex:a,sendComposerMessage:s,allowFileUpload:l,onFilePasted:u})=>{const f=Kc(h=>h.messageHistory),[c,p]=F.useState(""),{input:d}=ge.composer,m=h=>{if(!l||!u||!h.clipboardData)return;const y=Array.from(h.clipboardData.files);y.length>0&&(h.preventDefault(),y.forEach(g=>{u(g)}))};return S.jsx(_E,{...d,"aria-label":"Message Input",ref:e,placeholder:t??"Type your message...",disabled:n,value:r,"data-has-value":!!r,onChange:h=>{const y=h.target.value;o(y),f.includes(y)||a(-1)},onPaste:m,maxRows:5,onKeyDown:h=>{if(n)return;const y=h.nativeEvent;if(!(y.isComposing||y.keyCode===229)&&(h.key==="Enter"&&h.shiftKey?(h.preventDefault(),o(`${r}
279
+ `)):h.key==="Enter"&&(h.preventDefault(),s()),!(r.trim().includes(`
280
+ `)||r.trim().includes("\r")))){if(h.key==="ArrowUp"){h.preventDefault(),i===-1&&r.trim()!==""&&p(r);const g=Math.min(i+1,f.length-1);a(g),o(f[g]??"")}if(h.key==="ArrowDown"){h.preventDefault();const g=Math.max(i-1,-1);o(i===-1?r.trim():g===-1?c:f[g]??""),a(g)}}}})},NE=({disabled:e,setTextInput:t})=>{const[n,r]=F.useState(!1),i=F.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=u=>{var c,p,d;const f=((d=(p=(c=u.results)==null?void 0:c[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(hg,{...o,tabIndex:0,"aria-label":"Voice Input Button",role:"button","data-show":!e,"data-listens":!!n,onClick:s})},$a=F.memo(({ref:e,className:t,inputRef:n,disableComposer:r,isReadOnly:i,allowFileUpload:o,disableSendButton:a,connected:s,composerPlaceholder:l,footer:u,sendMessage:f,uploadFile:c,storageKey:p,children:d,...m})=>{const{composer:h}=ge,y=r||i||!s,[g,v]=F.useState(""),[x,A]=F.useState(-1),k=af(p),C=k(_=>_.files),T=k(_=>_.setFiles),M=k(_=>_.deleteFile),R=k(_=>_.uploadFile),I=Kc(_=>_.addMessageToHistory),O=!!g||C.filter(_=>_.status==="uploaded").length>0;n=n??F.useRef(null);const j=()=>{if(a)return;const _=C.filter(z=>z.status==="uploaded");if(!_.length&&!g)return;const N=(_==null?void 0:_.map(z=>{const U=z.url,$=z.type;return{video:{type:"video",videoUrl:U},audio:{type:"audio",audioUrl:U},image:{type:"image",imageUrl:U}}[$]??{title:z.name,type:"file",fileUrl:U}}))??[];g&&N.push({type:"text",text:g});let D;N.length==1?D=N[0]:D={type:"bloc",items:N.map(U=>{const{type:$,...V}=U;return{type:$,payload:V}})},v(""),g.trim()!==""&&(f==null||f(D),T([]),I(g),A(-1))};return i?null:S.jsxs(S.Fragment,{children:[S.jsxs("div",{"data-disabled":y,"data-waiting":a,className:dr(h.container.className,t),ref:e,...m,children:[d,C.length>0&&S.jsx("div",{...h==null?void 0:h.fileContainer,children:C.map(_=>S.jsx(gE,{..._,removeFile:M},_.name))}),S.jsxs("div",{...h.inputContainer,onClick:()=>{n&&"current"in n&&n.current&&n.current.focus()},children:[o&&S.jsx(mE,{disabled:y,onFileSelected:_=>{c&&R(_,c)}}),S.jsx(PE,{inputRef:n,composerPlaceholder:l,composerDisabled:y,textInput:g,historyIndex:x,setTextInput:v,setHistoryIndex:A,sendComposerMessage:j,allowFileUpload:o,onFilePasted:_=>{c&&R(_,c)}}),a&&S.jsx(cg,{...h.inputLoader,role:"status","data-show":a}),!y&&!a&&S.jsxs(S.Fragment,{children:[S.jsx(Zm,{...h.sendbutton,role:"button",tabIndex:0,"aria-label":"Send Message Button","data-show":O,onClick:()=>j()}),S.jsx(NE,{disabled:O,setTextInput:v})]})]})]}),S.jsx(oc,{components:{a:({node:_,...N})=>S.jsx("a",{...N,target:"_blank",rel:"noreferrer noopener"})},allowedElements:["a","strong","code","em","p","span"],...h.footer,children:u})]})});$a.displayName="Composer";var ja={exports:{}},hi={exports:{}},Ce={};/** @license React v16.13.1
259
281
  * react-is.production.min.js
260
282
  *
261
283
  * Copyright (c) Facebook, Inc. and its affiliates.
262
284
  *
263
285
  * This source code is licensed under the MIT license found in the
264
286
  * 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
287
+ */var Ld;function LE(){if(Ld)return Ce;Ld=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,u=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,c=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,y=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function x(k){if(typeof k=="object"&&k!==null){var C=k.$$typeof;switch(C){case t:switch(k=k.type,k){case l:case u:case r:case o:case i:case c:return k;default:switch(k=k&&k.$$typeof,k){case s:case f:case m:case d:case a:return k;default:return C}}case n:return C}}}function A(k){return x(k)===u}return Ce.AsyncMode=l,Ce.ConcurrentMode=u,Ce.ContextConsumer=s,Ce.ContextProvider=a,Ce.Element=t,Ce.ForwardRef=f,Ce.Fragment=r,Ce.Lazy=m,Ce.Memo=d,Ce.Portal=n,Ce.Profiler=o,Ce.StrictMode=i,Ce.Suspense=c,Ce.isAsyncMode=function(k){return A(k)||x(k)===l},Ce.isConcurrentMode=A,Ce.isContextConsumer=function(k){return x(k)===s},Ce.isContextProvider=function(k){return x(k)===a},Ce.isElement=function(k){return typeof k=="object"&&k!==null&&k.$$typeof===t},Ce.isForwardRef=function(k){return x(k)===f},Ce.isFragment=function(k){return x(k)===r},Ce.isLazy=function(k){return x(k)===m},Ce.isMemo=function(k){return x(k)===d},Ce.isPortal=function(k){return x(k)===n},Ce.isProfiler=function(k){return x(k)===o},Ce.isStrictMode=function(k){return x(k)===i},Ce.isSuspense=function(k){return x(k)===c},Ce.isValidElementType=function(k){return typeof k=="string"||typeof k=="function"||k===r||k===u||k===o||k===i||k===c||k===p||typeof k=="object"&&k!==null&&(k.$$typeof===m||k.$$typeof===d||k.$$typeof===a||k.$$typeof===s||k.$$typeof===f||k.$$typeof===y||k.$$typeof===g||k.$$typeof===v||k.$$typeof===h)},Ce.typeOf=x,Ce}var Ae={};/** @license React v16.13.1
266
288
  * react-is.development.js
267
289
  *
268
290
  * Copyright (c) Facebook, Inc. and its affiliates.
269
291
  *
270
292
  * This source code is licensed under the MIT license found in the
271
293
  * 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}/*
294
+ */var Fd;function FE(){return Fd||(Fd=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,u=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,c=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,y=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function x(L){return typeof L=="string"||typeof L=="function"||L===r||L===u||L===o||L===i||L===c||L===p||typeof L=="object"&&L!==null&&(L.$$typeof===m||L.$$typeof===d||L.$$typeof===a||L.$$typeof===s||L.$$typeof===f||L.$$typeof===y||L.$$typeof===g||L.$$typeof===v||L.$$typeof===h)}function A(L){if(typeof L=="object"&&L!==null){var ne=L.$$typeof;switch(ne){case t:var me=L.type;switch(me){case l:case u:case r:case o:case i:case c:return me;default:var ke=me&&me.$$typeof;switch(ke){case s:case f:case m:case d:case a:return ke;default:return ne}}case n:return ne}}}var k=l,C=u,T=s,M=a,R=t,I=f,O=r,j=m,_=d,N=n,D=o,z=i,U=c,$=!1;function V(L){return $||($=!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.")),b(L)||A(L)===l}function b(L){return A(L)===u}function P(L){return A(L)===s}function H(L){return A(L)===a}function w(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function W(L){return A(L)===f}function X(L){return A(L)===r}function Y(L){return A(L)===m}function J(L){return A(L)===d}function ee(L){return A(L)===n}function ie(L){return A(L)===o}function K(L){return A(L)===i}function te(L){return A(L)===c}Ae.AsyncMode=k,Ae.ConcurrentMode=C,Ae.ContextConsumer=T,Ae.ContextProvider=M,Ae.Element=R,Ae.ForwardRef=I,Ae.Fragment=O,Ae.Lazy=j,Ae.Memo=_,Ae.Portal=N,Ae.Profiler=D,Ae.StrictMode=z,Ae.Suspense=U,Ae.isAsyncMode=V,Ae.isConcurrentMode=b,Ae.isContextConsumer=P,Ae.isContextProvider=H,Ae.isElement=w,Ae.isForwardRef=W,Ae.isFragment=X,Ae.isLazy=Y,Ae.isMemo=J,Ae.isPortal=ee,Ae.isProfiler=ie,Ae.isStrictMode=K,Ae.isSuspense=te,Ae.isValidElementType=x,Ae.typeOf=A}()),Ae}var Rd;function Bd(){return Rd||(Rd=1,process.env.NODE_ENV==="production"?hi.exports=LE():hi.exports=FE()),hi.exports}/*
273
295
  object-assign
274
296
  (c) Sindre Sorhus
275
297
  @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,`
298
+ */var Ua,zd;function RE(){if(zd)return Ua;zd=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 u={};return"abcdefghijklmnopqrst".split("").forEach(function(f){u[f]=f}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Ua=i()?Object.assign:function(o,a){for(var s,l=r(o),u,f=1;f<arguments.length;f++){s=Object(arguments[f]);for(var c in s)t.call(s,c)&&(l[c]=s[c]);if(e){u=e(s);for(var p=0;p<u.length;p++)n.call(s,u[p])&&(l[u[p]]=s[u[p]])}}return l},Ua}var Ha,$d;function Wa(){if($d)return Ha;$d=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ha=e,Ha}var Va,jd;function Ud(){return jd||(jd=1,Va=Function.call.bind(Object.prototype.hasOwnProperty)),Va}var qa,Hd;function BE(){if(Hd)return qa;Hd=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Wa(),n={},r=Ud();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,u){if(process.env.NODE_ENV!=="production"){for(var f in o)if(r(o,f)){var c;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}c=o[f](a,f,l,s,null,t)}catch(m){c=m}if(c&&!(c 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 c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in n)){n[c.message]=!0;var d=u?u():"";e("Failed "+s+" type: "+c.message+(d??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},qa=i,qa}var Ka,Wd;function zE(){if(Wd)return Ka;Wd=1;var e=Bd(),t=RE(),n=Wa(),r=Ud(),i=BE(),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 Ka=function(s,l){var u=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function c(b){var P=b&&(u&&b[u]||b[f]);if(typeof P=="function")return P}var p="<<anonymous>>",d={array:g("array"),bigint:g("bigint"),bool:g("boolean"),func:g("function"),number:g("number"),object:g("object"),string:g("string"),symbol:g("symbol"),any:v(),arrayOf:x,element:A(),elementType:k(),instanceOf:C,node:I(),objectOf:M,oneOf:T,oneOfType:R,shape:j,exact:_};function m(b,P){return b===P?b!==0||1/b===1/P:b!==b&&P!==P}function h(b,P){this.message=b,this.data=P&&typeof P=="object"?P:{},this.stack=""}h.prototype=Error.prototype;function y(b){if(process.env.NODE_ENV!=="production")var P={},H=0;function w(X,Y,J,ee,ie,K,te){if(ee=ee||p,K=K||J,te!==n){if(l){var L=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 L.name="Invariant Violation",L}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=ee+":"+J;!P[ne]&&H<3&&(o("You are manually calling a React.PropTypes validation function for the `"+K+"` prop on `"+ee+"`. 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."),P[ne]=!0,H++)}}return Y[J]==null?X?Y[J]===null?new h("The "+ie+" `"+K+"` is marked as required "+("in `"+ee+"`, but its value is `null`.")):new h("The "+ie+" `"+K+"` is marked as required in "+("`"+ee+"`, but its value is `undefined`.")):null:b(Y,J,ee,ie,K)}var W=w.bind(null,!1);return W.isRequired=w.bind(null,!0),W}function g(b){function P(H,w,W,X,Y,J){var ee=H[w],ie=z(ee);if(ie!==b){var K=U(ee);return new h("Invalid "+X+" `"+Y+"` of type "+("`"+K+"` supplied to `"+W+"`, expected ")+("`"+b+"`."),{expectedType:b})}return null}return y(P)}function v(){return y(a)}function x(b){function P(H,w,W,X,Y){if(typeof b!="function")return new h("Property `"+Y+"` of component `"+W+"` has invalid PropType notation inside arrayOf.");var J=H[w];if(!Array.isArray(J)){var ee=z(J);return new h("Invalid "+X+" `"+Y+"` of type "+("`"+ee+"` supplied to `"+W+"`, expected an array."))}for(var ie=0;ie<J.length;ie++){var K=b(J,ie,W,X,Y+"["+ie+"]",n);if(K instanceof Error)return K}return null}return y(P)}function A(){function b(P,H,w,W,X){var Y=P[H];if(!s(Y)){var J=z(Y);return new h("Invalid "+W+" `"+X+"` of type "+("`"+J+"` supplied to `"+w+"`, expected a single ReactElement."))}return null}return y(b)}function k(){function b(P,H,w,W,X){var Y=P[H];if(!e.isValidElementType(Y)){var J=z(Y);return new h("Invalid "+W+" `"+X+"` of type "+("`"+J+"` supplied to `"+w+"`, expected a single ReactElement type."))}return null}return y(b)}function C(b){function P(H,w,W,X,Y){if(!(H[w]instanceof b)){var J=b.name||p,ee=V(H[w]);return new h("Invalid "+X+" `"+Y+"` of type "+("`"+ee+"` supplied to `"+W+"`, expected ")+("instance of `"+J+"`."))}return null}return y(P)}function T(b){if(!Array.isArray(b))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 P(H,w,W,X,Y){for(var J=H[w],ee=0;ee<b.length;ee++)if(m(J,b[ee]))return null;var ie=JSON.stringify(b,function(te,L){var ne=U(L);return ne==="symbol"?String(L):L});return new h("Invalid "+X+" `"+Y+"` of value `"+String(J)+"` "+("supplied to `"+W+"`, expected one of "+ie+"."))}return y(P)}function M(b){function P(H,w,W,X,Y){if(typeof b!="function")return new h("Property `"+Y+"` of component `"+W+"` has invalid PropType notation inside objectOf.");var J=H[w],ee=z(J);if(ee!=="object")return new h("Invalid "+X+" `"+Y+"` of type "+("`"+ee+"` supplied to `"+W+"`, expected an object."));for(var ie in J)if(r(J,ie)){var K=b(J,ie,W,X,Y+"."+ie,n);if(K instanceof Error)return K}return null}return y(P)}function R(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var P=0;P<b.length;P++){var H=b[P];if(typeof H!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+$(H)+" at index "+P+"."),a}function w(W,X,Y,J,ee){for(var ie=[],K=0;K<b.length;K++){var te=b[K],L=te(W,X,Y,J,ee,n);if(L==null)return null;L.data&&r(L.data,"expectedType")&&ie.push(L.data.expectedType)}var ne=ie.length>0?", expected one of type ["+ie.join(", ")+"]":"";return new h("Invalid "+J+" `"+ee+"` supplied to "+("`"+Y+"`"+ne+"."))}return y(w)}function I(){function b(P,H,w,W,X){return N(P[H])?null:new h("Invalid "+W+" `"+X+"` supplied to "+("`"+w+"`, expected a ReactNode."))}return y(b)}function O(b,P,H,w,W){return new h((b||"React class")+": "+P+" type `"+H+"."+w+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+W+"`.")}function j(b){function P(H,w,W,X,Y){var J=H[w],ee=z(J);if(ee!=="object")return new h("Invalid "+X+" `"+Y+"` of type `"+ee+"` "+("supplied to `"+W+"`, expected `object`."));for(var ie in b){var K=b[ie];if(typeof K!="function")return O(W,X,Y,ie,U(K));var te=K(J,ie,W,X,Y+"."+ie,n);if(te)return te}return null}return y(P)}function _(b){function P(H,w,W,X,Y){var J=H[w],ee=z(J);if(ee!=="object")return new h("Invalid "+X+" `"+Y+"` of type `"+ee+"` "+("supplied to `"+W+"`, expected `object`."));var ie=t({},H[w],b);for(var K in ie){var te=b[K];if(r(b,K)&&typeof te!="function")return O(W,X,Y,K,U(te));if(!te)return new h("Invalid "+X+" `"+Y+"` key `"+K+"` supplied to `"+W+"`.\nBad object: "+JSON.stringify(H[w],null," ")+`
299
+ Valid keys: `+JSON.stringify(Object.keys(b),null," "));var L=te(J,K,W,X,Y+"."+K,n);if(L)return L}return null}return y(P)}function N(b){switch(typeof b){case"number":case"string":case"undefined":return!0;case"boolean":return!b;case"object":if(Array.isArray(b))return b.every(N);if(b===null||s(b))return!0;var P=c(b);if(P){var H=P.call(b),w;if(P!==b.entries){for(;!(w=H.next()).done;)if(!N(w.value))return!1}else for(;!(w=H.next()).done;){var W=w.value;if(W&&!N(W[1]))return!1}}else return!1;return!0;default:return!1}}function D(b,P){return b==="symbol"?!0:P?P["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&P instanceof Symbol:!1}function z(b){var P=typeof b;return Array.isArray(b)?"array":b instanceof RegExp?"object":D(P,b)?"symbol":P}function U(b){if(typeof b>"u"||b===null)return""+b;var P=z(b);if(P==="object"){if(b instanceof Date)return"date";if(b instanceof RegExp)return"regexp"}return P}function $(b){var P=U(b);switch(P){case"array":case"object":return"an "+P;case"boolean":case"date":case"regexp":return"a "+P;default:return P}}function V(b){return!b.constructor||!b.constructor.name?p:b.constructor.name}return d.checkPropTypes=i,d.resetWarningCache=i.resetWarningCache,d.PropTypes=d,d},Ka}var Ya,Vd;function $E(){if(Vd)return Ya;Vd=1;var e=Wa();function t(){}function n(){}return n.resetWarningCache=t,Ya=function(){function r(a,s,l,u,f,c){if(c!==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},Ya}if(process.env.NODE_ENV!=="production"){var jE=Bd(),UE=!0;ja.exports=zE()(jE.isElement,UE)}else ja.exports=$E()();var HE=ja.exports;const Te=jt(HE);var WE=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 pr(e,t){var n=VE(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 VE(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=WE.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var qE=[".DS_Store","Thumbs.db"];function KE(e){return ln(this,void 0,void 0,function(){return un(this,function(t){return mi(e)&&YE(e.dataTransfer)?[2,ZE(e.dataTransfer,e.type)]:GE(e)?[2,QE(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,JE(e)]:[2,[]]})})}function YE(e){return mi(e)}function GE(e){return mi(e)&&mi(e.target)}function mi(e){return typeof e=="object"&&e!==null}function QE(e){return Ga(e.target.files).map(function(t){return pr(t)})}function JE(e){return ln(this,void 0,void 0,function(){var t;return un(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 pr(r)})]}})})}function ZE(e,t){return ln(this,void 0,void 0,function(){var n,r;return un(this,function(i){switch(i.label){case 0:return e.items?(n=Ga(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(XE))]):[3,2];case 1:return r=i.sent(),[2,qd(Kd(r))];case 2:return[2,qd(Ga(e.files).map(function(o){return pr(o)}))]}})})}function qd(e){return e.filter(function(t){return qE.indexOf(t.name)===-1})}function Ga(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function XE(e){if(typeof e.webkitGetAsEntry!="function")return Yd(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?Gd(t):Yd(e)}function Kd(e){return e.reduce(function(t,n){return la(la([],ff(t),!1),ff(Array.isArray(n)?Kd(n):[n]),!1)},[])}function Yd(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=pr(t);return Promise.resolve(n)}function eC(e){return ln(this,void 0,void 0,function(){return un(this,function(t){return[2,e.isDirectory?Gd(e):tC(e)]})})}function Gd(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,u,f;return un(this,function(c){switch(c.label){case 0:if(s.length)return[3,5];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=c.sent(),n(l),[3,4];case 3:return u=c.sent(),r(u),[3,4];case 4:return[3,6];case 5:f=Promise.all(s.map(eC)),i.push(f),o(),c.label=6;case 6:return[2]}})})},function(s){r(s)})}o()})}function tC(e){return ln(this,void 0,void 0,function(){return un(this,function(t){return[2,new Promise(function(n,r){e.file(function(i){var o=pr(i,e.fullPath);n(o)},function(i){r(i)})})]})})}var nC=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 Qd(e){return oC(e)||iC(e)||ep(e)||rC()}function rC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
300
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function oC(e){if(Array.isArray(e))return Qa(e)}function Jd(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 Zd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Jd(Object(n),!0).forEach(function(r){Xd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jd(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hr(e,t){return lC(e)||sC(e,t)||ep(e,t)||aC()}function aC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
301
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ep(e,t){if(e){if(typeof e=="string")return Qa(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 Qa(e,t)}}function Qa(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 sC(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 lC(e){if(Array.isArray(e))return e}var uC="file-invalid-type",cC="file-too-large",fC="file-too-small",dC="too-many-files",pC=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:uC,message:"File type must be ".concat(n)}},tp=function(t){return{code:cC,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},np=function(t){return{code:fC,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},hC={code:dC,message:"Too many files"};function rp(e,t){var n=e.type==="application/x-moz-file"||nC(e,t);return[n,n?null:pC(t)]}function ip(e,t,n){if(Gt(e.size))if(Gt(t)&&Gt(n)){if(e.size>n)return[!1,tp(n)];if(e.size<t)return[!1,np(t)]}else{if(Gt(t)&&e.size<t)return[!1,np(t)];if(Gt(n)&&e.size>n)return[!1,tp(n)]}return[!0,null]}function Gt(e){return e!=null}function mC(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 u=rp(l,n),f=hr(u,1),c=f[0],p=ip(l,r,i),d=hr(p,1),m=d[0],h=s?s(l):null;return c&&m&&!h})}function gi(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function yi(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 op(e){e.preventDefault()}function gC(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function yC(e){return e.indexOf("Edge/")!==-1}function vC(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return gC(e)||yC(e)}function kt(){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!gi(r)&&s&&s.apply(void 0,[r].concat(o)),gi(r)})}}function bC(){return"showOpenFilePicker"in window}function xC(e){if(Gt(e)){var t=Object.entries(e).filter(function(n){var r=hr(n,2),i=r[0],o=r[1],a=!0;return ap(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(sp))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),a=!1),a}).reduce(function(n,r){var i=hr(r,2),o=i[0],a=i[1];return Zd(Zd({},n),{},Xd({},o,a))},{});return[{description:"Files",accept:t}]}return e}function wC(e){if(Gt(e))return Object.entries(e).reduce(function(t,n){var r=hr(n,2),i=r[0],o=r[1];return[].concat(Qd(t),[i],Qd(o))},[]).filter(function(t){return ap(t)||sp(t)}).join(",")}function kC(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 ap(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function sp(e){return/^.*\.[\w]+$/.test(e)}var EC=["children"],CC=["open"],AC=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],IC=["refKey","onChange","onClick"];function TC(e){return MC(e)||DC(e)||lp(e)||OC()}function OC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
302
+ 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 MC(e){if(Array.isArray(e))return Za(e)}function Ja(e,t){return NC(e)||PC(e,t)||lp(e,t)||_C()}function _C(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
303
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lp(e,t){if(e){if(typeof e=="string")return Za(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 Za(e,t)}}function Za(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 PC(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 NC(e){if(Array.isArray(e))return e}function up(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 Ne(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?up(Object(n),!0).forEach(function(r){Xa(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):up(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vi(e,t){if(e==null)return{};var n=LC(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 LC(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 es=F.forwardRef(function(e,t){var n=e.children,r=vi(e,EC),i=fp(r),o=i.open,a=vi(i,CC);return F.useImperativeHandle(t,function(){return{open:o}},[o]),F.createElement(F.Fragment,null,n(Ne(Ne({},a),{},{open:o})))});es.displayName="Dropzone";var cp={disabled:!1,getFilesFromEvent:KE,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};es.defaultProps=cp,es.propTypes={children:Te.func,accept:Te.objectOf(Te.arrayOf(Te.string)),multiple:Te.bool,preventDropOnDocument:Te.bool,noClick:Te.bool,noKeyboard:Te.bool,noDrag:Te.bool,noDragEventsBubbling:Te.bool,minSize:Te.number,maxSize:Te.number,maxFiles:Te.number,disabled:Te.bool,getFilesFromEvent:Te.func,onFileDialogCancel:Te.func,onFileDialogOpen:Te.func,useFsAccessApi:Te.bool,autoFocus:Te.bool,onDragEnter:Te.func,onDragLeave:Te.func,onDragOver:Te.func,onDrop:Te.func,onDropAccepted:Te.func,onDropRejected:Te.func,onError:Te.func,validator:Te.func};var ts={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function fp(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Ne(Ne({},cp),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,f=t.onDragLeave,c=t.onDragOver,p=t.onDrop,d=t.onDropAccepted,m=t.onDropRejected,h=t.onFileDialogCancel,y=t.onFileDialogOpen,g=t.useFsAccessApi,v=t.autoFocus,x=t.preventDropOnDocument,A=t.noClick,k=t.noKeyboard,C=t.noDrag,T=t.noDragEventsBubbling,M=t.onError,R=t.validator,I=F.useMemo(function(){return wC(n)},[n]),O=F.useMemo(function(){return xC(n)},[n]),j=F.useMemo(function(){return typeof y=="function"?y:dp},[y]),_=F.useMemo(function(){return typeof h=="function"?h:dp},[h]),N=F.useRef(null),D=F.useRef(null),z=F.useReducer(FC,ts),U=Ja(z,2),$=U[0],V=U[1],b=$.isFocused,P=$.isFileDialogActive,H=F.useRef(typeof window<"u"&&window.isSecureContext&&g&&bC()),w=function(){!H.current&&P&&setTimeout(function(){if(D.current){var se=D.current.files;se.length||(V({type:"closeDialog"}),_())}},300)};F.useEffect(function(){return window.addEventListener("focus",w,!1),function(){window.removeEventListener("focus",w,!1)}},[D,P,_,H]);var W=F.useRef([]),X=function(se){N.current&&N.current.contains(se.target)||(se.preventDefault(),W.current=[])};F.useEffect(function(){return x&&(document.addEventListener("dragover",op,!1),document.addEventListener("drop",X,!1)),function(){x&&(document.removeEventListener("dragover",op),document.removeEventListener("drop",X))}},[N,x]),F.useEffect(function(){return!r&&v&&N.current&&N.current.focus(),function(){}},[N,v,r]);var Y=F.useCallback(function(Z){M?M(Z):console.error(Z)},[M]),J=F.useCallback(function(Z){Z.preventDefault(),Z.persist(),xe(Z),W.current=[].concat(TC(W.current),[Z.target]),yi(Z)&&Promise.resolve(i(Z)).then(function(se){if(!(gi(Z)&&!T)){var B=se.length,q=B>0&&mC({files:se,accept:I,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:R}),ae=B>0&&!q;V({isDragAccept:q,isDragReject:ae,isDragActive:!0,type:"setDraggedFiles"}),u&&u(Z)}}).catch(function(se){return Y(se)})},[i,u,Y,T,I,a,o,s,l,R]),ee=F.useCallback(function(Z){Z.preventDefault(),Z.persist(),xe(Z);var se=yi(Z);if(se&&Z.dataTransfer)try{Z.dataTransfer.dropEffect="copy"}catch{}return se&&c&&c(Z),!1},[c,T]),ie=F.useCallback(function(Z){Z.preventDefault(),Z.persist(),xe(Z);var se=W.current.filter(function(q){return N.current&&N.current.contains(q)}),B=se.indexOf(Z.target);B!==-1&&se.splice(B,1),W.current=se,!(se.length>0)&&(V({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),yi(Z)&&f&&f(Z))},[N,f,T]),K=F.useCallback(function(Z,se){var B=[],q=[];Z.forEach(function(ae){var le=rp(ae,I),pe=Ja(le,2),fe=pe[0],Ee=pe[1],Oe=ip(ae,a,o),st=Ja(Oe,2),gt=st[0],ze=st[1],lt=R?R(ae):null;if(fe&&gt&&!lt)B.push(ae);else{var Ge=[Ee,ze];lt&&(Ge=Ge.concat(lt)),q.push({file:ae,errors:Ge.filter(function(zi){return zi})})}}),(!s&&B.length>1||s&&l>=1&&B.length>l)&&(B.forEach(function(ae){q.push({file:ae,errors:[hC]})}),B.splice(0)),V({acceptedFiles:B,fileRejections:q,type:"setFiles"}),p&&p(B,q,se),q.length>0&&m&&m(q,se),B.length>0&&d&&d(B,se)},[V,s,I,a,o,l,p,d,m,R]),te=F.useCallback(function(Z){Z.preventDefault(),Z.persist(),xe(Z),W.current=[],yi(Z)&&Promise.resolve(i(Z)).then(function(se){gi(Z)&&!T||K(se,Z)}).catch(function(se){return Y(se)}),V({type:"reset"})},[i,K,Y,T]),L=F.useCallback(function(){if(H.current){V({type:"openDialog"}),j();var Z={multiple:s,types:O};window.showOpenFilePicker(Z).then(function(se){return i(se)}).then(function(se){K(se,null),V({type:"closeDialog"})}).catch(function(se){kC(se)?(_(se),V({type:"closeDialog"})):SC(se)?(H.current=!1,D.current?(D.current.value=null,D.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}D.current&&(V({type:"openDialog"}),j(),D.current.value=null,D.current.click())},[V,j,_,g,K,Y,O,s]),ne=F.useCallback(function(Z){!N.current||!N.current.isEqualNode(Z.target)||(Z.key===" "||Z.key==="Enter"||Z.keyCode===32||Z.keyCode===13)&&(Z.preventDefault(),L())},[N,L]),me=F.useCallback(function(){V({type:"focus"})},[]),ke=F.useCallback(function(){V({type:"blur"})},[]),oe=F.useCallback(function(){A||(vC()?setTimeout(L,0):L())},[A,L]),G=function(se){return r?null:se},ue=function(se){return k?null:G(se)},de=function(se){return C?null:G(se)},xe=function(se){T&&se.stopPropagation()},Se=F.useMemo(function(){return function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},se=Z.refKey,B=se===void 0?"ref":se,q=Z.role,ae=Z.onKeyDown,le=Z.onFocus,pe=Z.onBlur,fe=Z.onClick,Ee=Z.onDragEnter,Oe=Z.onDragOver,st=Z.onDragLeave,gt=Z.onDrop,ze=vi(Z,AC);return Ne(Ne(Xa({onKeyDown:ue(kt(ae,ne)),onFocus:ue(kt(le,me)),onBlur:ue(kt(pe,ke)),onClick:G(kt(fe,oe)),onDragEnter:de(kt(Ee,J)),onDragOver:de(kt(Oe,ee)),onDragLeave:de(kt(st,ie)),onDrop:de(kt(gt,te)),role:typeof q=="string"&&q!==""?q:"presentation"},B,N),!r&&!k?{tabIndex:0}:{}),ze)}},[N,ne,me,ke,oe,J,ee,ie,te,k,C,r]),Ue=F.useCallback(function(Z){Z.stopPropagation()},[]),Ye=F.useMemo(function(){return function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},se=Z.refKey,B=se===void 0?"ref":se,q=Z.onChange,ae=Z.onClick,le=vi(Z,IC),pe=Xa({accept:I,multiple:s,type:"file",style:{display:"none"},onChange:G(kt(q,te)),onClick:G(kt(ae,Ue)),tabIndex:-1},B,D);return Ne(Ne({},pe),le)}},[D,n,s,te,r]);return Ne(Ne({},$),{},{isFocused:b&&!r,getRootProps:Se,getInputProps:Ye,rootRef:N,inputRef:D,open:G(L)})}function FC(e,t){switch(t.type){case"focus":return Ne(Ne({},e),{},{isFocused:!0});case"blur":return Ne(Ne({},e),{},{isFocused:!1});case"openDialog":return Ne(Ne({},ts),{},{isFileDialogActive:!0});case"closeDialog":return Ne(Ne({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Ne(Ne({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Ne(Ne({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Ne({},ts);default:return e}}function dp(){}const pp=({children:e})=>{const t=F.useRef(null),[n,r]=F.useState({open:!1}),i=({title:a,description:s,confirmButtonText:l,cancelButtonText:u,onConfirm:f,onCancel:c,initialValue:p,Content:d})=>new Promise((m,h)=>{t.current=p,r({open:!0,title:a,description:s,confirmButtonText:l,cancelButtonText:u,content:d?S.jsx(d,{value:p,setValue:y=>{t.current=y}}):null,onConfirm:()=>{f==null||f(),m(t.current),o()},onCancel:()=>{c==null||c(),h(),o()}})}),o=()=>{r(a=>({...a,open:!1}))};return S.jsxs(aa,{value:{showInputModal:i},children:[S.jsx(In,{open:n.open,onOpenChange:a=>r(s=>({...s,open:a})),children:S.jsx(In.Content,{title:n.title,description:n.description,confirmButtonText:n.confirmButtonText,cancelButtonText:n.cancelButtonText,onConfirm:n.onConfirm,onCancel:n.onCancel,children:n.content})}),e]})},RC=(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)},hp=({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o,additionalStylesheetUrl:a})=>{F.useMemo(()=>{t&&RC(t,["100","200","300","400","500","600","700","800"])},[t]);const s=F.useMemo(()=>ll({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
304
  .bpWebchat {
283
305
  border-radius: ${.375*(n??1)}rem;
284
306
  }
285
307
  .bpMessagePreview {
286
308
  border-radius: ${.125*(n??1)}rem;
287
309
  }
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),"");/*!---------------------------------------------------------------------------------------------
310
+ `]})]})},ns=({ref:e,children:t,className:n,uploadFile:r,allowFileUpload:i,storageKey:o,connected:a,...s})=>{const{container:l}=ge,u=sn(y=>y.setMessageContainerRef),c=af(o)(y=>y.uploadFile),[p,d]=F.useState(0);F.useEffect(()=>{u(e)},[e,u]);const m=F.useCallback(y=>{r&&(y.forEach(g=>c(g,r)),d(0))},[c,r]),{getRootProps:h}=fp({noClick:!0,noKeyboard:!0,onDrop:m,disabled:!(i&&r),onDragEnter:()=>d(y=>y+1),onDragLeave:()=>d(y=>y-1)});return S.jsxs("div",{...s,className:dr(l.className,n),ref:e,...h(),children:[S.jsxs("div",{"data-hover":p>0,...l.dropzone.overlay,children:["Drop files to upload",S.jsx(ig,{style:{width:"50px"}})]}),S.jsx(pp,{children:t})]})};ns.displayName="Container";const mp=({ref:e,onClick:t,imgUrl:n,...r})=>{const{fab:i}=ge,{container:o,icon:a,image:s}=i??{};return n?S.jsx("img",{src:n,role:"button",tabIndex:0,...s,draggable:"false",onClick:t}):S.jsx("div",{...r,...o,ref:e,onClick:t,children:S.jsx("div",{...a})})};mp.displayName="Fab";function At(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 BC(e,t){const n=E.createContext(t),r=o=>{const{children:a,...s}=o,l=E.useMemo(()=>s,Object.values(s));return S.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function i(o){const a=E.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 gp(e,t=[]){let n=[];function r(o,a){const s=E.createContext(a),l=n.length;n=[...n,a];const u=c=>{var g;const{scope:p,children:d,...m}=c,h=((g=p==null?void 0:p[e])==null?void 0:g[l])||s,y=E.useMemo(()=>m,Object.values(m));return S.jsx(h.Provider,{value:y,children:d})};u.displayName=o+"Provider";function f(c,p){var h;const d=((h=p==null?void 0:p[e])==null?void 0:h[l])||s,m=E.useContext(d);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(a=>E.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return E.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,zC(i,...t)]}function zC(...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:u})=>{const c=l(o)[`__scope${u}`];return{...s,...c}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var $C=E[" useInsertionEffect ".trim().toString()]||Tt;function yp({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=jC({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{const f=E.useRef(e!==void 0);E.useEffect(()=>{const c=f.current;c!==s&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const u=E.useCallback(f=>{var c;if(s){const p=UC(f)?f(e):f;p!==e&&((c=a.current)==null||c.call(a,p))}else o(f)},[s,e,o,a]);return[l,u]}function jC({defaultProp:e,onChange:t}){const[n,r]=E.useState(e),i=E.useRef(n),o=E.useRef(t);return $C(()=>{o.current=t},[t]),E.useEffect(()=>{var a;i.current!==n&&((a=o.current)==null||a.call(o,n),i.current=n)},[n,i]),[n,r,o]}function UC(e){return typeof e=="function"}function vp(e){const t=HC(e),n=E.forwardRef((r,i)=>{const{children:o,...a}=r,s=E.Children.toArray(o),l=s.find(VC);if(l){const u=l.props.children,f=s.map(c=>c===l?E.Children.count(u)>1?E.Children.only(null):E.isValidElement(u)?u.props.children:null:c);return S.jsx(t,{...a,ref:i,children:E.isValidElement(u)?E.cloneElement(u,void 0,f):null})}return S.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function HC(e){const t=E.forwardRef((n,r)=>{const{children:i,...o}=n;if(E.isValidElement(i)){const a=KC(i),s=qC(o,i.props);return i.type!==E.Fragment&&(s.ref=r?Ui(r,a):a),E.cloneElement(i,s)}return E.Children.count(i)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var WC=Symbol("radix.slottable");function VC(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===WC}function qC(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)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function KC(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 YC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ht=YC.reduce((e,t)=>{const n=vp(`Primitive.${t}`),r=E.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function GC(e,t){e&&Fs.flushSync(()=>e.dispatchEvent(t))}function QC(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var bi=e=>{const{present:t,children:n}=e,r=JC(t),i=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),o=Ot(r.ref,ZC(i));return typeof n=="function"||r.isPresent?E.cloneElement(i,{ref:o}):null};bi.displayName="Presence";function JC(e){const[t,n]=E.useState(),r=E.useRef(null),i=E.useRef(e),o=E.useRef("none"),a=e?"mounted":"unmounted",[s,l]=QC(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const u=xi(r.current);o.current=s==="mounted"?u:"none"},[s]),Tt(()=>{const u=r.current,f=i.current;if(f!==e){const p=o.current,d=xi(u);e?l("MOUNT"):d==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&p!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Tt(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,c=d=>{const h=xi(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&h&&(l("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=d=>{d.target===t&&(o.current=xi(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:E.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function xi(e){return(e==null?void 0:e.animationName)||"none"}function ZC(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 XC=E[" useId ".trim().toString()]||(()=>{}),eA=0;function wi(e){const[t,n]=E.useState(XC());return Tt(()=>{n(r=>r??String(eA++))},[e]),e||(t?`radix-${t}`:"")}var ki="Collapsible",[tA]=gp(ki),[nA,rs]=tA(ki),bp=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:a,...s}=e,[l,u]=yp({prop:r,defaultProp:i??!1,onChange:a,caller:ki});return S.jsx(nA,{scope:n,disabled:o,contentId:wi(),open:l,onOpenToggle:E.useCallback(()=>u(f=>!f),[u]),children:S.jsx(ht.div,{"data-state":os(l),"data-disabled":o?"":void 0,...s,ref:t})})});bp.displayName=ki;var xp="CollapsibleTrigger",wp=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=rs(xp,n);return S.jsx(ht.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":os(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:At(e.onClick,i.onOpenToggle)})});wp.displayName=xp;var is="CollapsibleContent",kp=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=rs(is,e.__scopeCollapsible);return S.jsx(bi,{present:n||i.open,children:({present:o})=>S.jsx(rA,{...r,ref:t,present:o})})});kp.displayName=is;var rA=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,a=rs(is,n),[s,l]=E.useState(r),u=E.useRef(null),f=Ot(t,u),c=E.useRef(0),p=c.current,d=E.useRef(0),m=d.current,h=a.open||s,y=E.useRef(h),g=E.useRef(void 0);return E.useEffect(()=>{const v=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(v)},[]),Tt(()=>{const v=u.current;if(v){g.current=g.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const x=v.getBoundingClientRect();c.current=x.height,d.current=x.width,y.current||(v.style.transitionDuration=g.current.transitionDuration,v.style.animationName=g.current.animationName),l(r)}},[a.open,r]),S.jsx(ht.div,{"data-state":os(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 os(e){return e?"open":"closed"}var iA=bp,oA=kp;const Sp=({onClick:e,...t})=>{const{header:n}=ge,r=i=>{i.stopPropagation(),e==null||e()};return S.jsx(Nl,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":"Close Chatbot Button",onClick:r,onKeyDown:i=>{i.key==="Enter"&&r(i)}})},as=({restartConversation:e,...t})=>{var o,a;const{header:n}=ge,{showInputModal:r}=sa(),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(vg,{...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})},mr=({icon:e,title:t,link:n,...r})=>{var a,s,l,u,f,c,p,d,m,h,y,g;const{header:i}=ge,o=e??og;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,{...(u=(l=i.expandedContent)==null?void 0:l.descriptionItems)==null?void 0:u.icon}),S.jsx("p",{...(c=(f=i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:c.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",{...(g=(y=i.expandedContent)==null?void 0:y.descriptionItems)==null?void 0:g.text,children:t})]}):null},aA=({soundOn:e,toggleSound:t})=>{const n=o=>{o.stopPropagation(),t==null||t()},{header:r}=ge,i=e?Pl:Sg;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})})},Ep=({defaultOpen:e,closeWindow:t,configuration:n,restartConversation:r,disabled:i,soundOn:o,toggleSound:a,clientId:s,...l})=>{var m,h,y,g,v,x,A,k,C,T,M,R,I,O,j,_,N,D,z,U,$,V,b,P;const{header:u}=ge,[f,c]=F.useState(e),p=!!((m=n.email)!=null&&m.title)||!!((h=n.phone)!=null&&h.title)||!!((y=n.website)!=null&&y.title)||!!((g=n.termsOfService)!=null&&g.link)||!!((v=n.privacyPolicy)!=null&&v.link),d=p&&!i;return S.jsxs(iA,{open:d?f:!1,onOpenChange:c,"data-disabled":d?void 0:"",...u.container,...l,children:[S.jsxs(wp,{"aria-label":"Expand Header Button",...u.content.container,children:[S.jsx(Nn,{userId:s,src:n.botAvatar,...u.content.avatar,children:n.botName||"Bot"}),S.jsx("h2",{...u.content.title,children:n.botName||"Bot"}),n.botDescription&&S.jsx("p",{...u.content.description,children:n.botDescription}),S.jsxs("div",{...u.content.actions.container,children:[n.soundEnabled&&o!==void 0&&a&&S.jsx(aA,{soundOn:o,toggleSound:a})," ",r&&S.jsx(as,{restartConversation:r}),t&&S.jsx(Sp,{onClick:t})]})]}),p&&S.jsxs(oA,{...u.expandedContent.container,children:[S.jsxs("div",{"data-links":"",...u.expandedContent.group,children:[S.jsx(mr,{"data-email":"",icon:dg,title:(x=n.email)==null?void 0:x.title,link:(k=(A=n.email)==null?void 0:A.link)!=null&&k.startsWith("mailto:")?(C=n.email)==null?void 0:C.link:`mailto:${(T=n.email)==null?void 0:T.link}`}),S.jsx(mr,{"data-phone":"",icon:gg,title:(M=n.phone)==null?void 0:M.title,link:(I=(R=n.phone)==null?void 0:R.link)!=null&&I.startsWith("tel:")?(O=n.phone)==null?void 0:O.link:`tel:${(j=n.phone)==null?void 0:j.link}`}),S.jsx(mr,{"data-website":"",link:(_=n.website)==null?void 0:_.link,icon:lg,title:(N=n.website)==null?void 0:N.title})]}),S.jsxs("div",{"data-legal":"",...(D=u.expandedContent)==null?void 0:D.group,children:[((z=n.termsOfService)==null?void 0:z.link)&&S.jsx(mr,{"data-terms":"",link:(U=n.termsOfService)==null?void 0:U.link,icon:Ml,title:($=n.termsOfService)==null?void 0:$.title}),((V=n.privacyPolicy)==null?void 0:V.link)&&S.jsx(mr,{"data-privacy":"",link:(b=n.privacyPolicy)==null?void 0:b.link,icon:fg,title:(P=n.privacyPolicy)==null?void 0:P.title})]})]})]})},ss=F.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})})});ss.displayName="TypingIndicator";const Si=F.memo(({ref:e,direction:t,block:n,disableInput:r,children:i,sender:o,id:a,authorId:s,status:l,renderers:u,isReadOnly:f,isLastDeliveredMessage:c,feedback:p,timestamp:d,metadata:m,sendMessage:h,addMessageFeedback:y,showAvatar:g})=>{const[v,x]=F.useState([]),{message:{container:A,deliveryStatus:k}}=ge;return g=g??t==="incoming",S.jsx(oa,{value:{isLoading:v,setIsLoading:x},children:S.jsxs("div",{...A,className:dr(A==null?void 0:A.className,c&&(k==null?void 0:k.className)),"data-loaded":v.length===0,"data-disable-input":!!r,"data-direction":t,dir:"auto",ref:e,children:[t==="incoming"&&g&&S.jsx(Cp,{authorId:s,sender:o}),n&&S.jsx(Yt,{block:{...n,isReadOnly:f,direction:t,timestamp:d,sender:o,feedback:p,messageId:a,status:l,metadata:m,sendMessage:h,addMessageFeedback:y},renderers:u}),t==="outgoing"&&g&&S.jsx(Cp,{authorId:s,sender:o}),i]})})});Si.displayName="Message";const Cp=({authorId:e,sender:t})=>{const{message:{avatar:n}}=ge,[r,i]=F.useState("idle"),o=qs(e??"",15);return S.jsxs(Yi,{"data-color":o,"data-loading-status":r,...n==null?void 0:n.container,children:[S.jsx(Gi,{...n==null?void 0:n.image,onLoadingStatusChange:i,src:t==null?void 0:t.avatar}),S.jsxs(Qi,{...n==null?void 0:n.fallback,children:[t==null?void 0:t.name[0]," "]})]})};let ls=(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
311
  * Copyright (c) StackBlitz. All rights reserved.
290
312
  * 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(`
313
+ *--------------------------------------------------------------------------------------------*/const sA={damping:.7,stiffness:.05,mass:1.25},lA=70,uA=1e3/60,cA=350;let Ei=!1;(Rh=globalThis.document)==null||Rh.addEventListener("mousedown",()=>{Ei=!0}),(Bh=globalThis.document)==null||Bh.addEventListener("mouseup",()=>{Ei=!1}),(zh=globalThis.document)==null||zh.addEventListener("click",()=>{Ei=!1});const fA=(e={})=>{const[t,n]=F.useState(!1),[r,i]=F.useState(e.initial!==!1),[o,a]=F.useState(!1),s=F.useRef(null);s.current=e;const l=F.useCallback(()=>{var A;if(!Ei)return!1;const v=window.getSelection();if(!v||!v.rangeCount)return!1;const x=v.getRangeAt(0);return x.commonAncestorContainer.contains(y.current)||((A=y.current)==null?void 0:A.contains(x.commonAncestorContainer))},[]),u=F.useCallback(v=>{c.isAtBottom=v,i(v)},[]),f=F.useCallback(v=>{c.escapedFromLock=v,n(v)},[]),c=F.useMemo(()=>{let v;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){var x;return((x=y.current)==null?void 0:x.scrollTop)??0},set scrollTop(x){y.current&&(y.current.scrollTop=x,c.ignoreScrollToTop=y.current.scrollTop)},get targetScrollTop(){return!y.current||!g.current?0:y.current.scrollHeight-1-y.current.clientHeight},get calculatedTargetScrollTop(){if(!y.current||!g.current)return 0;const{targetScrollTop:x}=this;if(!e.targetScrollTop)return x;if((v==null?void 0:v.targetScrollTop)===x)return v.calculatedScrollTop;const A=Math.max(Math.min(e.targetScrollTop(x,{scrollElement:y.current,contentElement:g.current}),x),0);return v={targetScrollTop:x,calculatedScrollTop:A},requestAnimationFrame(()=>{v=void 0}),A},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=lA}}},[]),p=F.useCallback((v={})=>{var R;typeof v=="string"&&(v={animation:v}),v.preserveScrollPosition||u(!0);const x=Date.now()+(Number(v.wait)||0),A=cs(s.current,v.animation),{ignoreEscapes:k=!1}=v;let C,T=c.calculatedTargetScrollTop;v.duration instanceof Promise?v.duration.finally(()=>{C=Date.now()}):C=x+(v.duration??0);const M=async()=>{const I=new Promise(requestAnimationFrame).then(()=>{var N;if(!c.isAtBottom)return c.animation=void 0,!1;const{scrollTop:O}=c,j=performance.now(),_=(j-(c.lastTick??j))/uA;if(c.animation||(c.animation={behavior:A,promise:I,ignoreEscapes:k}),c.animation.behavior===A&&(c.lastTick=j),l()||x>Date.now())return M();if(O<Math.min(T,c.calculatedTargetScrollTop)){if(((N=c.animation)==null?void 0:N.behavior)===A){if(A==="instant")return c.scrollTop=c.calculatedTargetScrollTop,M();c.velocity=(A.damping*c.velocity+A.stiffness*c.scrollDifference)/A.mass,c.accumulated+=c.velocity*_,c.scrollTop+=c.accumulated,c.scrollTop!==O&&(c.accumulated=0)}return M()}return C>Date.now()?(T=c.calculatedTargetScrollTop,M()):(c.animation=void 0,c.scrollTop<c.calculatedTargetScrollTop?p({animation:cs(s.current,s.current.resize),ignoreEscapes:k,duration:Math.max(0,C-Date.now())||void 0}):c.isAtBottom)});return I.then(O=>(requestAnimationFrame(()=>{c.animation||(c.lastTick=void 0,c.velocity=0)}),O))};return v.wait!==!0&&(c.animation=void 0),((R=c.animation)==null?void 0:R.behavior)===A?c.animation.promise:M()},[u,l,c]),d=F.useCallback(()=>{f(!0),u(!1)},[f,u]),m=F.useCallback(({target:v})=>{if(v!==y.current)return;const{scrollTop:x,ignoreScrollToTop:A}=c;let{lastScrollTop:k=x}=c;c.lastScrollTop=x,c.ignoreScrollToTop=void 0,A&&A>x&&(k=A),a(c.isNearBottom),setTimeout(()=>{var M;if(c.resizeDifference||x===A)return;if(l()){f(!0),u(!1);return}const C=x>k,T=x<k;if((M=c.animation)!=null&&M.ignoreEscapes){c.scrollTop=k;return}T&&(f(!0),u(!1)),C&&f(!1),!c.escapedFromLock&&c.isNearBottom&&u(!0)},1)},[f,u,l,c]),h=F.useCallback(({target:v,deltaY:x})=>{var k;let A=v;for(;!["scroll","auto"].includes(getComputedStyle(A).overflow);){if(!A.parentElement)return;A=A.parentElement}A===y.current&&x<0&&y.current.scrollHeight>y.current.clientHeight&&!((k=c.animation)!=null&&k.ignoreEscapes)&&(f(!0),u(!1))},[f,u,c]),y=Ap(v=>{var x,A;(x=y.current)==null||x.removeEventListener("scroll",m),(A=y.current)==null||A.removeEventListener("wheel",h),v==null||v.addEventListener("scroll",m,{passive:!0}),v==null||v.addEventListener("wheel",h,{passive:!0})},[]),g=Ap(v=>{var A,k;if((A=c.resizeObserver)==null||A.disconnect(),!v)return;let x;c.resizeObserver=new ResizeObserver(([C])=>{const{height:T}=C.contentRect,M=T-(x??T);if(c.resizeDifference=M,c.scrollTop>c.targetScrollTop&&(c.scrollTop=c.targetScrollTop),a(c.isNearBottom),M>=0){const R=cs(s.current,x?s.current.resize:s.current.initial);p({animation:R,wait:!0,preserveScrollPosition:!0,duration:R==="instant"?void 0:cA})}else c.isNearBottom&&(f(!1),u(!0));x=T,requestAnimationFrame(()=>{setTimeout(()=>{c.resizeDifference===M&&(c.resizeDifference=0)},1)})}),(k=c.resizeObserver)==null||k.observe(v)},[]);return{contentRef:g,scrollRef:y,scrollToBottom:p,stopScroll:d,isAtBottom:r||o,isNearBottom:o,escapedFromLock:t,state:c}};function Ap(e,t){const n=F.useCallback(r=>(n.current=r,e(r)),t);return n}const us=new Map;function cs(...e){const t={...sA};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 us.has(r)||us.set(r,Object.freeze(t)),n?"instant":us.get(r)}const Ip=F.createContext(null),dA=typeof window<"u"?F.useLayoutEffect:F.useEffect;function Ci({instance:e,children:t,resize:n,initial:r,mass:i,damping:o,stiffness:a,targetScrollTop:s,contextRef:l,...u}){const f=F.useRef(null),c=E.useCallback((k,C)=>{const T=(A==null?void 0:A.targetScrollTop)??s;return(T==null?void 0:T(k,C))??k},[s]),p=fA({mass:i,damping:o,stiffness:a,resize:n,initial:r,targetScrollTop:c}),{scrollRef:d,contentRef:m,scrollToBottom:h,stopScroll:y,isAtBottom:g,escapedFromLock:v,state:x}=e??p,A=F.useMemo(()=>({scrollToBottom:h,stopScroll:y,scrollRef:d,isAtBottom:g,escapedFromLock:v,contentRef:m,state:x,get targetScrollTop(){return f.current},set targetScrollTop(k){f.current=k}}),[h,g,m,d,y,v,x]);return F.useImperativeHandle(l,()=>A,[A]),dA(()=>{d.current&&getComputedStyle(d.current).overflow==="visible"&&(d.current.style.overflow="auto")},[]),S.jsx(Ip.Provider,{value:A,children:S.jsx("div",{...u,children:typeof t=="function"?t(A):t})})}(function(e){function t({children:n,...r}){const i=Tp();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})(Ci||(Ci={}));function Tp(){const e=F.useContext(Ip);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}function pA({botAvatar:e,botDescription:t,botName:n}){const{messageList:{marquee:r}}=ge;return S.jsxs("li",{...r.container,children:[S.jsx(Nn,{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})]})]})}const fs=F.memo(({className:e,messages:t=[],isTyping:n,headerMessage:r,renderers:i,botAvatar:o,botDescription:a,botName:s,sendMessage:l,addMessageFeedback:u,showMarquee:f=!0,showDateSystemMessage:c=!0,showMessageStatus:p=!0,showIncomingMessageAvatar:d=!0,showOutgoingMessageAvatar:m=!1,...h})=>{var A;const{messageList:y}=ge,g=F.useMemo(()=>c?gm(t):t,[t]),v=F.useMemo(()=>{var C;const k=g.filter(T=>T.direction==="outgoing"&&T.status!=="pending");return(C=k[k.length-1])==null?void 0:C.id},[g]),x=k=>{if(k.direction==="incoming")return d;if(k.direction==="outgoing")return m};return S.jsxs(Ci,{...h,resize:"smooth",initial:"instant",className:dr(y.container.className,e),children:[S.jsxs(Ci.Content,{className:y.viewPort.className,children:[r&&S.jsx("span",{...y.headerMessage,children:r}),f&&S.jsx(pA,{botAvatar:o,botDescription:a,botName:s}),g.map(k=>{var C;return S.jsx(Si,{renderers:i,sendMessage:l,addMessageFeedback:u,isLastDeliveredMessage:p&&k.id===v,showAvatar:x(k),...k},((C=k.metadata)==null?void 0:C.clientMessageId)||k.id)}),n&&S.jsx(Si,{id:ls(),renderers:i,sendMessage:l,direction:"incoming",timestamp:new Date,showAvatar:d,block:void 0,sender:((A=t.filter(k=>k.direction==="incoming").at(-1))==null?void 0:A.sender)??{name:s||"Bot",avatar:o},children:S.jsx(ss,{})})]}),S.jsx(hA,{})]})}),hA=()=>{const{isAtBottom:e,scrollToBottom:t}=Tp(),{messageList:n}=ge;return e?null:S.jsx("button",{className:n.scrollDownButton.className,onClick:()=>t()})};fs.displayName="MessageList";function Op({error:e,restartConversation:t,closeWindow:n}){let r,i;const{error:o}=ge;return e.type==="configuration"?(r="Configuration error",i=S.jsx(mg,{...o.icon})):e.type==="bot"?(r="Bot error",i=S.jsx(Ol,{...o.icon})):e.type==="network"?(r="Network error",i=S.jsx(Eg,{...o.icon})):e.type==="disconnected"?(r="Disconnected",i=S.jsx(wg,{...o.icon})):(r="Unexpected error",i=S.jsx(Ol,{...o.icon})),S.jsx(mA,{error:e,title:r,icon:i,restartConversation:t,closeWindow:n})}function mA({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(as,{restartConversation:r,style:{color:"white",backgroundColor:"transparent"}}),i&&S.jsx(Sp,{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 gA=({className:e,...t})=>{const{className:n}=ge.loader;return S.jsx("div",{...t,className:dr(e,n)})},Dp=({ref:e,connected:t,configuration:n,isTyping:r,messages:i,user:o,isLoading:a,renderers:s,isReadOnly:l,disableComposer:u,allowFileUpload:f,error:c,participants:p,closeWindow:d,sendMessage:m,uploadFile:h,addMessageFeedback:y,restartConversation:g,clientId:v,storageKey:x,soundOn:A,toggleSound:k,disableSendButton:C,...T})=>{const{color:M,fontFamily:R,radius:I,themeMode:O,variant:j,headerVariant:_,botAvatar:N,botDescription:D,botName:z,composerPlaceholder:U,footer:$,feedbackEnabled:V,additionalStylesheetUrl:b}=n,P={color:M,fontFamily:R,radius:I,themeMode:O,variant:j,headerVariant:_,additionalStylesheetUrl:b};V||(y=void 0);const H=F.useMemo(()=>o?Qs(i,p,o.id,z,N):[],[N,z,i,o,p]),w=F.useRef(null),W=sn(X=>X.setPortalContainer);return F.useEffect(()=>(W(w.current),()=>{W(null)}),[W]),S.jsxs(S.Fragment,{children:[S.jsx(hp,{...P}),S.jsx("div",{ref:w,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}}),S.jsx(ns,{connected:t,allowFileUpload:f,uploadFile:h,storageKey:x,...T,children:c?S.jsx(Op,{error:c,restartConversation:g,closeWindow:d}):S.jsxs(S.Fragment,{children:[S.jsx(Ep,{closeWindow:d,configuration:n,restartConversation:g,clientId:v,soundOn:A,toggleSound:k}),a?S.jsx(gA,{}):S.jsx(fs,{botAvatar:N,botDescription:D,botName:z,renderers:s,isTyping:r,sendMessage:m,addMessageFeedback:y,messages:H}),S.jsx($a,{ref:e,sendMessage:m,uploadFile:h,connected:t,isReadOnly:l,disableComposer:u,footer:$,composerPlaceholder:U,allowFileUpload:f,disableSendButton:C,storageKey:x})]})})]})};function Mp(){const[e,t]=F.useState(!1),n=F.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 yA=Object.defineProperty,vA=(e,t,n)=>t in e?yA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bA=(e,t,n)=>vA(e,t+"",n),xA=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},wA={bodySerializer:e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString():n)},kA=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},SA=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},EA=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},_p=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let s=(e?i:i.map(l=>encodeURIComponent(l))).join(SA(r));switch(r){case"label":return`.${s}`;case"matrix":return`;${n}=${s}`;case"simple":return s;default:return`${n}=${s}`}}let o=kA(r),a=i.map(s=>r==="label"||r==="simple"?e?s:encodeURIComponent(s):Ai({allowReserved:e,name:n,value:s})).join(o);return r==="label"||r==="matrix"?o+a:a},Ai=({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)}`},Pp=({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(([u,f])=>{s=[...s,u,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=EA(r),a=Object.entries(i).map(([s,l])=>Ai({allowReserved:e,name:r==="deepObject"?`${n}[${s}]`:s,value:l})).join(o);return r==="label"||r==="matrix"?o+a:a},CA=/\{[^{}]+\}/g,AA=({path:e,url:t})=>{let n=t,r=t.match(CA);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,_p({explode:o,name:a,style:s,value:l}));continue}if(typeof l=="object"){n=n.replace(i,Pp({explode:o,name:a,style:s,value:l}));continue}if(s==="matrix"){n=n.replace(i,`;${Ai({name:a,value:l})}`);continue}let u=encodeURIComponent(s==="label"?`.${l}`:l);n=n.replace(i,u)}return n},Np=({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,_p({allowReserved:e,explode:!0,name:o,style:"form",value:a,...t})];continue}if(typeof a=="object"){i=[...i,Pp({allowReserved:e,explode:!0,name:o,style:"deepObject",value:a,...n})];continue}i=[...i,Ai({allowReserved:e,name:o,value:a})]}}return i.join("&")},IA=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"}},TA=async({security:e,...t})=>{for(let n of e){let r=await xA(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}},Lp=e=>OA({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:Np(e.querySerializer),url:e.url}),OA=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,a=(e??"")+o;t&&(a=AA({path:t,url:a}));let s=n?r(n):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(a+=`?${s}`),a},Fp=(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=Rp(e.headers,t.headers),r},Rp=(...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},ds=class{constructor(){bA(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 ds,request:new ds,response:new ds}),MA=Np({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),_A={"Content-Type":"application/json"},Bp=(e={})=>({...wA,headers:_A,parseAs:"auto",querySerializer:MA,...e}),PA=(e={})=>{let t=Fp(Bp(),e),n=()=>({...t}),r=a=>(t=Fp(t,a),n()),i=DA(),o=async a=>{let s={...t,...a,fetch:a.fetch??t.fetch??globalThis.fetch,headers:Rp(t.headers,a.headers)};s.security&&await TA({...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=Lp(s),u={redirect:"follow",...s},f=new Request(l,u);for(let y of i.request._fns)f=await y(f,s);let c=s.fetch,p=await c(f);for(let y of i.response._fns)p=await y(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 y=(s.parseAs==="auto"?IA(p.headers.get("Content-Type")):s.parseAs)??"json";if(y==="stream")return{data:p.body,...d};let g=await p[y]();return y==="json"&&(s.responseValidator&&await s.responseValidator(g),s.responseTransformer&&(g=await s.responseTransformer(g))),{data:g,...d}}let m=await p.text();try{m=JSON.parse(m)}catch{}let h=m;for(let y of i.error._fns)h=await y(m,p,f,s);if(h=h||{},s.throwOnError)throw h;return{error:h,...d}};return{buildUrl:Lp,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"})}},NA=PA,LA=Bp;const Me=NA((e=>({...e,withCredentials:!0,timeout:6e4,maxBodyLength:104857600,maxContentLength:104857600,throwOnError:!0}))(LA({baseUrl:"https://webchat.botpress.cloud/"}))),FA=e=>(e.client??Me).delete({url:"/conversations/{id}",...e}),RA=e=>(e.client??Me).get({url:"/conversations/{id}",...e}),BA=e=>(e.client??Me).get({url:"/conversations",...e}),zA=e=>(e.client??Me).post({url:"/conversations",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),$A=e=>(e.client??Me).get({url:"/conversations/{id}/messages",...e}),jA=e=>(e.client??Me).get({url:"/conversations/{id}/participants",...e}),UA=e=>(e.client??Me).post({url:"/conversations/{id}/participants",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),HA=e=>(e.client??Me).delete({url:"/conversations/{id}/participants/{userId}",...e}),WA=e=>(e.client??Me).get({url:"/conversations/{id}/participants/{userId}",...e}),VA=e=>(e.client??Me).delete({url:"/messages/{id}",...e}),qA=e=>(e.client??Me).get({url:"/messages/{id}",...e}),KA=e=>(e.client??Me).put({url:"/messages/{id}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),YA=e=>(e.client??Me).post({url:"/messages",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),GA=e=>(e.client??Me).delete({url:"/messages/{id}/feedback",...e}),QA=e=>(e.client??Me).put({url:"/messages/{id}/feedback",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),JA=e=>(e.client??Me).delete({url:"/users/me",...e}),ZA=e=>(e.client??Me).get({url:"/users/me",...e}),XA=e=>(e.client??Me).put({url:"/users/me",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),eI=e=>((e==null?void 0:e.client)??Me).post({url:"/users/key",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),tI=e=>(e.client??Me).get({url:"/events/{id}",...e}),nI=e=>(e.client??Me).post({url:"/events",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),rI=e=>(e.client??Me).post({url:"/files",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}});let zp=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 ps(e){}function iI(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=ps,onError:n=ps,onRetry:r=ps,onComment:i}=e;let o="",a=!0,s,l="",u="";function f(h){const y=a?h.replace(/^\xEF\xBB\xBF/,""):h,[g,v]=oI(`${o}${y}`);for(const x of g)c(x);o=v,a=!1}function c(h){if(h===""){d();return}if(h.startsWith(":")){i&&i(h.slice(h.startsWith(": ")?2:1));return}const y=h.indexOf(":");if(y!==-1){const g=h.slice(0,y),v=h[y+1]===" "?2:1,x=h.slice(y+v);p(g,x,h);return}p(h,"",h)}function p(h,y,g){switch(h){case"event":u=y;break;case"data":l=`${l}${y}
314
+ `;break;case"id":s=y.includes("\0")?void 0:y;break;case"retry":/^\d+$/.test(y)?r(parseInt(y,10)):n(new zp(`Invalid \`retry\` value: "${y}"`,{type:"invalid-retry",value:y,line:g}));break;default:n(new zp(`Unknown field "${h.length>20?`${h.slice(0,20)}…`:h}"`,{type:"unknown-field",field:h,value:y,line:g}));break}}function d(){l.length>0&&t({id:s,event:u||void 0,data:l.endsWith(`
315
+ `)?l.slice(0,-1):l}),s=void 0,l="",u=""}function m(h={}){o&&h.consume&&c(o),a=!0,s=void 0,l="",u="",o=""}return{feed:f,reset:m}}function oI(e){const t=[];let n="",r=0;for(;r<e.length;){const i=e.indexOf("\r",r),o=e.indexOf(`
294
316
  `,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,` {
317
+ `&&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(jp(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(jp(this),n)}}function aI(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function hs(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(hs).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${hs(e.cause)}`:e.message:`${e}`}function jp(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var Up=e=>{throw TypeError(e)},ms=(e,t,n)=>t.has(e)||Up("Cannot "+n),ve=(e,t,n)=>(ms(e,t,"read from private field"),n?n.call(e):t.get(e)),Be=(e,t,n)=>t.has(e)?Up("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),_e=(e,t,n,r)=>(ms(e,t,"write to private field"),t.set(e,n),n),It=(e,t,n)=>(ms(e,t,"access private method"),n),Xe,Qt,vn,Ii,Ti,gr,bn,yr,Bt,xn,wn,kn,vr,mt,gs,ys,vs,Hp,bs,xs,br,ws,ks;class Oi extends EventTarget{constructor(t,n){var r,i;super(),Be(this,mt),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Be(this,Xe),Be(this,Qt),Be(this,vn),Be(this,Ii),Be(this,Ti),Be(this,gr),Be(this,bn),Be(this,yr,null),Be(this,Bt),Be(this,xn),Be(this,wn,null),Be(this,kn,null),Be(this,vr,null),Be(this,ys,async o=>{var a;ve(this,xn).reset();const{body:s,redirected:l,status:u,headers:f}=o;if(u===204){It(this,mt,br).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?_e(this,vn,new URL(o.url)):_e(this,vn,void 0),u!==200){It(this,mt,br).call(this,`Non-200 status code (${u})`,u);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){It(this,mt,br).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(ve(this,Xe)===this.CLOSED)return;_e(this,Xe,this.OPEN);const c=new Event("open");if((a=ve(this,vr))==null||a.call(this,c),this.dispatchEvent(c),typeof s!="object"||!s||!("getReader"in s)){It(this,mt,br).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const p=new TextDecoder,d=s.getReader();let m=!0;do{const{done:h,value:y}=await d.read();y&&ve(this,xn).feed(p.decode(y,{stream:!h})),h&&(m=!1,ve(this,xn).reset(),It(this,mt,ws).call(this))}while(m)}),Be(this,vs,o=>{_e(this,Bt,void 0),!(o.name==="AbortError"||o.type==="aborted")&&It(this,mt,ws).call(this,hs(o))}),Be(this,bs,o=>{typeof o.id=="string"&&_e(this,yr,o.id);const a=new MessageEvent(o.event||"message",{data:o.data,origin:ve(this,vn)?ve(this,vn).origin:ve(this,Qt).origin,lastEventId:o.id||""});ve(this,kn)&&(!o.event||o.event==="message")&&ve(this,kn).call(this,a),this.dispatchEvent(a)}),Be(this,xs,o=>{_e(this,gr,o)}),Be(this,ks,()=>{_e(this,bn,void 0),ve(this,Xe)===this.CONNECTING&&It(this,mt,gs).call(this)});try{if(t instanceof URL)_e(this,Qt,t);else if(typeof t=="string")_e(this,Qt,new URL(t,sI()));else throw new Error("Invalid URL")}catch{throw aI("An invalid or illegal string was specified")}_e(this,xn,iI({onEvent:ve(this,bs),onRetry:ve(this,xs)})),_e(this,Xe,this.CONNECTING),_e(this,gr,3e3),_e(this,Ti,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),_e(this,Ii,(i=n==null?void 0:n.withCredentials)!=null?i:!1),It(this,mt,gs).call(this)}get readyState(){return ve(this,Xe)}get url(){return ve(this,Qt).href}get withCredentials(){return ve(this,Ii)}get onerror(){return ve(this,wn)}set onerror(t){_e(this,wn,t)}get onmessage(){return ve(this,kn)}set onmessage(t){_e(this,kn,t)}get onopen(){return ve(this,vr)}set onopen(t){_e(this,vr,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,bn)&&clearTimeout(ve(this,bn)),ve(this,Xe)!==this.CLOSED&&(ve(this,Bt)&&ve(this,Bt).abort(),_e(this,Xe,this.CLOSED),_e(this,Bt,void 0))}}Xe=new WeakMap,Qt=new WeakMap,vn=new WeakMap,Ii=new WeakMap,Ti=new WeakMap,gr=new WeakMap,bn=new WeakMap,yr=new WeakMap,Bt=new WeakMap,xn=new WeakMap,wn=new WeakMap,kn=new WeakMap,vr=new WeakMap,mt=new WeakSet,gs=function(){_e(this,Xe,this.CONNECTING),_e(this,Bt,new AbortController),ve(this,Ti)(ve(this,Qt),It(this,mt,Hp).call(this)).then(ve(this,ys)).catch(ve(this,vs))},ys=new WeakMap,vs=new WeakMap,Hp=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...ve(this,yr)?{"Last-Event-ID":ve(this,yr)}:void 0},cache:"no-store",signal:(e=ve(this,Bt))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},bs=new WeakMap,xs=new WeakMap,br=function(e,t){var n;ve(this,Xe)!==this.CLOSED&&_e(this,Xe,this.CLOSED);const r=new $p("error",{code:t,message:e});(n=ve(this,wn))==null||n.call(this,r),this.dispatchEvent(r)},ws=function(e,t){var n;if(ve(this,Xe)===this.CLOSED)return;_e(this,Xe,this.CONNECTING);const r=new $p("error",{code:t,message:e});(n=ve(this,wn))==null||n.call(this,r),this.dispatchEvent(r),_e(this,bn,setTimeout(ve(this,ks),ve(this,gr)))},ks=new WeakMap,Oi.CONNECTING=0,Oi.OPEN=1,Oi.CLOSED=2;function sI(){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 lI(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 Wp=()=>{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}))}}},Le=e=>e.data,Vp=10,qp=3e3,uI="60000",cI={throwOnError:!0},fI=({conversationId:e,userToken:t,clientId:n,apiUrl:r,adminSecret:i})=>{let o=0,a=null;const s=Wp(),l=()=>{a&&a.close();const u=`${`${r||Me.getConfig().baseUrl}/${n}`}/initialize${e?`?conversationId=${e}`:""}`,f={...i?{"x-admin-secret":i}:{},...t?{"x-user-key":t}:{}};a=Yp(u,f),a.onopen=()=>s.emit("open"),a.onerror=c=>{o<Vp?(o++,setTimeout(()=>l(),qp)):s.emit("error",c)},a.onmessage=c=>{const p=Kp(c.data);s.emit(p.type,p.data)}};return l(),s.on},dI=({userKey:e,clientId:t,apiUrl:n,customHeaders:r})=>{const i={"x-user-key":e,...r},o=`${n||Me.getConfig().baseUrl}/${t}`,a={...cI,baseUrl:o};return Me.interceptors.response._fns.length===0&&Me.interceptors.response.use(lI),{createConversation:()=>zA({...a,headers:i,body:{}}).then(Le),getConversation:({conversationId:s})=>RA({...a,headers:i,path:{id:s}}).then(Le),deleteConversation:({conversationId:s})=>FA({...a,headers:i,path:{id:s}}).then(Le),listConversations:({nextToken:s})=>BA({...a,headers:i,query:{nextToken:s}}).then(Le),listConversationMessages:({conversationId:s,nextToken:l})=>$A({...a,headers:i,path:{id:s},query:{nextToken:l}}).then(Le),addParticipant:({conversationId:s,userId:l})=>UA({...a,headers:i,path:{id:s},body:{userId:l}}).then(Le),removeParticipant:({conversationId:s,userId:l})=>HA({...a,headers:i,path:{id:s,userId:l}}).then(Le),getParticipant:({conversationId:s,userId:l})=>WA({...a,headers:i,path:{id:s,userId:l}}).then(Le),listParticipants:({conversationId:s,nextToken:l})=>jA({...a,headers:i,path:{id:s},query:{nextToken:l}}).then(Le),createMessage:s=>YA({...a,headers:i,body:s}).then(Le),updateMessage:({messageId:s,...l})=>KA({...a,headers:i,path:{id:s},body:l}).then(Le),getMessage:({messageId:s})=>qA({...a,headers:i,path:{id:s}}).then(Le),deleteMessage:({messageId:s})=>VA({...a,headers:i,path:{id:s}}).then(Le),createFile:s=>rI({...a,headers:i,body:s}).then(Le),getUser:()=>ZA({...a,headers:i}).then(Le),updateUser:s=>XA({...a,headers:i,body:s}).then(Le),deleteUser:()=>JA({...a,headers:i}).then(Le),createEvent:s=>nI({...a,headers:i,body:s}).then(Le),getEvent:({eventId:s})=>tI({...a,headers:i,path:{id:s}}).then(Le),addMessageFeedback:({messageId:s,...l})=>QA({...a,headers:i,path:{id:s},body:l}).then(Le),removeMessageFeedback:({messageId:s})=>GA({...a,headers:i,path:{id:s}}).then(Le),generateUserKey:({adminSecret:s,...l})=>eI({...a,headers:{"x-admin-secret":s},body:l}).then(Le),listenConversation:({conversationId:s})=>{let l=0,u=null;const f=Wp(),c=()=>{u&&u.close();const p=`${o}/conversations/${s}/listen`;u=Yp(p,i),u.onopen=()=>f.emit("open"),u.onerror=d=>{l<Vp?(l++,setTimeout(()=>c(),qp)):f.emit("error",d)},u.onmessage=d=>{const m=Kp(d.data);f.emit(m.type,m.data)}};return c(),f.on}}},Kp=e=>{try{return JSON.parse(e)}catch{return e}},Yp=(e,t)=>new Oi(e,{fetch:(n,r)=>fetch(n,{...r,headers:{...r==null?void 0:r.headers,...t,timeout:uI}})}),Gp={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:ji&&ji.tagName.toUpperCase()==="SCRIPT"&&ji.src||new URL("index.umd.cjs",document.baseURI).href).href};function Qp({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,soundEnabled:o,...a}){var oe;const s=of(n,r),l=s(G=>G.conversationId),u=s(G=>G.user),f=s(G=>G.setConversationId),c=s(G=>G.setUser),p=s(G=>G.clearConversationId),d=an(G=>G.messages),m=an(G=>G.saveMessage),h=an(G=>G.updateMessage),y=an(G=>G.fetchMessages),g=an(G=>G.setMessages),v=an(G=>G.clearMessages),x=Gn(G=>G.participants),A=Gn(G=>G.setParticipants),k=Gn(G=>G.addParticipant),C=Gn(G=>G.removeParticipant),T=Gn(G=>G.clearParticipants),M=sf(`webchat-sound-${t}`),R=M(G=>G.soundOn),I=M(G=>G.toggleSound),{state:O,setState:j}=Mp(),{state:_,setState:N}=Mp(),D=F.useMemo(()=>el(),[]),[z,U]=F.useState("connecting"),[$,V]=F.useState(a.conversationId),[b,P]=F.useState(a.user),[H,w]=F.useState(void 0),[W,X]=F.useState(!1),[Y,J]=F.useState(void 0),ee=F.useRef(!1),ie=F.useRef(null),K=F.useRef(o??!1);F.useEffect(()=>{K.current=o??!1},[o]);const te=F.useRef(R);F.useEffect(()=>{te.current=R},[R]),F.useEffect(()=>{var Ue,Ye,Z,se;const G=pI(t,e);if(G){J(G),U("error");return}if(ee.current)return;ee.current=!0,j(!1),U("connecting");try{ie.current=new Audio,ie.current.preload="auto",ie.current.src=Gp.chatMessageNotification,ie.current.volume=.9}catch(B){console.error("Error loading sound effect:",B),ie.current=null}let ue;(Ue=a.user)!=null&&Ue.userToken&&a.conversationId?ue={conversationId:a.conversationId,userToken:(Ye=a.user)==null?void 0:Ye.userToken}:(Z=a.user)!=null&&Z.userToken?ue={conversationId:void 0,userToken:(se=a.user)==null?void 0:se.userToken}:ue={conversationId:l,userToken:u==null?void 0:u.userToken};const de=fI({apiUrl:e,clientId:t,userToken:ue.userToken,conversationId:ue.conversationId,adminSecret:i});let xe=[];const Se=de("init",({conversation:B,messages:q,participants:ae,user:le})=>{const pe=dI({clientId:t,apiUrl:e,userKey:le.userKey});pe.createEvent({conversationId:B.id,payload:{type:"conversation_started",data:{}}}).then(({event:fe})=>{var Ee,Oe;(Oe=(Ee=fe.payload.data)==null?void 0:Ee.status)!=null&&Oe.isInitial&&D.emit("conversation",B.id)}),xe=[...xe,de("error",fe=>{J(Ee=>Ee||Sr(fe)),U("error"),D.emit("error",new Error(`Connection to conversation lost: ${fe==null?void 0:fe.message}`))}),de("message_created",fe=>{const Ee=Kn(fe);le.id!==Ee.authorId&&(K.current&&te.current&&ie.current&&ie.current.play().catch(()=>{}),j(!1),N(!1),D.emit("isTyping",{isTyping:!1,timeout:0})),m(Ee),D.emit("message",Ee)}),de("message_status_changed",fe=>{var Ee;fe.newStatus==="processing"&&h((Ee=fe.message.metadata)==null?void 0:Ee.clientMessageId,{status:fe.newStatus})}),de("typing_stopped",()=>{j(!1),N(!1)}),de("typing_started",()=>{j(!0,5e3),N(!0,5e3),D.emit("isTyping",{isTyping:!0,timeout:5e3})}),de("participant_added",fe=>{k(fe.participant),D.emit("participantAdded",fe.participant)}),de("participant_removed",fe=>{C(fe.participantId),D.emit("participantRemoved",fe.participantId)}),de("webchat_visibility",fe=>D.emit("webchatVisibility",fe.visibility)),de("webchat_config",fe=>D.emit("webchatConfig",fe.config)),de("custom",fe=>D.emit("customEvent",fe.event))],V(B.id),f(B.id),P({userId:le.id,userToken:le.userKey}),c({userId:le.id,userToken:le.userKey}),A(ae),g(q.reverse().map(fe=>Kn(fe)).filter(Boolean)),J(void 0),U("connected"),w(pe)});return xe.push(Se),()=>{ee.current=!1,xe.forEach(B=>B())}},[a.conversationId,(oe=a.user)==null?void 0:oe.userToken,W]);const L=async(G,ue)=>{const de=ue||$;if(!G||!de)return;const xe=await y({client:G,conversationId:de});g(xe);const{participants:Se}=await G.listParticipants({conversationId:de});A(Se)},ne=async G=>{if(!G)throw new Error("Cannot start new conversation: client is not initialized");p(),v(),T(),V(void 0),X(ue=>!ue)};async function me(G,ue){const xe=[{predicate:Se=>Se.message===Zi||Se.type==="ResourceNotFound",recover:()=>ne(ue)},{predicate:Se=>Se.type==="network"||Se.type==="disconnected"||Se.message===Pn,recover:()=>L(ue,$)}].find(Se=>Se.predicate(G));if(!xe){U("error"),J(G);return}try{await El(xe.recover,3,5e3),J(void 0),U("connected")}catch(Se){J(Sr(Se)),U("error")}}if(z!=="connected"||!b||!$||!H)return{clientState:z,on:D.on,client:void 0,messages:[],conversationId:void 0,newConversation:async()=>{await ne(H)},user:void 0,isTyping:void 0,participants:[],toggleSound:I,soundOn:R,error:Y,disableSendButton:_};const ke={sendMessage:async G=>{const ue=ls(),de={id:ue,createdAt:new Date().toISOString(),userId:b.userId,conversationId:$,payload:G,metadata:{clientMessageId:ue,delivered:!1}},xe=Kn(de);xe.status="pending",m(xe),N(!0,5e3);try{await H.createMessage({conversationId:$,payload:G,metadata:{clientMessageId:ue}})}catch(Se){await me(Sr(Se),H),D.emit("error",Se)}},sendEvent:async(G,ue)=>{await H.createEvent({conversationId:$,payload:{type:"custom",data:G},bindConversation:(ue==null?void 0:ue.bindConversation)??!0,bindUser:(ue==null?void 0:ue.bindUser)??!0})},uploadFile:async G=>{const{size:ue,name:de}=G,Se=await(ae=>new Promise((le,pe)=>{const fe=new FileReader;fe.onload=Ee=>{var Oe;return le((Oe=Ee.target)==null?void 0:Oe.result)},fe.onerror=Ee=>{var Oe;return pe((Oe=Ee.target)==null?void 0:Oe.error)},fe.readAsArrayBuffer(ae)}))(G),Ue=new Date;Ue.setDate(Ue.getDate()+30);const{file:{uploadUrl:Ye,contentType:Z,url:se}}=await H.createFile({size:ue,key:`${ls(6)}-${G.name}`,accessPolicies:["public_content"],index:!1,tags:{source:"integration",integrationName:"webchat",conversation:$,user:b.userId},expiresAt:Ue.toISOString()});await fetch(Ye,{method:"PUT",headers:{"x-amz-tagging":"public=true","content-type":Z},body:Se});const B=Z.split("/").shift()??"",q=fl(B)?B:"file";return{fileUrl:se,name:de,type:q}},addMessageFeedback:async(G,ue)=>{h(G,{feedback:ue.value}),await H.addMessageFeedback({messageId:G,...ue})},getUser:async()=>{const{user:G}=await H.getUser();return G},updateUser:async G=>{const{user:ue}=await H.updateUser({name:G.name,pictureUrl:G.pictureUrl,userData:G.data});return ue}};return{clientState:"connected",on:D.on,client:ke,messages:d,conversationId:$,newConversation:async()=>{await ne(H)},user:b,isTyping:O,participants:x,error:Y,soundOn:R,toggleSound:I,disableSendButton:_}}const pI=(e,t)=>{if(!e)return{type:"configuration",message:dl};if(!zm(t))return{type:"configuration",message:pl}},hI=({clientId:e,storageKey:t,configuration:n,allowFileUpload:r,apiUrl:i,user:o,conversationId:a,...s})=>{const l=t||`bp-webchat-${e}`,{clientState:u,client:f,isTyping:c,newConversation:p,messages:d,participants:m,user:h,error:y,soundOn:g,toggleSound:v,disableSendButton:x}=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:A,uploadFile:k,addMessageFeedback:C}=f??{};return S.jsx(Dp,{configuration:n??{},user:h!=null&&h.userId?{id:h==null?void 0:h.userId}:void 0,isLoading:u==="connecting",isTyping:c,connected:u==="connected"?!0:u==="disconnected"?!1:void 0,messages:d,sendMessage:A,uploadFile:k,addMessageFeedback:C,allowFileUpload:r,restartConversation:p,...s,participants:m,error:y,clientId:e,soundOn:g,toggleSound:v,disableSendButton:x})};function mI(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e);E.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 gI="DismissableLayer",Ss="dismissableLayer.update",yI="dismissableLayer.pointerDownOutside",vI="dismissableLayer.focusOutside",Jp,Zp=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xp=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=e,u=E.useContext(Zp),[f,c]=E.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=E.useState({}),m=Ot(t,T=>c(T)),h=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=h.indexOf(y),v=f?h.indexOf(f):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,A=v>=g,k=wI(T=>{const M=T.target,R=[...u.branches].some(I=>I.contains(M));!A||R||(i==null||i(T),a==null||a(T),T.defaultPrevented||s==null||s())},p),C=kI(T=>{const M=T.target;[...u.branches].some(I=>I.contains(M))||(o==null||o(T),a==null||a(T),T.defaultPrevented||s==null||s())},p);return mI(T=>{v===u.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},p),E.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Jp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),eh(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Jp)}},[f,p,n,u]),E.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),eh())},[f,u]),E.useEffect(()=>{const T=()=>d({});return document.addEventListener(Ss,T),()=>document.removeEventListener(Ss,T)},[]),S.jsx(ht.div,{...l,ref:m,style:{pointerEvents:x?A?"auto":"none":void 0,...e.style},onFocusCapture:At(e.onFocusCapture,C.onFocusCapture),onBlurCapture:At(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:At(e.onPointerDownCapture,k.onPointerDownCapture)})});Xp.displayName=gI;var bI="DismissableLayerBranch",xI=E.forwardRef((e,t)=>{const n=E.useContext(Zp),r=E.useRef(null),i=Ot(t,r);return E.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),S.jsx(ht.div,{...e,ref:i})});xI.displayName=bI;function wI(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),r=E.useRef(!1),i=E.useRef(()=>{});return E.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){th(yI,n,u,{discrete:!0})};const u={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 kI(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),r=E.useRef(!1);return E.useEffect(()=>{const i=o=>{o.target&&!r.current&&th(vI,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 eh(){const e=new CustomEvent(Ss);document.dispatchEvent(e)}function th(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?GC(i,o):i.dispatchEvent(o)}var Es="focusScope.autoFocusOnMount",Cs="focusScope.autoFocusOnUnmount",nh={bubbles:!1,cancelable:!0},SI="FocusScope",rh=E.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=E.useState(null),u=Zt(i),f=Zt(o),c=E.useRef(null),p=Ot(t,h=>l(h)),d=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let h=function(x){if(d.paused||!s)return;const A=x.target;s.contains(A)?c.current=A:zt(c.current,{select:!0})},y=function(x){if(d.paused||!s)return;const A=x.relatedTarget;A!==null&&(s.contains(A)||zt(c.current,{select:!0}))},g=function(x){if(document.activeElement===document.body)for(const k of x)k.removedNodes.length>0&&zt(s)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const v=new MutationObserver(g);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),v.disconnect()}}},[r,s,d.paused]),E.useEffect(()=>{if(s){ah.add(d);const h=document.activeElement;if(!s.contains(h)){const g=new CustomEvent(Es,nh);s.addEventListener(Es,u),s.dispatchEvent(g),g.defaultPrevented||(EI(OI(ih(s)),{select:!0}),document.activeElement===h&&zt(s))}return()=>{s.removeEventListener(Es,u),setTimeout(()=>{const g=new CustomEvent(Cs,nh);s.addEventListener(Cs,f),s.dispatchEvent(g),g.defaultPrevented||zt(h??document.body,{select:!0}),s.removeEventListener(Cs,f),ah.remove(d)},0)}}},[s,u,f,d]);const m=E.useCallback(h=>{if(!n&&!r||d.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,g=document.activeElement;if(y&&g){const v=h.currentTarget,[x,A]=CI(v);x&&A?!h.shiftKey&&g===A?(h.preventDefault(),n&&zt(x,{select:!0})):h.shiftKey&&g===x&&(h.preventDefault(),n&&zt(A,{select:!0})):g===v&&h.preventDefault()}},[n,r,d.paused]);return S.jsx(ht.div,{tabIndex:-1,...a,ref:p,onKeyDown:m})});rh.displayName=SI;function EI(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zt(r,{select:t}),document.activeElement!==n)return}function CI(e){const t=ih(e),n=oh(t,e),r=oh(t.reverse(),e);return[n,r]}function ih(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 oh(e,t){for(const n of e)if(!AI(n,{upTo:t}))return n}function AI(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 II(e){return e instanceof HTMLInputElement&&"select"in e}function zt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&II(e)&&t&&e.select()}}var ah=TI();function TI(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=sh(e,t),e.unshift(t)},remove(t){var n;e=sh(e,t),(n=e[0])==null||n.resume()}}}function sh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function OI(e){return e.filter(t=>t.tagName!=="A")}var As=0;function DI(){E.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??lh()),document.body.insertAdjacentElement("beforeend",e[1]??lh()),As++,()=>{As===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),As--}},[])}function lh(){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 Di="right-scroll-bar-position",Mi="width-before-scroll-bar",MI="with-scroll-bars-hidden",_I="--removed-body-scroll-bar-size";function Is(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function PI(e,t){var n=F.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 NI=typeof window<"u"?E.useLayoutEffect:E.useEffect,uh=new WeakMap;function LI(e,t){var n=PI(null,function(r){return e.forEach(function(i){return Is(i,r)})});return NI(function(){var r=uh.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(s){o.has(s)||Is(s,null)}),o.forEach(function(s){i.has(s)||Is(s,a)})}uh.set(n,e)},[e]),n}function FI(e){return e}function RI(e,t){t===void 0&&(t=FI);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)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){a.push(f),u()},filter:function(f){return a=a.filter(f),n}}}};return i}function BI(e){e===void 0&&(e={});var t=RI(null);return t.options=ot({async:!0,ssr:!1},e),t}var ch=function(e){var t=e.sideCar,n=cf(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 E.createElement(r,ot({},n))};ch.isSideCarExport=!0;function zI(e,t){return e.useMedium(t),ch}var fh=BI(),Ts=function(){},_i=E.forwardRef(function(e,t){var n=E.useRef(null),r=E.useState({onScrollCapture:Ts,onWheelCapture:Ts,onTouchMoveCapture:Ts}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,c=e.shards,p=e.sideCar,d=e.noRelative,m=e.noIsolation,h=e.inert,y=e.allowPinchZoom,g=e.as,v=g===void 0?"div":g,x=e.gapMode,A=cf(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=p,C=LI([n,t]),T=ot(ot({},A),i);return E.createElement(E.Fragment,null,f&&E.createElement(k,{sideCar:fh,removeScrollBar:u,shards:c,noRelative:d,noIsolation:m,inert:h,setCallbacks:o,allowPinchZoom:!!y,lockRef:n,gapMode:x}),a?E.cloneElement(E.Children.only(s),ot(ot({},T),{ref:C})):E.createElement(v,ot({},T,{className:l,ref:C}),s))});_i.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},_i.classNames={fullWidth:Mi,zeroRight:Di};var $I=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function jI(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=$I();return t&&e.setAttribute("nonce",t),e}function UI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function HI(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var WI=function(){var e=0,t=null;return{add:function(n){e==0&&(t=jI())&&(UI(t,n),HI(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},VI=function(){var e=WI();return function(t,n){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dh=function(){var e=VI(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},qI={left:0,top:0,right:0,gap:0},Os=function(e){return parseInt(e||"",10)||0},KI=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[Os(n),Os(r),Os(i)]},YI=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qI;var t=KI(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])}},GI=dh(),Sn="data-scroll-locked",QI=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
318
+ .`.concat(MI,` {
297
319
  overflow: hidden `).concat(r,`;
298
320
  padding-right: `).concat(s,"px ").concat(r,`;
299
321
  }
300
- body[`).concat(Cn,`] {
322
+ body[`).concat(Sn,`] {
301
323
  overflow: hidden `).concat(r,`;
302
324
  overscroll-behavior: contain;
303
325
  `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
@@ -310,30 +332,30 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
310
332
  `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
311
333
  }
312
334
 
313
- .`).concat(Ii,` {
335
+ .`).concat(Di,` {
314
336
  right: `).concat(s,"px ").concat(r,`;
315
337
  }
316
338
 
317
- .`).concat(Ti,` {
339
+ .`).concat(Mi,` {
318
340
  margin-right: `).concat(s,"px ").concat(r,`;
319
341
  }
320
342
 
321
- .`).concat(Ii," .").concat(Ii,` {
343
+ .`).concat(Di," .").concat(Di,` {
322
344
  right: 0 `).concat(r,`;
323
345
  }
324
346
 
325
- .`).concat(Ti," .").concat(Ti,` {
347
+ .`).concat(Mi," .").concat(Mi,` {
326
348
  margin-right: 0 `).concat(r,`;
327
349
  }
328
350
 
329
- body[`).concat(Cn,`] {
330
- `).concat(kI,": ").concat(s,`px;
351
+ body[`).concat(Sn,`] {
352
+ `).concat(_I,": ").concat(s,`px;
331
353
  }
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`
354
+ `)},ph=function(){var e=parseInt(document.body.getAttribute(Sn)||"0",10);return isFinite(e)?e:0},JI=function(){E.useEffect(function(){return document.body.setAttribute(Sn,(ph()+1).toString()),function(){var e=ph()-1;e<=0?document.body.removeAttribute(Sn):document.body.setAttribute(Sn,e.toString())}},[])},ZI=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;JI();var o=E.useMemo(function(){return YI(i)},[i]);return E.createElement(GI,{styles:QI(o,!t,i,n?"":"!important")})},Ds=!1;if(typeof window<"u")try{var Pi=Object.defineProperty({},"passive",{get:function(){return Ds=!0,!0}});window.addEventListener("test",Pi,Pi),window.removeEventListener("test",Pi,Pi)}catch{Ds=!1}var En=Ds?{passive:!1}:!1,XI=function(e){return e.tagName==="TEXTAREA"},hh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!XI(e)&&n[t]==="visible")},eT=function(e){return hh(e,"overflowY")},tT=function(e){return hh(e,"overflowX")},mh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=gh(e,r);if(i){var o=yh(e,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},nT=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},rT=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},gh=function(e,t){return e==="v"?eT(t):tT(t)},yh=function(e,t){return e==="v"?nT(t):rT(t)},iT=function(e,t){return e==="h"&&t==="rtl"?-1:1},oT=function(e,t,n,r,i){var o=iT(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),u=!1,f=a>0,c=0,p=0;do{if(!s)break;var d=yh(e,s),m=d[0],h=d[1],y=d[2],g=h-y-o*m;(m||g)&&gh(e,s)&&(c+=g,p+=m);var v=s.parentNode;s=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(f&&Math.abs(c)<1||!f&&Math.abs(p)<1)&&(u=!0),u},Ni=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vh=function(e){return[e.deltaX,e.deltaY]},bh=function(e){return e&&"current"in e?e.current:e},aT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sT=function(e){return`
333
355
  .block-interactivity-`.concat(e,` {pointer-events: none;}
334
356
  .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.
357
+ `)},lT=0,Cn=[];function uT(e){var t=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),i=E.useState(lT++)[0],o=E.useState(dh)[0],a=E.useRef(e);E.useEffect(function(){a.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var h=la([e.lockRef.current],(e.shards||[]).map(bh),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=E.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var g=Ni(h),v=n.current,x="deltaX"in h?h.deltaX:v[0]-g[0],A="deltaY"in h?h.deltaY:v[1]-g[1],k,C=h.target,T=Math.abs(x)>Math.abs(A)?"h":"v";if("touches"in h&&T==="h"&&C.type==="range")return!1;var M=mh(T,C);if(!M)return!0;if(M?k=T:(k=T==="v"?"h":"v",M=mh(T,C)),!M)return!1;if(!r.current&&"changedTouches"in h&&(x||A)&&(r.current=k),!k)return!0;var R=r.current||k;return oT(R,y,h,R==="h"?x:A)},[]),l=E.useCallback(function(h){var y=h;if(!(!Cn.length||Cn[Cn.length-1]!==o)){var g="deltaY"in y?vh(y):Ni(y),v=t.current.filter(function(k){return k.name===y.type&&(k.target===y.target||y.target===k.shadowParent)&&aT(k.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var x=(a.current.shards||[]).map(bh).filter(Boolean).filter(function(k){return k.contains(y.target)}),A=x.length>0?s(y,x[0]):!a.current.noIsolation;A&&y.cancelable&&y.preventDefault()}}},[]),u=E.useCallback(function(h,y,g,v){var x={name:h,delta:y,target:g,should:v,shadowParent:cT(g)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(A){return A!==x})},1)},[]),f=E.useCallback(function(h){n.current=Ni(h),r.current=void 0},[]),c=E.useCallback(function(h){u(h.type,vh(h),h.target,s(h,e.lockRef.current))},[]),p=E.useCallback(function(h){u(h.type,Ni(h),h.target,s(h,e.lockRef.current))},[]);E.useEffect(function(){return Cn.push(o),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:p}),document.addEventListener("wheel",l,En),document.addEventListener("touchmove",l,En),document.addEventListener("touchstart",f,En),function(){Cn=Cn.filter(function(h){return h!==o}),document.removeEventListener("wheel",l,En),document.removeEventListener("touchmove",l,En),document.removeEventListener("touchstart",f,En)}},[]);var d=e.removeScrollBar,m=e.inert;return E.createElement(E.Fragment,null,m?E.createElement(o,{styles:sT(i)}):null,d?E.createElement(ZI,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function cT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fT=zI(fh,uT);var xh=E.forwardRef(function(e,t){return E.createElement(_i,ot({},e,{ref:t,sideCar:fT}))});xh.classNames=_i.classNames;var dT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},An=new WeakMap,Li=new WeakMap,Fi={},Ms=0,wh=function(e){return e&&(e.host||wh(e.parentNode))},pT=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=wh(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})},hT=function(e,t,n,r){var i=pT(t,Array.isArray(e)?e:[e]);Fi[n]||(Fi[n]=new WeakMap);var o=Fi[n],a=[],s=new Set,l=new Set(i),u=function(c){!c||s.has(c)||(s.add(c),u(c.parentNode))};i.forEach(u);var f=function(c){!c||l.has(c)||Array.prototype.forEach.call(c.children,function(p){if(s.has(p))f(p);else try{var d=p.getAttribute(r),m=d!==null&&d!=="false",h=(An.get(p)||0)+1,y=(o.get(p)||0)+1;An.set(p,h),o.set(p,y),a.push(p),h===1&&m&&Li.set(p,!0),y===1&&p.setAttribute(n,"true"),m||p.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",p,g)}})};return f(t),s.clear(),Ms++,function(){a.forEach(function(c){var p=An.get(c)-1,d=o.get(c)-1;An.set(c,p),o.set(c,d),p||(Li.has(c)||c.removeAttribute(r),Li.delete(c)),d||c.removeAttribute(n)}),Ms--,Ms||(An=new WeakMap,An=new WeakMap,Li=new WeakMap,Fi={})}},mT=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=dT(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),hT(r,i,n,"aria-hidden")):function(){return null}},Ri="Dialog",[kh]=gp(Ri),[gT,St]=kh(Ri),Sh=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=E.useRef(null),l=E.useRef(null),[u,f]=yp({prop:r,defaultProp:i??!1,onChange:o,caller:Ri});return S.jsx(gT,{scope:t,triggerRef:s,contentRef:l,contentId:wi(),titleId:wi(),descriptionId:wi(),open:u,onOpenChange:f,onOpenToggle:E.useCallback(()=>f(c=>!c),[f]),modal:a,children:n})};Sh.displayName=Ri;var Eh="DialogTrigger",Ch=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=St(Eh,n),o=Ot(t,i.triggerRef);return S.jsx(ht.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ps(i.open),...r,ref:o,onClick:At(e.onClick,i.onOpenToggle)})});Ch.displayName=Eh;var yT="DialogPortal",[FO,Ah]=kh(yT,{forceMount:void 0}),Bi="DialogOverlay",vT=E.forwardRef((e,t)=>{const n=Ah(Bi,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=St(Bi,e.__scopeDialog);return o.modal?S.jsx(bi,{present:r||o.open,children:S.jsx(xT,{...i,ref:t})}):null});vT.displayName=Bi;var bT=vp("DialogOverlay.RemoveScroll"),xT=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=St(Bi,n);return S.jsx(xh,{as:bT,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(ht.div,{"data-state":Ps(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Jt="DialogContent",Ih=E.forwardRef((e,t)=>{const n=Ah(Jt,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=St(Jt,e.__scopeDialog);return S.jsx(bi,{present:r||o.open,children:o.modal?S.jsx(wT,{...i,ref:t}):S.jsx(kT,{...i,ref:t})})});Ih.displayName=Jt;var wT=E.forwardRef((e,t)=>{const n=St(Jt,e.__scopeDialog),r=E.useRef(null),i=Ot(t,n.contentRef,r);return E.useEffect(()=>{const o=r.current;if(o)return mT(o)},[]),S.jsx(Th,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:At(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:At(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:At(e.onFocusOutside,o=>o.preventDefault())})}),kT=E.forwardRef((e,t)=>{const n=St(Jt,e.__scopeDialog),r=E.useRef(!1),i=E.useRef(!1);return S.jsx(Th,{...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,u;(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;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Th=E.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=St(Jt,n),l=E.useRef(null),u=Ot(t,l);return DI(),S.jsxs(S.Fragment,{children:[S.jsx(rh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(Xp,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Ps(s.open),...a,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),S.jsxs(S.Fragment,{children:[S.jsx(ST,{titleId:s.titleId}),S.jsx(CT,{contentRef:l,descriptionId:s.descriptionId})]})]})}),_s="DialogTitle",Oh=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=St(_s,n);return S.jsx(ht.h2,{id:i.titleId,...r,ref:t})});Oh.displayName=_s;var Dh="DialogDescription",Mh=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=St(Dh,n);return S.jsx(ht.p,{id:i.descriptionId,...r,ref:t})});Mh.displayName=Dh;var _h="DialogClose",Ph=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=St(_h,n);return S.jsx(ht.button,{type:"button",...r,ref:t,onClick:At(e.onClick,()=>i.onOpenChange(!1))})});Ph.displayName=_h;function Ps(e){return e?"open":"closed"}var Nh="DialogTitleWarning",[RO,Lh]=BC(Nh,{contentName:Jt,titleName:_s,docsSlug:"dialog"}),ST=({titleId:e})=>{const t=Lh(Nh),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
336
358
 
337
359
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
338
360
 
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"})});
361
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return E.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ET="DialogDescriptionWarning",CT=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Lh(ET).contentName}}.`;return E.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},AT=Sh,IT=Ch,TT=Ih,OT=Oh,DT=Mh,MT=Ph;function In({open:e,onOpenChange:t,children:n}){const{modal:r}=ge;return S.jsxs(AT,{open:e,modal:!1,onOpenChange:t,children:[e&&S.jsx("div",{...r==null?void 0:r.overlay}),n]})}function _T({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(TT,{...s.dialog.container,children:[S.jsx(OT,{...s.dialog.title,children:e}),S.jsx(DT,{...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})]})]})})}In.Button=IT,In.Close=MT,In.Content=_T;const Fh=({ref:e,children:t,onClick:n,avatarUrl:r,botName:i,description:o,onClose:a,...s})=>{const{messagePreview:l}=ge,{container:u,closeButton:f,message:c,avatar:p,description:d}=l??{};return S.jsxs("div",{...s,...u,ref:e,onClick:n,children:[S.jsx(Nn,{src:r,...p,children:i||"Bot"}),S.jsx("p",{...c,children:t}),S.jsx("p",{...d,children:o}),S.jsx(Nl,{...f,onClick:m=>{m.stopPropagation(),a==null||a()}})]})};Fh.displayName="MessagePreview",re.Avatar=Nn,re.BOT_IS_BLOCKED=gl,re.Block=Yt,re.CONFIG_ACCESS_DENIED=Vm,re.Chat=Dp,re.Composer=$a,re.Container=ns,re.ErrorState=Op,re.Fab=mp,re.Header=Ep,re.INVALID_API_URL=pl,re.INVALID_BOTPRESS_URL=ml,re.INVALID_CLIENT_ID=hl,re.INVALID_CONFIGURATION=Wm,re.INVALID_CONFIG_URL=Hm,re.INVALID_MESSAGE_CONTENT_TYPE=bl,re.MISSING_API_URL=$m,re.MISSING_BOT_ID=jm,re.MISSING_CLIENT_ID=dl,re.MISSING_CONFIG_URL=Um,re.Message=Si,re.MessageContext=oa,re.MessageList=fs,re.MessagePreview=Fh,re.Modal=In,re.ModalContext=aa,re.ModalProvider=pp,re.NETWORK_ERROR=Pn,re.NOT_A_PARTICIPANT=Zi,re.QUOTA_EXCEEDED=yl,re.RestartConversationButton=as,re.SOUND_EFFECTS=Gp,re.SSE_DISCONNECTED_ERROR=vl,re.StylesheetProvider=hp,re.TypingIndicator=ss,re.Webchat=hI,re.commonApiErrorMap=eo,re.enrichMessage=Qs,re.fileTypes=cl,re.generateThemeOverride=ul,re.generateThemeStylesheet=ll,re.getUseChatSoundStore=sf,re.getUseWebchatClientStore=of,re.integrationMessagePayloadToBlockPayload=Gc,re.integrationMessageToBlockMessage=Kn,re.isCommonApiErrorType=wl,re.isEventError=Sl,re.isFileType=fl,re.isIntegrationError=kl,re.isWebhookHandlerErrorType=xl,re.mapToWebchatError=Sr,re.renderers=Ad,re.retryWithBackoff=El,re.useMessageContext=lf,re.useModalContext=sa,re.useWebchat=Qp,re.useWebchatStore=sn,re.webchatClasses=ge,re.webhookHandlerErrorMap=Xi,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});