import{r as I,a$ as jn,c5 as _d,a5 as ot,e as m,aH as Lt,A as de,q as ti,c6 as yd,aK as wd,c7 as Ed,P as X,c8 as vd,be as G,l as xt,bb as pa,c9 as Sd,am as ni,an as ri,bt as ae,bd as Wi,bs as Pr,ca as Un,cb as xd,br as kd,cc as Nd,bJ as si,cd as Vn,ce as Gt,cf as Kt,cg as Cd,ch as $r,ci as zr,cj as tt,ck as On,cl as Re,cm as Hr,cn as un,co as fn,cp as sn,cq as Ds,cr as Dn,cs as Td,ct as Md,cu as qi,cv as ha,cw as ii,cx as Ad,cy as Id,cz as Rd,cA as Od,cB as Dd,cC as Ls,cD as Ld,cE as Bd,Q as Wt,cF as kr,cG as ga,B as Ie,cH as ma,cI as ba,cJ as _a,cK as Pd,N as oi,cL as Fr,ax as ya,ay as wa,a3 as $d,T as ze,bU as ai,a7 as Ve,ao as ci,az as Ea,ah as zd,a6 as va,cM as Yi,ac as us,cN as on,w as qt,y as Gn,H as ht,D as gt,f as Ot,g as mt,cO as li,cP as di,i as Dt,k as Kn,cQ as Sa,bV as ui,u as Hd,cR as $t,cS as In,cT as Rn,aI as an,bR as fs,cU as ps,O as Ht,S as mr,X as hs,aq as Zi,aZ as Xi,ak as Fd,al as jd,aN as xa,aB as ka,x as fi,ad as Na,a4 as Ca,G as ft,J as pi,K as hi,b5 as Ud,b6 as Vd,b7 as Gd,cV as gs,b0 as Ta,cW as rt,cX as Kd,_ as Wd,aY as qd,a1 as Yd,cY as Zd,d as Ma,cZ as Qi,a9 as Bs,c_ as Ji,c$ as Xd,a8 as Aa,d0 as Qd,C as Ia,bN as Ra,ab as Oa,b9 as Da,d1 as La,h as Ps,aa as Ba,d2 as Pa,b8 as Jd,aF as $a,d3 as eu,ae as za,d4 as tu,ag as eo,d5 as nu,bZ as ru,d6 as su,d7 as iu,L as ou,b_ as au,b$ as cu,d8 as ms}from"./index-_6SmYgWK.js";import{d as br}from"./ExpandMore-DfVpxsz-.js";import{A as lu}from"./AssistantDialog-CjH6GuIO.js";import{i as Bt,a as to,b as du,d as no}from"./string-BbYD24iH.js";class gi{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new gi}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}let jr=!0,$s=!1;const uu=new gi,fu={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function pu(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&fu[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function hu(e){e.metaKey||e.altKey||e.ctrlKey||(jr=!0)}function bs(){jr=!1}function gu(){this.visibilityState==="hidden"&&$s&&(jr=!0)}function mu(e){e.addEventListener("keydown",hu,!0),e.addEventListener("mousedown",bs,!0),e.addEventListener("pointerdown",bs,!0),e.addEventListener("touchstart",bs,!0),e.addEventListener("visibilitychange",gu,!0)}function bu(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return jr||pu(t)}function _u(){const e=I.useCallback(s=>{s!=null&&mu(s.ownerDocument)},[]),t=I.useRef(!1);function n(){return t.current?($s=!0,uu.start(100,()=>{$s=!1}),t.current=!1,!0):!1}function r(s){return bu(s)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:r,onBlur:n,ref:e}}/**
 * @license @tabler/icons-react v3.31.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var yu=jn("outline","eraser","IconEraser",[["path",{d:"M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3",key:"svg-0"}],["path",{d:"M18 13.3l-6.3 -6.3",key:"svg-1"}]]);/**
 * @license @tabler/icons-react v3.31.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var wu=jn("outline","mail","IconMail",[["path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z",key:"svg-0"}],["path",{d:"M3 7l9 6l9 -6",key:"svg-1"}]]);/**
 * @license @tabler/icons-react v3.31.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var Eu=jn("outline","notebook","IconNotebook",[["path",{d:"M6 4h11a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-11a1 1 0 0 1 -1 -1v-14a1 1 0 0 1 1 -1m3 0v18",key:"svg-0"}],["path",{d:"M13 8l2 0",key:"svg-1"}],["path",{d:"M13 12l2 0",key:"svg-2"}]]);/**
 * @license @tabler/icons-react v3.31.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var vu=jn("outline","report","IconReport",[["path",{d:"M8 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h5.697",key:"svg-0"}],["path",{d:"M18 14v4h4",key:"svg-1"}],["path",{d:"M18 11v-4a2 2 0 0 0 -2 -2h-2",key:"svg-2"}],["path",{d:"M8 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-3"}],["path",{d:"M18 18m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-4"}],["path",{d:"M8 11h4",key:"svg-5"}],["path",{d:"M8 15h3",key:"svg-6"}]]);/**
 * @license @tabler/icons-react v3.31.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var zs=jn("outline","wand","IconWand",[["path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3",key:"svg-0"}],["path",{d:"M15 6l3 3",key:"svg-1"}],["path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2",key:"svg-2"}],["path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2",key:"svg-3"}]]);const Su=Lt(Ed)(({theme:e})=>({border:`1px solid ${e.palette.mode==="light"?"#b4b4b4":"#303030"}`,letterSpacing:"normal","& .MuiDataGrid-columnsContainer":{backgroundColor:e.palette.mode==="light"?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"},"& .MuiDataGrid-columnHeader, .MuiDataGrid-cell":{borderRight:`1px solid ${e.palette.mode==="light"?"#f0f0f0":"#303030"}`},"& .MuiDataGrid-columnsContainer, .MuiDataGrid-cell":{borderBottom:`1px solid ${e.palette.mode==="light"?"#f0f0f0":"#303030"}`},"& .MuiPaginationItem-root":{borderRadius:0},"& .MuiDataGrid-columnHeader:last-child, .MuiDataGrid-cell:last-child":{borderRight:"none"}})),mi=({columns:e,rows:t,style:n,disabled:r=!1,hideFooter:s=!1,onChange:a})=>{const[o,c]=I.useState(_d(t)??[]),l=I.useCallback(T=>()=>{let S=[];c(M=>{let k=[...ot.cloneDeep(M)];return k=k.filter(O=>O.id!==T),S=k,k}),a(JSON.stringify(S))},[]),p=(T=>[...T,{field:"actions",type:"actions",width:80,getActions:S=>[m.jsx(yd,{icon:m.jsx(wd,{}),label:"Delete",onClick:l(S.id)},"Delete")]}])(e),g=T=>{let S=[];return c(M=>{let k=[...ot.cloneDeep(M)];const O=k.findIndex(P=>P.id===T.id);return O>=0&&(k[O]={...T}),S=k,k}),a(JSON.stringify(S)),T},b=()=>{var S;const T={};for(let M=0;M<p.length;M+=1)T[(S=p[M])==null?void 0:S.field]="";return T},_=()=>{c(T=>{let S=[...ot.cloneDeep(T)];const M=S.length?S[S.length-1].id+1:1;return S.push({...b(),id:M}),S})};return m.jsxs(m.Fragment,{children:[o&&p&&m.jsx("div",{style:{marginTop:10,height:210,width:"100%",...n},children:m.jsx(Su,{processRowUpdate:g,isCellEditable:()=>!r,hideFooter:s,onProcessRowUpdateError:T=>console.error(T),rows:o,columns:p})}),!r&&m.jsx(de,{sx:{mt:1},variant:"outlined",onClick:_,startIcon:m.jsx(ti,{}),children:"Add Item"})]})};mi.propTypes={rows:X.array,columns:X.array,style:X.any,disabled:X.bool,hideFooter:X.bool,onChange:X.func};function nt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=nt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var xu={};const ro=e=>{let t;const n=new Set,r=(p,g)=>{const b=typeof p=="function"?p(t):p;if(!Object.is(b,t)){const _=t;t=g??(typeof b!="object"||b===null)?b:Object.assign({},t,b),n.forEach(T=>T(t,_))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>u,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(xu?"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()}},u=t=e(r,s,l);return l},ku=e=>e?ro(e):ro,{useDebugValue:Nu}=G,{useSyncExternalStoreWithSelector:Cu}=vd,Tu=e=>e;function Ha(e,t=Tu,n){const r=Cu(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Nu(r),r}const so=(e,t)=>{const n=ku(e),r=(s,a=t)=>Ha(n,s,a);return Object.assign(r,n),r},Mu=(e,t)=>e?so(e,t):so;function We(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var Au={value:()=>{}};function Ur(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new _r(n)}function _r(e){this._=e}function Iu(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}_r.prototype=Ur.prototype={constructor:_r,on:function(e,t){var n=this._,r=Iu(e+"",n),s,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((s=(e=r[a]).type)&&(s=Ru(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(s=(e=r[a]).type)n[s]=io(n[s],e.name,t);else if(t==null)for(s in n)n[s]=io(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new _r(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,a;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],r=0,s=a.length;r<s;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,a=r.length;s<a;++s)r[s].value.apply(t,n)}};function Ru(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function io(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=Au,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Hs="http://www.w3.org/1999/xhtml";const oo={svg:"http://www.w3.org/2000/svg",xhtml:Hs,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Vr(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),oo.hasOwnProperty(t)?{space:oo[t],local:e}:e}function Ou(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Hs&&t.documentElement.namespaceURI===Hs?t.createElement(e):t.createElementNS(n,e)}}function Du(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Fa(e){var t=Vr(e);return(t.local?Du:Ou)(t)}function Lu(){}function bi(e){return e==null?Lu:function(){return this.querySelector(e)}}function Bu(e){typeof e!="function"&&(e=bi(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var a=t[s],o=a.length,c=r[s]=new Array(o),l,u,p=0;p<o;++p)(l=a[p])&&(u=e.call(l,l.__data__,p,a))&&("__data__"in l&&(u.__data__=l.__data__),c[p]=u);return new Ye(r,this._parents)}function Pu(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function $u(){return[]}function ja(e){return e==null?$u:function(){return this.querySelectorAll(e)}}function zu(e){return function(){return Pu(e.apply(this,arguments))}}function Hu(e){typeof e=="function"?e=zu(e):e=ja(e);for(var t=this._groups,n=t.length,r=[],s=[],a=0;a<n;++a)for(var o=t[a],c=o.length,l,u=0;u<c;++u)(l=o[u])&&(r.push(e.call(l,l.__data__,u,o)),s.push(l));return new Ye(r,s)}function Ua(e){return function(){return this.matches(e)}}function Va(e){return function(t){return t.matches(e)}}var Fu=Array.prototype.find;function ju(e){return function(){return Fu.call(this.children,e)}}function Uu(){return this.firstElementChild}function Vu(e){return this.select(e==null?Uu:ju(typeof e=="function"?e:Va(e)))}var Gu=Array.prototype.filter;function Ku(){return Array.from(this.children)}function Wu(e){return function(){return Gu.call(this.children,e)}}function qu(e){return this.selectAll(e==null?Ku:Wu(typeof e=="function"?e:Va(e)))}function Yu(e){typeof e!="function"&&(e=Ua(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var a=t[s],o=a.length,c=r[s]=[],l,u=0;u<o;++u)(l=a[u])&&e.call(l,l.__data__,u,a)&&c.push(l);return new Ye(r,this._parents)}function Ga(e){return new Array(e.length)}function Zu(){return new Ye(this._enter||this._groups.map(Ga),this._parents)}function Nr(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Nr.prototype={constructor:Nr,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Xu(e){return function(){return e}}function Qu(e,t,n,r,s,a){for(var o=0,c,l=t.length,u=a.length;o<u;++o)(c=t[o])?(c.__data__=a[o],r[o]=c):n[o]=new Nr(e,a[o]);for(;o<l;++o)(c=t[o])&&(s[o]=c)}function Ju(e,t,n,r,s,a,o){var c,l,u=new Map,p=t.length,g=a.length,b=new Array(p),_;for(c=0;c<p;++c)(l=t[c])&&(b[c]=_=o.call(l,l.__data__,c,t)+"",u.has(_)?s[c]=l:u.set(_,l));for(c=0;c<g;++c)_=o.call(e,a[c],c,a)+"",(l=u.get(_))?(r[c]=l,l.__data__=a[c],u.delete(_)):n[c]=new Nr(e,a[c]);for(c=0;c<p;++c)(l=t[c])&&u.get(b[c])===l&&(s[c]=l)}function ef(e){return e.__data__}function tf(e,t){if(!arguments.length)return Array.from(this,ef);var n=t?Ju:Qu,r=this._parents,s=this._groups;typeof e!="function"&&(e=Xu(e));for(var a=s.length,o=new Array(a),c=new Array(a),l=new Array(a),u=0;u<a;++u){var p=r[u],g=s[u],b=g.length,_=nf(e.call(p,p&&p.__data__,u,r)),T=_.length,S=c[u]=new Array(T),M=o[u]=new Array(T),k=l[u]=new Array(b);n(p,g,S,M,k,_,t);for(var O=0,P=0,i,f;O<T;++O)if(i=S[O]){for(O>=P&&(P=O+1);!(f=M[P])&&++P<T;);i._next=f||null}}return o=new Ye(o,r),o._enter=c,o._exit=l,o}function nf(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function rf(){return new Ye(this._exit||this._groups.map(Ga),this._parents)}function sf(e,t,n){var r=this.enter(),s=this,a=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?a.remove():n(a),r&&s?r.merge(s).order():s}function of(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,a=r.length,o=Math.min(s,a),c=new Array(s),l=0;l<o;++l)for(var u=n[l],p=r[l],g=u.length,b=c[l]=new Array(g),_,T=0;T<g;++T)(_=u[T]||p[T])&&(b[T]=_);for(;l<s;++l)c[l]=n[l];return new Ye(c,this._parents)}function af(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,a=r[s],o;--s>=0;)(o=r[s])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function cf(e){e||(e=lf);function t(g,b){return g&&b?e(g.__data__,b.__data__):!g-!b}for(var n=this._groups,r=n.length,s=new Array(r),a=0;a<r;++a){for(var o=n[a],c=o.length,l=s[a]=new Array(c),u,p=0;p<c;++p)(u=o[p])&&(l[p]=u);l.sort(t)}return new Ye(s,this._parents).order()}function lf(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function df(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function uf(){return Array.from(this)}function ff(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,a=r.length;s<a;++s){var o=r[s];if(o)return o}return null}function pf(){let e=0;for(const t of this)++e;return e}function hf(){return!this.node()}function gf(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],a=0,o=s.length,c;a<o;++a)(c=s[a])&&e.call(c,c.__data__,a,s);return this}function mf(e){return function(){this.removeAttribute(e)}}function bf(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _f(e,t){return function(){this.setAttribute(e,t)}}function yf(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function wf(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Ef(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function vf(e,t){var n=Vr(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?bf:mf:typeof t=="function"?n.local?Ef:wf:n.local?yf:_f)(n,t))}function Ka(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Sf(e){return function(){this.style.removeProperty(e)}}function xf(e,t,n){return function(){this.style.setProperty(e,t,n)}}function kf(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Nf(e,t,n){return arguments.length>1?this.each((t==null?Sf:typeof t=="function"?kf:xf)(e,t,n??"")):pn(this.node(),e)}function pn(e,t){return e.style.getPropertyValue(t)||Ka(e).getComputedStyle(e,null).getPropertyValue(t)}function Cf(e){return function(){delete this[e]}}function Tf(e,t){return function(){this[e]=t}}function Mf(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Af(e,t){return arguments.length>1?this.each((t==null?Cf:typeof t=="function"?Mf:Tf)(e,t)):this.node()[e]}function Wa(e){return e.trim().split(/^|\s+/)}function _i(e){return e.classList||new qa(e)}function qa(e){this._node=e,this._names=Wa(e.getAttribute("class")||"")}qa.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Ya(e,t){for(var n=_i(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function Za(e,t){for(var n=_i(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function If(e){return function(){Ya(this,e)}}function Rf(e){return function(){Za(this,e)}}function Of(e,t){return function(){(t.apply(this,arguments)?Ya:Za)(this,e)}}function Df(e,t){var n=Wa(e+"");if(arguments.length<2){for(var r=_i(this.node()),s=-1,a=n.length;++s<a;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?Of:t?If:Rf)(n,t))}function Lf(){this.textContent=""}function Bf(e){return function(){this.textContent=e}}function Pf(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function $f(e){return arguments.length?this.each(e==null?Lf:(typeof e=="function"?Pf:Bf)(e)):this.node().textContent}function zf(){this.innerHTML=""}function Hf(e){return function(){this.innerHTML=e}}function Ff(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function jf(e){return arguments.length?this.each(e==null?zf:(typeof e=="function"?Ff:Hf)(e)):this.node().innerHTML}function Uf(){this.nextSibling&&this.parentNode.appendChild(this)}function Vf(){return this.each(Uf)}function Gf(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Kf(){return this.each(Gf)}function Wf(e){var t=typeof e=="function"?e:Fa(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function qf(){return null}function Yf(e,t){var n=typeof e=="function"?e:Fa(e),r=t==null?qf:typeof t=="function"?t:bi(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Zf(){var e=this.parentNode;e&&e.removeChild(this)}function Xf(){return this.each(Zf)}function Qf(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Jf(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ep(e){return this.select(e?Jf:Qf)}function tp(e){return arguments.length?this.property("__data__",e):this.node().__data__}function np(e){return function(t){e.call(this,t,this.__data__)}}function rp(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function sp(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,a;n<s;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function ip(e,t,n){return function(){var r=this.__on,s,a=np(t);if(r){for(var o=0,c=r.length;o<c;++o)if((s=r[o]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=a,s.options=n),s.value=t;return}}this.addEventListener(e.type,a,n),s={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(s):this.__on=[s]}}function op(e,t,n){var r=rp(e+""),s,a=r.length,o;if(arguments.length<2){var c=this.node().__on;if(c){for(var l=0,u=c.length,p;l<u;++l)for(s=0,p=c[l];s<a;++s)if((o=r[s]).type===p.type&&o.name===p.name)return p.value}return}for(c=t?ip:sp,s=0;s<a;++s)this.each(c(r[s],t,n));return this}function Xa(e,t,n){var r=Ka(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function ap(e,t){return function(){return Xa(this,e,t)}}function cp(e,t){return function(){return Xa(this,e,t.apply(this,arguments))}}function lp(e,t){return this.each((typeof t=="function"?cp:ap)(e,t))}function*dp(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,a=r.length,o;s<a;++s)(o=r[s])&&(yield o)}var Qa=[null];function Ye(e,t){this._groups=e,this._parents=t}function Wn(){return new Ye([[document.documentElement]],Qa)}function up(){return this}Ye.prototype=Wn.prototype={constructor:Ye,select:Bu,selectAll:Hu,selectChild:Vu,selectChildren:qu,filter:Yu,data:tf,enter:Zu,exit:rf,join:sf,merge:of,selection:up,order:af,sort:cf,call:df,nodes:uf,node:ff,size:pf,empty:hf,each:gf,attr:vf,style:Nf,property:Af,classed:Df,text:$f,html:jf,raise:Vf,lower:Kf,append:Wf,insert:Yf,remove:Xf,clone:ep,datum:tp,on:op,dispatch:lp,[Symbol.iterator]:dp};function st(e){return typeof e=="string"?new Ye([[document.querySelector(e)]],[document.documentElement]):new Ye([[e]],Qa)}function fp(e){let t;for(;t=e.sourceEvent;)e=t;return e}function pt(e,t){if(e=fp(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const pp={passive:!1},Ln={capture:!0,passive:!1};function _s(e){e.stopImmediatePropagation()}function cn(e){e.preventDefault(),e.stopImmediatePropagation()}function Ja(e){var t=e.document.documentElement,n=st(e).on("dragstart.drag",cn,Ln);"onselectstart"in t?n.on("selectstart.drag",cn,Ln):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ec(e,t){var n=e.document.documentElement,r=st(e).on("dragstart.drag",null);t&&(r.on("click.drag",cn,Ln),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const nr=e=>()=>e;function Fs(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:a,x:o,y:c,dx:l,dy:u,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:p}})}Fs.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function hp(e){return!e.ctrlKey&&!e.button}function gp(){return this.parentNode}function mp(e,t){return t??{x:e.x,y:e.y}}function bp(){return navigator.maxTouchPoints||"ontouchstart"in this}function _p(){var e=hp,t=gp,n=mp,r=bp,s={},a=Ur("start","drag","end"),o=0,c,l,u,p,g=0;function b(i){i.on("mousedown.drag",_).filter(r).on("touchstart.drag",M).on("touchmove.drag",k,pp).on("touchend.drag touchcancel.drag",O).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(i,f){if(!(p||!e.call(this,i,f))){var d=P(this,t.call(this,i,f),i,f,"mouse");d&&(st(i.view).on("mousemove.drag",T,Ln).on("mouseup.drag",S,Ln),Ja(i.view),_s(i),u=!1,c=i.clientX,l=i.clientY,d("start",i))}}function T(i){if(cn(i),!u){var f=i.clientX-c,d=i.clientY-l;u=f*f+d*d>g}s.mouse("drag",i)}function S(i){st(i.view).on("mousemove.drag mouseup.drag",null),ec(i.view,u),cn(i),s.mouse("end",i)}function M(i,f){if(e.call(this,i,f)){var d=i.changedTouches,y=t.call(this,i,f),w=d.length,v,x;for(v=0;v<w;++v)(x=P(this,y,i,f,d[v].identifier,d[v]))&&(_s(i),x("start",i,d[v]))}}function k(i){var f=i.changedTouches,d=f.length,y,w;for(y=0;y<d;++y)(w=s[f[y].identifier])&&(cn(i),w("drag",i,f[y]))}function O(i){var f=i.changedTouches,d=f.length,y,w;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),y=0;y<d;++y)(w=s[f[y].identifier])&&(_s(i),w("end",i,f[y]))}function P(i,f,d,y,w,v){var x=a.copy(),A=pt(v||d,f),$,D,E;if((E=n.call(i,new Fs("beforestart",{sourceEvent:d,target:b,identifier:w,active:o,x:A[0],y:A[1],dx:0,dy:0,dispatch:x}),y))!=null)return $=E.x-A[0]||0,D=E.y-A[1]||0,function C(h,N,L){var R=A,z;switch(h){case"start":s[w]=C,z=o++;break;case"end":delete s[w],--o;case"drag":A=pt(L||N,f),z=o;break}x.call(h,i,new Fs(h,{sourceEvent:N,subject:E,target:b,identifier:w,active:z,x:A[0]+$,y:A[1]+D,dx:A[0]-R[0],dy:A[1]-R[1],dispatch:x}),y)}}return b.filter=function(i){return arguments.length?(e=typeof i=="function"?i:nr(!!i),b):e},b.container=function(i){return arguments.length?(t=typeof i=="function"?i:nr(i),b):t},b.subject=function(i){return arguments.length?(n=typeof i=="function"?i:nr(i),b):n},b.touchable=function(i){return arguments.length?(r=typeof i=="function"?i:nr(!!i),b):r},b.on=function(){var i=a.on.apply(a,arguments);return i===a?b:i},b.clickDistance=function(i){return arguments.length?(g=(i=+i)*i,b):Math.sqrt(g)},b}var ao=180/Math.PI,js={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tc(e,t,n,r,s,a){var o,c,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(c=Math.sqrt(n*n+r*r))&&(n/=c,r/=c,l/=c),e*r<t*n&&(e=-e,t=-t,l=-l,o=-o),{translateX:s,translateY:a,rotate:Math.atan2(t,e)*ao,skewX:Math.atan(l)*ao,scaleX:o,scaleY:c}}var rr;function yp(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?js:tc(t.a,t.b,t.c,t.d,t.e,t.f)}function wp(e){return e==null||(rr||(rr=document.createElementNS("http://www.w3.org/2000/svg","g")),rr.setAttribute("transform",e),!(e=rr.transform.baseVal.consolidate()))?js:(e=e.matrix,tc(e.a,e.b,e.c,e.d,e.e,e.f))}function nc(e,t,n,r){function s(u){return u.length?u.pop()+" ":""}function a(u,p,g,b,_,T){if(u!==g||p!==b){var S=_.push("translate(",null,t,null,n);T.push({i:S-4,x:Bt(u,g)},{i:S-2,x:Bt(p,b)})}else(g||b)&&_.push("translate("+g+t+b+n)}function o(u,p,g,b){u!==p?(u-p>180?p+=360:p-u>180&&(u+=360),b.push({i:g.push(s(g)+"rotate(",null,r)-2,x:Bt(u,p)})):p&&g.push(s(g)+"rotate("+p+r)}function c(u,p,g,b){u!==p?b.push({i:g.push(s(g)+"skewX(",null,r)-2,x:Bt(u,p)}):p&&g.push(s(g)+"skewX("+p+r)}function l(u,p,g,b,_,T){if(u!==g||p!==b){var S=_.push(s(_)+"scale(",null,",",null,")");T.push({i:S-4,x:Bt(u,g)},{i:S-2,x:Bt(p,b)})}else(g!==1||b!==1)&&_.push(s(_)+"scale("+g+","+b+")")}return function(u,p){var g=[],b=[];return u=e(u),p=e(p),a(u.translateX,u.translateY,p.translateX,p.translateY,g,b),o(u.rotate,p.rotate,g,b),c(u.skewX,p.skewX,g,b),l(u.scaleX,u.scaleY,p.scaleX,p.scaleY,g,b),u=p=null,function(_){for(var T=-1,S=b.length,M;++T<S;)g[(M=b[T]).i]=M.x(_);return g.join("")}}}var Ep=nc(yp,"px, ","px)","deg)"),vp=nc(wp,", ",")",")"),Sp=1e-12;function co(e){return((e=Math.exp(e))+1/e)/2}function xp(e){return((e=Math.exp(e))-1/e)/2}function kp(e){return((e=Math.exp(2*e))-1)/(e+1)}const Np=function e(t,n,r){function s(a,o){var c=a[0],l=a[1],u=a[2],p=o[0],g=o[1],b=o[2],_=p-c,T=g-l,S=_*_+T*T,M,k;if(S<Sp)k=Math.log(b/u)/t,M=function(y){return[c+y*_,l+y*T,u*Math.exp(t*y*k)]};else{var O=Math.sqrt(S),P=(b*b-u*u+r*S)/(2*u*n*O),i=(b*b-u*u-r*S)/(2*b*n*O),f=Math.log(Math.sqrt(P*P+1)-P),d=Math.log(Math.sqrt(i*i+1)-i);k=(d-f)/t,M=function(y){var w=y*k,v=co(f),x=u/(n*O)*(v*kp(t*w+f)-xp(f));return[c+x*_,l+x*T,u*v/co(t*w+f)]}}return M.duration=k*1e3*t/Math.SQRT2,M}return s.rho=function(a){var o=Math.max(.001,+a),c=o*o,l=c*c;return e(o,c,l)},s}(Math.SQRT2,2,4);var hn=0,Mn=0,Sn=0,rc=1e3,Cr,An,Tr=0,Ut=0,Gr=0,Bn=typeof performance=="object"&&performance.now?performance:Date,sc=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function yi(){return Ut||(sc(Cp),Ut=Bn.now()+Gr)}function Cp(){Ut=0}function Mr(){this._call=this._time=this._next=null}Mr.prototype=ic.prototype={constructor:Mr,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?yi():+n)+(t==null?0:+t),!this._next&&An!==this&&(An?An._next=this:Cr=this,An=this),this._call=e,this._time=n,Us()},stop:function(){this._call&&(this._call=null,this._time=1/0,Us())}};function ic(e,t,n){var r=new Mr;return r.restart(e,t,n),r}function Tp(){yi(),++hn;for(var e=Cr,t;e;)(t=Ut-e._time)>=0&&e._call.call(void 0,t),e=e._next;--hn}function lo(){Ut=(Tr=Bn.now())+Gr,hn=Mn=0;try{Tp()}finally{hn=0,Ap(),Ut=0}}function Mp(){var e=Bn.now(),t=e-Tr;t>rc&&(Gr-=t,Tr=e)}function Ap(){for(var e,t=Cr,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Cr=n);An=e,Us(r)}function Us(e){if(!hn){Mn&&(Mn=clearTimeout(Mn));var t=e-Ut;t>24?(e<1/0&&(Mn=setTimeout(lo,e-Bn.now()-Gr)),Sn&&(Sn=clearInterval(Sn))):(Sn||(Tr=Bn.now(),Sn=setInterval(Mp,rc)),hn=1,sc(lo))}}function uo(e,t,n){var r=new Mr;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var Ip=Ur("start","end","cancel","interrupt"),Rp=[],oc=0,fo=1,Vs=2,yr=3,po=4,Gs=5,wr=6;function Kr(e,t,n,r,s,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Op(e,n,{name:t,index:r,group:s,on:Ip,tween:Rp,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:oc})}function wi(e,t){var n=at(e,t);if(n.state>oc)throw new Error("too late; already scheduled");return n}function bt(e,t){var n=at(e,t);if(n.state>yr)throw new Error("too late; already running");return n}function at(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Op(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=ic(a,0,n.time);function a(u){n.state=fo,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var p,g,b,_;if(n.state!==fo)return l();for(p in r)if(_=r[p],_.name===n.name){if(_.state===yr)return uo(o);_.state===po?(_.state=wr,_.timer.stop(),_.on.call("interrupt",e,e.__data__,_.index,_.group),delete r[p]):+p<t&&(_.state=wr,_.timer.stop(),_.on.call("cancel",e,e.__data__,_.index,_.group),delete r[p])}if(uo(function(){n.state===yr&&(n.state=po,n.timer.restart(c,n.delay,n.time),c(u))}),n.state=Vs,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Vs){for(n.state=yr,s=new Array(b=n.tween.length),p=0,g=-1;p<b;++p)(_=n.tween[p].value.call(e,e.__data__,n.index,n.group))&&(s[++g]=_);s.length=g+1}}function c(u){for(var p=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Gs,1),g=-1,b=s.length;++g<b;)s[g].call(e,p);n.state===Gs&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=wr,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Er(e,t){var n=e.__transition,r,s,a=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){a=!1;continue}s=r.state>Vs&&r.state<Gs,r.state=wr,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function Dp(e){return this.each(function(){Er(this,e)})}function Lp(e,t){var n,r;return function(){var s=bt(this,e),a=s.tween;if(a!==n){r=n=a;for(var o=0,c=r.length;o<c;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}s.tween=r}}function Bp(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var a=bt(this,e),o=a.tween;if(o!==r){s=(r=o).slice();for(var c={name:t,value:n},l=0,u=s.length;l<u;++l)if(s[l].name===t){s[l]=c;break}l===u&&s.push(c)}a.tween=s}}function Pp(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=at(this.node(),n).tween,s=0,a=r.length,o;s<a;++s)if((o=r[s]).name===e)return o.value;return null}return this.each((t==null?Lp:Bp)(n,e,t))}function Ei(e,t,n){var r=e._id;return e.each(function(){var s=bt(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return at(s,r).value[t]}}function ac(e,t){var n;return(typeof t=="number"?Bt:t instanceof no?to:(n=no(t))?(t=n,to):du)(e,t)}function $p(e){return function(){this.removeAttribute(e)}}function zp(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Hp(e,t,n){var r,s=n+"",a;return function(){var o=this.getAttribute(e);return o===s?null:o===r?a:a=t(r=o,n)}}function Fp(e,t,n){var r,s=n+"",a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===s?null:o===r?a:a=t(r=o,n)}}function jp(e,t,n){var r,s,a;return function(){var o,c=n(this),l;return c==null?void this.removeAttribute(e):(o=this.getAttribute(e),l=c+"",o===l?null:o===r&&l===s?a:(s=l,a=t(r=o,c)))}}function Up(e,t,n){var r,s,a;return function(){var o,c=n(this),l;return c==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),l=c+"",o===l?null:o===r&&l===s?a:(s=l,a=t(r=o,c)))}}function Vp(e,t){var n=Vr(e),r=n==="transform"?vp:ac;return this.attrTween(e,typeof t=="function"?(n.local?Up:jp)(n,r,Ei(this,"attr."+e,t)):t==null?(n.local?zp:$p)(n):(n.local?Fp:Hp)(n,r,t))}function Gp(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Kp(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Wp(e,t){var n,r;function s(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&Kp(e,a)),n}return s._value=t,s}function qp(e,t){var n,r;function s(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&Gp(e,a)),n}return s._value=t,s}function Yp(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Vr(e);return this.tween(n,(r.local?Wp:qp)(r,t))}function Zp(e,t){return function(){wi(this,e).delay=+t.apply(this,arguments)}}function Xp(e,t){return t=+t,function(){wi(this,e).delay=t}}function Qp(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Zp:Xp)(t,e)):at(this.node(),t).delay}function Jp(e,t){return function(){bt(this,e).duration=+t.apply(this,arguments)}}function eh(e,t){return t=+t,function(){bt(this,e).duration=t}}function th(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Jp:eh)(t,e)):at(this.node(),t).duration}function nh(e,t){if(typeof t!="function")throw new Error;return function(){bt(this,e).ease=t}}function rh(e){var t=this._id;return arguments.length?this.each(nh(t,e)):at(this.node(),t).ease}function sh(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;bt(this,e).ease=n}}function ih(e){if(typeof e!="function")throw new Error;return this.each(sh(this._id,e))}function oh(e){typeof e!="function"&&(e=Ua(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var a=t[s],o=a.length,c=r[s]=[],l,u=0;u<o;++u)(l=a[u])&&e.call(l,l.__data__,u,a)&&c.push(l);return new vt(r,this._parents,this._name,this._id)}function ah(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,a=Math.min(r,s),o=new Array(r),c=0;c<a;++c)for(var l=t[c],u=n[c],p=l.length,g=o[c]=new Array(p),b,_=0;_<p;++_)(b=l[_]||u[_])&&(g[_]=b);for(;c<r;++c)o[c]=t[c];return new vt(o,this._parents,this._name,this._id)}function ch(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function lh(e,t,n){var r,s,a=ch(t)?wi:bt;return function(){var o=a(this,e),c=o.on;c!==r&&(s=(r=c).copy()).on(t,n),o.on=s}}function dh(e,t){var n=this._id;return arguments.length<2?at(this.node(),n).on.on(e):this.each(lh(n,e,t))}function uh(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function fh(){return this.on("end.remove",uh(this._id))}function ph(e){var t=this._name,n=this._id;typeof e!="function"&&(e=bi(e));for(var r=this._groups,s=r.length,a=new Array(s),o=0;o<s;++o)for(var c=r[o],l=c.length,u=a[o]=new Array(l),p,g,b=0;b<l;++b)(p=c[b])&&(g=e.call(p,p.__data__,b,c))&&("__data__"in p&&(g.__data__=p.__data__),u[b]=g,Kr(u[b],t,n,b,u,at(p,n)));return new vt(a,this._parents,t,n)}function hh(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ja(e));for(var r=this._groups,s=r.length,a=[],o=[],c=0;c<s;++c)for(var l=r[c],u=l.length,p,g=0;g<u;++g)if(p=l[g]){for(var b=e.call(p,p.__data__,g,l),_,T=at(p,n),S=0,M=b.length;S<M;++S)(_=b[S])&&Kr(_,t,n,S,b,T);a.push(b),o.push(p)}return new vt(a,o,t,n)}var gh=Wn.prototype.constructor;function mh(){return new gh(this._groups,this._parents)}function bh(e,t){var n,r,s;return function(){var a=pn(this,e),o=(this.style.removeProperty(e),pn(this,e));return a===o?null:a===n&&o===r?s:s=t(n=a,r=o)}}function cc(e){return function(){this.style.removeProperty(e)}}function _h(e,t,n){var r,s=n+"",a;return function(){var o=pn(this,e);return o===s?null:o===r?a:a=t(r=o,n)}}function yh(e,t,n){var r,s,a;return function(){var o=pn(this,e),c=n(this),l=c+"";return c==null&&(l=c=(this.style.removeProperty(e),pn(this,e))),o===l?null:o===r&&l===s?a:(s=l,a=t(r=o,c))}}function wh(e,t){var n,r,s,a="style."+t,o="end."+a,c;return function(){var l=bt(this,e),u=l.on,p=l.value[a]==null?c||(c=cc(t)):void 0;(u!==n||s!==p)&&(r=(n=u).copy()).on(o,s=p),l.on=r}}function Eh(e,t,n){var r=(e+="")=="transform"?Ep:ac;return t==null?this.styleTween(e,bh(e,r)).on("end.style."+e,cc(e)):typeof t=="function"?this.styleTween(e,yh(e,r,Ei(this,"style."+e,t))).each(wh(this._id,e)):this.styleTween(e,_h(e,r,t),n).on("end.style."+e,null)}function vh(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Sh(e,t,n){var r,s;function a(){var o=t.apply(this,arguments);return o!==s&&(r=(s=o)&&vh(e,o,n)),r}return a._value=t,a}function xh(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Sh(e,t,n??""))}function kh(e){return function(){this.textContent=e}}function Nh(e){return function(){var t=e(this);this.textContent=t??""}}function Ch(e){return this.tween("text",typeof e=="function"?Nh(Ei(this,"text",e)):kh(e==null?"":e+""))}function Th(e){return function(t){this.textContent=e.call(this,t)}}function Mh(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&Th(s)),t}return r._value=e,r}function Ah(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Mh(e))}function Ih(){for(var e=this._name,t=this._id,n=lc(),r=this._groups,s=r.length,a=0;a<s;++a)for(var o=r[a],c=o.length,l,u=0;u<c;++u)if(l=o[u]){var p=at(l,t);Kr(l,e,n,u,o,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new vt(r,this._parents,e,n)}function Rh(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(a,o){var c={value:o},l={value:function(){--s===0&&a()}};n.each(function(){var u=bt(this,r),p=u.on;p!==e&&(t=(e=p).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(l)),u.on=t}),s===0&&a()})}var Oh=0;function vt(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function lc(){return++Oh}var wt=Wn.prototype;vt.prototype={constructor:vt,select:ph,selectAll:hh,selectChild:wt.selectChild,selectChildren:wt.selectChildren,filter:oh,merge:ah,selection:mh,transition:Ih,call:wt.call,nodes:wt.nodes,node:wt.node,size:wt.size,empty:wt.empty,each:wt.each,on:dh,attr:Vp,attrTween:Yp,style:Eh,styleTween:xh,text:Ch,textTween:Ah,remove:fh,tween:Pp,delay:Qp,duration:th,ease:rh,easeVarying:ih,end:Rh,[Symbol.iterator]:wt[Symbol.iterator]};function Dh(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Lh={time:null,delay:0,duration:250,ease:Dh};function Bh(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Ph(e){var t,n;e instanceof vt?(t=e._id,e=e._name):(t=lc(),(n=Lh).time=yi(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,a=0;a<s;++a)for(var o=r[a],c=o.length,l,u=0;u<c;++u)(l=o[u])&&Kr(l,e,t,u,o,n||Bh(l,t));return new vt(r,this._parents,e,t)}Wn.prototype.interrupt=Dp;Wn.prototype.transition=Ph;const sr=e=>()=>e;function $h(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Et(e,t,n){this.k=e,this.x=t,this.y=n}Et.prototype={constructor:Et,scale:function(e){return e===1?this:new Et(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Et(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var It=new Et(1,0,0);Et.prototype;function ys(e){e.stopImmediatePropagation()}function xn(e){e.preventDefault(),e.stopImmediatePropagation()}function zh(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Hh(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ho(){return this.__zoom||It}function Fh(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function jh(){return navigator.maxTouchPoints||"ontouchstart"in this}function Uh(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Vh(){var e=zh,t=Hh,n=Uh,r=Fh,s=jh,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],c=250,l=Np,u=Ur("start","zoom","end"),p,g,b,_=500,T=150,S=0,M=10;function k(E){E.property("__zoom",ho).on("wheel.zoom",w,{passive:!1}).on("mousedown.zoom",v).on("dblclick.zoom",x).filter(s).on("touchstart.zoom",A).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",D).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(E,C,h,N){var L=E.selection?E.selection():E;L.property("__zoom",ho),E!==L?f(E,C,h,N):L.interrupt().each(function(){d(this,arguments).event(N).start().zoom(null,typeof C=="function"?C.apply(this,arguments):C).end()})},k.scaleBy=function(E,C,h,N){k.scaleTo(E,function(){var L=this.__zoom.k,R=typeof C=="function"?C.apply(this,arguments):C;return L*R},h,N)},k.scaleTo=function(E,C,h,N){k.transform(E,function(){var L=t.apply(this,arguments),R=this.__zoom,z=h==null?i(L):typeof h=="function"?h.apply(this,arguments):h,B=R.invert(z),H=typeof C=="function"?C.apply(this,arguments):C;return n(P(O(R,H),z,B),L,o)},h,N)},k.translateBy=function(E,C,h,N){k.transform(E,function(){return n(this.__zoom.translate(typeof C=="function"?C.apply(this,arguments):C,typeof h=="function"?h.apply(this,arguments):h),t.apply(this,arguments),o)},null,N)},k.translateTo=function(E,C,h,N,L){k.transform(E,function(){var R=t.apply(this,arguments),z=this.__zoom,B=N==null?i(R):typeof N=="function"?N.apply(this,arguments):N;return n(It.translate(B[0],B[1]).scale(z.k).translate(typeof C=="function"?-C.apply(this,arguments):-C,typeof h=="function"?-h.apply(this,arguments):-h),R,o)},N,L)};function O(E,C){return C=Math.max(a[0],Math.min(a[1],C)),C===E.k?E:new Et(C,E.x,E.y)}function P(E,C,h){var N=C[0]-h[0]*E.k,L=C[1]-h[1]*E.k;return N===E.x&&L===E.y?E:new Et(E.k,N,L)}function i(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function f(E,C,h,N){E.on("start.zoom",function(){d(this,arguments).event(N).start()}).on("interrupt.zoom end.zoom",function(){d(this,arguments).event(N).end()}).tween("zoom",function(){var L=this,R=arguments,z=d(L,R).event(N),B=t.apply(L,R),H=h==null?i(B):typeof h=="function"?h.apply(L,R):h,j=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),V=L.__zoom,W=typeof C=="function"?C.apply(L,R):C,ne=l(V.invert(H).concat(j/V.k),W.invert(H).concat(j/W.k));return function(Z){if(Z===1)Z=W;else{var q=ne(Z),ie=j/q[2];Z=new Et(ie,H[0]-q[0]*ie,H[1]-q[1]*ie)}z.zoom(null,Z)}})}function d(E,C,h){return!h&&E.__zooming||new y(E,C)}function y(E,C){this.that=E,this.args=C,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,C),this.taps=0}y.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,C){return this.mouse&&E!=="mouse"&&(this.mouse[1]=C.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=C.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=C.invert(this.touch1[0])),this.that.__zoom=C,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var C=st(this.that).datum();u.call(E,this.that,new $h(E,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:u}),C)}};function w(E,...C){if(!e.apply(this,arguments))return;var h=d(this,C).event(E),N=this.__zoom,L=Math.max(a[0],Math.min(a[1],N.k*Math.pow(2,r.apply(this,arguments)))),R=pt(E);if(h.wheel)(h.mouse[0][0]!==R[0]||h.mouse[0][1]!==R[1])&&(h.mouse[1]=N.invert(h.mouse[0]=R)),clearTimeout(h.wheel);else{if(N.k===L)return;h.mouse=[R,N.invert(R)],Er(this),h.start()}xn(E),h.wheel=setTimeout(z,T),h.zoom("mouse",n(P(O(N,L),h.mouse[0],h.mouse[1]),h.extent,o));function z(){h.wheel=null,h.end()}}function v(E,...C){if(b||!e.apply(this,arguments))return;var h=E.currentTarget,N=d(this,C,!0).event(E),L=st(E.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",j,!0),R=pt(E,h),z=E.clientX,B=E.clientY;Ja(E.view),ys(E),N.mouse=[R,this.__zoom.invert(R)],Er(this),N.start();function H(V){if(xn(V),!N.moved){var W=V.clientX-z,ne=V.clientY-B;N.moved=W*W+ne*ne>S}N.event(V).zoom("mouse",n(P(N.that.__zoom,N.mouse[0]=pt(V,h),N.mouse[1]),N.extent,o))}function j(V){L.on("mousemove.zoom mouseup.zoom",null),ec(V.view,N.moved),xn(V),N.event(V).end()}}function x(E,...C){if(e.apply(this,arguments)){var h=this.__zoom,N=pt(E.changedTouches?E.changedTouches[0]:E,this),L=h.invert(N),R=h.k*(E.shiftKey?.5:2),z=n(P(O(h,R),N,L),t.apply(this,C),o);xn(E),c>0?st(this).transition().duration(c).call(f,z,N,E):st(this).call(k.transform,z,N,E)}}function A(E,...C){if(e.apply(this,arguments)){var h=E.touches,N=h.length,L=d(this,C,E.changedTouches.length===N).event(E),R,z,B,H;for(ys(E),z=0;z<N;++z)B=h[z],H=pt(B,this),H=[H,this.__zoom.invert(H),B.identifier],L.touch0?!L.touch1&&L.touch0[2]!==H[2]&&(L.touch1=H,L.taps=0):(L.touch0=H,R=!0,L.taps=1+!!p);p&&(p=clearTimeout(p)),R&&(L.taps<2&&(g=H[0],p=setTimeout(function(){p=null},_)),Er(this),L.start())}}function $(E,...C){if(this.__zooming){var h=d(this,C).event(E),N=E.changedTouches,L=N.length,R,z,B,H;for(xn(E),R=0;R<L;++R)z=N[R],B=pt(z,this),h.touch0&&h.touch0[2]===z.identifier?h.touch0[0]=B:h.touch1&&h.touch1[2]===z.identifier&&(h.touch1[0]=B);if(z=h.that.__zoom,h.touch1){var j=h.touch0[0],V=h.touch0[1],W=h.touch1[0],ne=h.touch1[1],Z=(Z=W[0]-j[0])*Z+(Z=W[1]-j[1])*Z,q=(q=ne[0]-V[0])*q+(q=ne[1]-V[1])*q;z=O(z,Math.sqrt(Z/q)),B=[(j[0]+W[0])/2,(j[1]+W[1])/2],H=[(V[0]+ne[0])/2,(V[1]+ne[1])/2]}else if(h.touch0)B=h.touch0[0],H=h.touch0[1];else return;h.zoom("touch",n(P(z,B,H),h.extent,o))}}function D(E,...C){if(this.__zooming){var h=d(this,C).event(E),N=E.changedTouches,L=N.length,R,z;for(ys(E),b&&clearTimeout(b),b=setTimeout(function(){b=null},_),R=0;R<L;++R)z=N[R],h.touch0&&h.touch0[2]===z.identifier?delete h.touch0:h.touch1&&h.touch1[2]===z.identifier&&delete h.touch1;if(h.touch1&&!h.touch0&&(h.touch0=h.touch1,delete h.touch1),h.touch0)h.touch0[1]=this.__zoom.invert(h.touch0[0]);else if(h.end(),h.taps===2&&(z=pt(z,this),Math.hypot(g[0]-z[0],g[1]-z[1])<M)){var B=st(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return k.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:sr(+E),k):r},k.filter=function(E){return arguments.length?(e=typeof E=="function"?E:sr(!!E),k):e},k.touchable=function(E){return arguments.length?(s=typeof E=="function"?E:sr(!!E),k):s},k.extent=function(E){return arguments.length?(t=typeof E=="function"?E:sr([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),k):t},k.scaleExtent=function(E){return arguments.length?(a[0]=+E[0],a[1]=+E[1],k):[a[0],a[1]]},k.translateExtent=function(E){return arguments.length?(o[0][0]=+E[0][0],o[1][0]=+E[1][0],o[0][1]=+E[0][1],o[1][1]=+E[1][1],k):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},k.constrain=function(E){return arguments.length?(n=E,k):n},k.duration=function(E){return arguments.length?(c=+E,k):c},k.interpolate=function(E){return arguments.length?(l=E,k):l},k.on=function(){var E=u.on.apply(u,arguments);return E===u?k:E},k.clickDistance=function(E){return arguments.length?(S=(E=+E)*E,k):Math.sqrt(S)},k.tapDistance=function(E){return arguments.length?(M=+E,k):M},k}const Wr=I.createContext(null),Gh=Wr.Provider,St={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},dc=St.error001();function Te(e,t){const n=I.useContext(Wr);if(n===null)throw new Error(dc);return Ha(n,e,t)}const Pe=()=>{const e=I.useContext(Wr);if(e===null)throw new Error(dc);return I.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},Kh=e=>e.userSelectionActive?"none":"all";function Wh({position:e,children:t,className:n,style:r,...s}){const a=Te(Kh),o=`${e}`.split("-");return G.createElement("div",{className:nt(["react-flow__panel",n,...o]),style:{...r,pointerEvents:a},...s},t)}function qh({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:G.createElement(Wh,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},G.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const Yh=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:s=!0,labelBgStyle:a={},labelBgPadding:o=[2,4],labelBgBorderRadius:c=2,children:l,className:u,...p})=>{const g=I.useRef(null),[b,_]=I.useState({x:0,y:0,width:0,height:0}),T=nt(["react-flow__edge-textwrapper",u]);return I.useEffect(()=>{if(g.current){const S=g.current.getBBox();_({x:S.x,y:S.y,width:S.width,height:S.height})}},[n]),typeof n>"u"||!n?null:G.createElement("g",{transform:`translate(${e-b.width/2} ${t-b.height/2})`,className:T,visibility:b.width?"visible":"hidden",...p},s&&G.createElement("rect",{width:b.width+2*o[0],x:-o[0],y:-o[1],height:b.height+2*o[1],className:"react-flow__edge-textbg",style:a,rx:c,ry:c}),G.createElement("text",{className:"react-flow__edge-text",y:b.height/2,dy:"0.3em",ref:g,style:r},n),l)};var Zh=I.memo(Yh);const vi=e=>({width:e.offsetWidth,height:e.offsetHeight}),gn=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Si=(e={x:0,y:0},t)=>({x:gn(e.x,t[0][0],t[1][0]),y:gn(e.y,t[0][1],t[1][1])}),go=(e,t,n)=>e<t?gn(Math.abs(e-t),1,50)/50:e>n?-gn(Math.abs(e-n),1,50)/50:0,uc=(e,t)=>{const n=go(e.x,35,t.width-35)*20,r=go(e.y,35,t.height-35)*20;return[n,r]},fc=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},pc=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Pn=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),hc=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),mo=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),$0=(e,t)=>hc(pc(Pn(e),Pn(t))),Ks=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Xh=e=>et(e.width)&&et(e.height)&&et(e.x)&&et(e.y),et=e=>!isNaN(e)&&isFinite(e),Oe=Symbol.for("internals"),gc=["Enter"," ","Escape"],Qh=(e,t)=>{},Jh=e=>"nativeEvent"in e;function Ws(e){var s,a;const t=Jh(e)?e.nativeEvent:e,n=((a=(s=t.composedPath)==null?void 0:s.call(t))==null?void 0:a[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const mc=e=>"clientX"in e,Rt=(e,t)=>{var a,o;const n=mc(e),r=n?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,s=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},Ar=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},qn=({id:e,path:t,labelX:n,labelY:r,label:s,labelStyle:a,labelShowBg:o,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:u,style:p,markerEnd:g,markerStart:b,interactionWidth:_=20})=>G.createElement(G.Fragment,null,G.createElement("path",{id:e,style:p,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:g,markerStart:b}),_&&G.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:_,className:"react-flow__edge-interaction"}),s&&et(n)&&et(r)?G.createElement(Zh,{x:n,y:r,label:s,labelStyle:a,labelShowBg:o,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:u}):null);qn.displayName="BaseEdge";function kn(e,t,n){return n===void 0?n:r=>{const s=t().edges.find(a=>a.id===e);s&&n(r,{...s})}}function bc({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,a=n<e?n+s:n-s,o=Math.abs(r-t)/2,c=r<t?r+o:r-o;return[a,c,s,o]}function _c({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:o,targetControlY:c}){const l=e*.125+s*.375+o*.375+n*.125,u=t*.125+a*.375+c*.375+r*.125,p=Math.abs(l-e),g=Math.abs(u-t);return[l,u,p,g]}var Vt;(function(e){e.Strict="strict",e.Loose="loose"})(Vt||(Vt={}));var zt;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(zt||(zt={}));var $n;(function(e){e.Partial="partial",e.Full="full"})($n||($n={}));var Mt;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Mt||(Mt={}));var Ir;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ir||(Ir={}));var re;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(re||(re={}));function bo({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===re.Left||e===re.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function yc({sourceX:e,sourceY:t,sourcePosition:n=re.Bottom,targetX:r,targetY:s,targetPosition:a=re.Top}){const[o,c]=bo({pos:n,x1:e,y1:t,x2:r,y2:s}),[l,u]=bo({pos:a,x1:r,y1:s,x2:e,y2:t}),[p,g,b,_]=_c({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:o,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${o},${c} ${l},${u} ${r},${s}`,p,g,b,_]}const xi=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:s=re.Bottom,targetPosition:a=re.Top,label:o,labelStyle:c,labelShowBg:l,labelBgStyle:u,labelBgPadding:p,labelBgBorderRadius:g,style:b,markerEnd:_,markerStart:T,interactionWidth:S})=>{const[M,k,O]=yc({sourceX:e,sourceY:t,sourcePosition:s,targetX:n,targetY:r,targetPosition:a});return G.createElement(qn,{path:M,labelX:k,labelY:O,label:o,labelStyle:c,labelShowBg:l,labelBgStyle:u,labelBgPadding:p,labelBgBorderRadius:g,style:b,markerEnd:_,markerStart:T,interactionWidth:S})});xi.displayName="SimpleBezierEdge";const _o={[re.Left]:{x:-1,y:0},[re.Right]:{x:1,y:0},[re.Top]:{x:0,y:-1},[re.Bottom]:{x:0,y:1}},eg=({source:e,sourcePosition:t=re.Bottom,target:n})=>t===re.Left||t===re.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},yo=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function tg({source:e,sourcePosition:t=re.Bottom,target:n,targetPosition:r=re.Top,center:s,offset:a}){const o=_o[t],c=_o[r],l={x:e.x+o.x*a,y:e.y+o.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},p=eg({source:l,sourcePosition:t,target:u}),g=p.x!==0?"x":"y",b=p[g];let _=[],T,S;const M={x:0,y:0},k={x:0,y:0},[O,P,i,f]=bc({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[g]*c[g]===-1){T=s.x||O,S=s.y||P;const y=[{x:T,y:l.y},{x:T,y:u.y}],w=[{x:l.x,y:S},{x:u.x,y:S}];o[g]===b?_=g==="x"?y:w:_=g==="x"?w:y}else{const y=[{x:l.x,y:u.y}],w=[{x:u.x,y:l.y}];if(g==="x"?_=o.x===b?w:y:_=o.y===b?y:w,t===r){const D=Math.abs(e[g]-n[g]);if(D<=a){const E=Math.min(a-1,a-D);o[g]===b?M[g]=(l[g]>e[g]?-1:1)*E:k[g]=(u[g]>n[g]?-1:1)*E}}if(t!==r){const D=g==="x"?"y":"x",E=o[g]===c[D],C=l[D]>u[D],h=l[D]<u[D];(o[g]===1&&(!E&&C||E&&h)||o[g]!==1&&(!E&&h||E&&C))&&(_=g==="x"?y:w)}const v={x:l.x+M.x,y:l.y+M.y},x={x:u.x+k.x,y:u.y+k.y},A=Math.max(Math.abs(v.x-_[0].x),Math.abs(x.x-_[0].x)),$=Math.max(Math.abs(v.y-_[0].y),Math.abs(x.y-_[0].y));A>=$?(T=(v.x+x.x)/2,S=_[0].y):(T=_[0].x,S=(v.y+x.y)/2)}return[[e,{x:l.x+M.x,y:l.y+M.y},..._,{x:u.x+k.x,y:u.y+k.y},n],T,S,i,f]}function ng(e,t,n,r){const s=Math.min(yo(e,t)/2,yo(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){const u=e.x<n.x?-1:1,p=e.y<n.y?1:-1;return`L ${a+s*u},${o}Q ${a},${o} ${a},${o+s*p}`}const c=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${a},${o+s*l}Q ${a},${o} ${a+s*c},${o}`}function qs({sourceX:e,sourceY:t,sourcePosition:n=re.Bottom,targetX:r,targetY:s,targetPosition:a=re.Top,borderRadius:o=5,centerX:c,centerY:l,offset:u=20}){const[p,g,b,_,T]=tg({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:a,center:{x:c,y:l},offset:u});return[p.reduce((M,k,O)=>{let P="";return O>0&&O<p.length-1?P=ng(p[O-1],k,p[O+1],o):P=`${O===0?"M":"L"}${k.x} ${k.y}`,M+=P,M},""),g,b,_,T]}const qr=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:s,labelStyle:a,labelShowBg:o,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:u,style:p,sourcePosition:g=re.Bottom,targetPosition:b=re.Top,markerEnd:_,markerStart:T,pathOptions:S,interactionWidth:M})=>{const[k,O,P]=qs({sourceX:e,sourceY:t,sourcePosition:g,targetX:n,targetY:r,targetPosition:b,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset});return G.createElement(qn,{path:k,labelX:O,labelY:P,label:s,labelStyle:a,labelShowBg:o,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:u,style:p,markerEnd:_,markerStart:T,interactionWidth:M})});qr.displayName="SmoothStepEdge";const ki=I.memo(e=>{var t;return G.createElement(qr,{...e,pathOptions:I.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});ki.displayName="StepEdge";function rg({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,a,o,c]=bc({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,a,o,c]}const Ni=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:s,labelStyle:a,labelShowBg:o,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:u,style:p,markerEnd:g,markerStart:b,interactionWidth:_})=>{const[T,S,M]=rg({sourceX:e,sourceY:t,targetX:n,targetY:r});return G.createElement(qn,{path:T,labelX:S,labelY:M,label:s,labelStyle:a,labelShowBg:o,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:u,style:p,markerEnd:g,markerStart:b,interactionWidth:_})});Ni.displayName="StraightEdge";function ir(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function wo({pos:e,x1:t,y1:n,x2:r,y2:s,c:a}){switch(e){case re.Left:return[t-ir(t-r,a),n];case re.Right:return[t+ir(r-t,a),n];case re.Top:return[t,n-ir(n-s,a)];case re.Bottom:return[t,n+ir(s-n,a)]}}function wc({sourceX:e,sourceY:t,sourcePosition:n=re.Bottom,targetX:r,targetY:s,targetPosition:a=re.Top,curvature:o=.25}){const[c,l]=wo({pos:n,x1:e,y1:t,x2:r,y2:s,c:o}),[u,p]=wo({pos:a,x1:r,y1:s,x2:e,y2:t,c:o}),[g,b,_,T]=_c({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:c,sourceControlY:l,targetControlX:u,targetControlY:p});return[`M${e},${t} C${c},${l} ${u},${p} ${r},${s}`,g,b,_,T]}const Rr=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:s=re.Bottom,targetPosition:a=re.Top,label:o,labelStyle:c,labelShowBg:l,labelBgStyle:u,labelBgPadding:p,labelBgBorderRadius:g,style:b,markerEnd:_,markerStart:T,pathOptions:S,interactionWidth:M})=>{const[k,O,P]=wc({sourceX:e,sourceY:t,sourcePosition:s,targetX:n,targetY:r,targetPosition:a,curvature:S==null?void 0:S.curvature});return G.createElement(qn,{path:k,labelX:O,labelY:P,label:o,labelStyle:c,labelShowBg:l,labelBgStyle:u,labelBgPadding:p,labelBgBorderRadius:g,style:b,markerEnd:_,markerStart:T,interactionWidth:M})});Rr.displayName="BezierEdge";const Ci=I.createContext(null),sg=Ci.Provider;Ci.Consumer;const ig=()=>I.useContext(Ci),og=e=>"id"in e&&"source"in e&&"target"in e,ag=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,Ys=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,cg=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),lg=(e,t)=>{if(!e.source||!e.target)return t;let n;return og(e)?n={...e}:n={...e,id:ag(e)},cg(n,t)?t:t.concat(n)},Zs=({x:e,y:t},[n,r,s],a,[o,c])=>{const l={x:(e-n)/s,y:(t-r)/s};return a?{x:o*Math.round(l.x/o),y:c*Math.round(l.y/c)}:l},Ec=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r}),ln=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],s={x:e.position.x-n,y:e.position.y-r};return{...s,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:s}},Ti=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const{x:a,y:o}=ln(s,t).positionAbsolute;return pc(r,Pn({x:a,y:o,width:s.width||0,height:s.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return hc(n)},vc=(e,t,[n,r,s]=[0,0,1],a=!1,o=!1,c=[0,0])=>{const l={x:(t.x-n)/s,y:(t.y-r)/s,width:t.width/s,height:t.height/s},u=[];return e.forEach(p=>{const{width:g,height:b,selectable:_=!0,hidden:T=!1}=p;if(o&&!_||T)return!1;const{positionAbsolute:S}=ln(p,c),M={x:S.x,y:S.y,width:g||0,height:b||0},k=Ks(l,M),O=typeof g>"u"||typeof b>"u"||g===null||b===null,P=a&&k>0,i=(g||0)*(b||0);(O||P||k>=i||p.dragging)&&u.push(p)}),u},Sc=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},xc=(e,t,n,r,s,a=.1)=>{const o=t/(e.width*(1+a)),c=n/(e.height*(1+a)),l=Math.min(o,c),u=gn(l,r,s),p=e.x+e.width/2,g=e.y+e.height/2,b=t/2-p*u,_=n/2-g*u;return{x:b,y:_,zoom:u}},Pt=(e,t=0)=>e.transition().duration(t);function Eo(e,t,n,r){return(t[n]||[]).reduce((s,a)=>{var o,c;return`${e.id}-${a.id}-${n}`!==r&&s.push({id:a.id||null,type:n,nodeId:e.id,x:(((o=e.positionAbsolute)==null?void 0:o.x)??0)+a.x+a.width/2,y:(((c=e.positionAbsolute)==null?void 0:c.y)??0)+a.y+a.height/2}),s},[])}function dg(e,t,n,r,s,a){const{x:o,y:c}=Rt(e),u=t.elementsFromPoint(o,c).find(T=>T.classList.contains("react-flow__handle"));if(u){const T=u.getAttribute("data-nodeid");if(T){const S=Mi(void 0,u),M=u.getAttribute("data-handleid"),k=a({nodeId:T,id:M,type:S});if(k){const O=s.find(P=>P.nodeId===T&&P.type===S&&P.id===M);return{handle:{id:M,type:S,nodeId:T,x:(O==null?void 0:O.x)||n.x,y:(O==null?void 0:O.y)||n.y},validHandleResult:k}}}}let p=[],g=1/0;if(s.forEach(T=>{const S=Math.sqrt((T.x-n.x)**2+(T.y-n.y)**2);if(S<=r){const M=a(T);S<=g&&(S<g?p=[{handle:T,validHandleResult:M}]:S===g&&p.push({handle:T,validHandleResult:M}),g=S)}}),!p.length)return{handle:null,validHandleResult:kc()};if(p.length===1)return p[0];const b=p.some(({validHandleResult:T})=>T.isValid),_=p.some(({handle:T})=>T.type==="target");return p.find(({handle:T,validHandleResult:S})=>_?T.type==="target":b?S.isValid:!0)||p[0]}const ug={source:null,target:null,sourceHandle:null,targetHandle:null},kc=()=>({handleDomNode:null,isValid:!1,connection:ug,endHandle:null});function Nc(e,t,n,r,s,a,o){const c=s==="target",l=o.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),u={...kc(),handleDomNode:l};if(l){const p=Mi(void 0,l),g=l.getAttribute("data-nodeid"),b=l.getAttribute("data-handleid"),_=l.classList.contains("connectable"),T=l.classList.contains("connectableend"),S={source:c?g:n,sourceHandle:c?b:r,target:c?n:g,targetHandle:c?r:b};u.connection=S,_&&T&&(t===Vt.Strict?c&&p==="source"||!c&&p==="target":g!==n||b!==r)&&(u.endHandle={nodeId:g,handleId:b,type:p},u.isValid=a(S))}return u}function fg({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((s,a)=>{if(a[Oe]){const{handleBounds:o}=a[Oe];let c=[],l=[];o&&(c=Eo(a,o,"source",`${t}-${n}-${r}`),l=Eo(a,o,"target",`${t}-${n}-${r}`)),s.push(...c,...l)}return s},[])}function Mi(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function ws(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function pg(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Cc({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:s,getState:a,setState:o,isValidConnection:c,edgeUpdaterType:l,onEdgeUpdateEnd:u}){const p=fc(e.target),{connectionMode:g,domNode:b,autoPanOnConnect:_,connectionRadius:T,onConnectStart:S,panBy:M,getNodes:k,cancelConnection:O}=a();let P=0,i;const{x:f,y:d}=Rt(e),y=p==null?void 0:p.elementFromPoint(f,d),w=Mi(l,y),v=b==null?void 0:b.getBoundingClientRect();if(!v||!w)return;let x,A=Rt(e,v),$=!1,D=null,E=!1,C=null;const h=fg({nodes:k(),nodeId:n,handleId:t,handleType:w}),N=()=>{if(!_)return;const[z,B]=uc(A,v);M({x:z,y:B}),P=requestAnimationFrame(N)};o({connectionPosition:A,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:w,connectionStartHandle:{nodeId:n,handleId:t,type:w},connectionEndHandle:null}),S==null||S(e,{nodeId:n,handleId:t,handleType:w});function L(z){const{transform:B}=a();A=Rt(z,v);const{handle:H,validHandleResult:j}=dg(z,p,Zs(A,B,!1,[1,1]),T,h,V=>Nc(V,g,n,t,s?"target":"source",c,p));if(i=H,$||(N(),$=!0),C=j.handleDomNode,D=j.connection,E=j.isValid,o({connectionPosition:i&&E?Ec({x:i.x,y:i.y},B):A,connectionStatus:pg(!!i,E),connectionEndHandle:j.endHandle}),!i&&!E&&!C)return ws(x);D.source!==D.target&&C&&(ws(x),x=C,C.classList.add("connecting","react-flow__handle-connecting"),C.classList.toggle("valid",E),C.classList.toggle("react-flow__handle-valid",E))}function R(z){var B,H;(i||C)&&D&&E&&(r==null||r(D)),(H=(B=a()).onConnectEnd)==null||H.call(B,z),l&&(u==null||u(z)),ws(x),O(),cancelAnimationFrame(P),$=!1,E=!1,D=null,C=null,p.removeEventListener("mousemove",L),p.removeEventListener("mouseup",R),p.removeEventListener("touchmove",L),p.removeEventListener("touchend",R)}p.addEventListener("mousemove",L),p.addEventListener("mouseup",R),p.addEventListener("touchmove",L),p.addEventListener("touchend",R)}const vo=()=>!0,hg=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),gg=(e,t,n)=>r=>{const{connectionStartHandle:s,connectionEndHandle:a,connectionClickStartHandle:o}=r;return{connecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n||(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.handleId)===t&&(a==null?void 0:a.type)===n,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n}},Tc=I.forwardRef(({type:e="source",position:t=re.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:a=!0,id:o,onConnect:c,children:l,className:u,onMouseDown:p,onTouchStart:g,...b},_)=>{var v,x;const T=o||null,S=e==="target",M=Pe(),k=ig(),{connectOnClick:O,noPanClassName:P}=Te(hg,We),{connecting:i,clickConnecting:f}=Te(gg(k,T,e),We);k||(x=(v=M.getState()).onError)==null||x.call(v,"010",St.error010());const d=A=>{const{defaultEdgeOptions:$,onConnect:D,hasDefaultEdges:E}=M.getState(),C={...$,...A};if(E){const{edges:h,setEdges:N}=M.getState();N(lg(C,h))}D==null||D(C),c==null||c(C)},y=A=>{if(!k)return;const $=mc(A);s&&($&&A.button===0||!$)&&Cc({event:A,handleId:T,nodeId:k,onConnect:d,isTarget:S,getState:M.getState,setState:M.setState,isValidConnection:n||M.getState().isValidConnection||vo}),$?p==null||p(A):g==null||g(A)},w=A=>{const{onClickConnectStart:$,onClickConnectEnd:D,connectionClickStartHandle:E,connectionMode:C,isValidConnection:h}=M.getState();if(!k||!E&&!s)return;if(!E){$==null||$(A,{nodeId:k,handleId:T,handleType:e}),M.setState({connectionClickStartHandle:{nodeId:k,type:e,handleId:T}});return}const N=fc(A.target),L=n||h||vo,{connection:R,isValid:z}=Nc({nodeId:k,id:T,type:e},C,E.nodeId,E.handleId||null,E.type,L,N);z&&d(R),D==null||D(A),M.setState({connectionClickStartHandle:null})};return G.createElement("div",{"data-handleid":T,"data-nodeid":k,"data-handlepos":t,"data-id":`${k}-${T}-${e}`,className:nt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",P,u,{source:!S,target:S,connectable:r,connectablestart:s,connectableend:a,connecting:f,connectionindicator:r&&(s&&!i||a&&i)}]),onMouseDown:y,onTouchStart:y,onClick:O?w:void 0,ref:_,...b},l)});Tc.displayName="Handle";var mn=I.memo(Tc);const Mc=({data:e,isConnectable:t,targetPosition:n=re.Top,sourcePosition:r=re.Bottom})=>G.createElement(G.Fragment,null,G.createElement(mn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,G.createElement(mn,{type:"source",position:r,isConnectable:t}));Mc.displayName="DefaultNode";var Xs=I.memo(Mc);const Ac=({data:e,isConnectable:t,sourcePosition:n=re.Bottom})=>G.createElement(G.Fragment,null,e==null?void 0:e.label,G.createElement(mn,{type:"source",position:n,isConnectable:t}));Ac.displayName="InputNode";var Ic=I.memo(Ac);const Rc=({data:e,isConnectable:t,targetPosition:n=re.Top})=>G.createElement(G.Fragment,null,G.createElement(mn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);Rc.displayName="OutputNode";var Oc=I.memo(Rc);const Ai=()=>null;Ai.displayName="GroupNode";const mg=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),or=e=>e.id;function bg(e,t){return We(e.selectedNodes.map(or),t.selectedNodes.map(or))&&We(e.selectedEdges.map(or),t.selectedEdges.map(or))}const Dc=I.memo(({onSelectionChange:e})=>{const t=Pe(),{selectedNodes:n,selectedEdges:r}=Te(mg,bg);return I.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChange.forEach(a=>a(s))},[n,r,e]),null});Dc.displayName="SelectionListener";const _g=e=>!!e.onSelectionChange;function yg({onSelectionChange:e}){const t=Te(_g);return e||t?G.createElement(Dc,{onSelectionChange:e}):null}const wg=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function Zt(e,t){I.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function le(e,t,n){I.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const Eg=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:s,onConnectStart:a,onConnectEnd:o,onClickConnectStart:c,onClickConnectEnd:l,nodesDraggable:u,nodesConnectable:p,nodesFocusable:g,edgesFocusable:b,edgesUpdatable:_,elevateNodesOnSelect:T,minZoom:S,maxZoom:M,nodeExtent:k,onNodesChange:O,onEdgesChange:P,elementsSelectable:i,connectionMode:f,snapGrid:d,snapToGrid:y,translateExtent:w,connectOnClick:v,defaultEdgeOptions:x,fitView:A,fitViewOptions:$,onNodesDelete:D,onEdgesDelete:E,onNodeDrag:C,onNodeDragStart:h,onNodeDragStop:N,onSelectionDrag:L,onSelectionDragStart:R,onSelectionDragStop:z,noPanClassName:B,nodeOrigin:H,rfId:j,autoPanOnConnect:V,autoPanOnNodeDrag:W,onError:ne,connectionRadius:Z,isValidConnection:q,nodeDragThreshold:ie})=>{const{setNodes:oe,setEdges:pe,setDefaultNodesAndEdges:Me,setMinZoom:ve,setMaxZoom:be,setTranslateExtent:ge,setNodeExtent:se,reset:we}=Te(wg,We),U=Pe();return I.useEffect(()=>{const He=r==null?void 0:r.map(me=>({...me,...x}));return Me(n,He),()=>{we()}},[]),le("defaultEdgeOptions",x,U.setState),le("connectionMode",f,U.setState),le("onConnect",s,U.setState),le("onConnectStart",a,U.setState),le("onConnectEnd",o,U.setState),le("onClickConnectStart",c,U.setState),le("onClickConnectEnd",l,U.setState),le("nodesDraggable",u,U.setState),le("nodesConnectable",p,U.setState),le("nodesFocusable",g,U.setState),le("edgesFocusable",b,U.setState),le("edgesUpdatable",_,U.setState),le("elementsSelectable",i,U.setState),le("elevateNodesOnSelect",T,U.setState),le("snapToGrid",y,U.setState),le("snapGrid",d,U.setState),le("onNodesChange",O,U.setState),le("onEdgesChange",P,U.setState),le("connectOnClick",v,U.setState),le("fitViewOnInit",A,U.setState),le("fitViewOnInitOptions",$,U.setState),le("onNodesDelete",D,U.setState),le("onEdgesDelete",E,U.setState),le("onNodeDrag",C,U.setState),le("onNodeDragStart",h,U.setState),le("onNodeDragStop",N,U.setState),le("onSelectionDrag",L,U.setState),le("onSelectionDragStart",R,U.setState),le("onSelectionDragStop",z,U.setState),le("noPanClassName",B,U.setState),le("nodeOrigin",H,U.setState),le("rfId",j,U.setState),le("autoPanOnConnect",V,U.setState),le("autoPanOnNodeDrag",W,U.setState),le("onError",ne,U.setState),le("connectionRadius",Z,U.setState),le("isValidConnection",q,U.setState),le("nodeDragThreshold",ie,U.setState),Zt(e,oe),Zt(t,pe),Zt(S,ve),Zt(M,be),Zt(w,ge),Zt(k,se),null},So={display:"none"},vg={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Lc="react-flow__node-desc",Bc="react-flow__edge-desc",Sg="react-flow__aria-live",xg=e=>e.ariaLiveMessage;function kg({rfId:e}){const t=Te(xg);return G.createElement("div",{id:`${Sg}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:vg},t)}function Ng({rfId:e,disableKeyboardA11y:t}){return G.createElement(G.Fragment,null,G.createElement("div",{id:`${Lc}-${e}`,style:So},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),G.createElement("div",{id:`${Bc}-${e}`,style:So},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&G.createElement(kg,{rfId:e}))}var zn=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=I.useState(!1),s=I.useRef(!1),a=I.useRef(new Set([])),[o,c]=I.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.split("+")),p=u.reduce((g,b)=>g.concat(...b),[]);return[u,p]}return[[],[]]},[e]);return I.useEffect(()=>{const l=typeof document<"u"?document:null,u=(t==null?void 0:t.target)||l;if(e!==null){const p=_=>{if(s.current=_.ctrlKey||_.metaKey||_.shiftKey,(!s.current||s.current&&!t.actInsideInputWithModifier)&&Ws(_))return!1;const S=ko(_.code,c);a.current.add(_[S]),xo(o,a.current,!1)&&(_.preventDefault(),r(!0))},g=_=>{if((!s.current||s.current&&!t.actInsideInputWithModifier)&&Ws(_))return!1;const S=ko(_.code,c);xo(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(_[S]),_.key==="Meta"&&a.current.clear(),s.current=!1},b=()=>{a.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",p),u==null||u.addEventListener("keyup",g),window.addEventListener("blur",b),()=>{u==null||u.removeEventListener("keydown",p),u==null||u.removeEventListener("keyup",g),window.removeEventListener("blur",b)}}},[e,r]),n};function xo(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function ko(e,t){return t.includes(e)?"code":"key"}function Pc(e,t,n,r){var o,c;if(!e.parentNode)return n;const s=t.get(e.parentNode),a=ln(s,r);return Pc(s,t,{x:(n.x??0)+a.x,y:(n.y??0)+a.y,z:(((o=s[Oe])==null?void 0:o.z)??0)>(n.z??0)?((c=s[Oe])==null?void 0:c.z)??0:n.z??0},r)}function $c(e,t,n){e.forEach(r=>{var s;if(r.parentNode&&!e.has(r.parentNode))throw new Error(`Parent node ${r.parentNode} not found`);if(r.parentNode||n!=null&&n[r.id]){const{x:a,y:o,z:c}=Pc(r,e,{...r.position,z:((s=r[Oe])==null?void 0:s.z)??0},t);r.positionAbsolute={x:a,y:o},r[Oe].z=c,n!=null&&n[r.id]&&(r[Oe].isParent=!0)}})}function Es(e,t,n,r){const s=new Map,a={},o=r?1e3:0;return e.forEach(c=>{var b;const l=(et(c.zIndex)?c.zIndex:0)+(c.selected?o:0),u=t.get(c.id),p={...c,positionAbsolute:{x:c.position.x,y:c.position.y}};c.parentNode&&(a[c.parentNode]=!0);const g=(u==null?void 0:u.type)&&(u==null?void 0:u.type)!==c.type;Object.defineProperty(p,Oe,{enumerable:!1,value:{handleBounds:g||(b=u==null?void 0:u[Oe])==null?void 0:b.handleBounds,z:l}}),s.set(c.id,p)}),$c(s,n,a),s}function zc(e,t={}){const{getNodes:n,width:r,height:s,minZoom:a,maxZoom:o,d3Zoom:c,d3Selection:l,fitViewOnInitDone:u,fitViewOnInit:p,nodeOrigin:g}=e(),b=t.initial&&!u&&p;if(c&&l&&(b||!t.initial)){const T=n().filter(M=>{var O;const k=t.includeHiddenNodes?M.width&&M.height:!M.hidden;return(O=t.nodes)!=null&&O.length?k&&t.nodes.some(P=>P.id===M.id):k}),S=T.every(M=>M.width&&M.height);if(T.length>0&&S){const M=Ti(T,g),{x:k,y:O,zoom:P}=xc(M,r,s,t.minZoom??a,t.maxZoom??o,t.padding??.1),i=It.translate(k,O).scale(P);return typeof t.duration=="number"&&t.duration>0?c.transform(Pt(l,t.duration),i):c.transform(l,i),!0}}return!1}function Cg(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[Oe]:r[Oe],selected:n.selected})}),new Map(t)}function Tg(e,t){return t.map(n=>{const r=e.find(s=>s.id===n.id);return r&&(n.selected=r.selected),n})}function ar({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:s,edges:a,onNodesChange:o,onEdgesChange:c,hasDefaultNodes:l,hasDefaultEdges:u}=n();e!=null&&e.length&&(l&&r({nodeInternals:Cg(e,s)}),o==null||o(e)),t!=null&&t.length&&(u&&r({edges:Tg(t,a)}),c==null||c(t))}const Xt=()=>{},Mg={zoomIn:Xt,zoomOut:Xt,zoomTo:Xt,getZoom:()=>1,setViewport:Xt,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Xt,fitBounds:Xt,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},Ag=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),Ig=()=>{const e=Pe(),{d3Zoom:t,d3Selection:n}=Te(Ag,We);return I.useMemo(()=>n&&t?{zoomIn:s=>t.scaleBy(Pt(n,s==null?void 0:s.duration),1.2),zoomOut:s=>t.scaleBy(Pt(n,s==null?void 0:s.duration),1/1.2),zoomTo:(s,a)=>t.scaleTo(Pt(n,a==null?void 0:a.duration),s),getZoom:()=>e.getState().transform[2],setViewport:(s,a)=>{const[o,c,l]=e.getState().transform,u=It.translate(s.x??o,s.y??c).scale(s.zoom??l);t.transform(Pt(n,a==null?void 0:a.duration),u)},getViewport:()=>{const[s,a,o]=e.getState().transform;return{x:s,y:a,zoom:o}},fitView:s=>zc(e.getState,s),setCenter:(s,a,o)=>{const{width:c,height:l,maxZoom:u}=e.getState(),p=typeof(o==null?void 0:o.zoom)<"u"?o.zoom:u,g=c/2-s*p,b=l/2-a*p,_=It.translate(g,b).scale(p);t.transform(Pt(n,o==null?void 0:o.duration),_)},fitBounds:(s,a)=>{const{width:o,height:c,minZoom:l,maxZoom:u}=e.getState(),{x:p,y:g,zoom:b}=xc(s,o,c,l,u,(a==null?void 0:a.padding)??.1),_=It.translate(p,g).scale(b);t.transform(Pt(n,a==null?void 0:a.duration),_)},project:s=>{const{transform:a,snapToGrid:o,snapGrid:c}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Zs(s,a,o,c)},screenToFlowPosition:s=>{const{transform:a,snapToGrid:o,snapGrid:c,domNode:l}=e.getState();if(!l)return s;const{x:u,y:p}=l.getBoundingClientRect(),g={x:s.x-u,y:s.y-p};return Zs(g,a,o,c)},flowToScreenPosition:s=>{const{transform:a,domNode:o}=e.getState();if(!o)return s;const{x:c,y:l}=o.getBoundingClientRect(),u=Ec(s,a);return{x:u.x+c,y:u.y+l}},viewportInitialized:!0}:Mg,[t,n])};function Hc(){const e=Ig(),t=Pe(),n=I.useCallback(()=>t.getState().getNodes().map(S=>({...S})),[]),r=I.useCallback(S=>t.getState().nodeInternals.get(S),[]),s=I.useCallback(()=>{const{edges:S=[]}=t.getState();return S.map(M=>({...M}))},[]),a=I.useCallback(S=>{const{edges:M=[]}=t.getState();return M.find(k=>k.id===S)},[]),o=I.useCallback(S=>{const{getNodes:M,setNodes:k,hasDefaultNodes:O,onNodesChange:P}=t.getState(),i=M(),f=typeof S=="function"?S(i):S;if(O)k(f);else if(P){const d=f.length===0?i.map(y=>({type:"remove",id:y.id})):f.map(y=>({item:y,type:"reset"}));P(d)}},[]),c=I.useCallback(S=>{const{edges:M=[],setEdges:k,hasDefaultEdges:O,onEdgesChange:P}=t.getState(),i=typeof S=="function"?S(M):S;if(O)k(i);else if(P){const f=i.length===0?M.map(d=>({type:"remove",id:d.id})):i.map(d=>({item:d,type:"reset"}));P(f)}},[]),l=I.useCallback(S=>{const M=Array.isArray(S)?S:[S],{getNodes:k,setNodes:O,hasDefaultNodes:P,onNodesChange:i}=t.getState();if(P){const d=[...k(),...M];O(d)}else if(i){const f=M.map(d=>({item:d,type:"add"}));i(f)}},[]),u=I.useCallback(S=>{const M=Array.isArray(S)?S:[S],{edges:k=[],setEdges:O,hasDefaultEdges:P,onEdgesChange:i}=t.getState();if(P)O([...k,...M]);else if(i){const f=M.map(d=>({item:d,type:"add"}));i(f)}},[]),p=I.useCallback(()=>{const{getNodes:S,edges:M=[],transform:k}=t.getState(),[O,P,i]=k;return{nodes:S().map(f=>({...f})),edges:M.map(f=>({...f})),viewport:{x:O,y:P,zoom:i}}},[]),g=I.useCallback(({nodes:S,edges:M})=>{const{nodeInternals:k,getNodes:O,edges:P,hasDefaultNodes:i,hasDefaultEdges:f,onNodesDelete:d,onEdgesDelete:y,onNodesChange:w,onEdgesChange:v}=t.getState(),x=(S||[]).map(C=>C.id),A=(M||[]).map(C=>C.id),$=O().reduce((C,h)=>{const N=!x.includes(h.id)&&h.parentNode&&C.find(R=>R.id===h.parentNode);return(typeof h.deletable=="boolean"?h.deletable:!0)&&(x.includes(h.id)||N)&&C.push(h),C},[]),D=P.filter(C=>typeof C.deletable=="boolean"?C.deletable:!0),E=D.filter(C=>A.includes(C.id));if($||E){const C=Sc($,D),h=[...E,...C],N=h.reduce((L,R)=>(L.includes(R.id)||L.push(R.id),L),[]);if((f||i)&&(f&&t.setState({edges:P.filter(L=>!N.includes(L.id))}),i&&($.forEach(L=>{k.delete(L.id)}),t.setState({nodeInternals:new Map(k)}))),N.length>0&&(y==null||y(h),v&&v(N.map(L=>({id:L,type:"remove"})))),$.length>0&&(d==null||d($),w)){const L=$.map(R=>({id:R.id,type:"remove"}));w(L)}}},[]),b=I.useCallback(S=>{const M=Xh(S),k=M?null:t.getState().nodeInternals.get(S.id);return!M&&!k?[null,null,M]:[M?S:mo(k),k,M]},[]),_=I.useCallback((S,M=!0,k)=>{const[O,P,i]=b(S);return O?(k||t.getState().getNodes()).filter(f=>{if(!i&&(f.id===P.id||!f.positionAbsolute))return!1;const d=mo(f),y=Ks(d,O);return M&&y>0||y>=O.width*O.height}):[]},[]),T=I.useCallback((S,M,k=!0)=>{const[O]=b(S);if(!O)return!1;const P=Ks(O,M);return k&&P>0||P>=O.width*O.height},[]);return I.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:s,getEdge:a,setNodes:o,setEdges:c,addNodes:l,addEdges:u,toObject:p,deleteElements:g,getIntersectingNodes:_,isNodeIntersecting:T}),[e,n,r,s,a,o,c,l,u,p,g,_,T])}const Rg={actInsideInputWithModifier:!1};var Og=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Pe(),{deleteElements:r}=Hc(),s=zn(e,Rg),a=zn(t);I.useEffect(()=>{if(s){const{edges:o,getNodes:c}=n.getState(),l=c().filter(p=>p.selected),u=o.filter(p=>p.selected);r({nodes:l,edges:u}),n.setState({nodesSelectionActive:!1})}},[s]),I.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])};function Dg(e){const t=Pe();I.useEffect(()=>{let n;const r=()=>{var a,o;if(!e.current)return;const s=vi(e.current);(s.height===0||s.width===0)&&((o=(a=t.getState()).onError)==null||o.call(a,"004",St.error004())),t.setState({width:s.width||500,height:s.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const Ii={position:"absolute",width:"100%",height:"100%",top:0,left:0},Lg=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,cr=e=>({x:e.x,y:e.y,zoom:e.k}),Qt=(e,t)=>e.target.closest(`.${t}`),No=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Co=e=>{const t=e.ctrlKey&&Ar()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},Bg=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Pg=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:s=!0,zoomOnPinch:a=!0,panOnScroll:o=!1,panOnScrollSpeed:c=.5,panOnScrollMode:l=zt.Free,zoomOnDoubleClick:u=!0,elementsSelectable:p,panOnDrag:g=!0,defaultViewport:b,translateExtent:_,minZoom:T,maxZoom:S,zoomActivationKeyCode:M,preventScrolling:k=!0,children:O,noWheelClassName:P,noPanClassName:i})=>{const f=I.useRef(),d=Pe(),y=I.useRef(!1),w=I.useRef(!1),v=I.useRef(null),x=I.useRef({x:0,y:0,zoom:0}),{d3Zoom:A,d3Selection:$,d3ZoomHandler:D,userSelectionActive:E}=Te(Bg,We),C=zn(M),h=I.useRef(0),N=I.useRef(!1),L=I.useRef();return Dg(v),I.useEffect(()=>{if(v.current){const R=v.current.getBoundingClientRect(),z=Vh().scaleExtent([T,S]).translateExtent(_),B=st(v.current).call(z),H=It.translate(b.x,b.y).scale(gn(b.zoom,T,S)),j=[[0,0],[R.width,R.height]],V=z.constrain()(H,j,_);z.transform(B,V),z.wheelDelta(Co),d.setState({d3Zoom:z,d3Selection:B,d3ZoomHandler:B.on("wheel.zoom"),transform:[V.x,V.y,V.k],domNode:v.current.closest(".react-flow")})}},[]),I.useEffect(()=>{$&&A&&(o&&!C&&!E?$.on("wheel.zoom",R=>{if(Qt(R,P))return!1;R.preventDefault(),R.stopImmediatePropagation();const z=$.property("__zoom").k||1,B=Ar();if(R.ctrlKey&&a&&B){const ie=pt(R),oe=Co(R),pe=z*Math.pow(2,oe);A.scaleTo($,pe,ie,R);return}const H=R.deltaMode===1?20:1;let j=l===zt.Vertical?0:R.deltaX*H,V=l===zt.Horizontal?0:R.deltaY*H;!B&&R.shiftKey&&l!==zt.Vertical&&(j=R.deltaY*H,V=0),A.translateBy($,-(j/z)*c,-(V/z)*c,{internal:!0});const W=cr($.property("__zoom")),{onViewportChangeStart:ne,onViewportChange:Z,onViewportChangeEnd:q}=d.getState();clearTimeout(L.current),N.current||(N.current=!0,t==null||t(R,W),ne==null||ne(W)),N.current&&(e==null||e(R,W),Z==null||Z(W),L.current=setTimeout(()=>{n==null||n(R,W),q==null||q(W),N.current=!1},150))},{passive:!1}):typeof D<"u"&&$.on("wheel.zoom",function(R,z){if(!k||Qt(R,P))return null;R.preventDefault(),D.call(this,R,z)},{passive:!1}))},[E,o,l,$,A,D,C,a,k,P,t,e,n]),I.useEffect(()=>{A&&A.on("start",R=>{var H,j;if(!R.sourceEvent||R.sourceEvent.internal)return null;h.current=(H=R.sourceEvent)==null?void 0:H.button;const{onViewportChangeStart:z}=d.getState(),B=cr(R.transform);y.current=!0,x.current=B,((j=R.sourceEvent)==null?void 0:j.type)==="mousedown"&&d.setState({paneDragging:!0}),z==null||z(B),t==null||t(R.sourceEvent,B)})},[A,t]),I.useEffect(()=>{A&&(E&&!y.current?A.on("zoom",null):E||A.on("zoom",R=>{var B;const{onViewportChange:z}=d.getState();if(d.setState({transform:[R.transform.x,R.transform.y,R.transform.k]}),w.current=!!(r&&No(g,h.current??0)),(e||z)&&!((B=R.sourceEvent)!=null&&B.internal)){const H=cr(R.transform);z==null||z(H),e==null||e(R.sourceEvent,H)}}))},[E,A,e,g,r]),I.useEffect(()=>{A&&A.on("end",R=>{if(!R.sourceEvent||R.sourceEvent.internal)return null;const{onViewportChangeEnd:z}=d.getState();if(y.current=!1,d.setState({paneDragging:!1}),r&&No(g,h.current??0)&&!w.current&&r(R.sourceEvent),w.current=!1,(n||z)&&Lg(x.current,R.transform)){const B=cr(R.transform);x.current=B,clearTimeout(f.current),f.current=setTimeout(()=>{z==null||z(B),n==null||n(R.sourceEvent,B)},o?150:0)}})},[A,o,g,n,r]),I.useEffect(()=>{A&&A.filter(R=>{const z=C||s,B=a&&R.ctrlKey;if((g===!0||Array.isArray(g)&&g.includes(1))&&R.button===1&&R.type==="mousedown"&&(Qt(R,"react-flow__node")||Qt(R,"react-flow__edge")))return!0;if(!g&&!z&&!o&&!u&&!a||E||!u&&R.type==="dblclick"||Qt(R,P)&&R.type==="wheel"||Qt(R,i)&&(R.type!=="wheel"||o&&R.type==="wheel"&&!C)||!a&&R.ctrlKey&&R.type==="wheel"||!z&&!o&&!B&&R.type==="wheel"||!g&&(R.type==="mousedown"||R.type==="touchstart")||Array.isArray(g)&&!g.includes(R.button)&&(R.type==="mousedown"||R.type==="touchstart"))return!1;const H=Array.isArray(g)&&g.includes(R.button)||!R.button||R.button<=1;return(!R.ctrlKey||R.type==="wheel")&&H})},[E,A,s,a,o,u,g,p,C]),G.createElement("div",{className:"react-flow__renderer",ref:v,style:Ii},O)},$g=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function zg(){const{userSelectionActive:e,userSelectionRect:t}=Te($g,We);return e&&t?G.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function To(e,t){const n=e.find(r=>r.id===t.parentNode);if(n){const r=t.position.x+t.width-n.width,s=t.position.y+t.height-n.height;if(r>0||s>0||t.position.x<0||t.position.y<0){if(n.style={...n.style},n.style.width=n.style.width??n.width,n.style.height=n.style.height??n.height,r>0&&(n.style.width+=r),s>0&&(n.style.height+=s),t.position.x<0){const a=Math.abs(t.position.x);n.position.x=n.position.x-a,n.style.width+=a,t.position.x=0}if(t.position.y<0){const a=Math.abs(t.position.y);n.position.y=n.position.y-a,n.style.height+=a,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function Fc(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,s)=>{const a=e.filter(c=>c.id===s.id);if(a.length===0)return r.push(s),r;const o={...s};for(const c of a)if(c)switch(c.type){case"select":{o.selected=c.selected;break}case"position":{typeof c.position<"u"&&(o.position=c.position),typeof c.positionAbsolute<"u"&&(o.positionAbsolute=c.positionAbsolute),typeof c.dragging<"u"&&(o.dragging=c.dragging),o.expandParent&&To(r,o);break}case"dimensions":{typeof c.dimensions<"u"&&(o.width=c.dimensions.width,o.height=c.dimensions.height),typeof c.updateStyle<"u"&&(o.style={...o.style||{},...c.dimensions}),typeof c.resizing=="boolean"&&(o.resizing=c.resizing),o.expandParent&&To(r,o);break}case"remove":return r}return r.push(o),r},n)}function jc(e,t){return Fc(e,t)}function Hg(e,t){return Fc(e,t)}const Ct=(e,t)=>({id:e,type:"select",selected:t});function rn(e,t){return e.reduce((n,r)=>{const s=t.includes(r.id);return!r.selected&&s?(r.selected=!0,n.push(Ct(r.id,!0))):r.selected&&!s&&(r.selected=!1,n.push(Ct(r.id,!1))),n},[])}const vs=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Fg=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),Uc=I.memo(({isSelecting:e,selectionMode:t=$n.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:s,onPaneClick:a,onPaneContextMenu:o,onPaneScroll:c,onPaneMouseEnter:l,onPaneMouseMove:u,onPaneMouseLeave:p,children:g})=>{const b=I.useRef(null),_=Pe(),T=I.useRef(0),S=I.useRef(0),M=I.useRef(),{userSelectionActive:k,elementsSelectable:O,dragging:P}=Te(Fg,We),i=()=>{_.setState({userSelectionActive:!1,userSelectionRect:null}),T.current=0,S.current=0},f=D=>{a==null||a(D),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},d=D=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){D.preventDefault();return}o==null||o(D)},y=c?D=>c(D):void 0,w=D=>{const{resetSelectedElements:E,domNode:C}=_.getState();if(M.current=C==null?void 0:C.getBoundingClientRect(),!O||!e||D.button!==0||D.target!==b.current||!M.current)return;const{x:h,y:N}=Rt(D,M.current);E(),_.setState({userSelectionRect:{width:0,height:0,startX:h,startY:N,x:h,y:N}}),r==null||r(D)},v=D=>{const{userSelectionRect:E,nodeInternals:C,edges:h,transform:N,onNodesChange:L,onEdgesChange:R,nodeOrigin:z,getNodes:B}=_.getState();if(!e||!M.current||!E)return;_.setState({userSelectionActive:!0,nodesSelectionActive:!1});const H=Rt(D,M.current),j=E.startX??0,V=E.startY??0,W={...E,x:H.x<j?H.x:j,y:H.y<V?H.y:V,width:Math.abs(H.x-j),height:Math.abs(H.y-V)},ne=B(),Z=vc(C,W,N,t===$n.Partial,!0,z),q=Sc(Z,h).map(oe=>oe.id),ie=Z.map(oe=>oe.id);if(T.current!==ie.length){T.current=ie.length;const oe=rn(ne,ie);oe.length&&(L==null||L(oe))}if(S.current!==q.length){S.current=q.length;const oe=rn(h,q);oe.length&&(R==null||R(oe))}_.setState({userSelectionRect:W})},x=D=>{if(D.button!==0)return;const{userSelectionRect:E}=_.getState();!k&&E&&D.target===b.current&&(f==null||f(D)),_.setState({nodesSelectionActive:T.current>0}),i(),s==null||s(D)},A=D=>{k&&(_.setState({nodesSelectionActive:T.current>0}),s==null||s(D)),i()},$=O&&(e||k);return G.createElement("div",{className:nt(["react-flow__pane",{dragging:P,selection:e}]),onClick:$?void 0:vs(f,b),onContextMenu:vs(d,b),onWheel:vs(y,b),onMouseEnter:$?void 0:l,onMouseDown:$?w:void 0,onMouseMove:$?v:u,onMouseUp:$?x:void 0,onMouseLeave:$?A:p,ref:b,style:Ii},g,G.createElement(zg,null))});Uc.displayName="Pane";function Vc(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:Vc(n,t):!1}function Mo(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function jg(e,t,n,r){return Array.from(e.values()).filter(s=>(s.selected||s.id===r)&&(!s.parentNode||!Vc(s,e))&&(s.draggable||t&&typeof s.draggable>"u")).map(s=>{var a,o;return{id:s.id,position:s.position||{x:0,y:0},positionAbsolute:s.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((a=s.positionAbsolute)==null?void 0:a.x)??0),y:n.y-(((o=s.positionAbsolute)==null?void 0:o.y)??0)},delta:{x:0,y:0},extent:s.extent,parentNode:s.parentNode,width:s.width,height:s.height,expandParent:s.expandParent}})}function Ug(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function Gc(e,t,n,r,s=[0,0],a){const o=Ug(e,e.extent||r);let c=o;if(e.extent==="parent"&&!e.expandParent)if(e.parentNode&&e.width&&e.height){const p=n.get(e.parentNode),{x:g,y:b}=ln(p,s).positionAbsolute;c=p&&et(g)&&et(b)&&et(p.width)&&et(p.height)?[[g+e.width*s[0],b+e.height*s[1]],[g+p.width-e.width+e.width*s[0],b+p.height-e.height+e.height*s[1]]]:c}else a==null||a("005",St.error005()),c=o;else if(e.extent&&e.parentNode&&e.extent!=="parent"){const p=n.get(e.parentNode),{x:g,y:b}=ln(p,s).positionAbsolute;c=[[e.extent[0][0]+g,e.extent[0][1]+b],[e.extent[1][0]+g,e.extent[1][1]+b]]}let l={x:0,y:0};if(e.parentNode){const p=n.get(e.parentNode);l=ln(p,s).positionAbsolute}const u=c&&c!=="parent"?Si(t,c):t;return{position:{x:u.x-l.x,y:u.y-l.y},positionAbsolute:u}}function Ss({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(s=>({...n.get(s.id),position:s.position,positionAbsolute:s.positionAbsolute}));return[e?r.find(s=>s.id===e):r[0],r]}const Ao=(e,t,n,r)=>{const s=t.querySelectorAll(e);if(!s||!s.length)return null;const a=Array.from(s),o=t.getBoundingClientRect(),c={x:o.width*r[0],y:o.height*r[1]};return a.map(l=>{const u=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(u.left-o.left-c.x)/n,y:(u.top-o.top-c.y)/n,...vi(l)}})};function Nn(e,t,n){return n===void 0?n:r=>{const s=t().nodeInternals.get(e);s&&n(r,{...s})}}function Qs({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:a,multiSelectionActive:o,nodeInternals:c,onError:l}=t.getState(),u=c.get(e);if(!u){l==null||l("012",St.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&o)&&(a({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):s([e])}function Vg(){const e=Pe();return I.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:s,snapToGrid:a}=e.getState(),o=n.touches?n.touches[0].clientX:n.clientX,c=n.touches?n.touches[0].clientY:n.clientY,l={x:(o-r[0])/r[2],y:(c-r[1])/r[2]};return{xSnapped:a?s[0]*Math.round(l.x/s[0]):l.x,ySnapped:a?s[1]*Math.round(l.y/s[1]):l.y,...l}},[])}function xs(e){return(t,n,r)=>e==null?void 0:e(t,r)}function Kc({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:a,selectNodesOnDrag:o}){const c=Pe(),[l,u]=I.useState(!1),p=I.useRef([]),g=I.useRef({x:null,y:null}),b=I.useRef(0),_=I.useRef(null),T=I.useRef({x:0,y:0}),S=I.useRef(null),M=I.useRef(!1),k=I.useRef(!1),O=Vg();return I.useEffect(()=>{if(e!=null&&e.current){const P=st(e.current),i=({x:y,y:w})=>{const{nodeInternals:v,onNodeDrag:x,onSelectionDrag:A,updateNodePositions:$,nodeExtent:D,snapGrid:E,snapToGrid:C,nodeOrigin:h,onError:N}=c.getState();g.current={x:y,y:w};let L=!1,R={x:0,y:0,x2:0,y2:0};if(p.current.length>1&&D){const B=Ti(p.current,h);R=Pn(B)}if(p.current=p.current.map(B=>{const H={x:y-B.distance.x,y:w-B.distance.y};C&&(H.x=E[0]*Math.round(H.x/E[0]),H.y=E[1]*Math.round(H.y/E[1]));const j=[[D[0][0],D[0][1]],[D[1][0],D[1][1]]];p.current.length>1&&D&&!B.extent&&(j[0][0]=B.positionAbsolute.x-R.x+D[0][0],j[1][0]=B.positionAbsolute.x+(B.width??0)-R.x2+D[1][0],j[0][1]=B.positionAbsolute.y-R.y+D[0][1],j[1][1]=B.positionAbsolute.y+(B.height??0)-R.y2+D[1][1]);const V=Gc(B,H,v,j,h,N);return L=L||B.position.x!==V.position.x||B.position.y!==V.position.y,B.position=V.position,B.positionAbsolute=V.positionAbsolute,B}),!L)return;$(p.current,!0,!0),u(!0);const z=s?x:xs(A);if(z&&S.current){const[B,H]=Ss({nodeId:s,dragItems:p.current,nodeInternals:v});z(S.current,B,H)}},f=()=>{if(!_.current)return;const[y,w]=uc(T.current,_.current);if(y!==0||w!==0){const{transform:v,panBy:x}=c.getState();g.current.x=(g.current.x??0)-y/v[2],g.current.y=(g.current.y??0)-w/v[2],x({x:y,y:w})&&i(g.current)}b.current=requestAnimationFrame(f)},d=y=>{var h;const{nodeInternals:w,multiSelectionActive:v,nodesDraggable:x,unselectNodesAndEdges:A,onNodeDragStart:$,onSelectionDragStart:D}=c.getState();k.current=!0;const E=s?$:xs(D);(!o||!a)&&!v&&s&&((h=w.get(s))!=null&&h.selected||A()),s&&a&&o&&Qs({id:s,store:c,nodeRef:e});const C=O(y);if(g.current=C,p.current=jg(w,x,C,s),E&&p.current){const[N,L]=Ss({nodeId:s,dragItems:p.current,nodeInternals:w});E(y.sourceEvent,N,L)}};if(t)P.on(".drag",null);else{const y=_p().on("start",w=>{const{domNode:v,nodeDragThreshold:x}=c.getState();x===0&&d(w);const A=O(w);g.current=A,_.current=(v==null?void 0:v.getBoundingClientRect())||null,T.current=Rt(w.sourceEvent,_.current)}).on("drag",w=>{var $,D;const v=O(w),{autoPanOnNodeDrag:x,nodeDragThreshold:A}=c.getState();if(!M.current&&k.current&&x&&(M.current=!0,f()),!k.current){const E=v.xSnapped-((($=g==null?void 0:g.current)==null?void 0:$.x)??0),C=v.ySnapped-(((D=g==null?void 0:g.current)==null?void 0:D.y)??0);Math.sqrt(E*E+C*C)>A&&d(w)}(g.current.x!==v.xSnapped||g.current.y!==v.ySnapped)&&p.current&&k.current&&(S.current=w.sourceEvent,T.current=Rt(w.sourceEvent,_.current),i(v))}).on("end",w=>{if(k.current&&(u(!1),M.current=!1,k.current=!1,cancelAnimationFrame(b.current),p.current)){const{updateNodePositions:v,nodeInternals:x,onNodeDragStop:A,onSelectionDragStop:$}=c.getState(),D=s?A:xs($);if(v(p.current,!1,!1),D){const[E,C]=Ss({nodeId:s,dragItems:p.current,nodeInternals:x});D(w.sourceEvent,E,C)}}}).filter(w=>{const v=w.target;return!w.button&&(!n||!Mo(v,`.${n}`,e))&&(!r||Mo(v,r,e))});return P.call(y),()=>{P.on(".drag",null)}}}},[e,t,n,r,a,c,s,o,O]),l}function Wc(){const e=Pe();return I.useCallback(n=>{const{nodeInternals:r,nodeExtent:s,updateNodePositions:a,getNodes:o,snapToGrid:c,snapGrid:l,onError:u,nodesDraggable:p}=e.getState(),g=o().filter(O=>O.selected&&(O.draggable||p&&typeof O.draggable>"u")),b=c?l[0]:5,_=c?l[1]:5,T=n.isShiftPressed?4:1,S=n.x*b*T,M=n.y*_*T,k=g.map(O=>{if(O.positionAbsolute){const P={x:O.positionAbsolute.x+S,y:O.positionAbsolute.y+M};c&&(P.x=l[0]*Math.round(P.x/l[0]),P.y=l[1]*Math.round(P.y/l[1]));const{positionAbsolute:i,position:f}=Gc(O,P,r,s,void 0,u);O.position=f,O.positionAbsolute=i}return O});a(k,!0,!1)},[])}const dn={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Cn=e=>{const t=({id:n,type:r,data:s,xPos:a,yPos:o,xPosOrigin:c,yPosOrigin:l,selected:u,onClick:p,onMouseEnter:g,onMouseMove:b,onMouseLeave:_,onContextMenu:T,onDoubleClick:S,style:M,className:k,isDraggable:O,isSelectable:P,isConnectable:i,isFocusable:f,selectNodesOnDrag:d,sourcePosition:y,targetPosition:w,hidden:v,resizeObserver:x,dragHandle:A,zIndex:$,isParent:D,noDragClassName:E,noPanClassName:C,initialized:h,disableKeyboardA11y:N,ariaLabel:L,rfId:R,hasHandleBounds:z})=>{const B=Pe(),H=I.useRef(null),j=I.useRef(y),V=I.useRef(w),W=I.useRef(r),ne=P||O||p||g||b||_,Z=Wc(),q=Nn(n,B.getState,g),ie=Nn(n,B.getState,b),oe=Nn(n,B.getState,_),pe=Nn(n,B.getState,T),Me=Nn(n,B.getState,S),ve=se=>{const{nodeDragThreshold:we}=B.getState();if(P&&(!d||!O||we>0)&&Qs({id:n,store:B,nodeRef:H}),p){const U=B.getState().nodeInternals.get(n);U&&p(se,{...U})}},be=se=>{if(!Ws(se))if(gc.includes(se.key)&&P){const we=se.key==="Escape";Qs({id:n,store:B,unselect:we,nodeRef:H})}else!N&&O&&u&&Object.prototype.hasOwnProperty.call(dn,se.key)&&(B.setState({ariaLiveMessage:`Moved selected node ${se.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~a}, y: ${~~o}`}),Z({x:dn[se.key].x,y:dn[se.key].y,isShiftPressed:se.shiftKey}))};I.useEffect(()=>()=>{H.current&&(x==null||x.unobserve(H.current))},[]),I.useEffect(()=>{if(H.current&&!v){const se=H.current;(!h||!z)&&(x==null||x.unobserve(se),x==null||x.observe(se))}},[v,h,z]),I.useEffect(()=>{const se=W.current!==r,we=j.current!==y,U=V.current!==w;H.current&&(se||we||U)&&(se&&(W.current=r),we&&(j.current=y),U&&(V.current=w),B.getState().updateNodeDimensions([{id:n,nodeElement:H.current,forceUpdate:!0}]))},[n,r,y,w]);const ge=Kc({nodeRef:H,disabled:v||!O,noDragClassName:E,handleSelector:A,nodeId:n,isSelectable:P,selectNodesOnDrag:d});return v?null:G.createElement("div",{className:nt(["react-flow__node",`react-flow__node-${r}`,{[C]:O},k,{selected:u,selectable:P,parent:D,dragging:ge}]),ref:H,style:{zIndex:$,transform:`translate(${c}px,${l}px)`,pointerEvents:ne?"all":"none",visibility:h?"visible":"hidden",...M},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:q,onMouseMove:ie,onMouseLeave:oe,onContextMenu:pe,onClick:ve,onDoubleClick:Me,onKeyDown:f?be:void 0,tabIndex:f?0:void 0,role:f?"button":void 0,"aria-describedby":N?void 0:`${Lc}-${R}`,"aria-label":L},G.createElement(sg,{value:n},G.createElement(e,{id:n,data:s,type:r,xPos:a,yPos:o,selected:u,isConnectable:i,sourcePosition:y,targetPosition:w,dragging:ge,dragHandle:A,zIndex:$})))};return t.displayName="NodeWrapper",I.memo(t)};const Gg=e=>{const t=e.getNodes().filter(n=>n.selected);return{...Ti(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function Kg({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Pe(),{width:s,height:a,x:o,y:c,transformString:l,userSelectionActive:u}=Te(Gg,We),p=Wc(),g=I.useRef(null);if(I.useEffect(()=>{var T;n||(T=g.current)==null||T.focus({preventScroll:!0})},[n]),Kc({nodeRef:g}),u||!s||!a)return null;const b=e?T=>{const S=r.getState().getNodes().filter(M=>M.selected);e(T,S)}:void 0,_=T=>{Object.prototype.hasOwnProperty.call(dn,T.key)&&p({x:dn[T.key].x,y:dn[T.key].y,isShiftPressed:T.shiftKey})};return G.createElement("div",{className:nt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l}},G.createElement("div",{ref:g,className:"react-flow__nodesselection-rect",onContextMenu:b,tabIndex:n?void 0:-1,onKeyDown:n?void 0:_,style:{width:s,height:a,top:c,left:o}}))}var Wg=I.memo(Kg);const qg=e=>e.nodesSelectionActive,qc=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:a,onPaneScroll:o,deleteKeyCode:c,onMove:l,onMoveStart:u,onMoveEnd:p,selectionKeyCode:g,selectionOnDrag:b,selectionMode:_,onSelectionStart:T,onSelectionEnd:S,multiSelectionKeyCode:M,panActivationKeyCode:k,zoomActivationKeyCode:O,elementsSelectable:P,zoomOnScroll:i,zoomOnPinch:f,panOnScroll:d,panOnScrollSpeed:y,panOnScrollMode:w,zoomOnDoubleClick:v,panOnDrag:x,defaultViewport:A,translateExtent:$,minZoom:D,maxZoom:E,preventScrolling:C,onSelectionContextMenu:h,noWheelClassName:N,noPanClassName:L,disableKeyboardA11y:R})=>{const z=Te(qg),B=zn(g),H=zn(k),j=H||x,V=H||d,W=B||b&&j!==!0;return Og({deleteKeyCode:c,multiSelectionKeyCode:M}),G.createElement(Pg,{onMove:l,onMoveStart:u,onMoveEnd:p,onPaneContextMenu:a,elementsSelectable:P,zoomOnScroll:i,zoomOnPinch:f,panOnScroll:V,panOnScrollSpeed:y,panOnScrollMode:w,zoomOnDoubleClick:v,panOnDrag:!B&&j,defaultViewport:A,translateExtent:$,minZoom:D,maxZoom:E,zoomActivationKeyCode:O,preventScrolling:C,noWheelClassName:N,noPanClassName:L},G.createElement(Uc,{onSelectionStart:T,onSelectionEnd:S,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:j,isSelecting:!!W,selectionMode:_},e,z&&G.createElement(Wg,{onSelectionContextMenu:h,noPanClassName:L,disableKeyboardA11y:R})))};qc.displayName="FlowRenderer";var Yg=I.memo(qc);function Zg(e){return Te(I.useCallback(n=>e?vc(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function Xg(e){const t={input:Cn(e.input||Ic),default:Cn(e.default||Xs),output:Cn(e.output||Oc),group:Cn(e.group||Ai)},n={},r=Object.keys(e).filter(s=>!["input","default","output","group"].includes(s)).reduce((s,a)=>(s[a]=Cn(e[a]||Xs),s),n);return{...t,...r}}const Qg=({x:e,y:t,width:n,height:r,origin:s})=>!n||!r?{x:e,y:t}:s[0]<0||s[1]<0||s[0]>1||s[1]>1?{x:e,y:t}:{x:e-n*s[0],y:t-r*s[1]},Jg=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),Yc=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,updateNodeDimensions:a,onError:o}=Te(Jg,We),c=Zg(e.onlyRenderVisibleElements),l=I.useRef(),u=I.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const p=new ResizeObserver(g=>{const b=g.map(_=>({id:_.target.getAttribute("data-id"),nodeElement:_.target,forceUpdate:!0}));a(b)});return l.current=p,p},[]);return I.useEffect(()=>()=>{var p;(p=l==null?void 0:l.current)==null||p.disconnect()},[]),G.createElement("div",{className:"react-flow__nodes",style:Ii},c.map(p=>{var f,d,y;let g=p.type||"default";e.nodeTypes[g]||(o==null||o("003",St.error003(g)),g="default");const b=e.nodeTypes[g]||e.nodeTypes.default,_=!!(p.draggable||t&&typeof p.draggable>"u"),T=!!(p.selectable||s&&typeof p.selectable>"u"),S=!!(p.connectable||n&&typeof p.connectable>"u"),M=!!(p.focusable||r&&typeof p.focusable>"u"),k=e.nodeExtent?Si(p.positionAbsolute,e.nodeExtent):p.positionAbsolute,O=(k==null?void 0:k.x)??0,P=(k==null?void 0:k.y)??0,i=Qg({x:O,y:P,width:p.width??0,height:p.height??0,origin:e.nodeOrigin});return G.createElement(b,{key:p.id,id:p.id,className:p.className,style:p.style,type:g,data:p.data,sourcePosition:p.sourcePosition||re.Bottom,targetPosition:p.targetPosition||re.Top,hidden:p.hidden,xPos:O,yPos:P,xPosOrigin:i.x,yPosOrigin:i.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!p.selected,isDraggable:_,isSelectable:T,isConnectable:S,isFocusable:M,resizeObserver:u,dragHandle:p.dragHandle,zIndex:((f=p[Oe])==null?void 0:f.z)??0,isParent:!!((d=p[Oe])!=null&&d.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!p.width&&!!p.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:p.ariaLabel,hasHandleBounds:!!((y=p[Oe])!=null&&y.handleBounds)})}))};Yc.displayName="NodeRenderer";var em=I.memo(Yc);const tm=(e,t,n)=>n===re.Left?e-t:n===re.Right?e+t:e,nm=(e,t,n)=>n===re.Top?e-t:n===re.Bottom?e+t:e,Io="react-flow__edgeupdater",Ro=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:a,onMouseOut:o,type:c})=>G.createElement("circle",{onMouseDown:s,onMouseEnter:a,onMouseOut:o,className:nt([Io,`${Io}-${c}`]),cx:tm(t,r,e),cy:nm(n,r,e),r,stroke:"transparent",fill:"transparent"}),rm=()=>!0;var Jt=e=>{const t=({id:n,className:r,type:s,data:a,onClick:o,onEdgeDoubleClick:c,selected:l,animated:u,label:p,labelStyle:g,labelShowBg:b,labelBgStyle:_,labelBgPadding:T,labelBgBorderRadius:S,style:M,source:k,target:O,sourceX:P,sourceY:i,targetX:f,targetY:d,sourcePosition:y,targetPosition:w,elementsSelectable:v,hidden:x,sourceHandleId:A,targetHandleId:$,onContextMenu:D,onMouseEnter:E,onMouseMove:C,onMouseLeave:h,edgeUpdaterRadius:N,onEdgeUpdate:L,onEdgeUpdateStart:R,onEdgeUpdateEnd:z,markerEnd:B,markerStart:H,rfId:j,ariaLabel:V,isFocusable:W,isUpdatable:ne,pathOptions:Z,interactionWidth:q})=>{const ie=I.useRef(null),[oe,pe]=I.useState(!1),[Me,ve]=I.useState(!1),be=Pe(),ge=I.useMemo(()=>`url('#${Ys(H,j)}')`,[H,j]),se=I.useMemo(()=>`url('#${Ys(B,j)}')`,[B,j]);if(x)return null;const we=ue=>{var Qe;const{edges:_e,addSelectedEdges:Xe,unselectNodesAndEdges:$e,multiSelectionActive:_t}=be.getState(),Ke=_e.find(kt=>kt.id===n);Ke&&(v&&(be.setState({nodesSelectionActive:!1}),Ke.selected&&_t?($e({nodes:[],edges:[Ke]}),(Qe=ie.current)==null||Qe.blur()):Xe([n])),o&&o(ue,Ke))},U=kn(n,be.getState,c),He=kn(n,be.getState,D),me=kn(n,be.getState,E),fe=kn(n,be.getState,C),qe=kn(n,be.getState,h),Ae=(ue,_e)=>{if(ue.button!==0)return;const{edges:Xe,isValidConnection:$e}=be.getState(),_t=_e?O:k,Ke=(_e?$:A)||null,Qe=_e?"target":"source",kt=$e||rm,ct=_e,lt=Xe.find(yt=>yt.id===n);ve(!0),R==null||R(ue,lt,Qe);const yn=yt=>{ve(!1),z==null||z(yt,lt,Qe)};Cc({event:ue,handleId:Ke,nodeId:_t,onConnect:yt=>L==null?void 0:L(lt,yt),isTarget:ct,getState:be.getState,setState:be.setState,isValidConnection:kt,edgeUpdaterType:Qe,onEdgeUpdateEnd:yn})},Ge=ue=>Ae(ue,!0),Ze=ue=>Ae(ue,!1),K=()=>pe(!0),Q=()=>pe(!1),te=!v&&!o,ce=ue=>{var _e;if(gc.includes(ue.key)&&v){const{unselectNodesAndEdges:Xe,addSelectedEdges:$e,edges:_t}=be.getState();ue.key==="Escape"?((_e=ie.current)==null||_e.blur(),Xe({edges:[_t.find(Qe=>Qe.id===n)]})):$e([n])}};return G.createElement("g",{className:nt(["react-flow__edge",`react-flow__edge-${s}`,r,{selected:l,animated:u,inactive:te,updating:oe}]),onClick:we,onDoubleClick:U,onContextMenu:He,onMouseEnter:me,onMouseMove:fe,onMouseLeave:qe,onKeyDown:W?ce:void 0,tabIndex:W?0:void 0,role:W?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":V===null?void 0:V||`Edge from ${k} to ${O}`,"aria-describedby":W?`${Bc}-${j}`:void 0,ref:ie},!Me&&G.createElement(e,{id:n,source:k,target:O,selected:l,animated:u,label:p,labelStyle:g,labelShowBg:b,labelBgStyle:_,labelBgPadding:T,labelBgBorderRadius:S,data:a,style:M,sourceX:P,sourceY:i,targetX:f,targetY:d,sourcePosition:y,targetPosition:w,sourceHandleId:A,targetHandleId:$,markerStart:ge,markerEnd:se,pathOptions:Z,interactionWidth:q}),ne&&G.createElement(G.Fragment,null,(ne==="source"||ne===!0)&&G.createElement(Ro,{position:y,centerX:P,centerY:i,radius:N,onMouseDown:Ge,onMouseEnter:K,onMouseOut:Q,type:"source"}),(ne==="target"||ne===!0)&&G.createElement(Ro,{position:w,centerX:f,centerY:d,radius:N,onMouseDown:Ze,onMouseEnter:K,onMouseOut:Q,type:"target"})))};return t.displayName="EdgeWrapper",I.memo(t)};function sm(e){const t={default:Jt(e.default||Rr),straight:Jt(e.bezier||Ni),step:Jt(e.step||ki),smoothstep:Jt(e.step||qr),simplebezier:Jt(e.simplebezier||xi)},n={},r=Object.keys(e).filter(s=>!["default","bezier"].includes(s)).reduce((s,a)=>(s[a]=Jt(e[a]||Rr),s),n);return{...t,...r}}function Oo(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,s=((n==null?void 0:n.y)||0)+t.y,a=(n==null?void 0:n.width)||t.width,o=(n==null?void 0:n.height)||t.height;switch(e){case re.Top:return{x:r+a/2,y:s};case re.Right:return{x:r+a,y:s+o/2};case re.Bottom:return{x:r+a/2,y:s+o};case re.Left:return{x:r,y:s+o/2}}}function Do(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const im=(e,t,n,r,s,a)=>{const o=Oo(n,e,t),c=Oo(a,r,s);return{sourceX:o.x,sourceY:o.y,targetX:c.x,targetY:c.y}};function om({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:s,targetHeight:a,width:o,height:c,transform:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+s),y2:Math.max(e.y+r,t.y+a)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const p=Pn({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:o/l[2],height:c/l[2]}),g=Math.max(0,Math.min(p.x2,u.x2)-Math.max(p.x,u.x)),b=Math.max(0,Math.min(p.y2,u.y2)-Math.max(p.y,u.y));return Math.ceil(g*b)>0}function Lo(e){var r,s,a,o,c;const t=((r=e==null?void 0:e[Oe])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)<"u"&&typeof((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.y)<"u";return[{x:((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.x)||0,y:((c=e==null?void 0:e.positionAbsolute)==null?void 0:c.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const am=[{level:0,isMaxLevel:!0,edges:[]}];function cm(e,t,n=!1){let r=-1;const s=e.reduce((o,c)=>{var p,g;const l=et(c.zIndex);let u=l?c.zIndex:0;if(n){const b=t.get(c.target),_=t.get(c.source),T=c.selected||(b==null?void 0:b.selected)||(_==null?void 0:_.selected),S=Math.max(((p=_==null?void 0:_[Oe])==null?void 0:p.z)||0,((g=b==null?void 0:b[Oe])==null?void 0:g.z)||0,1e3);u=(l?c.zIndex:0)+(T?S:0)}return o[u]?o[u].push(c):o[u]=[c],r=u>r?u:r,o},{}),a=Object.entries(s).map(([o,c])=>{const l=+o;return{edges:c,level:l,isMaxLevel:l===r}});return a.length===0?am:a}function lm(e,t,n){const r=Te(I.useCallback(s=>e?s.edges.filter(a=>{const o=t.get(a.source),c=t.get(a.target);return(o==null?void 0:o.width)&&(o==null?void 0:o.height)&&(c==null?void 0:c.width)&&(c==null?void 0:c.height)&&om({sourcePos:o.positionAbsolute||{x:0,y:0},targetPos:c.positionAbsolute||{x:0,y:0},sourceWidth:o.width,sourceHeight:o.height,targetWidth:c.width,targetHeight:c.height,width:s.width,height:s.height,transform:s.transform})}):s.edges,[e,t]));return cm(r,t,n)}const dm=({color:e="none",strokeWidth:t=1})=>G.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),um=({color:e="none",strokeWidth:t=1})=>G.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Bo={[Ir.Arrow]:dm,[Ir.ArrowClosed]:um};function fm(e){const t=Pe();return I.useMemo(()=>{var s,a;return Object.prototype.hasOwnProperty.call(Bo,e)?Bo[e]:((a=(s=t.getState()).onError)==null||a.call(s,"009",St.error009(e)),null)},[e])}const pm=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:a="strokeWidth",strokeWidth:o,orient:c="auto-start-reverse"})=>{const l=fm(t);return l?G.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:c,refX:"0",refY:"0"},G.createElement(l,{color:n,strokeWidth:o})):null},hm=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((s,a)=>([a.markerStart,a.markerEnd].forEach(o=>{if(o&&typeof o=="object"){const c=Ys(o,t);r.includes(c)||(s.push({id:c,color:o.color||e,...o}),r.push(c))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))},Zc=({defaultColor:e,rfId:t})=>{const n=Te(I.useCallback(hm({defaultColor:e,rfId:t}),[e,t]),(r,s)=>!(r.length!==s.length||r.some((a,o)=>a.id!==s[o].id)));return G.createElement("defs",null,n.map(r=>G.createElement(pm,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};Zc.displayName="MarkerDefinitions";var gm=I.memo(Zc);const mm=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),Xc=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:s,noPanClassName:a,onEdgeUpdate:o,onEdgeContextMenu:c,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:p,onEdgeClick:g,edgeUpdaterRadius:b,onEdgeDoubleClick:_,onEdgeUpdateStart:T,onEdgeUpdateEnd:S,children:M})=>{const{edgesFocusable:k,edgesUpdatable:O,elementsSelectable:P,width:i,height:f,connectionMode:d,nodeInternals:y,onError:w}=Te(mm,We),v=lm(t,y,n);return i?G.createElement(G.Fragment,null,v.map(({level:x,edges:A,isMaxLevel:$})=>G.createElement("svg",{key:x,style:{zIndex:x},width:i,height:f,className:"react-flow__edges react-flow__container"},$&&G.createElement(gm,{defaultColor:e,rfId:r}),G.createElement("g",null,A.map(D=>{const[E,C,h]=Lo(y.get(D.source)),[N,L,R]=Lo(y.get(D.target));if(!h||!R)return null;let z=D.type||"default";s[z]||(w==null||w("011",St.error011(z)),z="default");const B=s[z]||s.default,H=d===Vt.Strict?L.target:(L.target??[]).concat(L.source??[]),j=Do(C.source,D.sourceHandle),V=Do(H,D.targetHandle),W=(j==null?void 0:j.position)||re.Bottom,ne=(V==null?void 0:V.position)||re.Top,Z=!!(D.focusable||k&&typeof D.focusable>"u"),q=typeof o<"u"&&(D.updatable||O&&typeof D.updatable>"u");if(!j||!V)return w==null||w("008",St.error008(j,D)),null;const{sourceX:ie,sourceY:oe,targetX:pe,targetY:Me}=im(E,j,W,N,V,ne);return G.createElement(B,{key:D.id,id:D.id,className:nt([D.className,a]),type:z,data:D.data,selected:!!D.selected,animated:!!D.animated,hidden:!!D.hidden,label:D.label,labelStyle:D.labelStyle,labelShowBg:D.labelShowBg,labelBgStyle:D.labelBgStyle,labelBgPadding:D.labelBgPadding,labelBgBorderRadius:D.labelBgBorderRadius,style:D.style,source:D.source,target:D.target,sourceHandleId:D.sourceHandle,targetHandleId:D.targetHandle,markerEnd:D.markerEnd,markerStart:D.markerStart,sourceX:ie,sourceY:oe,targetX:pe,targetY:Me,sourcePosition:W,targetPosition:ne,elementsSelectable:P,onEdgeUpdate:o,onContextMenu:c,onMouseEnter:l,onMouseMove:u,onMouseLeave:p,onClick:g,edgeUpdaterRadius:b,onEdgeDoubleClick:_,onEdgeUpdateStart:T,onEdgeUpdateEnd:S,rfId:r,ariaLabel:D.ariaLabel,isFocusable:Z,isUpdatable:q,pathOptions:"pathOptions"in D?D.pathOptions:void 0,interactionWidth:D.interactionWidth})})))),M):null};Xc.displayName="EdgeRenderer";var bm=I.memo(Xc);const _m=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function ym({children:e}){const t=Te(_m);return G.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function wm(e){const t=Hc(),n=I.useRef(!1);I.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Em={[re.Left]:re.Right,[re.Right]:re.Left,[re.Top]:re.Bottom,[re.Bottom]:re.Top},Qc=({nodeId:e,handleType:t,style:n,type:r=Mt.Bezier,CustomComponent:s,connectionStatus:a})=>{var d,y,w;const{fromNode:o,handleId:c,toX:l,toY:u,connectionMode:p}=Te(I.useCallback(v=>({fromNode:v.nodeInternals.get(e),handleId:v.connectionHandleId,toX:(v.connectionPosition.x-v.transform[0])/v.transform[2],toY:(v.connectionPosition.y-v.transform[1])/v.transform[2],connectionMode:v.connectionMode}),[e]),We),g=(d=o==null?void 0:o[Oe])==null?void 0:d.handleBounds;let b=g==null?void 0:g[t];if(p===Vt.Loose&&(b=b||(g==null?void 0:g[t==="source"?"target":"source"])),!o||!b)return null;const _=c?b.find(v=>v.id===c):b[0],T=_?_.x+_.width/2:(o.width??0)/2,S=_?_.y+_.height/2:o.height??0,M=(((y=o.positionAbsolute)==null?void 0:y.x)??0)+T,k=(((w=o.positionAbsolute)==null?void 0:w.y)??0)+S,O=_==null?void 0:_.position,P=O?Em[O]:null;if(!O||!P)return null;if(s)return G.createElement(s,{connectionLineType:r,connectionLineStyle:n,fromNode:o,fromHandle:_,fromX:M,fromY:k,toX:l,toY:u,fromPosition:O,toPosition:P,connectionStatus:a});let i="";const f={sourceX:M,sourceY:k,sourcePosition:O,targetX:l,targetY:u,targetPosition:P};return r===Mt.Bezier?[i]=wc(f):r===Mt.Step?[i]=qs({...f,borderRadius:0}):r===Mt.SmoothStep?[i]=qs(f):r===Mt.SimpleBezier?[i]=yc(f):i=`M${M},${k} ${l},${u}`,G.createElement("path",{d:i,fill:"none",className:"react-flow__connection-path",style:n})};Qc.displayName="ConnectionLine";const vm=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Sm({containerStyle:e,style:t,type:n,component:r}){const{nodeId:s,handleType:a,nodesConnectable:o,width:c,height:l,connectionStatus:u}=Te(vm,We);return!(s&&a&&c&&o)?null:G.createElement("svg",{style:e,width:c,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container"},G.createElement("g",{className:nt(["react-flow__connection",u])},G.createElement(Qc,{nodeId:s,handleType:a,style:t,type:n,CustomComponent:r,connectionStatus:u})))}function Po(e,t){return I.useRef(null),Pe(),I.useMemo(()=>t(e),[e])}const Jc=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:s,onInit:a,onNodeClick:o,onEdgeClick:c,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:p,onNodeMouseMove:g,onNodeMouseLeave:b,onNodeContextMenu:_,onSelectionContextMenu:T,onSelectionStart:S,onSelectionEnd:M,connectionLineType:k,connectionLineStyle:O,connectionLineComponent:P,connectionLineContainerStyle:i,selectionKeyCode:f,selectionOnDrag:d,selectionMode:y,multiSelectionKeyCode:w,panActivationKeyCode:v,zoomActivationKeyCode:x,deleteKeyCode:A,onlyRenderVisibleElements:$,elementsSelectable:D,selectNodesOnDrag:E,defaultViewport:C,translateExtent:h,minZoom:N,maxZoom:L,preventScrolling:R,defaultMarkerColor:z,zoomOnScroll:B,zoomOnPinch:H,panOnScroll:j,panOnScrollSpeed:V,panOnScrollMode:W,zoomOnDoubleClick:ne,panOnDrag:Z,onPaneClick:q,onPaneMouseEnter:ie,onPaneMouseMove:oe,onPaneMouseLeave:pe,onPaneScroll:Me,onPaneContextMenu:ve,onEdgeUpdate:be,onEdgeContextMenu:ge,onEdgeMouseEnter:se,onEdgeMouseMove:we,onEdgeMouseLeave:U,edgeUpdaterRadius:He,onEdgeUpdateStart:me,onEdgeUpdateEnd:fe,noDragClassName:qe,noWheelClassName:Ae,noPanClassName:Ge,elevateEdgesOnSelect:Ze,disableKeyboardA11y:K,nodeOrigin:Q,nodeExtent:te,rfId:ce})=>{const ue=Po(e,Xg),_e=Po(t,sm);return wm(a),G.createElement(Yg,{onPaneClick:q,onPaneMouseEnter:ie,onPaneMouseMove:oe,onPaneMouseLeave:pe,onPaneContextMenu:ve,onPaneScroll:Me,deleteKeyCode:A,selectionKeyCode:f,selectionOnDrag:d,selectionMode:y,onSelectionStart:S,onSelectionEnd:M,multiSelectionKeyCode:w,panActivationKeyCode:v,zoomActivationKeyCode:x,elementsSelectable:D,onMove:n,onMoveStart:r,onMoveEnd:s,zoomOnScroll:B,zoomOnPinch:H,zoomOnDoubleClick:ne,panOnScroll:j,panOnScrollSpeed:V,panOnScrollMode:W,panOnDrag:Z,defaultViewport:C,translateExtent:h,minZoom:N,maxZoom:L,onSelectionContextMenu:T,preventScrolling:R,noDragClassName:qe,noWheelClassName:Ae,noPanClassName:Ge,disableKeyboardA11y:K},G.createElement(ym,null,G.createElement(bm,{edgeTypes:_e,onEdgeClick:c,onEdgeDoubleClick:u,onEdgeUpdate:be,onlyRenderVisibleElements:$,onEdgeContextMenu:ge,onEdgeMouseEnter:se,onEdgeMouseMove:we,onEdgeMouseLeave:U,onEdgeUpdateStart:me,onEdgeUpdateEnd:fe,edgeUpdaterRadius:He,defaultMarkerColor:z,noPanClassName:Ge,elevateEdgesOnSelect:!!Ze,disableKeyboardA11y:K,rfId:ce},G.createElement(Sm,{style:O,type:k,component:P,containerStyle:i})),G.createElement("div",{className:"react-flow__edgelabel-renderer"}),G.createElement(em,{nodeTypes:ue,onNodeClick:o,onNodeDoubleClick:l,onNodeMouseEnter:p,onNodeMouseMove:g,onNodeMouseLeave:b,onNodeContextMenu:_,selectNodesOnDrag:E,onlyRenderVisibleElements:$,noPanClassName:Ge,noDragClassName:qe,disableKeyboardA11y:K,nodeOrigin:Q,nodeExtent:te,rfId:ce})))};Jc.displayName="GraphView";var xm=I.memo(Jc);const Js=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Nt={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Js,nodeExtent:Js,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Vt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:Qh,isValidConnection:void 0},km=()=>Mu((e,t)=>({...Nt,setNodes:n=>{const{nodeInternals:r,nodeOrigin:s,elevateNodesOnSelect:a}=t();e({nodeInternals:Es(n,r,s,a)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(s=>({...r,...s}))})},setDefaultNodesAndEdges:(n,r)=>{const s=typeof n<"u",a=typeof r<"u",o=s?Es(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:o,edges:a?r:[],hasDefaultNodes:s,hasDefaultEdges:a})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:s,fitViewOnInit:a,fitViewOnInitDone:o,fitViewOnInitOptions:c,domNode:l,nodeOrigin:u}=t(),p=l==null?void 0:l.querySelector(".react-flow__viewport");if(!p)return;const g=window.getComputedStyle(p),{m22:b}=new window.DOMMatrixReadOnly(g.transform),_=n.reduce((S,M)=>{const k=s.get(M.id);if(k){const O=vi(M.nodeElement);!!(O.width&&O.height&&(k.width!==O.width||k.height!==O.height||M.forceUpdate))&&(s.set(k.id,{...k,[Oe]:{...k[Oe],handleBounds:{source:Ao(".source",M.nodeElement,b,u),target:Ao(".target",M.nodeElement,b,u)}},...O}),S.push({id:k.id,type:"dimensions",dimensions:O}))}return S},[]);$c(s,u);const T=o||a&&!o&&zc(t,{initial:!0,...c});e({nodeInternals:new Map(s),fitViewOnInitDone:T}),(_==null?void 0:_.length)>0&&(r==null||r(_))},updateNodePositions:(n,r=!0,s=!1)=>{const{triggerNodeChanges:a}=t(),o=n.map(c=>{const l={id:c.id,type:"position",dragging:s};return r&&(l.positionAbsolute=c.positionAbsolute,l.position=c.position),l});a(o)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:s,hasDefaultNodes:a,nodeOrigin:o,getNodes:c,elevateNodesOnSelect:l}=t();if(n!=null&&n.length){if(a){const u=jc(n,c()),p=Es(u,s,o,l);e({nodeInternals:p})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:s,getNodes:a}=t();let o,c=null;r?o=n.map(l=>Ct(l,!0)):(o=rn(a(),n),c=rn(s,[])),ar({changedNodes:o,changedEdges:c,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:s,getNodes:a}=t();let o,c=null;r?o=n.map(l=>Ct(l,!0)):(o=rn(s,n),c=rn(a(),[])),ar({changedNodes:c,changedEdges:o,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:s,getNodes:a}=t(),o=n||a(),c=r||s,l=o.map(p=>(p.selected=!1,Ct(p.id,!1))),u=c.map(p=>Ct(p.id,!1));ar({changedNodes:l,changedEdges:u,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:s}=t();r==null||r.scaleExtent([n,s]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:s}=t();r==null||r.scaleExtent([s,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),a=r().filter(c=>c.selected).map(c=>Ct(c.id,!1)),o=n.filter(c=>c.selected).map(c=>Ct(c.id,!1));ar({changedNodes:a,changedEdges:o,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(s=>{s.positionAbsolute=Si(s.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:s,height:a,d3Zoom:o,d3Selection:c,translateExtent:l}=t();if(!o||!c||!n.x&&!n.y)return!1;const u=It.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),p=[[0,0],[s,a]],g=o==null?void 0:o.constrain()(u,p,l);return o.transform(c,g),r[0]!==g.x||r[1]!==g.y||r[2]!==g.k},cancelConnection:()=>e({connectionNodeId:Nt.connectionNodeId,connectionHandleId:Nt.connectionHandleId,connectionHandleType:Nt.connectionHandleType,connectionStatus:Nt.connectionStatus,connectionStartHandle:Nt.connectionStartHandle,connectionEndHandle:Nt.connectionEndHandle}),reset:()=>e({...Nt})}),Object.is),el=({children:e})=>{const t=I.useRef(null);return t.current||(t.current=km()),G.createElement(Gh,{value:t.current},e)};el.displayName="ReactFlowProvider";const tl=({children:e})=>I.useContext(Wr)?G.createElement(G.Fragment,null,e):G.createElement(el,null,e);tl.displayName="ReactFlowWrapper";const Nm={input:Ic,default:Xs,output:Oc,group:Ai},Cm={default:Rr,straight:Ni,step:ki,smoothstep:qr,simplebezier:xi},Tm=[0,0],Mm=[15,15],Am={x:0,y:0,zoom:1},Im={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Rm=I.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:a=Nm,edgeTypes:o=Cm,onNodeClick:c,onEdgeClick:l,onInit:u,onMove:p,onMoveStart:g,onMoveEnd:b,onConnect:_,onConnectStart:T,onConnectEnd:S,onClickConnectStart:M,onClickConnectEnd:k,onNodeMouseEnter:O,onNodeMouseMove:P,onNodeMouseLeave:i,onNodeContextMenu:f,onNodeDoubleClick:d,onNodeDragStart:y,onNodeDrag:w,onNodeDragStop:v,onNodesDelete:x,onEdgesDelete:A,onSelectionChange:$,onSelectionDragStart:D,onSelectionDrag:E,onSelectionDragStop:C,onSelectionContextMenu:h,onSelectionStart:N,onSelectionEnd:L,connectionMode:R=Vt.Strict,connectionLineType:z=Mt.Bezier,connectionLineStyle:B,connectionLineComponent:H,connectionLineContainerStyle:j,deleteKeyCode:V="Backspace",selectionKeyCode:W="Shift",selectionOnDrag:ne=!1,selectionMode:Z=$n.Full,panActivationKeyCode:q="Space",multiSelectionKeyCode:ie=Ar()?"Meta":"Control",zoomActivationKeyCode:oe=Ar()?"Meta":"Control",snapToGrid:pe=!1,snapGrid:Me=Mm,onlyRenderVisibleElements:ve=!1,selectNodesOnDrag:be=!0,nodesDraggable:ge,nodesConnectable:se,nodesFocusable:we,nodeOrigin:U=Tm,edgesFocusable:He,edgesUpdatable:me,elementsSelectable:fe,defaultViewport:qe=Am,minZoom:Ae=.5,maxZoom:Ge=2,translateExtent:Ze=Js,preventScrolling:K=!0,nodeExtent:Q,defaultMarkerColor:te="#b1b1b7",zoomOnScroll:ce=!0,zoomOnPinch:ue=!0,panOnScroll:_e=!1,panOnScrollSpeed:Xe=.5,panOnScrollMode:$e=zt.Free,zoomOnDoubleClick:_t=!0,panOnDrag:Ke=!0,onPaneClick:Qe,onPaneMouseEnter:kt,onPaneMouseMove:ct,onPaneMouseLeave:lt,onPaneScroll:yn,onPaneContextMenu:Zn,children:yt,onEdgeUpdate:Qr,onEdgeContextMenu:Jr,onEdgeDoubleClick:es,onEdgeMouseEnter:Xn,onEdgeMouseMove:ts,onEdgeMouseLeave:Qn,onEdgeUpdateStart:wn,onEdgeUpdateEnd:ns,edgeUpdaterRadius:rs=10,onNodesChange:ss,onEdgesChange:is,noDragClassName:os="nodrag",noWheelClassName:as="nowheel",noPanClassName:En="nopan",fitView:cs=!1,fitViewOptions:Jn,connectOnClick:er=!0,attributionPosition:tr,proOptions:ls,defaultEdgeOptions:ds,elevateNodesOnSelect:F=!0,elevateEdgesOnSelect:Y=!1,disableKeyboardA11y:ee=!1,autoPanOnConnect:J=!0,autoPanOnNodeDrag:ye=!0,connectionRadius:Se=20,isValidConnection:xe,onError:Fe,style:ke,id:Ne,nodeDragThreshold:Ee,...De},Je)=>{const vn=Ne||"1";return G.createElement("div",{...De,style:{...ke,...Im},ref:Je,className:nt(["react-flow",s]),"data-testid":"rf__wrapper",id:Ne},G.createElement(tl,null,G.createElement(xm,{onInit:u,onMove:p,onMoveStart:g,onMoveEnd:b,onNodeClick:c,onEdgeClick:l,onNodeMouseEnter:O,onNodeMouseMove:P,onNodeMouseLeave:i,onNodeContextMenu:f,onNodeDoubleClick:d,nodeTypes:a,edgeTypes:o,connectionLineType:z,connectionLineStyle:B,connectionLineComponent:H,connectionLineContainerStyle:j,selectionKeyCode:W,selectionOnDrag:ne,selectionMode:Z,deleteKeyCode:V,multiSelectionKeyCode:ie,panActivationKeyCode:q,zoomActivationKeyCode:oe,onlyRenderVisibleElements:ve,selectNodesOnDrag:be,defaultViewport:qe,translateExtent:Ze,minZoom:Ae,maxZoom:Ge,preventScrolling:K,zoomOnScroll:ce,zoomOnPinch:ue,zoomOnDoubleClick:_t,panOnScroll:_e,panOnScrollSpeed:Xe,panOnScrollMode:$e,panOnDrag:Ke,onPaneClick:Qe,onPaneMouseEnter:kt,onPaneMouseMove:ct,onPaneMouseLeave:lt,onPaneScroll:yn,onPaneContextMenu:Zn,onSelectionContextMenu:h,onSelectionStart:N,onSelectionEnd:L,onEdgeUpdate:Qr,onEdgeContextMenu:Jr,onEdgeDoubleClick:es,onEdgeMouseEnter:Xn,onEdgeMouseMove:ts,onEdgeMouseLeave:Qn,onEdgeUpdateStart:wn,onEdgeUpdateEnd:ns,edgeUpdaterRadius:rs,defaultMarkerColor:te,noDragClassName:os,noWheelClassName:as,noPanClassName:En,elevateEdgesOnSelect:Y,rfId:vn,disableKeyboardA11y:ee,nodeOrigin:U,nodeExtent:Q}),G.createElement(Eg,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:_,onConnectStart:T,onConnectEnd:S,onClickConnectStart:M,onClickConnectEnd:k,nodesDraggable:ge,nodesConnectable:se,nodesFocusable:we,edgesFocusable:He,edgesUpdatable:me,elementsSelectable:fe,elevateNodesOnSelect:F,minZoom:Ae,maxZoom:Ge,nodeExtent:Q,onNodesChange:ss,onEdgesChange:is,snapToGrid:pe,snapGrid:Me,connectionMode:R,translateExtent:Ze,connectOnClick:er,defaultEdgeOptions:ds,fitView:cs,fitViewOptions:Jn,onNodesDelete:x,onEdgesDelete:A,onNodeDragStart:y,onNodeDrag:w,onNodeDragStop:v,onSelectionDrag:E,onSelectionDragStart:D,onSelectionDragStop:C,noPanClassName:En,nodeOrigin:U,rfId:vn,autoPanOnConnect:J,autoPanOnNodeDrag:ye,onError:Fe,connectionRadius:Se,isValidConnection:xe,nodeDragThreshold:Ee}),G.createElement(yg,{onSelectionChange:$}),yt,G.createElement(qh,{proOptions:ls,position:tr}),G.createElement(Ng,{rfId:vn,disableKeyboardA11y:ee})))});Rm.displayName="ReactFlow";const Om=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function z0({children:e}){const t=Te(Om);return t?xt.createPortal(e,t):null}function Dm(){const e=Pe();return I.useCallback(t=>{const{domNode:n,updateNodeDimensions:r}=e.getState(),a=(Array.isArray(t)?t:[t]).reduce((o,c)=>{const l=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${c}"]`);return l&&o.push({id:c,nodeElement:l,forceUpdate:!0}),o},[]);requestAnimationFrame(()=>r(a))},[])}function nl(e){return t=>{const[n,r]=I.useState(t),s=I.useCallback(a=>r(o=>e(a,o)),[]);return[n,r,s]}}const H0=nl(jc),F0=nl(Hg);var rl={exports:{}};(function(e){(function(){function t(i){var f={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:`Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`,type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,describe:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,describe:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,describe:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,describe:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},ellipsis:{defaultValue:!0,describe:"Replaces three dots with the ellipsis unicode character",type:"boolean"},completeHTMLDocument:{defaultValue:!1,describe:"Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",type:"boolean"},metadata:{defaultValue:!1,describe:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,describe:"Split adjacent blockquote blocks",type:"boolean"}};if(i===!1)return JSON.parse(JSON.stringify(f));var d={};for(var y in f)f.hasOwnProperty(y)&&(d[y]=f[y].defaultValue);return d}function n(){var i=t(!0),f={};for(var d in i)i.hasOwnProperty(d)&&(f[d]=!0);return f}var r={},s={},a={},o=t(!0),c="vanilla",l={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:t(!0),allOn:n()};r.helper={},r.extensions={},r.setOption=function(i,f){return o[i]=f,this},r.getOption=function(i){return o[i]},r.getOptions=function(){return o},r.resetOptions=function(){o=t(!0)},r.setFlavor=function(i){if(!l.hasOwnProperty(i))throw Error(i+" flavor was not found");r.resetOptions();var f=l[i];c=i;for(var d in f)f.hasOwnProperty(d)&&(o[d]=f[d])},r.getFlavor=function(){return c},r.getFlavorOptions=function(i){if(l.hasOwnProperty(i))return l[i]},r.getDefaultOptions=function(i){return t(i)},r.subParser=function(i,f){if(r.helper.isString(i))if(typeof f<"u")s[i]=f;else{if(s.hasOwnProperty(i))return s[i];throw Error("SubParser named "+i+" not registered!")}},r.extension=function(i,f){if(!r.helper.isString(i))throw Error("Extension 'name' must be a string");if(i=r.helper.stdExtName(i),r.helper.isUndefined(f)){if(!a.hasOwnProperty(i))throw Error("Extension named "+i+" is not registered!");return a[i]}else{typeof f=="function"&&(f=f()),r.helper.isArray(f)||(f=[f]);var d=u(f,i);if(d.valid)a[i]=f;else throw Error(d.error)}},r.getAllExtensions=function(){return a},r.removeExtension=function(i){delete a[i]},r.resetExtensions=function(){a={}};function u(i,f){var d=f?"Error in "+f+" extension->":"Error in unnamed extension",y={valid:!0,error:""};r.helper.isArray(i)||(i=[i]);for(var w=0;w<i.length;++w){var v=d+" sub-extension "+w+": ",x=i[w];if(typeof x!="object")return y.valid=!1,y.error=v+"must be an object, but "+typeof x+" given",y;if(!r.helper.isString(x.type))return y.valid=!1,y.error=v+'property "type" must be a string, but '+typeof x.type+" given",y;var A=x.type=x.type.toLowerCase();if(A==="language"&&(A=x.type="lang"),A==="html"&&(A=x.type="output"),A!=="lang"&&A!=="output"&&A!=="listener")return y.valid=!1,y.error=v+"type "+A+' is not recognized. Valid values: "lang/language", "output/html" or "listener"',y;if(A==="listener"){if(r.helper.isUndefined(x.listeners))return y.valid=!1,y.error=v+'. Extensions of type "listener" must have a property called "listeners"',y}else if(r.helper.isUndefined(x.filter)&&r.helper.isUndefined(x.regex))return y.valid=!1,y.error=v+A+' extensions must define either a "regex" property or a "filter" method',y;if(x.listeners){if(typeof x.listeners!="object")return y.valid=!1,y.error=v+'"listeners" property must be an object but '+typeof x.listeners+" given",y;for(var $ in x.listeners)if(x.listeners.hasOwnProperty($)&&typeof x.listeners[$]!="function")return y.valid=!1,y.error=v+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+$+" must be a function but "+typeof x.listeners[$]+" given",y}if(x.filter){if(typeof x.filter!="function")return y.valid=!1,y.error=v+'"filter" must be a function, but '+typeof x.filter+" given",y}else if(x.regex){if(r.helper.isString(x.regex)&&(x.regex=new RegExp(x.regex,"g")),!(x.regex instanceof RegExp))return y.valid=!1,y.error=v+'"regex" property must either be a string or a RegExp object, but '+typeof x.regex+" given",y;if(r.helper.isUndefined(x.replace))return y.valid=!1,y.error=v+'"regex" extensions must implement a replace string or function',y}}return y}r.validateExtension=function(i){var f=u(i,null);return f.valid?!0:(console.warn(f.error),!1)},r.hasOwnProperty("helper")||(r.helper={}),r.helper.isString=function(i){return typeof i=="string"||i instanceof String},r.helper.isFunction=function(i){var f={};return i&&f.toString.call(i)==="[object Function]"},r.helper.isArray=function(i){return Array.isArray(i)},r.helper.isUndefined=function(i){return typeof i>"u"},r.helper.forEach=function(i,f){if(r.helper.isUndefined(i))throw new Error("obj param is required");if(r.helper.isUndefined(f))throw new Error("callback param is required");if(!r.helper.isFunction(f))throw new Error("callback param must be a function/closure");if(typeof i.forEach=="function")i.forEach(f);else if(r.helper.isArray(i))for(var d=0;d<i.length;d++)f(i[d],d,i);else if(typeof i=="object")for(var y in i)i.hasOwnProperty(y)&&f(i[y],y,i);else throw new Error("obj does not seem to be an array or an iterable object")},r.helper.stdExtName=function(i){return i.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()};function p(i,f){var d=f.charCodeAt(0);return"¨E"+d+"E"}r.helper.escapeCharactersCallback=p,r.helper.escapeCharacters=function(i,f,d){var y="(["+f.replace(/([\[\]\\])/g,"\\$1")+"])";d&&(y="\\\\"+y);var w=new RegExp(y,"g");return i=i.replace(w,p),i},r.helper.unescapeHTMLEntities=function(i){return i.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")};var g=function(i,f,d,y){var w=y||"",v=w.indexOf("g")>-1,x=new RegExp(f+"|"+d,"g"+w.replace(/g/g,"")),A=new RegExp(f,w.replace(/g/g,"")),$=[],D,E,C,h,N;do for(D=0;C=x.exec(i);)if(A.test(C[0]))D++||(E=x.lastIndex,h=E-C[0].length);else if(D&&!--D){N=C.index+C[0].length;var L={left:{start:h,end:E},match:{start:E,end:C.index},right:{start:C.index,end:N},wholeMatch:{start:h,end:N}};if($.push(L),!v)return $}while(D&&(x.lastIndex=E));return $};r.helper.matchRecursiveRegExp=function(i,f,d,y){for(var w=g(i,f,d,y),v=[],x=0;x<w.length;++x)v.push([i.slice(w[x].wholeMatch.start,w[x].wholeMatch.end),i.slice(w[x].match.start,w[x].match.end),i.slice(w[x].left.start,w[x].left.end),i.slice(w[x].right.start,w[x].right.end)]);return v},r.helper.replaceRecursiveRegExp=function(i,f,d,y,w){if(!r.helper.isFunction(f)){var v=f;f=function(){return v}}var x=g(i,d,y,w),A=i,$=x.length;if($>0){var D=[];x[0].wholeMatch.start!==0&&D.push(i.slice(0,x[0].wholeMatch.start));for(var E=0;E<$;++E)D.push(f(i.slice(x[E].wholeMatch.start,x[E].wholeMatch.end),i.slice(x[E].match.start,x[E].match.end),i.slice(x[E].left.start,x[E].left.end),i.slice(x[E].right.start,x[E].right.end))),E<$-1&&D.push(i.slice(x[E].wholeMatch.end,x[E+1].wholeMatch.start));x[$-1].wholeMatch.end<i.length&&D.push(i.slice(x[$-1].wholeMatch.end)),A=D.join("")}return A},r.helper.regexIndexOf=function(i,f,d){if(!r.helper.isString(i))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";if(!(f instanceof RegExp))throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";var y=i.substring(d||0).search(f);return y>=0?y+(d||0):y},r.helper.splitAtIndex=function(i,f){if(!r.helper.isString(i))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[i.substring(0,f),i.substring(f)]},r.helper.encodeEmailAddress=function(i){var f=[function(d){return"&#"+d.charCodeAt(0)+";"},function(d){return"&#x"+d.charCodeAt(0).toString(16)+";"},function(d){return d}];return i=i.replace(/./g,function(d){if(d==="@")d=f[Math.floor(Math.random()*2)](d);else{var y=Math.random();d=y>.9?f[2](d):y>.45?f[1](d):f[0](d)}return d}),i},r.helper.padEnd=function(f,d,y){return d=d>>0,y=String(y||" "),f.length>d?String(f):(d=d-f.length,d>y.length&&(y+=y.repeat(d/y.length)),String(f)+y.slice(0,d))},typeof console>"u"&&(console={warn:function(i){alert(i)},log:function(i){alert(i)},error:function(i){throw i}}),r.helper.regexes={asteriskDashAndColon:/([*_:~])/g},r.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️&zwj;♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴&zwj;♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱&zwj;♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇&zwj;♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷&zwj;♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨&zwj;❤️&zwj;👨",couple_with_heart_woman_woman:"👩&zwj;❤️&zwj;👩",couplekiss_man_man:"👨&zwj;❤️&zwj;💋&zwj;👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩&zwj;❤️&zwj;💋&zwj;👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯&zwj;♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁&zwj;🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨&zwj;👦",family_man_boy_boy:"👨&zwj;👦&zwj;👦",family_man_girl:"👨&zwj;👧",family_man_girl_boy:"👨&zwj;👧&zwj;👦",family_man_girl_girl:"👨&zwj;👧&zwj;👧",family_man_man_boy:"👨&zwj;👨&zwj;👦",family_man_man_boy_boy:"👨&zwj;👨&zwj;👦&zwj;👦",family_man_man_girl:"👨&zwj;👨&zwj;👧",family_man_man_girl_boy:"👨&zwj;👨&zwj;👧&zwj;👦",family_man_man_girl_girl:"👨&zwj;👨&zwj;👧&zwj;👧",family_man_woman_boy_boy:"👨&zwj;👩&zwj;👦&zwj;👦",family_man_woman_girl:"👨&zwj;👩&zwj;👧",family_man_woman_girl_boy:"👨&zwj;👩&zwj;👧&zwj;👦",family_man_woman_girl_girl:"👨&zwj;👩&zwj;👧&zwj;👧",family_woman_boy:"👩&zwj;👦",family_woman_boy_boy:"👩&zwj;👦&zwj;👦",family_woman_girl:"👩&zwj;👧",family_woman_girl_boy:"👩&zwj;👧&zwj;👦",family_woman_girl_girl:"👩&zwj;👧&zwj;👧",family_woman_woman_boy:"👩&zwj;👩&zwj;👦",family_woman_woman_boy_boy:"👩&zwj;👩&zwj;👦&zwj;👦",family_woman_woman_girl:"👩&zwj;👩&zwj;👧",family_woman_woman_girl_boy:"👩&zwj;👩&zwj;👧&zwj;👦",family_woman_woman_girl_girl:"👩&zwj;👩&zwj;👧&zwj;👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️&zwj;♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍&zwj;♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️&zwj;♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂&zwj;♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇&zwj;♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨&zwj;🎨",man_astronaut:"👨&zwj;🚀",man_cartwheeling:"🤸&zwj;♂️",man_cook:"👨&zwj;🍳",man_dancing:"🕺",man_facepalming:"🤦&zwj;♂️",man_factory_worker:"👨&zwj;🏭",man_farmer:"👨&zwj;🌾",man_firefighter:"👨&zwj;🚒",man_health_worker:"👨&zwj;⚕️",man_in_tuxedo:"🤵",man_judge:"👨&zwj;⚖️",man_juggling:"🤹&zwj;♂️",man_mechanic:"👨&zwj;🔧",man_office_worker:"👨&zwj;💼",man_pilot:"👨&zwj;✈️",man_playing_handball:"🤾&zwj;♂️",man_playing_water_polo:"🤽&zwj;♂️",man_scientist:"👨&zwj;🔬",man_shrugging:"🤷&zwj;♂️",man_singer:"👨&zwj;🎤",man_student:"👨&zwj;🎓",man_teacher:"👨&zwj;🏫",man_technologist:"👨&zwj;💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆&zwj;♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼&zwj;♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵&zwj;♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅&zwj;♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆&zwj;♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮&zwj;♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎&zwj;♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️&zwj;🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋&zwj;♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣&zwj;♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃&zwj;♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄&zwj;♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊&zwj;♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁&zwj;♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶&zwj;♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️&zwj;♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩&zwj;🎨",woman_astronaut:"👩&zwj;🚀",woman_cartwheeling:"🤸&zwj;♀️",woman_cook:"👩&zwj;🍳",woman_facepalming:"🤦&zwj;♀️",woman_factory_worker:"👩&zwj;🏭",woman_farmer:"👩&zwj;🌾",woman_firefighter:"👩&zwj;🚒",woman_health_worker:"👩&zwj;⚕️",woman_judge:"👩&zwj;⚖️",woman_juggling:"🤹&zwj;♀️",woman_mechanic:"👩&zwj;🔧",woman_office_worker:"👩&zwj;💼",woman_pilot:"👩&zwj;✈️",woman_playing_handball:"🤾&zwj;♀️",woman_playing_water_polo:"🤽&zwj;♀️",woman_scientist:"👩&zwj;🔬",woman_shrugging:"🤷&zwj;♀️",woman_singer:"👩&zwj;🎤",woman_student:"👩&zwj;🎓",woman_teacher:"👩&zwj;🏫",woman_technologist:"👩&zwj;💻",woman_with_turban:"👳&zwj;♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼&zwj;♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',showdown:`<span style="font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;">S</span>`},r.Converter=function(i){var f={},d=[],y=[],w={},v=c,x={parsed:{},raw:"",format:""};A();function A(){i=i||{};for(var h in o)o.hasOwnProperty(h)&&(f[h]=o[h]);if(typeof i=="object")for(var N in i)i.hasOwnProperty(N)&&(f[N]=i[N]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof i+" was passed instead.");f.extensions&&r.helper.forEach(f.extensions,$)}function $(h,N){if(N=N||null,r.helper.isString(h))if(h=r.helper.stdExtName(h),N=h,r.extensions[h]){console.warn("DEPRECATION WARNING: "+h+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),D(r.extensions[h],h);return}else if(!r.helper.isUndefined(a[h]))h=a[h];else throw Error('Extension "'+h+'" could not be loaded. It was either not found or is not a valid extension.');typeof h=="function"&&(h=h()),r.helper.isArray(h)||(h=[h]);var L=u(h,N);if(!L.valid)throw Error(L.error);for(var R=0;R<h.length;++R){switch(h[R].type){case"lang":d.push(h[R]);break;case"output":y.push(h[R]);break}if(h[R].hasOwnProperty("listeners"))for(var z in h[R].listeners)h[R].listeners.hasOwnProperty(z)&&E(z,h[R].listeners[z])}}function D(h,N){typeof h=="function"&&(h=h(new r.Converter)),r.helper.isArray(h)||(h=[h]);var L=u(h,N);if(!L.valid)throw Error(L.error);for(var R=0;R<h.length;++R)switch(h[R].type){case"lang":d.push(h[R]);break;case"output":y.push(h[R]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}function E(h,N){if(!r.helper.isString(h))throw Error("Invalid argument in converter.listen() method: name must be a string, but "+typeof h+" given");if(typeof N!="function")throw Error("Invalid argument in converter.listen() method: callback must be a function, but "+typeof N+" given");w.hasOwnProperty(h)||(w[h]=[]),w[h].push(N)}function C(h){var N=h.match(/^\s*/)[0].length,L=new RegExp("^\\s{0,"+N+"}","gm");return h.replace(L,"")}this._dispatch=function(N,L,R,z){if(w.hasOwnProperty(N))for(var B=0;B<w[N].length;++B){var H=w[N][B](N,L,this,R,z);H&&typeof H<"u"&&(L=H)}return L},this.listen=function(h,N){return E(h,N),this},this.makeHtml=function(h){if(!h)return h;var N={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:d,outputModifiers:y,converter:this,ghCodeBlocks:[],metadata:{parsed:{},raw:"",format:""}};return h=h.replace(/¨/g,"¨T"),h=h.replace(/\$/g,"¨D"),h=h.replace(/\r\n/g,`
`),h=h.replace(/\r/g,`
`),h=h.replace(/\u00A0/g,"&nbsp;"),f.smartIndentationFix&&(h=C(h)),h=`

`+h+`

`,h=r.subParser("detab")(h,f,N),h=h.replace(/^[ \t]+$/mg,""),r.helper.forEach(d,function(L){h=r.subParser("runExtension")(L,h,f,N)}),h=r.subParser("metadata")(h,f,N),h=r.subParser("hashPreCodeTags")(h,f,N),h=r.subParser("githubCodeBlocks")(h,f,N),h=r.subParser("hashHTMLBlocks")(h,f,N),h=r.subParser("hashCodeTags")(h,f,N),h=r.subParser("stripLinkDefinitions")(h,f,N),h=r.subParser("blockGamut")(h,f,N),h=r.subParser("unhashHTMLSpans")(h,f,N),h=r.subParser("unescapeSpecialChars")(h,f,N),h=h.replace(/¨D/g,"$$"),h=h.replace(/¨T/g,"¨"),h=r.subParser("completeHTMLDocument")(h,f,N),r.helper.forEach(y,function(L){h=r.subParser("runExtension")(L,h,f,N)}),x=N.metadata,h},this.makeMarkdown=this.makeMd=function(h,N){if(h=h.replace(/\r\n/g,`
`),h=h.replace(/\r/g,`
`),h=h.replace(/>[ \t]+</,">¨NBSP;<"),!N)if(window&&window.document)N=window.document;else throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");var L=N.createElement("div");L.innerHTML=h;var R={preList:V(L)};j(L);for(var z=L.childNodes,B="",H=0;H<z.length;H++)B+=r.subParser("makeMarkdown.node")(z[H],R);function j(W){for(var ne=0;ne<W.childNodes.length;++ne){var Z=W.childNodes[ne];Z.nodeType===3?!/\S/.test(Z.nodeValue)&&!/^[ ]+$/.test(Z.nodeValue)?(W.removeChild(Z),--ne):(Z.nodeValue=Z.nodeValue.split(`
`).join(" "),Z.nodeValue=Z.nodeValue.replace(/(\s)+/g,"$1")):Z.nodeType===1&&j(Z)}}function V(W){for(var ne=W.querySelectorAll("pre"),Z=[],q=0;q<ne.length;++q)if(ne[q].childElementCount===1&&ne[q].firstChild.tagName.toLowerCase()==="code"){var ie=ne[q].firstChild.innerHTML.trim(),oe=ne[q].firstChild.getAttribute("data-language")||"";if(oe==="")for(var pe=ne[q].firstChild.className.split(" "),Me=0;Me<pe.length;++Me){var ve=pe[Me].match(/^language-(.+)$/);if(ve!==null){oe=ve[1];break}}ie=r.helper.unescapeHTMLEntities(ie),Z.push(ie),ne[q].outerHTML='<precode language="'+oe+'" precodenum="'+q.toString()+'"></precode>'}else Z.push(ne[q].innerHTML),ne[q].innerHTML="",ne[q].setAttribute("prenum",q.toString());return Z}return B},this.setOption=function(h,N){f[h]=N},this.getOption=function(h){return f[h]},this.getOptions=function(){return f},this.addExtension=function(h,N){N=N||null,$(h,N)},this.useExtension=function(h){$(h)},this.setFlavor=function(h){if(!l.hasOwnProperty(h))throw Error(h+" flavor was not found");var N=l[h];v=h;for(var L in N)N.hasOwnProperty(L)&&(f[L]=N[L])},this.getFlavor=function(){return v},this.removeExtension=function(h){r.helper.isArray(h)||(h=[h]);for(var N=0;N<h.length;++N){for(var L=h[N],R=0;R<d.length;++R)d[R]===L&&d.splice(R,1);for(var z=0;z<y.length;++z)y[z]===L&&y.splice(z,1)}},this.getAllExtensions=function(){return{language:d,output:y}},this.getMetadata=function(h){return h?x.raw:x.parsed},this.getMetadataFormat=function(){return x.format},this._setMetadataPair=function(h,N){x.parsed[h]=N},this._setMetadataFormat=function(h){x.format=h},this._setMetadataRaw=function(h){x.raw=h}},r.subParser("anchors",function(i,f,d){i=d.converter._dispatch("anchors.before",i,f,d);var y=function(w,v,x,A,$,D,E){if(r.helper.isUndefined(E)&&(E=""),x=x.toLowerCase(),w.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)A="";else if(!A)if(x||(x=v.toLowerCase().replace(/ ?\n/g," ")),A="#"+x,!r.helper.isUndefined(d.gUrls[x]))A=d.gUrls[x],r.helper.isUndefined(d.gTitles[x])||(E=d.gTitles[x]);else return w;A=A.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var C='<a href="'+A+'"';return E!==""&&E!==null&&(E=E.replace(/"/g,"&quot;"),E=E.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),C+=' title="'+E+'"'),f.openLinksInNewWindow&&!/^#/.test(A)&&(C+=' rel="noopener noreferrer" target="¨E95Eblank"'),C+=">"+v+"</a>",C};return i=i.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,y),i=i.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,y),i=i.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,y),i=i.replace(/\[([^\[\]]+)]()()()()()/g,y),f.ghMentions&&(i=i.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi,function(w,v,x,A,$){if(x==="\\")return v+A;if(!r.helper.isString(f.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var D=f.ghMentionsLink.replace(/\{u}/g,$),E="";return f.openLinksInNewWindow&&(E=' rel="noopener noreferrer" target="¨E95Eblank"'),v+'<a href="'+D+'"'+E+">"+A+"</a>"})),i=d.converter._dispatch("anchors.after",i,f,d),i});var b=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,_=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,T=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,S=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,M=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,k=function(i){return function(f,d,y,w,v,x,A){y=y.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var $=y,D="",E="",C=d||"",h=A||"";return/^www\./i.test(y)&&(y=y.replace(/^www\./i,"http://www.")),i.excludeTrailingPunctuationFromURLs&&x&&(D=x),i.openLinksInNewWindow&&(E=' rel="noopener noreferrer" target="¨E95Eblank"'),C+'<a href="'+y+'"'+E+">"+$+"</a>"+D+h}},O=function(i,f){return function(d,y,w){var v="mailto:";return y=y||"",w=r.subParser("unescapeSpecialChars")(w,i,f),i.encodeEmails?(v=r.helper.encodeEmailAddress(v+w),w=r.helper.encodeEmailAddress(w)):v=v+w,y+'<a href="'+v+'">'+w+"</a>"}};r.subParser("autoLinks",function(i,f,d){return i=d.converter._dispatch("autoLinks.before",i,f,d),i=i.replace(T,k(f)),i=i.replace(M,O(f,d)),i=d.converter._dispatch("autoLinks.after",i,f,d),i}),r.subParser("simplifiedAutoLinks",function(i,f,d){return f.simplifiedAutoLink&&(i=d.converter._dispatch("simplifiedAutoLinks.before",i,f,d),f.excludeTrailingPunctuationFromURLs?i=i.replace(_,k(f)):i=i.replace(b,k(f)),i=i.replace(S,O(f,d)),i=d.converter._dispatch("simplifiedAutoLinks.after",i,f,d)),i}),r.subParser("blockGamut",function(i,f,d){return i=d.converter._dispatch("blockGamut.before",i,f,d),i=r.subParser("blockQuotes")(i,f,d),i=r.subParser("headers")(i,f,d),i=r.subParser("horizontalRule")(i,f,d),i=r.subParser("lists")(i,f,d),i=r.subParser("codeBlocks")(i,f,d),i=r.subParser("tables")(i,f,d),i=r.subParser("hashHTMLBlocks")(i,f,d),i=r.subParser("paragraphs")(i,f,d),i=d.converter._dispatch("blockGamut.after",i,f,d),i}),r.subParser("blockQuotes",function(i,f,d){i=d.converter._dispatch("blockQuotes.before",i,f,d),i=i+`

`;var y=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return f.splitAdjacentBlockquotes&&(y=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),i=i.replace(y,function(w){return w=w.replace(/^[ \t]*>[ \t]?/gm,""),w=w.replace(/¨0/g,""),w=w.replace(/^[ \t]+$/gm,""),w=r.subParser("githubCodeBlocks")(w,f,d),w=r.subParser("blockGamut")(w,f,d),w=w.replace(/(^|\n)/g,"$1  "),w=w.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(v,x){var A=x;return A=A.replace(/^  /mg,"¨0"),A=A.replace(/¨0/g,""),A}),r.subParser("hashBlock")(`<blockquote>
`+w+`
</blockquote>`,f,d)}),i=d.converter._dispatch("blockQuotes.after",i,f,d),i}),r.subParser("codeBlocks",function(i,f,d){i=d.converter._dispatch("codeBlocks.before",i,f,d),i+="¨0";var y=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;return i=i.replace(y,function(w,v,x){var A=v,$=x,D=`
`;return A=r.subParser("outdent")(A,f,d),A=r.subParser("encodeCode")(A,f,d),A=r.subParser("detab")(A,f,d),A=A.replace(/^\n+/g,""),A=A.replace(/\n+$/g,""),f.omitExtraWLInCodeBlocks&&(D=""),A="<pre><code>"+A+D+"</code></pre>",r.subParser("hashBlock")(A,f,d)+$}),i=i.replace(/¨0/,""),i=d.converter._dispatch("codeBlocks.after",i,f,d),i}),r.subParser("codeSpans",function(i,f,d){return i=d.converter._dispatch("codeSpans.before",i,f,d),typeof i>"u"&&(i=""),i=i.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(y,w,v,x){var A=x;return A=A.replace(/^([ \t]*)/g,""),A=A.replace(/[ \t]*$/g,""),A=r.subParser("encodeCode")(A,f,d),A=w+"<code>"+A+"</code>",A=r.subParser("hashHTMLSpans")(A,f,d),A}),i=d.converter._dispatch("codeSpans.after",i,f,d),i}),r.subParser("completeHTMLDocument",function(i,f,d){if(!f.completeHTMLDocument)return i;i=d.converter._dispatch("completeHTMLDocument.before",i,f,d);var y="html",w=`<!DOCTYPE HTML>
`,v="",x=`<meta charset="utf-8">
`,A="",$="";typeof d.metadata.parsed.doctype<"u"&&(w="<!DOCTYPE "+d.metadata.parsed.doctype+`>
`,y=d.metadata.parsed.doctype.toString().toLowerCase(),(y==="html"||y==="html5")&&(x='<meta charset="utf-8">'));for(var D in d.metadata.parsed)if(d.metadata.parsed.hasOwnProperty(D))switch(D.toLowerCase()){case"doctype":break;case"title":v="<title>"+d.metadata.parsed.title+`</title>
`;break;case"charset":y==="html"||y==="html5"?x='<meta charset="'+d.metadata.parsed.charset+`">
`:x='<meta name="charset" content="'+d.metadata.parsed.charset+`">
`;break;case"language":case"lang":A=' lang="'+d.metadata.parsed[D]+'"',$+='<meta name="'+D+'" content="'+d.metadata.parsed[D]+`">
`;break;default:$+='<meta name="'+D+'" content="'+d.metadata.parsed[D]+`">
`}return i=w+"<html"+A+`>
<head>
`+v+x+$+`</head>
<body>
`+i.trim()+`
</body>
</html>`,i=d.converter._dispatch("completeHTMLDocument.after",i,f,d),i}),r.subParser("detab",function(i,f,d){return i=d.converter._dispatch("detab.before",i,f,d),i=i.replace(/\t(?=\t)/g,"    "),i=i.replace(/\t/g,"¨A¨B"),i=i.replace(/¨B(.+?)¨A/g,function(y,w){for(var v=w,x=4-v.length%4,A=0;A<x;A++)v+=" ";return v}),i=i.replace(/¨A/g,"    "),i=i.replace(/¨B/g,""),i=d.converter._dispatch("detab.after",i,f,d),i}),r.subParser("ellipsis",function(i,f,d){return f.ellipsis&&(i=d.converter._dispatch("ellipsis.before",i,f,d),i=i.replace(/\.\.\./g,"…"),i=d.converter._dispatch("ellipsis.after",i,f,d)),i}),r.subParser("emoji",function(i,f,d){if(!f.emoji)return i;i=d.converter._dispatch("emoji.before",i,f,d);var y=/:([\S]+?):/g;return i=i.replace(y,function(w,v){return r.helper.emojis.hasOwnProperty(v)?r.helper.emojis[v]:w}),i=d.converter._dispatch("emoji.after",i,f,d),i}),r.subParser("encodeAmpsAndAngles",function(i,f,d){return i=d.converter._dispatch("encodeAmpsAndAngles.before",i,f,d),i=i.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&amp;"),i=i.replace(/<(?![a-z\/?$!])/gi,"&lt;"),i=i.replace(/</g,"&lt;"),i=i.replace(/>/g,"&gt;"),i=d.converter._dispatch("encodeAmpsAndAngles.after",i,f,d),i}),r.subParser("encodeBackslashEscapes",function(i,f,d){return i=d.converter._dispatch("encodeBackslashEscapes.before",i,f,d),i=i.replace(/\\(\\)/g,r.helper.escapeCharactersCallback),i=i.replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g,r.helper.escapeCharactersCallback),i=d.converter._dispatch("encodeBackslashEscapes.after",i,f,d),i}),r.subParser("encodeCode",function(i,f,d){return i=d.converter._dispatch("encodeCode.before",i,f,d),i=i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/([*_{}\[\]\\=~-])/g,r.helper.escapeCharactersCallback),i=d.converter._dispatch("encodeCode.after",i,f,d),i}),r.subParser("escapeSpecialCharsWithinTagAttributes",function(i,f,d){i=d.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",i,f,d);var y=/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,w=/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;return i=i.replace(y,function(v){return v.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,r.helper.escapeCharactersCallback)}),i=i.replace(w,function(v){return v.replace(/([\\`*_~=|])/g,r.helper.escapeCharactersCallback)}),i=d.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",i,f,d),i}),r.subParser("githubCodeBlocks",function(i,f,d){return f.ghCodeBlocks?(i=d.converter._dispatch("githubCodeBlocks.before",i,f,d),i+="¨0",i=i.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(y,w,v,x){var A=f.omitExtraWLInCodeBlocks?"":`
`;return x=r.subParser("encodeCode")(x,f,d),x=r.subParser("detab")(x,f,d),x=x.replace(/^\n+/g,""),x=x.replace(/\n+$/g,""),x="<pre><code"+(v?' class="'+v+" language-"+v+'"':"")+">"+x+A+"</code></pre>",x=r.subParser("hashBlock")(x,f,d),`

¨G`+(d.ghCodeBlocks.push({text:y,codeblock:x})-1)+`G

`}),i=i.replace(/¨0/,""),d.converter._dispatch("githubCodeBlocks.after",i,f,d)):i}),r.subParser("hashBlock",function(i,f,d){return i=d.converter._dispatch("hashBlock.before",i,f,d),i=i.replace(/(^\n+|\n+$)/g,""),i=`

¨K`+(d.gHtmlBlocks.push(i)-1)+`K

`,i=d.converter._dispatch("hashBlock.after",i,f,d),i}),r.subParser("hashCodeTags",function(i,f,d){i=d.converter._dispatch("hashCodeTags.before",i,f,d);var y=function(w,v,x,A){var $=x+r.subParser("encodeCode")(v,f,d)+A;return"¨C"+(d.gHtmlSpans.push($)-1)+"C"};return i=r.helper.replaceRecursiveRegExp(i,y,"<code\\b[^>]*>","</code>","gim"),i=d.converter._dispatch("hashCodeTags.after",i,f,d),i}),r.subParser("hashElement",function(i,f,d){return function(y,w){var v=w;return v=v.replace(/\n\n/g,`
`),v=v.replace(/^\n/,""),v=v.replace(/\n+$/g,""),v=`

¨K`+(d.gHtmlBlocks.push(v)-1)+`K

`,v}}),r.subParser("hashHTMLBlocks",function(i,f,d){i=d.converter._dispatch("hashHTMLBlocks.before",i,f,d);var y=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],w=function(h,N,L,R){var z=h;return L.search(/\bmarkdown\b/)!==-1&&(z=L+d.converter.makeHtml(N)+R),`

¨K`+(d.gHtmlBlocks.push(z)-1)+`K

`};f.backslashEscapesHTMLTags&&(i=i.replace(/\\<(\/?[^>]+?)>/g,function(h,N){return"&lt;"+N+"&gt;"}));for(var v=0;v<y.length;++v)for(var x,A=new RegExp("^ {0,3}(<"+y[v]+"\\b[^>]*>)","im"),$="<"+y[v]+"\\b[^>]*>",D="</"+y[v]+">";(x=r.helper.regexIndexOf(i,A))!==-1;){var E=r.helper.splitAtIndex(i,x),C=r.helper.replaceRecursiveRegExp(E[1],w,$,D,"im");if(C===E[1])break;i=E[0].concat(C)}return i=i.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,r.subParser("hashElement")(i,f,d)),i=r.helper.replaceRecursiveRegExp(i,function(h){return`

¨K`+(d.gHtmlBlocks.push(h)-1)+`K

`},"^ {0,3}<!--","-->","gm"),i=i.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,r.subParser("hashElement")(i,f,d)),i=d.converter._dispatch("hashHTMLBlocks.after",i,f,d),i}),r.subParser("hashHTMLSpans",function(i,f,d){i=d.converter._dispatch("hashHTMLSpans.before",i,f,d);function y(w){return"¨C"+(d.gHtmlSpans.push(w)-1)+"C"}return i=i.replace(/<[^>]+?\/>/gi,function(w){return y(w)}),i=i.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(w){return y(w)}),i=i.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(w){return y(w)}),i=i.replace(/<[^>]+?>/gi,function(w){return y(w)}),i=d.converter._dispatch("hashHTMLSpans.after",i,f,d),i}),r.subParser("unhashHTMLSpans",function(i,f,d){i=d.converter._dispatch("unhashHTMLSpans.before",i,f,d);for(var y=0;y<d.gHtmlSpans.length;++y){for(var w=d.gHtmlSpans[y],v=0;/¨C(\d+)C/.test(w);){var x=RegExp.$1;if(w=w.replace("¨C"+x+"C",d.gHtmlSpans[x]),v===10){console.error("maximum nesting of 10 spans reached!!!");break}++v}i=i.replace("¨C"+y+"C",w)}return i=d.converter._dispatch("unhashHTMLSpans.after",i,f,d),i}),r.subParser("hashPreCodeTags",function(i,f,d){i=d.converter._dispatch("hashPreCodeTags.before",i,f,d);var y=function(w,v,x,A){var $=x+r.subParser("encodeCode")(v,f,d)+A;return`

¨G`+(d.ghCodeBlocks.push({text:w,codeblock:$})-1)+`G

`};return i=r.helper.replaceRecursiveRegExp(i,y,"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>","^ {0,3}</code>\\s*</pre>","gim"),i=d.converter._dispatch("hashPreCodeTags.after",i,f,d),i}),r.subParser("headers",function(i,f,d){i=d.converter._dispatch("headers.before",i,f,d);var y=isNaN(parseInt(f.headerLevelStart))?1:parseInt(f.headerLevelStart),w=f.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,v=f.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;i=i.replace(w,function($,D){var E=r.subParser("spanGamut")(D,f,d),C=f.noHeaderId?"":' id="'+A(D)+'"',h=y,N="<h"+h+C+">"+E+"</h"+h+">";return r.subParser("hashBlock")(N,f,d)}),i=i.replace(v,function($,D){var E=r.subParser("spanGamut")(D,f,d),C=f.noHeaderId?"":' id="'+A(D)+'"',h=y+1,N="<h"+h+C+">"+E+"</h"+h+">";return r.subParser("hashBlock")(N,f,d)});var x=f.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;i=i.replace(x,function($,D,E){var C=E;f.customizedHeaderId&&(C=E.replace(/\s?\{([^{]+?)}\s*$/,""));var h=r.subParser("spanGamut")(C,f,d),N=f.noHeaderId?"":' id="'+A(E)+'"',L=y-1+D.length,R="<h"+L+N+">"+h+"</h"+L+">";return r.subParser("hashBlock")(R,f,d)});function A($){var D,E;if(f.customizedHeaderId){var C=$.match(/\{([^{]+?)}\s*$/);C&&C[1]&&($=C[1])}return D=$,r.helper.isString(f.prefixHeaderId)?E=f.prefixHeaderId:f.prefixHeaderId===!0?E="section-":E="",f.rawPrefixHeaderId||(D=E+D),f.ghCompatibleHeaderId?D=D.replace(/ /g,"-").replace(/&amp;/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():f.rawHeaderId?D=D.replace(/ /g,"-").replace(/&amp;/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():D=D.replace(/[^\w]/g,"").toLowerCase(),f.rawPrefixHeaderId&&(D=E+D),d.hashLinkCounts[D]?D=D+"-"+d.hashLinkCounts[D]++:d.hashLinkCounts[D]=1,D}return i=d.converter._dispatch("headers.after",i,f,d),i}),r.subParser("horizontalRule",function(i,f,d){i=d.converter._dispatch("horizontalRule.before",i,f,d);var y=r.subParser("hashBlock")("<hr />",f,d);return i=i.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,y),i=i.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,y),i=i.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,y),i=d.converter._dispatch("horizontalRule.after",i,f,d),i}),r.subParser("images",function(i,f,d){i=d.converter._dispatch("images.before",i,f,d);var y=/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,w=/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,v=/!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,x=/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,A=/!\[([^\[\]]+)]()()()()()/g;function $(E,C,h,N,L,R,z,B){return N=N.replace(/\s/g,""),D(E,C,h,N,L,R,z,B)}function D(E,C,h,N,L,R,z,B){var H=d.gUrls,j=d.gTitles,V=d.gDimensions;if(h=h.toLowerCase(),B||(B=""),E.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)N="";else if(N===""||N===null)if((h===""||h===null)&&(h=C.toLowerCase().replace(/ ?\n/g," ")),N="#"+h,!r.helper.isUndefined(H[h]))N=H[h],r.helper.isUndefined(j[h])||(B=j[h]),r.helper.isUndefined(V[h])||(L=V[h].width,R=V[h].height);else return E;C=C.replace(/"/g,"&quot;").replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),N=N.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var W='<img src="'+N+'" alt="'+C+'"';return B&&r.helper.isString(B)&&(B=B.replace(/"/g,"&quot;").replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),W+=' title="'+B+'"'),L&&R&&(L=L==="*"?"auto":L,R=R==="*"?"auto":R,W+=' width="'+L+'"',W+=' height="'+R+'"'),W+=" />",W}return i=i.replace(x,D),i=i.replace(v,$),i=i.replace(w,D),i=i.replace(y,D),i=i.replace(A,D),i=d.converter._dispatch("images.after",i,f,d),i}),r.subParser("italicsAndBold",function(i,f,d){i=d.converter._dispatch("italicsAndBold.before",i,f,d);function y(w,v,x){return v+w+x}return f.literalMidWordUnderscores?(i=i.replace(/\b___(\S[\s\S]*?)___\b/g,function(w,v){return y(v,"<strong><em>","</em></strong>")}),i=i.replace(/\b__(\S[\s\S]*?)__\b/g,function(w,v){return y(v,"<strong>","</strong>")}),i=i.replace(/\b_(\S[\s\S]*?)_\b/g,function(w,v){return y(v,"<em>","</em>")})):(i=i.replace(/___(\S[\s\S]*?)___/g,function(w,v){return/\S$/.test(v)?y(v,"<strong><em>","</em></strong>"):w}),i=i.replace(/__(\S[\s\S]*?)__/g,function(w,v){return/\S$/.test(v)?y(v,"<strong>","</strong>"):w}),i=i.replace(/_([^\s_][\s\S]*?)_/g,function(w,v){return/\S$/.test(v)?y(v,"<em>","</em>"):w})),f.literalMidWordAsterisks?(i=i.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function(w,v,x){return y(x,v+"<strong><em>","</em></strong>")}),i=i.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function(w,v,x){return y(x,v+"<strong>","</strong>")}),i=i.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function(w,v,x){return y(x,v+"<em>","</em>")})):(i=i.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(w,v){return/\S$/.test(v)?y(v,"<strong><em>","</em></strong>"):w}),i=i.replace(/\*\*(\S[\s\S]*?)\*\*/g,function(w,v){return/\S$/.test(v)?y(v,"<strong>","</strong>"):w}),i=i.replace(/\*([^\s*][\s\S]*?)\*/g,function(w,v){return/\S$/.test(v)?y(v,"<em>","</em>"):w})),i=d.converter._dispatch("italicsAndBold.after",i,f,d),i}),r.subParser("lists",function(i,f,d){function y(x,A){d.gListLevel++,x=x.replace(/\n{2,}$/,`
`),x+="¨0";var $=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,D=/\n[ \t]*\n(?!¨0)/.test(x);return f.disableForced4SpacesIndentedSublists&&($=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),x=x.replace($,function(E,C,h,N,L,R,z){z=z&&z.trim()!=="";var B=r.subParser("outdent")(L,f,d),H="";return R&&f.tasklists&&(H=' class="task-list-item" style="list-style-type: none;"',B=B.replace(/^[ \t]*\[(x|X| )?]/m,function(){var j='<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';return z&&(j+=" checked"),j+=">",j})),B=B.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,function(j){return"¨A"+j}),C||B.search(/\n{2,}/)>-1?(B=r.subParser("githubCodeBlocks")(B,f,d),B=r.subParser("blockGamut")(B,f,d)):(B=r.subParser("lists")(B,f,d),B=B.replace(/\n$/,""),B=r.subParser("hashHTMLBlocks")(B,f,d),B=B.replace(/\n\n+/g,`

`),D?B=r.subParser("paragraphs")(B,f,d):B=r.subParser("spanGamut")(B,f,d)),B=B.replace("¨A",""),B="<li"+H+">"+B+`</li>
`,B}),x=x.replace(/¨0/g,""),d.gListLevel--,A&&(x=x.replace(/\s+$/,"")),x}function w(x,A){if(A==="ol"){var $=x.match(/^ *(\d+)\./);if($&&$[1]!=="1")return' start="'+$[1]+'"'}return""}function v(x,A,$){var D=f.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,E=f.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,C=A==="ul"?D:E,h="";if(x.search(C)!==-1)(function L(R){var z=R.search(C),B=w(x,A);z!==-1?(h+=`

<`+A+B+`>
`+y(R.slice(0,z),!!$)+"</"+A+`>
`,A=A==="ul"?"ol":"ul",C=A==="ul"?D:E,L(R.slice(z))):h+=`

<`+A+B+`>
`+y(R,!!$)+"</"+A+`>
`})(x);else{var N=w(x,A);h=`

<`+A+N+`>
`+y(x,!!$)+"</"+A+`>
`}return h}return i=d.converter._dispatch("lists.before",i,f,d),i+="¨0",d.gListLevel?i=i.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(x,A,$){var D=$.search(/[*+-]/g)>-1?"ul":"ol";return v(A,D,!0)}):i=i.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(x,A,$,D){var E=D.search(/[*+-]/g)>-1?"ul":"ol";return v($,E,!1)}),i=i.replace(/¨0/,""),i=d.converter._dispatch("lists.after",i,f,d),i}),r.subParser("metadata",function(i,f,d){if(!f.metadata)return i;i=d.converter._dispatch("metadata.before",i,f,d);function y(w){d.metadata.raw=w,w=w.replace(/&/g,"&amp;").replace(/"/g,"&quot;"),w=w.replace(/\n {4}/g," "),w.replace(/^([\S ]+): +([\s\S]+?)$/gm,function(v,x,A){return d.metadata.parsed[x]=A,""})}return i=i.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,function(w,v,x){return y(x),"¨M"}),i=i.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,function(w,v,x){return v&&(d.metadata.format=v),y(x),"¨M"}),i=i.replace(/¨M/g,""),i=d.converter._dispatch("metadata.after",i,f,d),i}),r.subParser("outdent",function(i,f,d){return i=d.converter._dispatch("outdent.before",i,f,d),i=i.replace(/^(\t|[ ]{1,4})/gm,"¨0"),i=i.replace(/¨0/g,""),i=d.converter._dispatch("outdent.after",i,f,d),i}),r.subParser("paragraphs",function(i,f,d){i=d.converter._dispatch("paragraphs.before",i,f,d),i=i.replace(/^\n+/g,""),i=i.replace(/\n+$/g,"");for(var y=i.split(/\n{2,}/g),w=[],v=y.length,x=0;x<v;x++){var A=y[x];A.search(/¨(K|G)(\d+)\1/g)>=0?w.push(A):A.search(/\S/)>=0&&(A=r.subParser("spanGamut")(A,f,d),A=A.replace(/^([ \t]*)/g,"<p>"),A+="</p>",w.push(A))}for(v=w.length,x=0;x<v;x++){for(var $="",D=w[x],E=!1;/¨(K|G)(\d+)\1/.test(D);){var C=RegExp.$1,h=RegExp.$2;C==="K"?$=d.gHtmlBlocks[h]:E?$=r.subParser("encodeCode")(d.ghCodeBlocks[h].text,f,d):$=d.ghCodeBlocks[h].codeblock,$=$.replace(/\$/g,"$$$$"),D=D.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/,$),/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(D)&&(E=!0)}w[x]=D}return i=w.join(`
`),i=i.replace(/^\n+/g,""),i=i.replace(/\n+$/g,""),d.converter._dispatch("paragraphs.after",i,f,d)}),r.subParser("runExtension",function(i,f,d,y){if(i.filter)f=i.filter(f,y.converter,d);else if(i.regex){var w=i.regex;w instanceof RegExp||(w=new RegExp(w,"g")),f=f.replace(w,i.replace)}return f}),r.subParser("spanGamut",function(i,f,d){return i=d.converter._dispatch("spanGamut.before",i,f,d),i=r.subParser("codeSpans")(i,f,d),i=r.subParser("escapeSpecialCharsWithinTagAttributes")(i,f,d),i=r.subParser("encodeBackslashEscapes")(i,f,d),i=r.subParser("images")(i,f,d),i=r.subParser("anchors")(i,f,d),i=r.subParser("autoLinks")(i,f,d),i=r.subParser("simplifiedAutoLinks")(i,f,d),i=r.subParser("emoji")(i,f,d),i=r.subParser("underline")(i,f,d),i=r.subParser("italicsAndBold")(i,f,d),i=r.subParser("strikethrough")(i,f,d),i=r.subParser("ellipsis")(i,f,d),i=r.subParser("hashHTMLSpans")(i,f,d),i=r.subParser("encodeAmpsAndAngles")(i,f,d),f.simpleLineBreaks?/\n\n¨K/.test(i)||(i=i.replace(/\n+/g,`<br />
`)):i=i.replace(/  +\n/g,`<br />
`),i=d.converter._dispatch("spanGamut.after",i,f,d),i}),r.subParser("strikethrough",function(i,f,d){function y(w){return f.simplifiedAutoLink&&(w=r.subParser("simplifiedAutoLinks")(w,f,d)),"<del>"+w+"</del>"}return f.strikethrough&&(i=d.converter._dispatch("strikethrough.before",i,f,d),i=i.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(w,v){return y(v)}),i=d.converter._dispatch("strikethrough.after",i,f,d)),i}),r.subParser("stripLinkDefinitions",function(i,f,d){var y=/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,w=/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;i+="¨0";var v=function(x,A,$,D,E,C,h){return A=A.toLowerCase(),i.toLowerCase().split(A).length-1<2?x:($.match(/^data:.+?\/.+?;base64,/)?d.gUrls[A]=$.replace(/\s/g,""):d.gUrls[A]=r.subParser("encodeAmpsAndAngles")($,f,d),C?C+h:(h&&(d.gTitles[A]=h.replace(/"|'/g,"&quot;")),f.parseImgDimensions&&D&&E&&(d.gDimensions[A]={width:D,height:E}),""))};return i=i.replace(w,v),i=i.replace(y,v),i=i.replace(/¨0/,""),i}),r.subParser("tables",function(i,f,d){if(!f.tables)return i;var y=/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,w=/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;function v(E){return/^:[ \t]*--*$/.test(E)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(E)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(E)?' style="text-align:center;"':""}function x(E,C){var h="";return E=E.trim(),(f.tablesHeaderId||f.tableHeaderId)&&(h=' id="'+E.replace(/ /g,"_").toLowerCase()+'"'),E=r.subParser("spanGamut")(E,f,d),"<th"+h+C+">"+E+`</th>
`}function A(E,C){var h=r.subParser("spanGamut")(E,f,d);return"<td"+C+">"+h+`</td>
`}function $(E,C){for(var h=`<table>
<thead>
<tr>
`,N=E.length,L=0;L<N;++L)h+=E[L];for(h+=`</tr>
</thead>
<tbody>
`,L=0;L<C.length;++L){h+=`<tr>
`;for(var R=0;R<N;++R)h+=C[L][R];h+=`</tr>
`}return h+=`</tbody>
</table>
`,h}function D(E){var C,h=E.split(`
`);for(C=0;C<h.length;++C)/^ {0,3}\|/.test(h[C])&&(h[C]=h[C].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(h[C])&&(h[C]=h[C].replace(/\|[ \t]*$/,"")),h[C]=r.subParser("codeSpans")(h[C],f,d);var N=h[0].split("|").map(function(W){return W.trim()}),L=h[1].split("|").map(function(W){return W.trim()}),R=[],z=[],B=[],H=[];for(h.shift(),h.shift(),C=0;C<h.length;++C)h[C].trim()!==""&&R.push(h[C].split("|").map(function(W){return W.trim()}));if(N.length<L.length)return E;for(C=0;C<L.length;++C)B.push(v(L[C]));for(C=0;C<N.length;++C)r.helper.isUndefined(B[C])&&(B[C]=""),z.push(x(N[C],B[C]));for(C=0;C<R.length;++C){for(var j=[],V=0;V<z.length;++V)r.helper.isUndefined(R[C][V]),j.push(A(R[C][V],B[V]));H.push(j)}return $(z,H)}return i=d.converter._dispatch("tables.before",i,f,d),i=i.replace(/\\(\|)/g,r.helper.escapeCharactersCallback),i=i.replace(y,D),i=i.replace(w,D),i=d.converter._dispatch("tables.after",i,f,d),i}),r.subParser("underline",function(i,f,d){return f.underline&&(i=d.converter._dispatch("underline.before",i,f,d),f.literalMidWordUnderscores?(i=i.replace(/\b___(\S[\s\S]*?)___\b/g,function(y,w){return"<u>"+w+"</u>"}),i=i.replace(/\b__(\S[\s\S]*?)__\b/g,function(y,w){return"<u>"+w+"</u>"})):(i=i.replace(/___(\S[\s\S]*?)___/g,function(y,w){return/\S$/.test(w)?"<u>"+w+"</u>":y}),i=i.replace(/__(\S[\s\S]*?)__/g,function(y,w){return/\S$/.test(w)?"<u>"+w+"</u>":y})),i=i.replace(/(_)/g,r.helper.escapeCharactersCallback),i=d.converter._dispatch("underline.after",i,f,d)),i}),r.subParser("unescapeSpecialChars",function(i,f,d){return i=d.converter._dispatch("unescapeSpecialChars.before",i,f,d),i=i.replace(/¨E(\d+)E/g,function(y,w){var v=parseInt(w);return String.fromCharCode(v)}),i=d.converter._dispatch("unescapeSpecialChars.after",i,f,d),i}),r.subParser("makeMarkdown.blockquote",function(i,f){var d="";if(i.hasChildNodes())for(var y=i.childNodes,w=y.length,v=0;v<w;++v){var x=r.subParser("makeMarkdown.node")(y[v],f);x!==""&&(d+=x)}return d=d.trim(),d="> "+d.split(`
`).join(`
> `),d}),r.subParser("makeMarkdown.codeBlock",function(i,f){var d=i.getAttribute("language"),y=i.getAttribute("precodenum");return"```"+d+`
`+f.preList[y]+"\n```"}),r.subParser("makeMarkdown.codeSpan",function(i){return"`"+i.innerHTML+"`"}),r.subParser("makeMarkdown.emphasis",function(i,f){var d="";if(i.hasChildNodes()){d+="*";for(var y=i.childNodes,w=y.length,v=0;v<w;++v)d+=r.subParser("makeMarkdown.node")(y[v],f);d+="*"}return d}),r.subParser("makeMarkdown.header",function(i,f,d){var y=new Array(d+1).join("#"),w="";if(i.hasChildNodes()){w=y+" ";for(var v=i.childNodes,x=v.length,A=0;A<x;++A)w+=r.subParser("makeMarkdown.node")(v[A],f)}return w}),r.subParser("makeMarkdown.hr",function(){return"---"}),r.subParser("makeMarkdown.image",function(i){var f="";return i.hasAttribute("src")&&(f+="!["+i.getAttribute("alt")+"](",f+="<"+i.getAttribute("src")+">",i.hasAttribute("width")&&i.hasAttribute("height")&&(f+=" ="+i.getAttribute("width")+"x"+i.getAttribute("height")),i.hasAttribute("title")&&(f+=' "'+i.getAttribute("title")+'"'),f+=")"),f}),r.subParser("makeMarkdown.links",function(i,f){var d="";if(i.hasChildNodes()&&i.hasAttribute("href")){var y=i.childNodes,w=y.length;d="[";for(var v=0;v<w;++v)d+=r.subParser("makeMarkdown.node")(y[v],f);d+="](",d+="<"+i.getAttribute("href")+">",i.hasAttribute("title")&&(d+=' "'+i.getAttribute("title")+'"'),d+=")"}return d}),r.subParser("makeMarkdown.list",function(i,f,d){var y="";if(!i.hasChildNodes())return"";for(var w=i.childNodes,v=w.length,x=i.getAttribute("start")||1,A=0;A<v;++A)if(!(typeof w[A].tagName>"u"||w[A].tagName.toLowerCase()!=="li")){var $="";d==="ol"?$=x.toString()+". ":$="- ",y+=$+r.subParser("makeMarkdown.listItem")(w[A],f),++x}return y+=`
<!-- -->
`,y.trim()}),r.subParser("makeMarkdown.listItem",function(i,f){for(var d="",y=i.childNodes,w=y.length,v=0;v<w;++v)d+=r.subParser("makeMarkdown.node")(y[v],f);return/\n$/.test(d)?d=d.split(`
`).join(`
    `).replace(/^ {4}$/gm,"").replace(/\n\n+/g,`

`):d+=`
`,d}),r.subParser("makeMarkdown.node",function(i,f,d){d=d||!1;var y="";if(i.nodeType===3)return r.subParser("makeMarkdown.txt")(i,f);if(i.nodeType===8)return"<!--"+i.data+`-->

`;if(i.nodeType!==1)return"";var w=i.tagName.toLowerCase();switch(w){case"h1":d||(y=r.subParser("makeMarkdown.header")(i,f,1)+`

`);break;case"h2":d||(y=r.subParser("makeMarkdown.header")(i,f,2)+`

`);break;case"h3":d||(y=r.subParser("makeMarkdown.header")(i,f,3)+`

`);break;case"h4":d||(y=r.subParser("makeMarkdown.header")(i,f,4)+`

`);break;case"h5":d||(y=r.subParser("makeMarkdown.header")(i,f,5)+`

`);break;case"h6":d||(y=r.subParser("makeMarkdown.header")(i,f,6)+`

`);break;case"p":d||(y=r.subParser("makeMarkdown.paragraph")(i,f)+`

`);break;case"blockquote":d||(y=r.subParser("makeMarkdown.blockquote")(i,f)+`

`);break;case"hr":d||(y=r.subParser("makeMarkdown.hr")(i,f)+`

`);break;case"ol":d||(y=r.subParser("makeMarkdown.list")(i,f,"ol")+`

`);break;case"ul":d||(y=r.subParser("makeMarkdown.list")(i,f,"ul")+`

`);break;case"precode":d||(y=r.subParser("makeMarkdown.codeBlock")(i,f)+`

`);break;case"pre":d||(y=r.subParser("makeMarkdown.pre")(i,f)+`

`);break;case"table":d||(y=r.subParser("makeMarkdown.table")(i,f)+`

`);break;case"code":y=r.subParser("makeMarkdown.codeSpan")(i,f);break;case"em":case"i":y=r.subParser("makeMarkdown.emphasis")(i,f);break;case"strong":case"b":y=r.subParser("makeMarkdown.strong")(i,f);break;case"del":y=r.subParser("makeMarkdown.strikethrough")(i,f);break;case"a":y=r.subParser("makeMarkdown.links")(i,f);break;case"img":y=r.subParser("makeMarkdown.image")(i,f);break;default:y=i.outerHTML+`

`}return y}),r.subParser("makeMarkdown.paragraph",function(i,f){var d="";if(i.hasChildNodes())for(var y=i.childNodes,w=y.length,v=0;v<w;++v)d+=r.subParser("makeMarkdown.node")(y[v],f);return d=d.trim(),d}),r.subParser("makeMarkdown.pre",function(i,f){var d=i.getAttribute("prenum");return"<pre>"+f.preList[d]+"</pre>"}),r.subParser("makeMarkdown.strikethrough",function(i,f){var d="";if(i.hasChildNodes()){d+="~~";for(var y=i.childNodes,w=y.length,v=0;v<w;++v)d+=r.subParser("makeMarkdown.node")(y[v],f);d+="~~"}return d}),r.subParser("makeMarkdown.strong",function(i,f){var d="";if(i.hasChildNodes()){d+="**";for(var y=i.childNodes,w=y.length,v=0;v<w;++v)d+=r.subParser("makeMarkdown.node")(y[v],f);d+="**"}return d}),r.subParser("makeMarkdown.table",function(i,f){var d="",y=[[],[]],w=i.querySelectorAll("thead>tr>th"),v=i.querySelectorAll("tbody>tr"),x,A;for(x=0;x<w.length;++x){var $=r.subParser("makeMarkdown.tableCell")(w[x],f),D="---";if(w[x].hasAttribute("style")){var E=w[x].getAttribute("style").toLowerCase().replace(/\s/g,"");switch(E){case"text-align:left;":D=":---";break;case"text-align:right;":D="---:";break;case"text-align:center;":D=":---:";break}}y[0][x]=$.trim(),y[1][x]=D}for(x=0;x<v.length;++x){var C=y.push([])-1,h=v[x].getElementsByTagName("td");for(A=0;A<w.length;++A){var N=" ";typeof h[A]<"u"&&(N=r.subParser("makeMarkdown.tableCell")(h[A],f)),y[C].push(N)}}var L=3;for(x=0;x<y.length;++x)for(A=0;A<y[x].length;++A){var R=y[x][A].length;R>L&&(L=R)}for(x=0;x<y.length;++x){for(A=0;A<y[x].length;++A)x===1?y[x][A].slice(-1)===":"?y[x][A]=r.helper.padEnd(y[x][A].slice(-1),L-1,"-")+":":y[x][A]=r.helper.padEnd(y[x][A],L,"-"):y[x][A]=r.helper.padEnd(y[x][A],L);d+="| "+y[x].join(" | ")+` |
`}return d.trim()}),r.subParser("makeMarkdown.tableCell",function(i,f){var d="";if(!i.hasChildNodes())return"";for(var y=i.childNodes,w=y.length,v=0;v<w;++v)d+=r.subParser("makeMarkdown.node")(y[v],f,!0);return d.trim()}),r.subParser("makeMarkdown.txt",function(i){var f=i.nodeValue;return f=f.replace(/ +/g," "),f=f.replace(/¨NBSP;/g," "),f=r.helper.unescapeHTMLEntities(f),f=f.replace(/([*_~|`])/g,"\\$1"),f=f.replace(/^(\s*)>/g,"\\$1>"),f=f.replace(/^#/gm,"\\#"),f=f.replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3"),f=f.replace(/^( {0,3}\d+)\./gm,"$1\\."),f=f.replace(/^( {0,3})([+-])/gm,"$1\\$2"),f=f.replace(/]([\s]*)\(/g,"\\]$1\\("),f=f.replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:"),f});var P=this;e.exports?e.exports=r:P.showdown=r}).call(Sd)})(rl);var Lm=rl.exports;const Bm=pa(Lm);var Ri={},Pm=ni;Object.defineProperty(Ri,"__esModule",{value:!0});var sl=Ri.default=void 0,$m=Pm(ri()),zm=m,Hm=(0,$m.default)((0,zm.jsx)("path",{d:"M7.5 5.6 10 7 8.6 4.5 10 2 7.5 3.4 5 2l1.4 2.5L5 7zm12 9.8L17 14l1.4 2.5L17 19l2.5-1.4L22 19l-1.4-2.5L22 14zM22 2l-2.5 1.4L17 2l1.4 2.5L17 7l2.5-1.4L22 7l-1.4-2.5zm-7.63 5.29a.9959.9959 0 0 0-1.41 0L1.29 18.96c-.39.39-.39 1.02 0 1.41l2.34 2.34c.39.39 1.02.39 1.41 0L16.7 11.05c.39-.39.39-1.02 0-1.41l-2.33-2.35zm-1.03 5.49-2.12-2.12 2.44-2.44 2.12 2.12-2.44 2.44z"}),"AutoFixHigh");sl=Ri.default=Hm;function Fm(e){return typeof e=="string"}function jm(e,t,n){return e===void 0||Fm(e)?t:ae({},t,{ownerState:ae({},t.ownerState,n)})}function $o(e,t,n=(r,s)=>r===s){return e.length===t.length&&e.every((r,s)=>n(r,t[s]))}const Um={disableDefaultClasses:!1},Vm=I.createContext(Um);function Oi(e){const{disableDefaultClasses:t}=I.useContext(Vm);return n=>t?"":e(n)}function bn(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function Gm(e,t,n){return typeof e=="function"?e(t,n):e}function Km(e){const{rootElementName:t=""}=e,[n,r]=I.useState(t.toUpperCase()),s=I.useCallback(a=>{var o;r((o=a==null?void 0:a.tagName)!=null?o:"")},[]);return[n,s]}function zo(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function Wm(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:s,className:a}=e;if(!t){const _=Wi(n==null?void 0:n.className,a,s==null?void 0:s.className,r==null?void 0:r.className),T=ae({},n==null?void 0:n.style,s==null?void 0:s.style,r==null?void 0:r.style),S=ae({},n,s,r);return _.length>0&&(S.className=_),Object.keys(T).length>0&&(S.style=T),{props:S,internalRef:void 0}}const o=bn(ae({},s,r)),c=zo(r),l=zo(s),u=t(o),p=Wi(u==null?void 0:u.className,n==null?void 0:n.className,a,s==null?void 0:s.className,r==null?void 0:r.className),g=ae({},u==null?void 0:u.style,n==null?void 0:n.style,s==null?void 0:s.style,r==null?void 0:r.style),b=ae({},u,n,l,c);return p.length>0&&(b.className=p),Object.keys(g).length>0&&(b.style=g),{props:b,internalRef:u.ref}}const qm=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function Di(e){var t;const{elementType:n,externalSlotProps:r,ownerState:s,skipResolvingSlotProps:a=!1}=e,o=Pr(e,qm),c=a?{}:Gm(r,s),{props:l,internalRef:u}=Wm(ae({},o,{externalSlotProps:c})),p=Un(u,c==null?void 0:c.ref,(t=e.additionalProps)==null?void 0:t.ref);return jm(n,ae({},l,{ref:p}),s)}const il="base";function Ym(e){return`${il}--${e}`}function Zm(e,t){return`${il}-${e}-${t}`}function Yr(e,t){const n=xd[t];return n?Ym(n):Zm(e,t)}function Zr(e,t){const n={};return t.forEach(r=>{n[r]=Yr(e,r)}),n}const ol="Tabs";function Xm(e){return Yr(ol,e)}Zr(ol,["root","horizontal","vertical"]);const Li=I.createContext(null);function Qm(e){const t=Array.from(e.keys()).map(n=>{const r=e.get(n);return{key:n,subitem:r}});return t.sort((n,r)=>{const s=n.subitem.ref.current,a=r.subitem.ref.current;return s===null||a===null||s===a?0:s.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING?1:-1}),new Map(t.map(n=>[n.key,n.subitem]))}function al(){const[e,t]=I.useState(new Map),n=I.useRef(new Set),r=I.useCallback(function(u){n.current.delete(u),t(p=>{const g=new Map(p);return g.delete(u),g})},[]),s=I.useCallback(function(u,p){let g;return typeof u=="function"?g=u(n.current):g=u,n.current.add(g),t(b=>{const _=new Map(b);return _.set(g,p),_}),{id:g,deregister:()=>r(g)}},[r]),a=I.useMemo(()=>Qm(e),[e]),o=I.useCallback(function(u){return Array.from(a.keys()).indexOf(u)},[a]);return{contextValue:I.useMemo(()=>({getItemIndex:o,registerItem:s,totalSubitemCount:e.size}),[o,s,e.size]),subitems:a}}function Jm(e,t){const n=I.useContext(Li);if(n===null)throw new Error("useCompoundItem must be used within a useCompoundParent");const{registerItem:r}=n,[s,a]=I.useState(typeof e=="function"?void 0:e);return kd(()=>{const{id:o,deregister:c}=r(e,t);return a(o),c},[r,t,e]),{id:s,index:s!==void 0?n.getItemIndex(s):-1,totalItemCount:n.totalSubitemCount}}function eb(e){const{value:t,defaultValue:n,onChange:r,orientation:s="horizontal",direction:a="ltr",selectionFollowsFocus:o=!1}=e,[c,l]=Nd({controlled:t,default:n,name:"Tabs",state:"value"}),u=I.useCallback((M,k)=>{l(k),r==null||r(M,k)},[r,l]),{subitems:p,contextValue:g}=al(),b=I.useRef(()=>{}),_=I.useCallback(M=>{var k;return(k=p.get(M))==null?void 0:k.id},[p]),T=I.useCallback(M=>b.current(M),[]),S=I.useCallback(M=>{b.current=M},[]);return{contextValue:ae({direction:a,getTabId:T,getTabPanelId:_,onSelected:u,orientation:s,registerTabIdLookup:S,selectionFollowsFocus:o,value:c},g)}}const cl=I.createContext(null);function ll(){const e=I.useContext(cl);if(e==null)throw new Error("No TabsContext provided");return e}function tb(e){const{value:t,children:n}=e,{direction:r,getItemIndex:s,onSelected:a,orientation:o,registerItem:c,registerTabIdLookup:l,selectionFollowsFocus:u,totalSubitemCount:p,value:g,getTabId:b,getTabPanelId:_}=t,T=I.useMemo(()=>({getItemIndex:s,registerItem:c,totalSubitemCount:p}),[c,s,p]),S=I.useMemo(()=>({direction:r,getTabId:b,getTabPanelId:_,onSelected:a,orientation:o,registerTabIdLookup:l,selectionFollowsFocus:u,value:g}),[r,b,_,a,o,l,u,g]);return m.jsx(Li.Provider,{value:T,children:m.jsx(cl.Provider,{value:S,children:n})})}const nb=["children","value","defaultValue","orientation","direction","onChange","selectionFollowsFocus","slotProps","slots"],rb=e=>{const{orientation:t}=e;return si({root:["root",t]},Oi(Xm))},dl=I.forwardRef(function(t,n){var r;const{children:s,orientation:a="horizontal",direction:o="ltr",slotProps:c={},slots:l={}}=t,u=Pr(t,nb),p=ae({},t,{orientation:a,direction:o}),{contextValue:g}=eb(p),b=rb(p),_=(r=l.root)!=null?r:"div",T=Di({elementType:_,externalSlotProps:c.root,externalForwardedProps:u,additionalProps:{ref:n},ownerState:p,className:b.root});return m.jsx(_,ae({},T,{children:m.jsx(tb,{value:g,children:s})}))}),ul=Vn.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Gt({key:new Kt("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,s=[];if(!n)return null;const a=this.editor.isEmpty;return e.descendants((o,c)=>{const l=r>=c&&r<=c+o.nodeSize,u=!o.isLeaf&&Cd(o);if((l||!this.options.showOnlyCurrent)&&u){const p=[this.options.emptyNodeClass];a&&p.push(this.options.emptyEditorClass);const g=$r.node(c,c+o.nodeSize,{class:p.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:c,hasAnchor:l}):this.options.placeholder});s.push(g)}return this.options.includeChildren}),zr.create(e,s)}}})]}}),sb=/^\s*>\s$/,ib=tt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return["blockquote",Re(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[On({find:sb,type:this.type})]}}),ob=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,ab=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,cb=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,lb=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,db=Hr.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",Re(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[fn({find:ob,type:this.type}),fn({find:cb,type:this.type})]},addPasteRules(){return[un({find:ab,type:this.type}),un({find:lb,type:this.type})]}}),ub="listItem",Ho="textStyle",Fo=/^\s*([-+*])\s$/,fb=tt.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",Re(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ub,this.editor.getAttributes(Ho)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=On({find:Fo,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=On({find:Fo,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Ho),editor:this.editor})),[e]}}),pb=/(^|[^`])`([^`]+)`(?!`)/,hb=/(^|[^`])`([^`]+)`(?!`)/g,gb=Hr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",Re(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[fn({find:pb,type:this.type})]},addPasteRules(){return[un({find:hb,type:this.type})]}}),mb=/^```([a-z]+)?[\s\n]$/,bb=/^~~~([a-z]+)?[\s\n]$/,fl=tt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,a=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return a||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",Re(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:s}=n;if(!s||r.parent.type!==this.type)return!1;const a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`

`);return!a||!o?!1:e.chain().command(({tr:c})=>(c.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:s,empty:a}=n;if(!a||s.parent.type!==this.type||!(s.parentOffset===s.parent.nodeSize-2))return!1;const c=s.after();return c===void 0?!1:r.nodeAt(c)?e.commands.command(({tr:u})=>(u.setSelection(Dn.near(r.resolve(c))),!0)):e.commands.exitCode()}}},addInputRules(){return[Ds({find:mb,type:this.type,getAttributes:e=>({language:e[1]})}),Ds({find:bb,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Gt({key:new Kt("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),s=r?JSON.parse(r):void 0,a=s==null?void 0:s.mode;if(!n||!a)return!1;const{tr:o,schema:c}=e.state,l=c.text(n.replace(/\r\n?/g,`
`));return o.replaceSelectionWith(this.type.create({language:a},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(sn.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}}),_b=tt.create({name:"doc",topNode:!0,content:"block+"});function yb(e={}){return new Gt({view(t){return new wb(t,e)}})}class wb{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let a=o=>{this[s](o)};return t.dom.addEventListener(s,a),{name:s,handler:a}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r,s=this.editorView.dom,a=s.getBoundingClientRect(),o=a.width/s.offsetWidth,c=a.height/s.offsetHeight;if(n){let g=t.nodeBefore,b=t.nodeAfter;if(g||b){let _=this.editorView.nodeDOM(this.cursorPos-(g?g.nodeSize:0));if(_){let T=_.getBoundingClientRect(),S=g?T.bottom:T.top;g&&b&&(S=(S+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let M=this.width/2*c;r={left:T.left,right:T.right,top:S-M,bottom:S+M}}}}if(!r){let g=this.editorView.coordsAtPos(this.cursorPos),b=this.width/2*o;r={left:g.left-b,right:g.left+b,top:g.top,bottom:g.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let u,p;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,p=-pageYOffset;else{let g=l.getBoundingClientRect(),b=g.width/l.offsetWidth,_=g.height/l.offsetHeight;u=g.left-l.scrollLeft*b,p=g.top-l.scrollTop*_}this.element.style.left=(r.left-u)/o+"px",this.element.style.top=(r.top-p)/c+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/c+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),s=r&&r.type.spec.disableDropCursor,a=typeof s=="function"?s(this.editorView,n,t):s;if(n&&!a){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let c=Td(this.editorView.state.doc,o,this.editorView.dragging.slice);c!=null&&(o=c)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}const Eb=Vn.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[yb(this.options)]}});class Ce extends Dn{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return Ce.valid(r)?new Ce(r):Dn.near(r)}content(){return ha.empty}eq(t){return t instanceof Ce&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ce(t.resolve(n.pos))}getBookmark(){return new Bi(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!vb(t)||!Sb(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let s=n.contentMatchAt(t.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&Ce.valid(t))return t;let s=t.pos,a=null;for(let o=t.depth;;o--){let c=t.node(o);if(n>0?t.indexAfter(o)<c.childCount:t.index(o)>0){a=c.child(n>0?t.indexAfter(o):t.index(o)-1);break}else if(o==0)return null;s+=n;let l=t.doc.resolve(s);if(Ce.valid(l))return l}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!ii.isSelectable(a)){t=t.doc.resolve(s+a.nodeSize*n),r=!1;continue e}break}a=o,s+=n;let c=t.doc.resolve(s);if(Ce.valid(c))return c}return null}}}Ce.prototype.visible=!1;Ce.findFrom=Ce.findGapCursorFrom;Dn.jsonID("gapcursor",Ce);class Bi{constructor(t){this.pos=t}map(t){return new Bi(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return Ce.valid(n)?new Ce(n):Dn.near(n)}}function vb(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||s.isAtom||s.type.spec.isolating)return!0;if(s.inlineContent)return!1}}return!0}function Sb(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||s.isAtom||s.type.spec.isolating)return!0;if(s.inlineContent)return!1}}return!0}function xb(){return new Gt({props:{decorations:Tb,createSelectionBetween(e,t,n){return t.pos==n.pos&&Ce.valid(n)?new Ce(n):null},handleClick:Nb,handleKeyDown:kb,handleDOMEvents:{beforeinput:Cb}}})}const kb=Md({ArrowLeft:lr("horiz",-1),ArrowRight:lr("horiz",1),ArrowUp:lr("vert",-1),ArrowDown:lr("vert",1)});function lr(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,s,a){let o=r.selection,c=t>0?o.$to:o.$from,l=o.empty;if(o instanceof sn){if(!a.endOfTextblock(n)||c.depth==0)return!1;l=!1,c=r.doc.resolve(t>0?c.after():c.before())}let u=Ce.findGapCursorFrom(c,t,l);return u?(s&&s(r.tr.setSelection(new Ce(u))),!0):!1}}function Nb(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Ce.valid(r))return!1;let s=e.posAtCoords({left:n.clientX,top:n.clientY});return s&&s.inside>-1&&ii.isSelectable(e.state.doc.nodeAt(s.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Ce(r))),!0)}function Cb(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Ce))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let s=qi.empty;for(let o=r.length-1;o>=0;o--)s=qi.from(r[o].createAndFill(null,s));let a=e.state.tr.replace(n.pos,n.pos,new ha(s,0,0));return a.setSelection(sn.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function Tb(e){if(!(e.selection instanceof Ce))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",zr.create(e.doc,[$r.widget(e.selection.head,t,{key:"gapcursor"})])}const Mb=Vn.create({name:"gapCursor",addProseMirrorPlugins(){return[xb()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=Ad(Id(e,"allowGapCursor",n)))!==null&&t!==void 0?t:null}}}),Ab=tt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",Re(this.options.HTMLAttributes,e)]},renderText(){return`
`},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:s,storedMarks:a}=n;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:c}=r.extensionManager,l=a||s.$to.parentOffset&&s.$from.marks();return t().insertContent({type:this.name}).command(({tr:u,dispatch:p})=>{if(p&&l&&o){const g=l.filter(b=>c.includes(b.type.name));u.ensureMarks(g)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Ib=tt.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Re(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Ds({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var Or=200,Be=function(){};Be.prototype.append=function(t){return t.length?(t=Be.from(t),!this.length&&t||t.length<Or&&this.leafAppend(t)||this.length<Or&&t.leafPrepend(this)||this.appendInner(t)):this};Be.prototype.prepend=function(t){return t.length?Be.from(t).append(this):this};Be.prototype.appendInner=function(t){return new Rb(this,t)};Be.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?Be.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Be.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Be.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};Be.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(a,o){return s.push(t(a,o))},n,r),s};Be.from=function(t){return t instanceof Be?t:t&&t.length?new pl(t):Be.empty};var pl=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(s,a){return s==0&&a==this.length?this:new t(this.values.slice(s,a))},t.prototype.getInner=function(s){return this.values[s]},t.prototype.forEachInner=function(s,a,o,c){for(var l=a;l<o;l++)if(s(this.values[l],c+l)===!1)return!1},t.prototype.forEachInvertedInner=function(s,a,o,c){for(var l=a-1;l>=o;l--)if(s(this.values[l],c+l)===!1)return!1},t.prototype.leafAppend=function(s){if(this.length+s.length<=Or)return new t(this.values.concat(s.flatten()))},t.prototype.leafPrepend=function(s){if(this.length+s.length<=Or)return new t(s.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Be);Be.empty=new pl([]);var Rb=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,s,a,o){var c=this.left.length;if(s<c&&this.left.forEachInner(r,s,Math.min(a,c),o)===!1||a>c&&this.right.forEachInner(r,Math.max(s-c,0),Math.min(this.length,a)-c,o+c)===!1)return!1},t.prototype.forEachInvertedInner=function(r,s,a,o){var c=this.left.length;if(s>c&&this.right.forEachInvertedInner(r,s-c,Math.max(a,c)-c,o+c)===!1||a<c&&this.left.forEachInvertedInner(r,Math.min(s,c),a,o)===!1)return!1},t.prototype.sliceInner=function(r,s){if(r==0&&s==this.length)return this;var a=this.left.length;return s<=a?this.left.slice(r,s):r>=a?this.right.slice(r-a,s-a):this.left.slice(r,a).append(this.right.slice(0,s-a))},t.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new t(this.left,s)},t.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new t(s,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(Be);const Ob=500;class it{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,a;n&&(s=this.remapping(r,this.items.length),a=s.maps.length);let o=t.tr,c,l,u=[],p=[];return this.items.forEach((g,b)=>{if(!g.step){s||(s=this.remapping(r,b+1),a=s.maps.length),a--,p.push(g);return}if(s){p.push(new ut(g.map));let _=g.step.map(s.slice(a)),T;_&&o.maybeStep(_).doc&&(T=o.mapping.maps[o.mapping.maps.length-1],u.push(new ut(T,void 0,void 0,u.length+p.length))),a--,T&&s.appendMap(T,a)}else o.maybeStep(g.step);if(g.selection)return c=s?g.selection.map(s.slice(a)):g.selection,l=new it(this.items.slice(0,r).append(p.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:c}}addTransform(t,n,r,s){let a=[],o=this.eventCount,c=this.items,l=!s&&c.length?c.get(c.length-1):null;for(let p=0;p<t.steps.length;p++){let g=t.steps[p].invert(t.docs[p]),b=new ut(t.mapping.maps[p],g,n),_;(_=l&&l.merge(b))&&(b=_,p?a.pop():c=c.slice(0,c.length-1)),a.push(b),n&&(o++,n=void 0),s||(l=b)}let u=o-r.depth;return u>Lb&&(c=Db(c,u),o-=u),new it(c.append(a),o)}remapping(t,n){let r=new Rd;return this.items.forEach((s,a)=>{let o=s.mirrorOffset!=null&&a-s.mirrorOffset>=t?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,o)},t,n),r}addMaps(t){return this.eventCount==0?this:new it(this.items.append(t.map(n=>new ut(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,c=this.eventCount;this.items.forEach(b=>{b.selection&&c--},s);let l=n;this.items.forEach(b=>{let _=a.getMirror(--l);if(_==null)return;o=Math.min(o,_);let T=a.maps[_];if(b.step){let S=t.steps[_].invert(t.docs[_]),M=b.selection&&b.selection.map(a.slice(l+1,_));M&&c++,r.push(new ut(T,S,M))}else r.push(new ut(T))},s);let u=[];for(let b=n;b<o;b++)u.push(new ut(a.maps[b]));let p=this.items.slice(0,s).append(u).append(r),g=new it(p,c);return g.emptyItemCount()>Ob&&(g=g.compress(this.items.length-r.length)),g}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,s=[],a=0;return this.items.forEach((o,c)=>{if(c>=t)s.push(o),o.selection&&a++;else if(o.step){let l=o.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let p=o.selection&&o.selection.map(n.slice(r));p&&a++;let g=new ut(u.invert(),l,p),b,_=s.length-1;(b=s.length&&s[_].merge(g))?s[_]=b:s.push(g)}}else o.map&&r--},this.items.length,0),new it(Be.from(s.reverse()),a)}}it.empty=new it(Be.empty,0);function Db(e,t){let n;return e.forEach((r,s)=>{if(r.selection&&t--==0)return n=s,!1}),e.slice(n)}class ut{constructor(t,n,r,s){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=s}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new ut(n.getMap().invert(),n,this.selection)}}}class Tt{constructor(t,n,r,s,a){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=s,this.prevComposition=a}}const Lb=20;function Bb(e,t,n,r){let s=n.getMeta(Ft),a;if(s)return s.historyState;n.getMeta(zb)&&(e=new Tt(e.done,e.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(o&&o.getMeta(Ft))return o.getMeta(Ft).redo?new Tt(e.done.addTransform(n,void 0,r,vr(t)),e.undone,jo(n.mapping.maps),e.prevTime,e.prevComposition):new Tt(e.done,e.undone.addTransform(n,void 0,r,vr(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let c=n.getMeta("composition"),l=e.prevTime==0||!o&&e.prevComposition!=c&&(e.prevTime<(n.time||0)-r.newGroupDelay||!Pb(n,e.prevRanges)),u=o?ks(e.prevRanges,n.mapping):jo(n.mapping.maps);return new Tt(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,vr(t)),it.empty,u,n.time,c??e.prevComposition)}else return(a=n.getMeta("rebased"))?new Tt(e.done.rebased(n,a),e.undone.rebased(n,a),ks(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Tt(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),ks(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function Pb(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,s)=>{for(let a=0;a<t.length;a+=2)r<=t[a+1]&&s>=t[a]&&(n=!0)}),n}function jo(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,s,a,o)=>t.push(a,o));return t}function ks(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let s=t.map(e[r],1),a=t.map(e[r+1],-1);s<=a&&n.push(s,a)}return n}function $b(e,t,n){let r=vr(t),s=Ft.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),c=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),s,r),l=new Tt(n?c:a.remaining,n?a.remaining:c,null,0,-1);return a.transform.setSelection(o).setMeta(Ft,{redo:n,historyState:l})}let Ns=!1,Uo=null;function vr(e){let t=e.plugins;if(Uo!=t){Ns=!1,Uo=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){Ns=!0;break}}return Ns}const Ft=new Kt("history"),zb=new Kt("closeHistory");function Hb(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Gt({key:Ft,state:{init(){return new Tt(it.empty,it.empty,null,0,-1)},apply(t,n,r){return Bb(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,s=r=="historyUndo"?gl:r=="historyRedo"?ml:null;return s?(n.preventDefault(),s(t.state,t.dispatch)):!1}}}})}function hl(e,t){return(n,r)=>{let s=Ft.getState(n);if(!s||(e?s.undone:s.done).eventCount==0)return!1;if(r){let a=$b(s,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}const gl=hl(!1,!0),ml=hl(!0,!0),Fb=Vn.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>gl(e,t),redo:()=>({state:e,dispatch:t})=>ml(e,t)}},addProseMirrorPlugins(){return[Hb(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),jb=tt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",Re(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{const{selection:n}=t,{$from:r,$to:s}=n,a=e();return r.parentOffset===0?a.insertContentAt({from:Math.max(r.pos-1,0),to:s.pos},{type:this.name}):Dd(n)?a.insertContentAt(s.pos,{type:this.name}):a.insertContent({type:this.name}),a.command(({tr:o,dispatch:c})=>{var l;if(c){const{$to:u}=o.selection,p=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?o.setSelection(sn.create(o.doc,u.pos+1)):u.nodeAfter.isBlock?o.setSelection(ii.create(o.doc,u.pos)):o.setSelection(sn.create(o.doc,u.pos));else{const g=(l=u.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();g&&(o.insert(p,g),o.setSelection(sn.create(o.doc,p+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Od({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Ub=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Vb=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Gb=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Kb=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Wb=Hr.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Re(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[fn({find:Ub,type:this.type}),fn({find:Gb,type:this.type})]},addPasteRules(){return[un({find:Vb,type:this.type}),un({find:Kb,type:this.type})]}}),qb=tt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Re(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Yb="listItem",Vo="textStyle",Go=/^(\d+)\.\s$/,Zb=tt.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",Re(this.options.HTMLAttributes,n),0]:["ol",Re(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Yb,this.editor.getAttributes(Vo)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=On({find:Go,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=On({find:Go,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(Vo)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),Xb=tt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Re(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Qb=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Jb=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,e_=Hr.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",Re(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[fn({find:Qb,type:this.type})]},addPasteRules(){return[un({find:Jb,type:this.type})]}}),t_=tt.create({name:"text",group:"inline"}),bl=Vn.create({name:"starterKit",addExtensions(){const e=[];return this.options.bold!==!1&&e.push(db.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(ib.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(fb.configure(this.options.bulletList)),this.options.code!==!1&&e.push(gb.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(fl.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(_b.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(Eb.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(Mb.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(Ab.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(Ib.configure(this.options.heading)),this.options.history!==!1&&e.push(Fb.configure(this.options.history)),this.options.horizontalRule!==!1&&e.push(jb.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(Wb.configure(this.options.italic)),this.options.listItem!==!1&&e.push(qb.configure(this.options.listItem)),this.options.orderedList!==!1&&e.push(Zb.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(Xb.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(e_.configure(this.options.strike)),this.options.text!==!1&&e.push(t_.configure(this.options.text)),e}});function _l(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&_l(n)}),e}class Ko{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function yl(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function At(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const s in r)n[s]=r[s]}),n}const n_="</span>",Wo=e=>!!e.scope,r_=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,s)=>`${r}${"_".repeat(s+1)}`)].join(" ")}return`${t}${e}`};class s_{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=yl(t)}openNode(t){if(!Wo(t))return;const n=r_(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){Wo(t)&&(this.buffer+=n_)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const qo=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Pi{constructor(){this.rootNode=qo(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=qo({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{Pi._collapse(n)}))}}class i_ extends Pi{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new s_(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Hn(e){return e?typeof e=="string"?e:e.source:null}function wl(e){return Yt("(?=",e,")")}function o_(e){return Yt("(?:",e,")*")}function a_(e){return Yt("(?:",e,")?")}function Yt(...e){return e.map(n=>Hn(n)).join("")}function c_(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function $i(...e){return"("+(c_(e).capture?"":"?:")+e.map(r=>Hn(r)).join("|")+")"}function El(e){return new RegExp(e.toString()+"|").exec("").length-1}function l_(e,t){const n=e&&e.exec(t);return n&&n.index===0}const d_=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function zi(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let a=Hn(r),o="";for(;a.length>0;){const c=d_.exec(a);if(!c){o+=a;break}o+=a.substring(0,c.index),a=a.substring(c.index+c[0].length),c[0][0]==="\\"&&c[1]?o+="\\"+String(Number(c[1])+s):(o+=c[0],c[0]==="("&&n++)}return o}).map(r=>`(${r})`).join(t)}const u_=/\b\B/,vl="[a-zA-Z]\\w*",Hi="[a-zA-Z_]\\w*",Sl="\\b\\d+(\\.\\d+)?",xl="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",kl="\\b(0b[01]+)",f_="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",p_=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Yt(t,/.*\b/,e.binary,/\b.*/)),At({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Fn={begin:"\\\\[\\s\\S]",relevance:0},h_={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Fn]},g_={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Fn]},m_={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Xr=function(e,t,n={}){const r=At({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const s=$i("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Yt(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},b_=Xr("//","$"),__=Xr("/\\*","\\*/"),y_=Xr("#","$"),w_={scope:"number",begin:Sl,relevance:0},E_={scope:"number",begin:xl,relevance:0},v_={scope:"number",begin:kl,relevance:0},S_={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Fn,{begin:/\[/,end:/\]/,relevance:0,contains:[Fn]}]},x_={scope:"title",begin:vl,relevance:0},k_={scope:"title",begin:Hi,relevance:0},N_={begin:"\\.\\s*"+Hi,relevance:0},C_=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var dr=Object.freeze({__proto__:null,APOS_STRING_MODE:h_,BACKSLASH_ESCAPE:Fn,BINARY_NUMBER_MODE:v_,BINARY_NUMBER_RE:kl,COMMENT:Xr,C_BLOCK_COMMENT_MODE:__,C_LINE_COMMENT_MODE:b_,C_NUMBER_MODE:E_,C_NUMBER_RE:xl,END_SAME_AS_BEGIN:C_,HASH_COMMENT_MODE:y_,IDENT_RE:vl,MATCH_NOTHING_RE:u_,METHOD_GUARD:N_,NUMBER_MODE:w_,NUMBER_RE:Sl,PHRASAL_WORDS_MODE:m_,QUOTE_STRING_MODE:g_,REGEXP_MODE:S_,RE_STARTERS_RE:f_,SHEBANG:p_,TITLE_MODE:x_,UNDERSCORE_IDENT_RE:Hi,UNDERSCORE_TITLE_MODE:k_});function T_(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function M_(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function A_(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=T_,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function I_(e,t){Array.isArray(e.illegal)&&(e.illegal=$i(...e.illegal))}function R_(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function O_(e,t){e.relevance===void 0&&(e.relevance=1)}const D_=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=Yt(n.beforeMatch,wl(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},L_=["of","and","for","in","not","or","if","then","parent","list","value"],B_="keyword";function Nl(e,t,n=B_){const r=Object.create(null);return typeof e=="string"?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach(function(a){Object.assign(r,Nl(e[a],t,a))}),r;function s(a,o){t&&(o=o.map(c=>c.toLowerCase())),o.forEach(function(c){const l=c.split("|");r[l[0]]=[a,P_(l[0],l[1])]})}}function P_(e,t){return t?Number(t):$_(e)?0:1}function $_(e){return L_.includes(e.toLowerCase())}const Yo={},jt=e=>{console.error(e)},Zo=(e,...t)=>{console.log(`WARN: ${e}`,...t)},en=(e,t)=>{Yo[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Yo[`${e}/${t}`]=!0)},Dr=new Error;function Cl(e,t,{key:n}){let r=0;const s=e[n],a={},o={};for(let c=1;c<=t.length;c++)o[c+r]=s[c],a[c+r]=!0,r+=El(t[c-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function z_(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw jt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Dr;if(typeof e.beginScope!="object"||e.beginScope===null)throw jt("beginScope must be object"),Dr;Cl(e,e.begin,{key:"beginScope"}),e.begin=zi(e.begin,{joinWith:""})}}function H_(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw jt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Dr;if(typeof e.endScope!="object"||e.endScope===null)throw jt("endScope must be object"),Dr;Cl(e,e.end,{key:"endScope"}),e.end=zi(e.end,{joinWith:""})}}function F_(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function j_(e){F_(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),z_(e),H_(e)}function U_(e){function t(o,c){return new RegExp(Hn(o),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(c?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(c,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,c]),this.matchAt+=El(c)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const c=this.regexes.map(l=>l[1]);this.matcherRe=t(zi(c,{joinWith:"|"}),!0),this.lastIndex=0}exec(c){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(c);if(!l)return null;const u=l.findIndex((g,b)=>b>0&&g!==void 0),p=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,p)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(c){if(this.multiRegexes[c])return this.multiRegexes[c];const l=new n;return this.rules.slice(c).forEach(([u,p])=>l.addRule(u,p)),l.compile(),this.multiRegexes[c]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(c,l){this.rules.push([c,l]),l.type==="begin"&&this.count++}exec(c){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(c);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,u=p.exec(c)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(o){const c=new r;return o.contains.forEach(l=>c.addRule(l.begin,{rule:l,type:"begin"})),o.terminatorEnd&&c.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&c.addRule(o.illegal,{type:"illegal"}),c}function a(o,c){const l=o;if(o.isCompiled)return l;[M_,R_,j_,D_].forEach(p=>p(o,c)),e.compilerExtensions.forEach(p=>p(o,c)),o.__beforeBegin=null,[A_,I_,O_].forEach(p=>p(o,c)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=Nl(o.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),c&&(o.begin||(o.begin=/\B|\b/),l.beginRe=t(l.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(l.endRe=t(l.end)),l.terminatorEnd=Hn(l.end)||"",o.endsWithParent&&c.terminatorEnd&&(l.terminatorEnd+=(o.end?"|":"")+c.terminatorEnd)),o.illegal&&(l.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(p){return V_(p==="self"?o:p)})),o.contains.forEach(function(p){a(p,l)}),o.starts&&a(o.starts,c),l.matcher=s(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language.  See documentation.");return e.classNameAliases=At(e.classNameAliases||{}),a(e)}function Tl(e){return e?e.endsWithParent||Tl(e.starts):!1}function V_(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return At(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Tl(e)?At(e,{starts:e.starts?At(e.starts):null}):Object.isFrozen(e)?At(e):e}var G_="11.11.1";class K_ extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Cs=yl,Xo=At,Qo=Symbol("nomatch"),W_=7,Ml=function(e){const t=Object.create(null),n=Object.create(null),r=[];let s=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let c={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:i_};function l(h){return c.noHighlightRe.test(h)}function u(h){let N=h.className+" ";N+=h.parentNode?h.parentNode.className:"";const L=c.languageDetectRe.exec(N);if(L){const R=w(L[1]);return R||(Zo(a.replace("{}",L[1])),Zo("Falling back to no-highlight mode for this block.",h)),R?L[1]:"no-highlight"}return N.split(/\s+/).find(R=>l(R)||w(R))}function p(h,N,L){let R="",z="";typeof N=="object"?(R=h,L=N.ignoreIllegals,z=N.language):(en("10.7.0","highlight(lang, code, ...args) has been deprecated."),en("10.7.0",`Please use highlight(code, options) instead.
https://github.com/highlightjs/highlight.js/issues/2277`),z=h,R=N),L===void 0&&(L=!0);const B={code:R,language:z};E("before:highlight",B);const H=B.result?B.result:g(B.language,B.code,L);return H.code=B.code,E("after:highlight",H),H}function g(h,N,L,R){const z=Object.create(null);function B(K,Q){return K.keywords[Q]}function H(){if(!U.keywords){me.addText(fe);return}let K=0;U.keywordPatternRe.lastIndex=0;let Q=U.keywordPatternRe.exec(fe),te="";for(;Q;){te+=fe.substring(K,Q.index);const ce=ge.case_insensitive?Q[0].toLowerCase():Q[0],ue=B(U,ce);if(ue){const[_e,Xe]=ue;if(me.addText(te),te="",z[ce]=(z[ce]||0)+1,z[ce]<=W_&&(qe+=Xe),_e.startsWith("_"))te+=Q[0];else{const $e=ge.classNameAliases[_e]||_e;W(Q[0],$e)}}else te+=Q[0];K=U.keywordPatternRe.lastIndex,Q=U.keywordPatternRe.exec(fe)}te+=fe.substring(K),me.addText(te)}function j(){if(fe==="")return;let K=null;if(typeof U.subLanguage=="string"){if(!t[U.subLanguage]){me.addText(fe);return}K=g(U.subLanguage,fe,!0,He[U.subLanguage]),He[U.subLanguage]=K._top}else K=_(fe,U.subLanguage.length?U.subLanguage:null);U.relevance>0&&(qe+=K.relevance),me.__addSublanguage(K._emitter,K.language)}function V(){U.subLanguage!=null?j():H(),fe=""}function W(K,Q){K!==""&&(me.startScope(Q),me.addText(K),me.endScope())}function ne(K,Q){let te=1;const ce=Q.length-1;for(;te<=ce;){if(!K._emit[te]){te++;continue}const ue=ge.classNameAliases[K[te]]||K[te],_e=Q[te];ue?W(_e,ue):(fe=_e,H(),fe=""),te++}}function Z(K,Q){return K.scope&&typeof K.scope=="string"&&me.openNode(ge.classNameAliases[K.scope]||K.scope),K.beginScope&&(K.beginScope._wrap?(W(fe,ge.classNameAliases[K.beginScope._wrap]||K.beginScope._wrap),fe=""):K.beginScope._multi&&(ne(K.beginScope,Q),fe="")),U=Object.create(K,{parent:{value:U}}),U}function q(K,Q,te){let ce=l_(K.endRe,te);if(ce){if(K["on:end"]){const ue=new Ko(K);K["on:end"](Q,ue),ue.isMatchIgnored&&(ce=!1)}if(ce){for(;K.endsParent&&K.parent;)K=K.parent;return K}}if(K.endsWithParent)return q(K.parent,Q,te)}function ie(K){return U.matcher.regexIndex===0?(fe+=K[0],1):(Ze=!0,0)}function oe(K){const Q=K[0],te=K.rule,ce=new Ko(te),ue=[te.__beforeBegin,te["on:begin"]];for(const _e of ue)if(_e&&(_e(K,ce),ce.isMatchIgnored))return ie(Q);return te.skip?fe+=Q:(te.excludeBegin&&(fe+=Q),V(),!te.returnBegin&&!te.excludeBegin&&(fe=Q)),Z(te,K),te.returnBegin?0:Q.length}function pe(K){const Q=K[0],te=N.substring(K.index),ce=q(U,K,te);if(!ce)return Qo;const ue=U;U.endScope&&U.endScope._wrap?(V(),W(Q,U.endScope._wrap)):U.endScope&&U.endScope._multi?(V(),ne(U.endScope,K)):ue.skip?fe+=Q:(ue.returnEnd||ue.excludeEnd||(fe+=Q),V(),ue.excludeEnd&&(fe=Q));do U.scope&&me.closeNode(),!U.skip&&!U.subLanguage&&(qe+=U.relevance),U=U.parent;while(U!==ce.parent);return ce.starts&&Z(ce.starts,K),ue.returnEnd?0:Q.length}function Me(){const K=[];for(let Q=U;Q!==ge;Q=Q.parent)Q.scope&&K.unshift(Q.scope);K.forEach(Q=>me.openNode(Q))}let ve={};function be(K,Q){const te=Q&&Q[0];if(fe+=K,te==null)return V(),0;if(ve.type==="begin"&&Q.type==="end"&&ve.index===Q.index&&te===""){if(fe+=N.slice(Q.index,Q.index+1),!s){const ce=new Error(`0 width match regex (${h})`);throw ce.languageName=h,ce.badRule=ve.rule,ce}return 1}if(ve=Q,Q.type==="begin")return oe(Q);if(Q.type==="illegal"&&!L){const ce=new Error('Illegal lexeme "'+te+'" for mode "'+(U.scope||"<unnamed>")+'"');throw ce.mode=U,ce}else if(Q.type==="end"){const ce=pe(Q);if(ce!==Qo)return ce}if(Q.type==="illegal"&&te==="")return fe+=`
`,1;if(Ge>1e5&&Ge>Q.index*3)throw new Error("potential infinite loop, way more iterations than matches");return fe+=te,te.length}const ge=w(h);if(!ge)throw jt(a.replace("{}",h)),new Error('Unknown language: "'+h+'"');const se=U_(ge);let we="",U=R||se;const He={},me=new c.__emitter(c);Me();let fe="",qe=0,Ae=0,Ge=0,Ze=!1;try{if(ge.__emitTokens)ge.__emitTokens(N,me);else{for(U.matcher.considerAll();;){Ge++,Ze?Ze=!1:U.matcher.considerAll(),U.matcher.lastIndex=Ae;const K=U.matcher.exec(N);if(!K)break;const Q=N.substring(Ae,K.index),te=be(Q,K);Ae=K.index+te}be(N.substring(Ae))}return me.finalize(),we=me.toHTML(),{language:h,value:we,relevance:qe,illegal:!1,_emitter:me,_top:U}}catch(K){if(K.message&&K.message.includes("Illegal"))return{language:h,value:Cs(N),illegal:!0,relevance:0,_illegalBy:{message:K.message,index:Ae,context:N.slice(Ae-100,Ae+100),mode:K.mode,resultSoFar:we},_emitter:me};if(s)return{language:h,value:Cs(N),illegal:!1,relevance:0,errorRaised:K,_emitter:me,_top:U};throw K}}function b(h){const N={value:Cs(h),illegal:!1,relevance:0,_top:o,_emitter:new c.__emitter(c)};return N._emitter.addText(h),N}function _(h,N){N=N||c.languages||Object.keys(t);const L=b(h),R=N.filter(w).filter(x).map(V=>g(V,h,!1));R.unshift(L);const z=R.sort((V,W)=>{if(V.relevance!==W.relevance)return W.relevance-V.relevance;if(V.language&&W.language){if(w(V.language).supersetOf===W.language)return 1;if(w(W.language).supersetOf===V.language)return-1}return 0}),[B,H]=z,j=B;return j.secondBest=H,j}function T(h,N,L){const R=N&&n[N]||L;h.classList.add("hljs"),h.classList.add(`language-${R}`)}function S(h){let N=null;const L=u(h);if(l(L))return;if(E("before:highlightElement",{el:h,language:L}),h.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",h);return}if(h.children.length>0&&(c.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(h)),c.throwUnescapedHTML))throw new K_("One of your code blocks includes unescaped HTML.",h.innerHTML);N=h;const R=N.textContent,z=L?p(R,{language:L,ignoreIllegals:!0}):_(R);h.innerHTML=z.value,h.dataset.highlighted="yes",T(h,L,z.language),h.result={language:z.language,re:z.relevance,relevance:z.relevance},z.secondBest&&(h.secondBest={language:z.secondBest.language,relevance:z.secondBest.relevance}),E("after:highlightElement",{el:h,result:z,text:R})}function M(h){c=Xo(c,h)}const k=()=>{i(),en("10.6.0","initHighlighting() deprecated.  Use highlightAll() now.")};function O(){i(),en("10.6.0","initHighlightingOnLoad() deprecated.  Use highlightAll() now.")}let P=!1;function i(){function h(){i()}if(document.readyState==="loading"){P||window.addEventListener("DOMContentLoaded",h,!1),P=!0;return}document.querySelectorAll(c.cssSelector).forEach(S)}function f(h,N){let L=null;try{L=N(e)}catch(R){if(jt("Language definition for '{}' could not be registered.".replace("{}",h)),s)jt(R);else throw R;L=o}L.name||(L.name=h),t[h]=L,L.rawDefinition=N.bind(null,e),L.aliases&&v(L.aliases,{languageName:h})}function d(h){delete t[h];for(const N of Object.keys(n))n[N]===h&&delete n[N]}function y(){return Object.keys(t)}function w(h){return h=(h||"").toLowerCase(),t[h]||t[n[h]]}function v(h,{languageName:N}){typeof h=="string"&&(h=[h]),h.forEach(L=>{n[L.toLowerCase()]=N})}function x(h){const N=w(h);return N&&!N.disableAutodetect}function A(h){h["before:highlightBlock"]&&!h["before:highlightElement"]&&(h["before:highlightElement"]=N=>{h["before:highlightBlock"](Object.assign({block:N.el},N))}),h["after:highlightBlock"]&&!h["after:highlightElement"]&&(h["after:highlightElement"]=N=>{h["after:highlightBlock"](Object.assign({block:N.el},N))})}function $(h){A(h),r.push(h)}function D(h){const N=r.indexOf(h);N!==-1&&r.splice(N,1)}function E(h,N){const L=h;r.forEach(function(R){R[L]&&R[L](N)})}function C(h){return en("10.7.0","highlightBlock will be removed entirely in v12.0"),en("10.7.0","Please use highlightElement now."),S(h)}Object.assign(e,{highlight:p,highlightAuto:_,highlightAll:i,highlightElement:S,highlightBlock:C,configure:M,initHighlighting:k,initHighlightingOnLoad:O,registerLanguage:f,unregisterLanguage:d,listLanguages:y,getLanguage:w,registerAliases:v,autoDetection:x,inherit:Xo,addPlugin:$,removePlugin:D}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=G_,e.regex={concat:Yt,lookahead:wl,either:$i,optional:a_,anyNumberOfTimes:o_};for(const h in dr)typeof dr[h]=="object"&&_l(dr[h]);return Object.assign(e,dr),e},_n=Ml({});_n.newInstance=()=>Ml({});var q_=_n;_n.HighlightJS=_n;_n.default=_n;const Al=pa(q_);function Il(e,t=[]){return e.map(n=>{const r=[...t,...n.properties?n.properties.className:[]];return n.children?Il(n.children,r):{text:n.value,classes:r}}).flat()}function Jo(e){return e.value||e.children||[]}function Y_(e){return!!Al.getLanguage(e)}function ea({doc:e,name:t,lowlight:n,defaultLanguage:r}){const s=[];return Ls(e,a=>a.type.name===t).forEach(a=>{var o;let c=a.pos+1;const l=a.node.attrs.language||r,u=n.listLanguages(),p=l&&(u.includes(l)||Y_(l)||(o=n.registered)!=null&&o.call(n,l))?Jo(n.highlight(l,a.node.textContent)):Jo(n.highlightAuto(a.node.textContent));Il(p).forEach(g=>{const b=c+g.text.length;if(g.classes.length){const _=$r.inline(c,b,{class:g.classes.join(" ")});s.push(_)}c=b})}),zr.create(e,s)}function Z_(e){return typeof e=="function"}function X_({name:e,lowlight:t,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(s=>Z_(t[s])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new Gt({key:new Kt("lowlight"),state:{init:(s,{doc:a})=>ea({doc:a,name:e,lowlight:t,defaultLanguage:n}),apply:(s,a,o,c)=>{const l=o.selection.$head.parent.type.name,u=c.selection.$head.parent.type.name,p=Ls(o.doc,b=>b.type.name===e),g=Ls(c.doc,b=>b.type.name===e);return s.docChanged&&([l,u].includes(e)||g.length!==p.length||s.steps.some(b=>b.from!==void 0&&b.to!==void 0&&p.some(_=>_.pos>=b.from&&_.pos+_.node.nodeSize<=b.to)))?ea({doc:s.doc,name:e,lowlight:t,defaultLanguage:n}):a.map(s.mapping,s.doc)}},props:{decorations(s){return r.getState(s)}}});return r}var Q_=fl.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}},addProseMirrorPlugins(){var e;return[...((e=this.parent)==null?void 0:e.call(this))||[],X_({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),Rl=Q_;function J_(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",c={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},p={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},b={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},_=t.optional(s)+e.IDENT_RE+"\\s*\\(",T=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],S=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],M=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],k=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],i={type:S,keyword:T,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:M},f={className:"function.dispatch",relevance:0,keywords:{_hint:k},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},d=[f,g,c,n,e.C_BLOCK_COMMENT_MODE,p,u],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:i,contains:d.concat([{begin:/\(/,end:/\)/,keywords:i,contains:d.concat(["self"]),relevance:0}]),relevance:0},w={className:"function",begin:"("+o+"[\\*&\\s]+)+"+_,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:i,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:i,relevance:0},{begin:_,returnBegin:!0,contains:[b],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,p]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,p,c,{begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,p,c]}]},c,n,e.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:i,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(y,w,f,d,[g,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:i,contains:["self",c]},{begin:e.IDENT_RE+"::",keywords:i},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function ey(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=J_(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function ty(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(c);const l={match:/\\"/},u={className:"string",begin:/'/,end:/'/},p={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},b=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],_=e.SHEBANG({binary:`(${b.join("|")})`,relevance:10}),T={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},S=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],M=["true","false"],k={match:/(\/[a-z._-]+)+/},O=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],P=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],i=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],f=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:S,literal:M,built_in:[...O,...P,"set","shopt",...i,...f]},contains:[_,e.SHEBANG(),T,g,a,o,k,c,l,u,p,n]}}function ny(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",o="("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",c={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},p={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},b={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},_=t.optional(s)+e.IDENT_RE+"\\s*\\(",M={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},k=[g,c,n,e.C_BLOCK_COMMENT_MODE,p,u],O={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:M,contains:k.concat([{begin:/\(/,end:/\)/,keywords:M,contains:k.concat(["self"]),relevance:0}]),relevance:0},P={begin:"("+o+"[\\*&\\s]+)+"+_,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:M,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:M,relevance:0},{begin:_,returnBegin:!0,contains:[e.inherit(b,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:M,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,p,c,{begin:/\(/,end:/\)/,keywords:M,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,p,c]}]},c,n,e.C_BLOCK_COMMENT_MODE,g]};return{name:"C",aliases:["h"],keywords:M,disableAutodetect:!0,illegal:"</",contains:[].concat(O,P,k,[g,{begin:e.IDENT_RE+"::",keywords:M},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:g,strings:u,keywords:M}}}function ry(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",c={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},p={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},b={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},_=t.optional(s)+e.IDENT_RE+"\\s*\\(",T=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],S=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],M=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],k=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],i={type:S,keyword:T,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:M},f={className:"function.dispatch",relevance:0,keywords:{_hint:k},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},d=[f,g,c,n,e.C_BLOCK_COMMENT_MODE,p,u],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:i,contains:d.concat([{begin:/\(/,end:/\)/,keywords:i,contains:d.concat(["self"]),relevance:0}]),relevance:0},w={className:"function",begin:"("+o+"[\\*&\\s]+)+"+_,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:i,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:i,relevance:0},{begin:_,returnBegin:!0,contains:[b],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,p]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,p,c,{begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,p,c]}]},c,n,e.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:i,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(y,w,f,d,[g,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:i,contains:["self",c]},{begin:e.IDENT_RE+"::",keywords:i},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function sy(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],s=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],a=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:s.concat(a),built_in:t,literal:r},c=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},p={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},g=e.inherit(p,{illegal:/\n/}),b={className:"subst",begin:/\{/,end:/\}/,keywords:o},_=e.inherit(b,{illegal:/\n/}),T={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,_]},S={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},b]},M=e.inherit(S,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},_]});b.contains=[S,T,p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],_.contains=[M,T,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const k={variants:[u,S,T,p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},O={begin:"<",end:">",contains:[{beginKeywords:"in out"},c]},P=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",i={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},k,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},c,O,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[c,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[c,O,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+P+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,O],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[k,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},i]}}const iy=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),oy=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ay=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],cy=[...oy,...ay],ly=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),dy=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),uy=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),fy=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function py(e){const t=e.regex,n=iy(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",a=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",c=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+dy.join("|")+")"},{begin:":(:)?("+uy.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+fy.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...c,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...c,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:ly.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...c,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+cy.join("|")+")\\b"}]}}function hy(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function gy(e){const a={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:a,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:a,illegal:/["']/}]}]}}function my(e){const t=e.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function by(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const s={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={className:"literal",begin:/\bon|off|true|false|yes|no\b/},o={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},c={begin:/\[/,end:/\]/,contains:[r,a,s,o,n,"self"],relevance:0},l=/[A-Za-z0-9_-]+/,u=/"(\\"|[^"])*"/,p=/'[^']*'/,g=t.either(l,u,p),b=t.concat(g,"(\\s*\\.\\s*",g,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:b,className:"attr",starts:{end:/$/,contains:[r,c,a,s,o,n]}}]}}var tn="[0-9](_*[0-9])*",ur=`\\.(${tn})`,fr="[0-9a-fA-F](_*[0-9a-fA-F])*",ta={className:"number",variants:[{begin:`(\\b(${tn})((${ur})|\\.)?|(${ur}))[eE][+-]?(${tn})[fFdD]?\\b`},{begin:`\\b(${tn})((${ur})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ur})[fFdD]?\\b`},{begin:`\\b(${tn})[fFdD]\\b`},{begin:`\\b0[xX]((${fr})\\.?|(${fr})?\\.(${fr}))[pP][+-]?(${tn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${fr})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Ol(e,t,n){return n===-1?"":e.replace(t,r=>Ol(e,t,n-1))}function _y(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Ol("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},p={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[p,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,ta,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},ta,u]}}const na="[A-Za-z$_][0-9A-Za-z$_]*",yy=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],wy=["true","false","null","undefined","NaN","Infinity"],Dl=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Ll=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Bl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ey=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],vy=[].concat(Bl,Dl,Ll);function Sy(e){const t=e.regex,n=(L,{after:R})=>{const z="</"+L[0].slice(1);return L.input.indexOf(z,R)!==-1},r=na,s={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,R)=>{const z=L[0].length+L.index,B=L.input[z];if(B==="<"||B===","){R.ignoreMatch();return}B===">"&&(n(L,{after:z})||R.ignoreMatch());let H;const j=L.input.substring(z);if(H=j.match(/^\s*=/)){R.ignoreMatch();return}if((H=j.match(/^\s+extends\s+/))&&H.index===0){R.ignoreMatch();return}}},c={$pattern:na,keyword:yy,literal:wy,built_in:vy,"variable.language":Ey},l="[0-9](_?[0-9])*",u=`\\.(${l})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${p})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${p})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},b={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},_={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"xml"}},T={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"graphql"}},M={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,b]},O={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},P=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,_,T,S,M,{match:/\$\d+/},g];b.contains=P.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(P)});const i=[].concat(O,b.contains),f=i.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(i)}]),d={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:f},y={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},w={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Dl,...Ll]}},v={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},x={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[d],illegal:/%/},A={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(L){return t.concat("(?!",L.join("|"),")")}const D={match:t.concat(/\b/,$([...Bl,"super","import"].map(L=>`${L}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},E={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},C={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},d]},h="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(h)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[d]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:f,CLASS_REFERENCE:w},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),v,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,_,T,S,M,O,{match:/\$\d+/},g,w,{scope:"attr",match:r+t.lookahead(":"),relevance:0},N,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,e.REGEXP_MODE,{className:"function",begin:h,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:f}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},x,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[d,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},E,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[d]},D,A,y,C,{match:/\$[(.]/}]}}function xy(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var nn="[0-9](_*[0-9])*",pr=`\\.(${nn})`,hr="[0-9a-fA-F](_*[0-9a-fA-F])*",ky={className:"number",variants:[{begin:`(\\b(${nn})((${pr})|\\.)?|(${pr}))[eE][+-]?(${nn})[fFdD]?\\b`},{begin:`\\b(${nn})((${pr})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${pr})[fFdD]?\\b`},{begin:`\\b(${nn})[fFdD]\\b`},{begin:`\\b0[xX]((${hr})\\.?|(${hr})?\\.(${hr}))[pP][+-]?(${nn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${hr})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Ny(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},s={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},a={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[a,s]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,a,s]}]};s.contains.push(o);const c={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},u=ky,p=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),g={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},b=g;return b.variants[1].contains=[g],g.variants[1].contains=[b],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,p,n,r,c,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[g,e.C_LINE_COMMENT_MODE,p],relevance:0},e.C_LINE_COMMENT_MODE,p,c,l,o,e.C_NUMBER_MODE]},p]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},c,l]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
`},u]}}const Cy=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Ty=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],My=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Ay=[...Ty,...My],Iy=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Pl=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),$l=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ry=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),Oy=Pl.concat($l).sort().reverse();function Dy(e){const t=Cy(e),n=Oy,r="and or not only",s="[\\w-]+",a="("+s+"|@\\{"+s+"\\})",o=[],c=[],l=function(P){return{className:"string",begin:"~?"+P+".*?"+P}},u=function(P,i,f){return{className:P,begin:i,relevance:f}},p={$pattern:/[a-z-]+/,keyword:r,attribute:Iy.join(" ")},g={begin:"\\(",end:"\\)",contains:c,keywords:p,relevance:0};c.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,g,u("variable","@@?"+s,10),u("variable","@\\{"+s+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:s+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const b=c.concat({begin:/\{/,end:/\}/,contains:o}),_={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(c)},T={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ry.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:c}}]},S={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:p,returnEnd:!0,contains:c,relevance:0}},M={className:"variable",variants:[{begin:"@"+s+"\\s*:",relevance:15},{begin:"@"+s}],starts:{end:"[;}]",returnEnd:!0,contains:b}},k={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,_,u("keyword","all\\b"),u("variable","@\\{"+s+"\\}"),{begin:"\\b("+Ay.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",a,0),u("selector-id","#"+a),u("selector-class","\\."+a,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Pl.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+$l.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:b},{begin:"!important"},t.FUNCTION_DISPATCH]},O={begin:s+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[k]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,S,M,O,T,k,_,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function Ly(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},s=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:s.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:s}].concat(s)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function By(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},s={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},a={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,r,s,a,o]}}function Py(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},a={className:"bullet",begin:"^[ 	]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},c=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},p={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=e.inherit(u,{contains:[]}),b=e.inherit(p,{contains:[]});u.contains.push(b),p.contains.push(g);let _=[n,l];return[u,p,g,b].forEach(k=>{k.contains=k.contains.concat(_)}),_=_.concat(u,p),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:_},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:_}]}]},n,a,u,p,{className:"quote",begin:"^>\\s+",contains:_,end:"$"},s,r,l,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function $y(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,c={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:c,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function zy(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,s={$pattern:/[\w.]+/,keyword:n.join(" ")},a={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:s},o={begin:/->\{/,end:/\}/},c={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[c]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},p=[e.BACKSLASH_ESCAPE,a,l],g=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],b=(S,M,k="\\1")=>{const O=k==="\\1"?k:t.concat(k,M);return t.concat(t.concat("(?:",S,")"),M,/(?:\\.|[^\\\/])*?/,O,/(?:\\.|[^\\\/])*?/,k,r)},_=(S,M,k)=>t.concat(t.concat("(?:",S,")"),M,/(?:\\.|[^\\\/])*?/,k,r),T=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:p,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:b("s|tr|y",t.either(...g,{capture:!0}))},{begin:b("s|tr|y","\\(","\\)")},{begin:b("s|tr|y","\\[","\\]")},{begin:b("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:_("(?:m|qr)?",/\//,/\//)},{begin:_("m|qr",t.either(...g,{capture:!0}),/\1/)},{begin:_("m|qr",/\(/,/\)/)},{begin:_("m|qr",/\[/,/\]/)},{begin:_("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,c]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,c,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return a.contains=T,o.contains=T,{name:"Perl",aliases:["pl","pm"],keywords:s,contains:T}}function Hy(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),s=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},c={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),p=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),g={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(E,C)=>{C.data._beginMatch=E[1]||E[2]},"on:end":(E,C)=>{C.data._beginMatch!==E[1]&&C.ignoreMatch()}},b=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),_=`[ 	
]`,T={scope:"string",variants:[p,u,g,b]},S={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},M=["false","null","true"],k=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],O=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],i={keyword:k,literal:(E=>{const C=[];return E.forEach(h=>{C.push(h),h.toLowerCase()===h?C.push(h.toUpperCase()):C.push(h.toLowerCase())}),C})(M),built_in:O},f=E=>E.map(C=>C.replace(/\|\d+$/,"")),d={variants:[{match:[/new/,t.concat(_,"+"),t.concat("(?!",f(O).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},y=t.concat(r,"\\b(?!\\()"),w={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),y],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),y],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},v={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},x={relevance:0,begin:/\(/,end:/\)/,keywords:i,contains:[v,o,w,e.C_BLOCK_COMMENT_MODE,T,S,d]},A={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",f(k).join("\\b|"),"|",f(O).join("\\b|"),"\\b)"),r,t.concat(_,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[x]};x.contains.push(A);const $=[v,w,e.C_BLOCK_COMMENT_MODE,T,S,d],D={begin:t.concat(/#\[\s*\\?/,t.either(s,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:M,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:M,keyword:["new","array"]},contains:["self",...$]},...$,{scope:"meta",variants:[{match:s},{match:a}]}]};return{case_insensitive:!1,keywords:i,contains:[D,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},c,{scope:"variable.language",match:/\$this\b/},o,A,w,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},d,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:i,contains:["self",D,o,w,e.C_BLOCK_COMMENT_MODE,T,S]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},T,S]}}function Fy(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function jy(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Uy(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},p={begin:/\{\{/,relevance:0},g={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,p,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,p,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,p,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,p,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},b="[0-9](_?[0-9])*",_=`(\\b(${b}))?\\.(${b})|\\b(${b})\\.`,T=`\\b|${r.join("|")}`,S={className:"number",relevance:0,variants:[{begin:`(\\b(${b})|(${_}))[eE][+-]?(${b})[jJ]?(?=${T})`},{begin:`(${_})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${T})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${T})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${T})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${T})`},{begin:`\\b(${b})[jJ](?=${T})`}]},M={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},k={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",l,S,g,e.HASH_COMMENT_MODE]}]};return u.contains=[g,S,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[l,S,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,M,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[k]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[S,k,g]}]}}function Vy(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Gy(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),s=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[s,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[a,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:s},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Ky(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=t.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},c={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[c]}),e.COMMENT("^=begin","^=end",{contains:[c],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],p={className:"subst",begin:/#\{/,end:/\}/,keywords:o},g={className:"string",contains:[e.BACKSLASH_ESCAPE,p],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,p]})]}]},b="[1-9](_?[0-9])*|0",_="[0-9](_?[0-9])*",T={className:"number",relevance:0,variants:[{begin:`\\b(${b})(\\.(${_}))?([eE][+-]?(${_})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},S={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},d=[g,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:o},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[S]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[g,{begin:n}],relevance:0},T,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,p],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);p.contains=d,S.contains=d;const x=[{begin:/^\s*=>/,starts:{end:"$",contains:d}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:d}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(x).concat(u).concat(d)}}function Wy(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),s=t.concat(n,e.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",c=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],p=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:p,keyword:c,literal:l,built_in:u},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:p}},{className:"punctuation",begin:"->"},a]}}const qy=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Yy=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Zy=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Xy=[...Yy,...Zy],Qy=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Jy=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),ew=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),tw=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function nw(e){const t=qy(e),n=ew,r=Jy,s="@[a-z-]+",a="and or not only",c={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Xy.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},c,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+tw.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,c,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:s,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:Qy.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},c,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function rw(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function sw(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],c=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],p=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],g=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],b=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],_=p,T=[...u,...l].filter(f=>!p.includes(f)),S={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},M={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},k={match:t.concat(/\b/,t.either(..._),/\s*\(/),relevance:0,keywords:{built_in:_}};function O(f){return t.concat(/\b/,t.either(...f.map(d=>d.replace(/\s+/,"\\s+"))),/\b/)}const P={scope:"keyword",match:O(b),relevance:0};function i(f,{exceptions:d,when:y}={}){const w=y;return d=d||[],f.map(v=>v.match(/\|\d+$/)||d.includes(v)?v:w(v)?`${v}|0`:v)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:i(T,{when:f=>f.length<3}),literal:a,type:c,built_in:g},contains:[{scope:"type",match:O(o)},P,k,S,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,M]}}function zl(e){return e?typeof e=="string"?e:e.source:null}function Tn(e){return he("(?=",e,")")}function he(...e){return e.map(n=>zl(n)).join("")}function iw(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function je(...e){return"("+(iw(e).capture?"":"?:")+e.map(r=>zl(r)).join("|")+")"}const Fi=e=>he(/\b/,e,/\w$/.test(e)?/\b/:/\B/),ow=["Protocol","Type"].map(Fi),ra=["init","self"].map(Fi),aw=["Any","Self"],Ts=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],sa=["false","nil","true"],cw=["assignment","associativity","higherThan","left","lowerThan","none","right"],lw=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],ia=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Hl=je(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Fl=je(Hl,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Ms=he(Hl,Fl,"*"),jl=je(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Lr=je(jl,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),dt=he(jl,Lr,"*"),gr=he(/[A-Z]/,Lr,"*"),dw=["attached","autoclosure",he(/convention\(/,je("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",he(/objc\(/,dt,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],uw=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function fw(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,je(...ow,...ra)],className:{2:"keyword"}},a={match:he(/\./,je(...Ts)),relevance:0},o=Ts.filter(se=>typeof se=="string").concat(["_|0"]),c=Ts.filter(se=>typeof se!="string").concat(aw).map(Fi),l={variants:[{className:"keyword",match:je(...c,...ra)}]},u={$pattern:je(/\b\w+/,/#\w+/),keyword:o.concat(lw),literal:sa},p=[s,a,l],g={match:he(/\./,je(...ia)),relevance:0},b={className:"built_in",match:he(/\b/,je(...ia),/(?=\()/)},_=[g,b],T={match:/->/,relevance:0},S={className:"operator",relevance:0,variants:[{match:Ms},{match:`\\.(\\.|${Fl})+`}]},M=[T,S],k="([0-9]_*)+",O="([0-9a-fA-F]_*)+",P={className:"number",relevance:0,variants:[{match:`\\b(${k})(\\.(${k}))?([eE][+-]?(${k}))?\\b`},{match:`\\b0x(${O})(\\.(${O}))?([pP][+-]?(${k}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},i=(se="")=>({className:"subst",variants:[{match:he(/\\/,se,/[0\\tnr"']/)},{match:he(/\\/,se,/u\{[0-9a-fA-F]{1,8}\}/)}]}),f=(se="")=>({className:"subst",match:he(/\\/,se,/[\t ]*(?:[\r\n]|\r\n)/)}),d=(se="")=>({className:"subst",label:"interpol",begin:he(/\\/,se,/\(/),end:/\)/}),y=(se="")=>({begin:he(se,/"""/),end:he(/"""/,se),contains:[i(se),f(se),d(se)]}),w=(se="")=>({begin:he(se,/"/),end:he(/"/,se),contains:[i(se),d(se)]}),v={className:"string",variants:[y(),y("#"),y("##"),y("###"),w(),w("#"),w("##"),w("###")]},x=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],A={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:x},$=se=>{const we=he(se,/\//),U=he(/\//,se);return{begin:we,end:U,contains:[...x,{scope:"comment",begin:`#(?!.*${U})`,end:/$/}]}},D={scope:"regexp",variants:[$("###"),$("##"),$("#"),A]},E={match:he(/`/,dt,/`/)},C={className:"variable",match:/\$\d+/},h={className:"variable",match:`\\$${Lr}+`},N=[E,C,h],L={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:uw,contains:[...M,P,v]}]}},R={scope:"keyword",match:he(/@/,je(...dw),Tn(je(/\(/,/\s+/)))},z={scope:"meta",match:he(/@/,dt)},B=[L,R,z],H={match:Tn(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:he(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Lr,"+")},{className:"type",match:gr,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:he(/\s+&\s+/,Tn(gr)),relevance:0}]},j={begin:/</,end:/>/,keywords:u,contains:[...r,...p,...B,T,H]};H.contains.push(j);const V={match:he(dt,/\s*:/),keywords:"_|0",relevance:0},W={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",V,...r,D,...p,..._,...M,P,v,...N,...B,H]},ne={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,H]},Z={begin:je(Tn(he(dt,/\s*:/)),Tn(he(dt,/\s+/,dt,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:dt}]},q={begin:/\(/,end:/\)/,keywords:u,contains:[Z,...r,...p,...M,P,v,...B,H,W],endsParent:!0,illegal:/["']/},ie={match:[/(func|macro)/,/\s+/,je(E.match,dt,Ms)],className:{1:"keyword",3:"title.function"},contains:[ne,q,t],illegal:[/\[/,/%/]},oe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ne,q,t],illegal:/\[|%/},pe={match:[/operator/,/\s+/,Ms],className:{1:"keyword",3:"title"}},Me={begin:[/precedencegroup/,/\s+/,gr],className:{1:"keyword",3:"title"},contains:[H],keywords:[...cw,...sa],end:/}/},ve={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},be={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ge={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,dt,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[ne,...p,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:gr},...p],relevance:0}]};for(const se of v.variants){const we=se.contains.find(He=>He.label==="interpol");we.keywords=u;const U=[...p,..._,...M,P,v,...N];we.contains=[...U,{begin:/\(/,end:/\)/,contains:["self",...U]}]}return{name:"Swift",keywords:u,contains:[...r,ie,oe,ve,be,ge,pe,Me,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},D,...p,..._,...M,P,v,...N,...B,H,W]}}const Br="[A-Za-z$_][0-9A-Za-z$_]*",Ul=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Vl=["true","false","null","undefined","NaN","Infinity"],Gl=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Kl=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Wl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ql=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Yl=[].concat(Wl,Gl,Kl);function pw(e){const t=e.regex,n=(L,{after:R})=>{const z="</"+L[0].slice(1);return L.input.indexOf(z,R)!==-1},r=Br,s={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,R)=>{const z=L[0].length+L.index,B=L.input[z];if(B==="<"||B===","){R.ignoreMatch();return}B===">"&&(n(L,{after:z})||R.ignoreMatch());let H;const j=L.input.substring(z);if(H=j.match(/^\s*=/)){R.ignoreMatch();return}if((H=j.match(/^\s+extends\s+/))&&H.index===0){R.ignoreMatch();return}}},c={$pattern:Br,keyword:Ul,literal:Vl,built_in:Yl,"variable.language":ql},l="[0-9](_?[0-9])*",u=`\\.(${l})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${p})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${p})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},b={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},_={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"xml"}},T={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"graphql"}},M={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,b]},O={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},P=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,_,T,S,M,{match:/\$\d+/},g];b.contains=P.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(P)});const i=[].concat(O,b.contains),f=i.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(i)}]),d={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:f},y={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},w={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Gl,...Kl]}},v={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},x={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[d],illegal:/%/},A={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(L){return t.concat("(?!",L.join("|"),")")}const D={match:t.concat(/\b/,$([...Wl,"super","import"].map(L=>`${L}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},E={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},C={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},d]},h="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(h)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[d]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:f,CLASS_REFERENCE:w},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),v,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,_,T,S,M,O,{match:/\$\d+/},g,w,{scope:"attr",match:r+t.lookahead(":"),relevance:0},N,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,e.REGEXP_MODE,{className:"function",begin:h,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:f}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},x,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[d,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},E,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[d]},D,A,y,C,{match:/\$[(.]/}]}}function hw(e){const t=e.regex,n=pw(e),r=Br,s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[n.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:Br,keyword:Ul.concat(l),literal:Vl,built_in:Yl.concat(s),"variable.language":ql},p={className:"meta",begin:"@"+r},g=(S,M,k)=>{const O=S.contains.findIndex(P=>P.label===M);if(O===-1)throw new Error("can not find mode to replace");S.contains.splice(O,1,k)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(p);const b=n.contains.find(S=>S.scope==="attr"),_=Object.assign({},b,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,b,_]),n.contains=n.contains.concat([p,a,o,_]),g(n,"shebang",e.SHEBANG()),g(n,"use_strict",c);const T=n.contains.find(S=>S.label==="func.def");return T.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function gw(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,c=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(a,s),/ *#/)},{begin:t.concat(/# */,c,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,s),/ +/,t.either(o,c),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},p={className:"label",begin:/^\w+:/},g=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),b=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,u,p,g,b,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[b]}]}}function mw(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],s={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},a={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},c={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},a,o,s,e.QUOTE_STRING_MODE,l,u,c]}}function bw(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),c=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,l,c,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,o,l,c]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function _w(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},c=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),b={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},_={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},T={begin:/\{/,end:/\}/,contains:[_],illegal:"\\n",relevance:0},S={begin:"\\[",end:"\\]",contains:[_],illegal:"\\n",relevance:0},M=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},b,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},T,S,a,o],k=[...M];return k.pop(),k.push(c),_.contains=k,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:M}}const Zl={arduino:ey,bash:ty,c:ny,cpp:ry,csharp:sy,css:py,diff:hy,go:gy,graphql:my,ini:by,java:_y,javascript:Sy,json:xy,kotlin:Ny,less:Dy,lua:Ly,makefile:By,markdown:Py,objectivec:$y,perl:zy,php:Hy,"php-template":Fy,plaintext:jy,python:Uy,"python-repl":Vy,r:Gy,ruby:Ky,rust:Wy,scss:nw,shell:rw,sql:sw,swift:fw,typescript:hw,vbnet:gw,wasm:mw,xml:bw,yaml:_w},oa={},yw="hljs-";function Xl(e){const t=Al.newInstance();return e&&a(e),{highlight:n,highlightAuto:r,listLanguages:s,register:a,registerAlias:o,registered:c};function n(l,u,p){const g=p||oa,b=typeof g.prefix=="string"?g.prefix:yw;if(!t.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");t.configure({__emitter:ww,classPrefix:b});const _=t.highlight(u,{ignoreIllegals:!0,language:l});if(_.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:_.errorRaised});const T=_._emitter.root,S=T.data;return S.language=_.language,S.relevance=_.relevance,T}function r(l,u){const g=(u||oa).subset||s();let b=-1,_=0,T;for(;++b<g.length;){const S=g[b];if(!t.getLanguage(S))continue;const M=n(S,l,u);M.data&&M.data.relevance!==void 0&&M.data.relevance>_&&(_=M.data.relevance,T=M)}return T||{type:"root",children:[],data:{language:void 0,relevance:_}}}function s(){return t.listLanguages()}function a(l,u){if(typeof l=="string")t.registerLanguage(l,u);else{let p;for(p in l)Object.hasOwn(l,p)&&t.registerLanguage(p,l[p])}}function o(l,u){if(typeof l=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:l});else{let p;for(p in l)if(Object.hasOwn(l,p)){const g=l[p];t.registerAliases(typeof g=="string"?g:[...g],{languageName:p})}}}function c(l){return!!t.getLanguage(l)}}class ww{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],s=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:s}):r.children.push(...s)}openNode(t){const n=this,r=t.split(".").map(function(o,c){return c?o+"_".repeat(c):n.options.classPrefix+o}),s=this.stack[this.stack.length-1],a={type:"element",tagName:"span",properties:{className:r},children:[]};s.children.push(a),this.stack.push(a)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}function Ew(e){var t;const{char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:a,startOfLine:o,$position:c}=e,l=r&&!s,u=Ld(n),p=new RegExp(`\\s${u}$`),g=o?"^":"",b=s?"":u,_=l?new RegExp(`${g}${u}.*?(?=\\s${b}|$)`,"gm"):new RegExp(`${g}(?:^)?${u}[^\\s${b}]*`,"gm"),T=((t=c.nodeBefore)===null||t===void 0?void 0:t.isText)&&c.nodeBefore.text;if(!T)return null;const S=c.pos-T.length,M=Array.from(T.matchAll(_)).pop();if(!M||M.input===void 0||M.index===void 0)return null;const k=M.input.slice(Math.max(0,M.index-1),M.index),O=new RegExp(`^[${a==null?void 0:a.join("")}\0]?$`).test(k);if(a!==null&&!O)return null;const P=S+M.index;let i=P+M[0].length;return l&&p.test(T.slice(i-1,i+1))&&(M[0]+=" ",i+=1),P<c.pos&&i>=c.pos?{range:{from:P,to:i},query:M[0].slice(n.length),text:M[0]}:null}const vw=new Kt("suggestion");function Sw({pluginKey:e=vw,editor:t,char:n="@",allowSpaces:r=!1,allowToIncludeChar:s=!1,allowedPrefixes:a=[" "],startOfLine:o=!1,decorationTag:c="span",decorationClass:l="suggestion",command:u=()=>null,items:p=()=>[],render:g=()=>({}),allow:b=()=>!0,findSuggestionMatch:_=Ew}){let T;const S=g==null?void 0:g(),M=new Gt({key:e,view(){return{update:async(k,O)=>{var P,i,f,d,y,w,v;const x=(P=this.key)===null||P===void 0?void 0:P.getState(O),A=(i=this.key)===null||i===void 0?void 0:i.getState(k.state),$=x.active&&A.active&&x.range.from!==A.range.from,D=!x.active&&A.active,E=x.active&&!A.active,C=!D&&!E&&x.query!==A.query,h=D||$&&C,N=C||$,L=E||$&&C;if(!h&&!N&&!L)return;const R=L&&!h?x:A,z=k.dom.querySelector(`[data-decoration-id="${R.decorationId}"]`);T={editor:t,range:R.range,query:R.query,text:R.text,items:[],command:B=>u({editor:t,range:R.range,props:B}),decorationNode:z,clientRect:z?()=>{var B;const{decorationId:H}=(B=this.key)===null||B===void 0?void 0:B.getState(t.state),j=k.dom.querySelector(`[data-decoration-id="${H}"]`);return(j==null?void 0:j.getBoundingClientRect())||null}:null},h&&((f=S==null?void 0:S.onBeforeStart)===null||f===void 0||f.call(S,T)),N&&((d=S==null?void 0:S.onBeforeUpdate)===null||d===void 0||d.call(S,T)),(N||h)&&(T.items=await p({editor:t,query:R.query})),L&&((y=S==null?void 0:S.onExit)===null||y===void 0||y.call(S,T)),N&&((w=S==null?void 0:S.onUpdate)===null||w===void 0||w.call(S,T)),h&&((v=S==null?void 0:S.onStart)===null||v===void 0||v.call(S,T))},destroy:()=>{var k;T&&((k=S==null?void 0:S.onExit)===null||k===void 0||k.call(S,T))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(k,O,P,i){const{isEditable:f}=t,{composing:d}=t.view,{selection:y}=k,{empty:w,from:v}=y,x={...O};if(x.composing=d,f&&(w||t.view.composing)){(v<O.range.from||v>O.range.to)&&!d&&!O.composing&&(x.active=!1);const A=_({char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:a,startOfLine:o,$position:y.$from}),$=`id_${Math.floor(Math.random()*4294967295)}`;A&&b({editor:t,state:i,range:A.range,isActive:O.active})?(x.active=!0,x.decorationId=O.decorationId?O.decorationId:$,x.range=A.range,x.query=A.query,x.text=A.text):x.active=!1}else x.active=!1;return x.active||(x.decorationId=null,x.range={from:0,to:0},x.query=null,x.text=null),x}},props:{handleKeyDown(k,O){var P;const{active:i,range:f}=M.getState(k.state);return i&&((P=S==null?void 0:S.onKeyDown)===null||P===void 0?void 0:P.call(S,{view:k,event:O,range:f}))||!1},decorations(k){const{active:O,range:P,decorationId:i}=M.getState(k);return O?zr.create(k.doc,[$r.inline(P.from,P.to,{nodeName:c,class:l,"data-decoration-id":i})]):null}}});return M}const xw=new Kt("mention"),kw=tt.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({options:e,node:t}){var n;return`${e.suggestion.char}${(n=t.attrs.label)!==null&&n!==void 0?n:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:e,node:t}){var n;return["span",Re(this.HTMLAttributes,e.HTMLAttributes),`${e.suggestion.char}${(n=t.attrs.label)!==null&&n!==void 0?n:t.attrs.id}`]},suggestion:{char:"@",pluginKey:xw,command:({editor:e,range:t,props:n})=>{var r,s,a;const o=e.view.state.selection.$to.nodeAfter;((r=o==null?void 0:o.text)===null||r===void 0?void 0:r.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),(a=(s=e.view.dom.ownerDocument.defaultView)===null||s===void 0?void 0:s.getSelection())===null||a===void 0||a.collapseToEnd()},allow:({state:e,range:t})=>{const n=e.doc.resolve(t.from),r=e.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",Re({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})];const n={...this.options};n.HTMLAttributes=Re({"data-type":this.name},this.options.HTMLAttributes,t);const r=this.options.renderHTML({options:n,node:e});return typeof r=="string"?["span",Re({"data-type":this.name},this.options.HTMLAttributes,t),r]:r},renderText({node:e}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:e})):this.options.renderText({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let n=!1;const{selection:r}=t,{empty:s,anchor:a}=r;return s?(t.doc.nodesBetween(a-1,a,(o,c)=>{if(o.type.name===this.name)return n=!0,e.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",c,c+o.nodeSize),!1}),n):!1})}},addProseMirrorPlugins(){return[Sw({editor:this.editor,...this.options.suggestion})]}}),Ql=kw.extend({renderText({node:e}){return`{{${e.attrs.label??e.attrs.id}}}`},addPasteRules(){return[new Bd({find:/\{\{([^{}]+)\}\}/g,handler:({match:e,chain:t,range:n})=>{const r=e[1].trim();r&&t().deleteRange(n).insertContentAt(n.from,{type:this.name,attrs:{id:r,label:r}})}})]}}),Nw=Xl(Zl),Cw=(e,t,n,r,s,a)=>[bl.configure({codeBlock:!1}),Ql.configure({HTMLAttributes:{class:"variable"},renderHTML({options:o,node:c}){return["span",Re(this.HTMLAttributes,o.HTMLAttributes),`${o.suggestion.char} ${c.attrs.label??c.attrs.id} }}`]},suggestion:ma(e,t,n,r,s,a),deleteTriggerWithBackspace:!0}),Rl.configure({lowlight:Nw,enableTabIndentation:!0,tabSize:2})],Tw=Lt(ba)(({theme:e,rows:t,disabled:n,isDarkMode:r})=>({"& .ProseMirror":{padding:"0px 14px",height:t?`${t*1.4375}rem`:"2.4rem",overflowY:t?"auto":"hidden",overflowX:t?"auto":"hidden",lineHeight:t?"1.4375em":"0.875em",fontWeight:500,color:n?e.palette.action.disabled:e.palette.grey[900],border:`1px solid ${e.palette.grey[900]+25}`,borderRadius:"10px",backgroundColor:e.palette.textBackground.main,boxSizing:"border-box",whiteSpace:t?"pre-wrap":"nowrap","&:hover":{borderColor:n?`${e.palette.grey[900]+25}`:e.palette.text.primary,cursor:n?"default":"text"},"&:focus":{borderColor:n?`${e.palette.grey[900]+25}`:e.palette.primary.main,outline:"none"},"& p.is-editor-empty:first-of-type::before":{content:"attr(data-placeholder)",float:"left",color:n?e.palette.action.disabled:e.palette.text.primary,opacity:n?.6:.4,pointerEvents:"none",height:0},"--code-bg":r?"#2d2d2d":"#f5f5f5","--code-color":r?"#d4d4d4":"#333333","--hljs-comment":"#6a9955","--hljs-variable":r?"#9cdcfe":"#d73a49","--hljs-number":r?"#b5cea8":"#e36209","--hljs-string":r?"#ce9178":"#22863a","--hljs-title":r?"#dcdcaa":"#6f42c1","--hljs-keyword":r?"#569cd6":"#005cc5","--hljs-operator":r?"#d4d4d4":"#333333","--hljs-punctuation":r?"#d4d4d4":"#333333"}})),Jl=({inputParam:e,value:t,nodes:n,edges:r,nodeId:s,onChange:a,disabled:o=!1})=>{const l=Wt(O=>O.customization).isDarkMode,[u,p]=I.useState([]),[g,b]=I.useState([]),[_,T]=I.useState({}),[S,M]=I.useState(!1);I.useEffect(()=>{var O,P,i;if(!o&&n&&r&&s&&e){const f=e!=null&&e.acceptVariable?kr(n,r,s,e.id):[];p(f);const d=n.find(v=>v.data.name==="startAgentflow"),y=(P=(O=d==null?void 0:d.data)==null?void 0:O.inputs)==null?void 0:P.startState;b(y);const w=n.find(v=>v.data.id===s);T(w==null?void 0:w.data),M(((i=n.find(v=>v.data.id===s))==null?void 0:i.extent)==="parent")}},[o,e,n,r,s]);const k=ga({extensions:[...Cw(u,g,e==null?void 0:e.acceptNodeOutputAsVariable,n,_,S),ul.configure({placeholder:e==null?void 0:e.placeholder})],content:t,onUpdate:({editor:O})=>{a(O.getHTML())},editable:!o},[u]);return m.jsx(Ie,{sx:{mt:1,border:""},children:m.jsx(Tw,{editor:k,rows:e==null?void 0:e.rows,disabled:o,isDarkMode:l})})};Jl.propTypes={inputParam:X.object,value:X.oneOfType([X.string,X.number]),onChange:X.func,disabled:X.bool,nodes:X.array,edges:X.array,nodeId:X.string};const ed="TabsList";function Mw(e){return Yr(ed,e)}Zr(ed,["root","horizontal","vertical"]);const td={valueChange:"valueChange"},Le={blur:"list:blur",itemClick:"list:itemClick",itemHover:"list:itemHover",itemsChange:"list:itemsChange",keyDown:"list:keyDown",resetHighlight:"list:resetHighlight",highlightLast:"list:highlightLast",textNavigation:"list:textNavigation",clearSelection:"list:clearSelection"};function Aw(e,t,n,r,s,a){if(n.length===0||!r&&n.every((c,l)=>s(c,l)))return-1;let o=e;for(;;){if(!a&&t==="next"&&o===n.length||!a&&t==="previous"&&o===-1)return-1;if(r?!1:s(n[o],o))o+=t==="next"?1:-1,a&&(o=(o+n.length)%n.length);else return o}}function Ue(e,t,n){var r;const{items:s,isItemDisabled:a,disableListWrap:o,disabledItemsFocusable:c,itemComparer:l,focusManagement:u}=n,p=u==="DOM"?0:-1,g=s.length-1,b=e==null?-1:s.findIndex(k=>l(k,e));let _,T,S=!o;switch(t){case"reset":if(p===-1)return null;_=0,T="next",S=!1;break;case"start":_=0,T="next",S=!1;break;case"end":_=g,T="previous",S=!1;break;default:{const k=b+t;k<0?!S&&b!==-1||Math.abs(t)>1?(_=0,T="next"):(_=g,T="previous"):k>g?!S||Math.abs(t)>1?(_=g,T="previous"):(_=0,T="next"):(_=k,T=t>=0?"next":"previous")}}const M=Aw(_,T,s,c,a,S);return M===-1&&e!==null&&!a(e,b)?e:(r=s[M])!=null?r:null}function Iw(e,t,n,r){return n==="none"?[]:n==="single"?r(t[0],e)?t:[e]:t.some(s=>r(s,e))?t.filter(s=>!r(s,e)):[...t,e]}function nd(e,t,n){const{itemComparer:r,isItemDisabled:s,selectionMode:a,items:o}=n,{selectedValues:c}=t,l=o.findIndex(p=>r(e,p));if(s(e,l))return t;const u=Iw(e,c,a,r);return ae({},t,{selectedValues:u,highlightedValue:e})}function Rw(e,t,n){const r=t.highlightedValue,{orientation:s,pageSize:a}=n;switch(e){case"Home":return ae({},t,{highlightedValue:Ue(r,"start",n)});case"End":return ae({},t,{highlightedValue:Ue(r,"end",n)});case"PageUp":return ae({},t,{highlightedValue:Ue(r,-a,n)});case"PageDown":return ae({},t,{highlightedValue:Ue(r,a,n)});case"ArrowUp":if(s!=="vertical")break;return ae({},t,{highlightedValue:Ue(r,-1,n)});case"ArrowDown":if(s!=="vertical")break;return ae({},t,{highlightedValue:Ue(r,1,n)});case"ArrowLeft":{if(s==="vertical")break;return ae({},t,{highlightedValue:Ue(r,s==="horizontal-ltr"?-1:1,n)})}case"ArrowRight":{if(s==="vertical")break;return ae({},t,{highlightedValue:Ue(r,s==="horizontal-ltr"?1:-1,n)})}case"Enter":case" ":return t.highlightedValue===null?t:nd(t.highlightedValue,t,n)}return t}function Ow(e,t){return t.focusManagement==="DOM"?e:ae({},e,{highlightedValue:null})}function Dw(e,t,n){var r;const s=(r=n(e))==null?void 0:r.trim().toLowerCase();return!s||s.length===0?!1:s.indexOf(t)===0}function Lw(e,t,n){const{items:r,isItemDisabled:s,disabledItemsFocusable:a,getItemAsString:o}=n,c=t.length>1;let l=c?e.highlightedValue:Ue(e.highlightedValue,1,n);for(let u=0;u<r.length;u+=1){if(!l||!c&&e.highlightedValue===l)return e;if(Dw(l,t,o)&&(!s(l,r.indexOf(l))||a))return ae({},e,{highlightedValue:l});l=Ue(l,1,n)}return e}function Bw(e,t,n,r){var s;const{itemComparer:a,focusManagement:o}=r;let c=null;if(n.highlightedValue!=null){var l;c=(l=e.find(g=>a(g,n.highlightedValue)))!=null?l:null}else o==="DOM"&&t.length===0&&(c=Ue(null,"reset",r));const p=((s=n.selectedValues)!=null?s:[]).filter(g=>e.some(b=>a(b,g)));return ae({},n,{highlightedValue:c,selectedValues:p})}function Pw(e,t){return ae({},e,{highlightedValue:Ue(null,"reset",t)})}function $w(e,t){return ae({},e,{highlightedValue:Ue(null,"end",t)})}function zw(e,t){return ae({},e,{selectedValues:[],highlightedValue:Ue(null,"reset",t)})}function rd(e,t){const{type:n,context:r}=t;switch(n){case Le.keyDown:return Rw(t.key,e,r);case Le.itemClick:return nd(t.item,e,r);case Le.blur:return Ow(e,r);case Le.textNavigation:return Lw(e,t.searchString,r);case Le.itemsChange:return Bw(t.items,t.previousItems,e,r);case Le.resetHighlight:return Pw(e,r);case Le.highlightLast:return $w(e,r);case Le.clearSelection:return zw(e,r);default:return e}}function Hw(e,t){return e===t}const As={},aa=()=>{};function ei(e,t){const n=ae({},e);return Object.keys(t).forEach(r=>{t[r]!==void 0&&(n[r]=t[r])}),n}function Fw(e){const{nextState:t,initialState:n,stateComparers:r,onStateChange:s,controlledProps:a,lastActionRef:o}=e,c=I.useRef(n);I.useEffect(()=>{if(o.current===null)return;const l=ei(c.current,a);Object.keys(t).forEach(u=>{var p;const g=(p=r[u])!=null?p:Hw,b=t[u],_=l[u];if(_==null&&b!=null||_!=null&&b==null||_!=null&&b!=null&&!g(b,_)){var T,S;s==null||s((T=o.current.event)!=null?T:null,u,b,(S=o.current.type)!=null?S:"",t)}}),c.current=t,o.current=null},[c,t,o,s,r,a])}function jw(e){const t=I.useRef(null),{reducer:n,initialState:r,controlledProps:s=As,stateComparers:a=As,onStateChange:o=aa,actionContext:c}=e;I.useRef(s);const l=I.useCallback((b,_)=>{t.current=_;const T=ei(b,s);return n(T,_)},[s,n]),[u,p]=I.useReducer(l,r),g=I.useCallback(b=>{p(ae({},b,{context:c}))},[c]);return Fw({nextState:u,initialState:r,stateComparers:a??As,onStateChange:o??aa,controlledProps:s,lastActionRef:t}),[ei(u,s),g]}const Uw=500;function Vw(e){const t=I.useRef({searchString:"",lastTime:null});return I.useCallback(n=>{if(n.key.length===1&&n.key!==" "){const r=t.current,s=n.key.toLowerCase(),a=performance.now();r.searchString.length>0&&r.lastTime&&a-r.lastTime>Uw?r.searchString=s:(r.searchString.length!==1||s!==r.searchString)&&(r.searchString+=s),r.lastTime=a,e(r.searchString,n)}},[e])}const ca={},Gw=()=>{},Kw=(e,t)=>e===t,Ww=()=>!1,qw=e=>typeof e=="string"?e:String(e),Yw=()=>({highlightedValue:null,selectedValues:[]});function Zw(e){const{controlledProps:t=ca,disabledItemsFocusable:n=!1,disableListWrap:r=!1,focusManagement:s="activeDescendant",getInitialState:a=Yw,getItemDomElement:o,getItemId:c,isItemDisabled:l=Ww,rootRef:u,onStateChange:p=Gw,items:g,itemComparer:b=Kw,getItemAsString:_=qw,onChange:T,onHighlightChange:S,onItemsChange:M,orientation:k="vertical",pageSize:O=5,reducerActionContext:P=ca,selectionMode:i="single",stateReducer:f,componentName:d="useList"}=e,y=I.useRef(null),w=Un(u,y),v=I.useCallback((Z,q,ie)=>{if(S==null||S(Z,q,ie),s==="DOM"&&q!=null&&(ie===Le.itemClick||ie===Le.keyDown||ie===Le.textNavigation)){var oe;o==null||(oe=o(q))==null||oe.focus()}},[o,S,s]),x=I.useMemo(()=>({highlightedValue:b,selectedValues:(Z,q)=>$o(Z,q,b)}),[b]),A=I.useCallback((Z,q,ie,oe,pe)=>{switch(p==null||p(Z,q,ie,oe,pe),q){case"highlightedValue":v(Z,ie,oe);break;case"selectedValues":T==null||T(Z,ie,oe);break}},[v,T,p]),$=I.useMemo(()=>({disabledItemsFocusable:n,disableListWrap:r,focusManagement:s,isItemDisabled:l,itemComparer:b,items:g,getItemAsString:_,onHighlightChange:v,orientation:k,pageSize:O,selectionMode:i,stateComparers:x}),[n,r,s,l,b,g,_,v,k,O,i,x]),D=a(),E=f??rd,C=I.useMemo(()=>ae({},P,$),[P,$]),[h,N]=jw({reducer:E,actionContext:C,initialState:D,controlledProps:t,stateComparers:x,onStateChange:A}),{highlightedValue:L,selectedValues:R}=h,z=Vw((Z,q)=>N({type:Le.textNavigation,event:q,searchString:Z})),B=I.useRef([]);I.useEffect(()=>{$o(B.current,g,b)||(N({type:Le.itemsChange,event:null,items:g,previousItems:B.current}),B.current=g,M==null||M(g))},[g,b,N,M]);const H=Z=>q=>{var ie;if((ie=Z.onKeyDown)==null||ie.call(Z,q),q.defaultMuiPrevented)return;const oe=["Home","End","PageUp","PageDown"];k==="vertical"?oe.push("ArrowUp","ArrowDown"):oe.push("ArrowLeft","ArrowRight"),s==="activeDescendant"&&oe.push(" ","Enter"),oe.includes(q.key)&&q.preventDefault(),N({type:Le.keyDown,key:q.key,event:q}),z(q)},j=Z=>q=>{var ie,oe;(ie=Z.onBlur)==null||ie.call(Z,q),!q.defaultMuiPrevented&&((oe=y.current)!=null&&oe.contains(q.relatedTarget)||N({type:Le.blur,event:q}))},V=(Z={})=>{const q=bn(Z);return ae({},Z,{"aria-activedescendant":s==="activeDescendant"&&L!=null?c(L):void 0,tabIndex:s==="DOM"?-1:0,ref:w},q,{onBlur:j(q),onKeyDown:H(q)})},W=I.useCallback(Z=>{const q=(R??[]).some(pe=>pe!=null&&b(Z,pe)),ie=L!=null&&b(Z,L);return{focusable:s==="DOM",highlighted:ie,selected:q}},[b,R,L,s]),ne=I.useMemo(()=>({dispatch:N,getItemState:W}),[N,W]);return I.useDebugValue({state:h}),{contextValue:ne,dispatch:N,getRootProps:V,rootRef:w,state:h}}const sd=I.createContext(null);function Xw(e){const{handlePointerOverEvents:t=!1,item:n}=e,r=I.useContext(sd);if(!r)throw new Error("useListItem must be used within a ListProvider");const{dispatch:s,getItemState:a}=r,{highlighted:o,selected:c,focusable:l}=a(n),u=I.useCallback(_=>T=>{var S;(S=_.onClick)==null||S.call(_,T),!T.defaultPrevented&&s({type:Le.itemClick,item:n,event:T})},[s,n]),p=I.useCallback(_=>T=>{var S;(S=_.onMouseOver)==null||S.call(_,T),!T.defaultPrevented&&s({type:Le.itemHover,item:n,event:T})},[s,n]);let g;return l&&(g=o?0:-1),{getRootProps:(_={})=>{const T=bn(_);return ae({},_,{onClick:u(T),onPointerOver:t?p(T):void 0,tabIndex:g})},highlighted:o,selected:c}}function Qw(e,t){if(t.type===td.valueChange)return ae({},e,{highlightedValue:t.value});const n=rd(e,t),{context:{selectionFollowsFocus:r}}=t;if(t.type===Le.itemsChange){if(n.selectedValues.length>0)return ae({},n,{highlightedValue:n.selectedValues[0]});Ue(null,"reset",t.context)}return r&&n.highlightedValue!=null?ae({},n,{selectedValues:[n.highlightedValue]}):n}function Jw(e){var t;const{rootRef:n}=e,{direction:r="ltr",onSelected:s,orientation:a="horizontal",value:o,registerTabIdLookup:c,selectionFollowsFocus:l}=ll(),{subitems:u,contextValue:p}=al(),g=I.useCallback(A=>{var $;return($=u.get(A))==null?void 0:$.id},[u]);c(g);const b=I.useMemo(()=>Array.from(u.keys()),[u]),_=I.useCallback(A=>{var $,D;return A==null?null:($=(D=u.get(A))==null?void 0:D.ref.current)!=null?$:null},[u]),T=r==="rtl";let S;a==="vertical"?S="vertical":S=T?"horizontal-rtl":"horizontal-ltr";const M=I.useCallback((A,$)=>{var D;s(A,(D=$[0])!=null?D:null)},[s]),k=I.useMemo(()=>o===void 0?{}:o!=null?{selectedValues:[o]}:{selectedValues:[]},[o]),O=I.useCallback(A=>{var $,D;return($=(D=u.get(A))==null?void 0:D.disabled)!=null?$:!1},[u]),{contextValue:P,dispatch:i,getRootProps:f,state:{highlightedValue:d,selectedValues:y},rootRef:w}=Zw({controlledProps:k,disabledItemsFocusable:!l,focusManagement:"DOM",getItemDomElement:_,isItemDisabled:O,items:b,rootRef:n,onChange:M,orientation:S,reducerActionContext:I.useMemo(()=>({selectionFollowsFocus:l||!1}),[l]),selectionMode:"single",stateReducer:Qw});I.useEffect(()=>{o!==void 0&&o!=null&&i({type:td.valueChange,value:o})},[i,o]);const v=(A={})=>ae({},A,f(A),{"aria-orientation":a==="vertical"?"vertical":void 0,role:"tablist"});return{contextValue:I.useMemo(()=>ae({},p,P),[p,P]),dispatch:i,getRootProps:v,highlightedValue:d,isRtl:T,orientation:a,rootRef:w,selectedValue:(t=y[0])!=null?t:null}}function e0(e){const{value:t,children:n}=e,{dispatch:r,getItemIndex:s,getItemState:a,registerItem:o,totalSubitemCount:c}=t,l=I.useMemo(()=>({dispatch:r,getItemState:a,getItemIndex:s}),[r,s,a]),u=I.useMemo(()=>({getItemIndex:s,registerItem:o,totalSubitemCount:c}),[o,s,c]);return m.jsx(Li.Provider,{value:u,children:m.jsx(sd.Provider,{value:l,children:n})})}const t0=["children","slotProps","slots"],n0=e=>{const{orientation:t}=e;return si({root:["root",t]},Oi(Mw))},r0=I.forwardRef(function(t,n){var r;const{children:s,slotProps:a={},slots:o={}}=t,c=Pr(t,t0),{isRtl:l,orientation:u,getRootProps:p,contextValue:g}=Jw({rootRef:n}),b=ae({},t,{isRtl:l,orientation:u}),_=n0(b),T=(r=o.root)!=null?r:"div",S=Di({elementType:T,getSlotProps:p,externalSlotProps:a.root,externalForwardedProps:c,ownerState:b,className:_.root});return m.jsx(e0,{value:g,children:m.jsx(T,ae({},S,{children:s}))})}),Sr={200:"#80BFFF",400:"#3399FF",500:"#007FFF",600:"#0072E5"},id=_a(r0)(({theme:e,...t})=>{var n;return`
    min-width: 400px;
    background-color: ${((n=t.sx)==null?void 0:n.backgroundColor)||Sr[500]};
    border-radius: 20px;
    margin-top: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-content: space-between;
    box-shadow: 0px 4px 6px ${e.palette.mode==="dark"?"rgba(0,0,0, 0.4)":"rgba(0,0,0, 0.2)"};
    `}),s0="Button",i0=Zr(s0,["root","active","disabled","focusVisible"]);function o0(e={}){const{disabled:t=!1,focusableWhenDisabled:n,href:r,rootRef:s,tabIndex:a,to:o,type:c,rootElementName:l}=e,u=I.useRef(),[p,g]=I.useState(!1),{isFocusVisibleRef:b,onFocus:_,onBlur:T,ref:S}=_u(),[M,k]=I.useState(!1);t&&!n&&M&&k(!1),I.useEffect(()=>{b.current=M},[M,b]);const[O,P]=Km({rootElementName:l??(r||o?"a":void 0)}),i=C=>h=>{var N;M&&h.preventDefault(),(N=C.onMouseLeave)==null||N.call(C,h)},f=C=>h=>{var N;T(h),b.current===!1&&k(!1),(N=C.onBlur)==null||N.call(C,h)},d=C=>h=>{var N;if(u.current||(u.current=h.currentTarget),_(h),b.current===!0){var L;k(!0),(L=C.onFocusVisible)==null||L.call(C,h)}(N=C.onFocus)==null||N.call(C,h)},y=()=>{const C=u.current;return O==="BUTTON"||O==="INPUT"&&["button","submit","reset"].includes(C==null?void 0:C.type)||O==="A"&&(C==null?void 0:C.href)},w=C=>h=>{if(!t){var N;(N=C.onClick)==null||N.call(C,h)}},v=C=>h=>{var N;t||(g(!0),document.addEventListener("mouseup",()=>{g(!1)},{once:!0})),(N=C.onMouseDown)==null||N.call(C,h)},x=C=>h=>{var N;if((N=C.onKeyDown)==null||N.call(C,h),!h.defaultMuiPrevented&&(h.target===h.currentTarget&&!y()&&h.key===" "&&h.preventDefault(),h.target===h.currentTarget&&h.key===" "&&!t&&g(!0),h.target===h.currentTarget&&!y()&&h.key==="Enter"&&!t)){var L;(L=C.onClick)==null||L.call(C,h),h.preventDefault()}},A=C=>h=>{var N;if(h.target===h.currentTarget&&g(!1),(N=C.onKeyUp)==null||N.call(C,h),h.target===h.currentTarget&&!y()&&!t&&h.key===" "&&!h.defaultMuiPrevented){var L;(L=C.onClick)==null||L.call(C,h)}},$=Un(P,s,S,u),D={};return a!==void 0&&(D.tabIndex=a),O==="BUTTON"?(D.type=c??"button",n?D["aria-disabled"]=t:D.disabled=t):O==="INPUT"?c&&["button","submit","reset"].includes(c)&&(n?D["aria-disabled"]=t:D.disabled=t):O!==""&&(!r&&!o&&(D.role="button",D.tabIndex=a??0),t&&(D["aria-disabled"]=t,D.tabIndex=n?a??0:-1)),{getRootProps:(C={})=>{const h=ae({},bn(e),bn(C)),N=ae({type:c},h,D,C,{onBlur:f(h),onClick:w(h),onFocus:d(h),onKeyDown:x(h),onKeyUp:A(h),onMouseDown:v(h),onMouseLeave:i(h),ref:$});return delete N.onFocusVisible,N},focusVisible:M,setFocusVisible:k,active:p,rootRef:$}}const od="Tab";function a0(e){return Yr(od,e)}const c0=Zr(od,["root","selected","disabled"]);function l0(e,t){return function(r={}){const s=ae({},r,e(r));return ae({},s,t(s))}}function d0(e){return e.size}function u0(e){const{value:t,rootRef:n,disabled:r=!1,id:s}=e,a=I.useRef(null),o=Pd(s),{value:c,selectionFollowsFocus:l,getTabPanelId:u}=ll(),p=I.useMemo(()=>({disabled:r,ref:a,id:o}),[r,a,o]),{id:g,index:b,totalItemCount:_}=Jm(t??d0,p),{getRootProps:T,highlighted:S,selected:M}=Xw({item:g}),{getRootProps:k,rootRef:O,active:P,focusVisible:i,setFocusVisible:f}=o0({disabled:r,focusableWhenDisabled:!l,type:"button"}),d=Un(a,n,O),y=g!==void 0?u(g):void 0;return{getRootProps:(v={})=>{const x=bn(v),A=l0(T,k);return ae({},v,A(x),{role:"tab","aria-controls":y,"aria-selected":M,id:o,ref:d})},active:P,focusVisible:i,highlighted:S,index:b,rootRef:d,selected:M||g===c,setFocusVisible:f,totalTabsCount:_}}const f0=["action","children","disabled","onChange","onClick","onFocus","slotProps","slots","value"],p0=e=>{const{selected:t,disabled:n}=e;return si({root:["root",t&&"selected",n&&"disabled"]},Oi(a0))},h0=I.forwardRef(function(t,n){var r;const{children:s,disabled:a=!1,slotProps:o={},slots:c={},value:l}=t,u=Pr(t,f0),p=I.useRef(),g=Un(p,n),{active:b,highlighted:_,selected:T,getRootProps:S}=u0(ae({},t,{rootRef:g,value:l})),M=ae({},t,{active:b,disabled:a,highlighted:_,selected:T}),k=p0(M),O=(r=c.root)!=null?r:"button",P=Di({elementType:O,getSlotProps:S,externalSlotProps:o.root,externalForwardedProps:u,additionalProps:{ref:n},ownerState:M,className:k.root});return m.jsx(O,ae({},P,{children:s}))}),ad=_a(h0)(({...e})=>{var t,n;return`
  font-family: 'IBM Plex Sans', sans-serif;
  color: white;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: bold;
  background-color: transparent;
  width: 100%;
  line-height: 1.5;
  padding: 8px 12px;
  margin: 6px;
  border: none;
  border-radius: 25px;
  display: flex;
  justify-content: center;

  &:hover {
    background-color: ${((t=e.sx)==null?void 0:t.backgroundColor)||Sr[400]};
  }

  &:focus {
    color: #fff;
    outline: 3px solid ${((n=e.sx)==null?void 0:n.backgroundColor)||Sr[200]};
  }

  &.${c0.selected} {
    background-color: #fff;
    color: ${Sr[600]};
  }

  &.${i0.disabled} {
    opacity: 0.5;
    cursor: not-allowed;
  }
 `}),cd=({data:e,inputParam:t,disabled:n=!1,arrayIndex:r=null,parentParamForArray:s=null})=>{const a=oi(),{reactFlowInstance:o}=I.useContext(Fr),[c,l]=I.useState(!1),[u,p]=I.useState({}),[g,b]=I.useState({mainValue:null,configValue:null,arrayValue:null}),_=(M,k)=>{l(k)},T=({inputParam:M,newValue:k})=>{let O=ot.cloneDeep(u);const P={...O.inputs};P[M.name]=k;const i=us({...O,inputs:P});Object.keys(P).forEach(d=>{const y=i.find(w=>w.name===d);y&&y.display===!1&&delete P[d]});const f=P.credential||P[on];O={...O,inputParams:i,inputs:P,credential:f||void 0},p(O)},S=I.useMemo(()=>({mainValue:e.inputs[t.name],configValue:e.inputs[`${t.name}Config`],arrayValue:s?e.inputs[s.name]:null}),[e.inputs,t.name,s==null?void 0:s.name]);return I.useEffect(()=>{(async()=>{const k=e.inputs[t.name],O=await zd.getSpecificNode(k);if(!O.data)return;const P=ot.cloneDeep(va(O.data,`${O.data.nodeName}_0`)),i=()=>s&&e.inputs[s.name],f=()=>s&&e.inputs[s.name]&&Array.isArray(e.inputs[s.name])&&e.inputs[s.name][r]&&e.inputs[s.name][r][`${t.name}Config`],d=()=>f()?e.inputs[s.name][r][t.name]:e.inputs[t.name],y=()=>f()?e.inputs[s.name][r][`${t.name}Config`]:e.inputs[`${t.name}Config`];if(f()||e.inputs[`${t.name}Config`]){const v=y(),x=d();if(v[t.name]!==x){const A=Yi(P.inputParams);P.inputs={...A,[t.name]:x}}else P.inputs={...v,[t.name]:x}}else{const v=i()?e.inputs[s.name][r][t.name]:e.inputs[t.name];P.inputs={...P.inputs,[t.name]:v}}P.inputParams=us({...P,inputs:P.inputs});const w=P.inputs.credential||P.inputs[on];P.credential=w||void 0,p(P),b({mainValue:e.inputs[t.name],configValue:e.inputs[`${t.name}Config`],arrayValue:s?e.inputs[s.name]:null})})()},[]),I.useEffect(()=>{if(!u.inputParams)return;const M=g.mainValue!==S.mainValue,k=g.configValue!==S.configValue,O=g.arrayValue!==S.arrayValue;if(!M&&!k&&!O)return;(()=>{const i=ot.cloneDeep(u),f=()=>s&&e.inputs[s.name]&&Array.isArray(e.inputs[s.name])&&e.inputs[s.name][r]&&e.inputs[s.name][r][`${t.name}Config`],d=()=>f()?e.inputs[s.name][r][t.name]:e.inputs[t.name],y=()=>f()?e.inputs[s.name][r][`${t.name}Config`]:e.inputs[`${t.name}Config`],w=d();if(w!==void 0&&(i.inputs[t.name]=w),f()||e.inputs[`${t.name}Config`]){const x=y();if(x&&x[t.name]===w)i.inputs={...x,[t.name]:w};else if(M){const A=Yi(i.inputParams);i.inputs={...A,[t.name]:w}}}i.inputParams=us({...i,inputs:i.inputs});const v=i.inputs.credential||i.inputs[on];i.credential=v||void 0,p(i),b({mainValue:S.mainValue,configValue:S.configValue,arrayValue:S.arrayValue})})()},[S,u.inputParams,t.name,s==null?void 0:s.name,r]),I.useEffect(()=>{u.inputs&&o.setNodes(M=>M.map(k=>(k.id!==e.id||(r!==null&&s?(k.data.inputs[s.name]||(k.data.inputs[s.name]=[]),k.data.inputs[s.name][r]||(k.data.inputs[s.name][r]={}),k.data.inputs[s.name][r][`${t.name}Config`]=u.inputs):k.data.inputs[`${t.name}Config`]=u.inputs),k)))},[u]),m.jsx(m.Fragment,{children:m.jsx(Ie,{sx:{p:0,mt:1,mb:1,border:1,borderColor:a.palette.grey[900]+25,borderRadius:2},children:m.jsxs(ya,{sx:{background:"transparent"},expanded:c,onChange:_,children:[m.jsx(wa,{expandIcon:m.jsx(br,{}),sx:{background:"transparent"},children:m.jsxs("div",{style:{display:"flex",alignItems:"center",width:"100%"},children:[m.jsx($d,{stroke:1.5,size:"1.3rem"}),m.jsxs(ze,{sx:{ml:1},children:[u==null?void 0:u.label," Parameters"]}),m.jsx("div",{style:{flexGrow:1}}),(u==null?void 0:u.warning)&&m.jsx(ai,{title:m.jsx("span",{style:{whiteSpace:"pre-line"},children:u.warning}),placement:"top",children:m.jsx(Ve,{sx:{height:35,width:35},children:m.jsx(ci,{size:20,color:"orange"})})})]})}),m.jsx(Ea,{children:(u.inputParams??[]).filter(M=>!M.hidden).filter(M=>M.display!==!1).map((M,k)=>m.jsx(Yn,{disabled:n,inputParam:M,data:u,isAdditionalParams:!0,onCustomDataChange:T},k))})]})})})};cd.propTypes={name:X.string,inputParam:X.object,data:X.object,disabled:X.bool,arrayIndex:X.number,parentParamForArray:X.object};const ld=({show:e,dialogProps:t,onChange:n,onCancel:r})=>{const s=document.getElementById("portal"),a=Wt(l=>l.customization),o=qt();I.useEffect(()=>(o(e?{type:Gn}:{type:ht}),()=>o({type:ht})),[e,o]);const c=e?m.jsxs(gt,{onClose:r,open:e,fullWidth:!0,maxWidth:"sm","aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[m.jsx(Ot,{sx:{fontSize:"1rem"},id:"alert-dialog-title",children:t.inputParam.label??"Format Prompt Values"}),m.jsx(mt,{children:m.jsx(li,{style:{height:"100%",maxHeight:"calc(100vh - 220px)",overflowX:"hidden"},children:m.jsx(di,{onChange:l=>n(l),value:t.value,isDarkMode:a.isDarkMode,inputParam:t.inputParam,nodes:t.nodes,edges:t.edges,nodeId:t.nodeId,isSequentialAgent:t.data.category==="Sequential Agents"})})})]}):null;return xt.createPortal(c,s)};ld.propTypes={show:X.bool,dialogProps:X.object,onChange:X.func,onCancel:X.func};const g0=Xl(Zl),m0=Lt(ba)(({theme:e,rows:t,disabled:n,isDarkMode:r})=>({"& .ProseMirror":{padding:"0px 14px",height:t?`${t*1.4375}rem`:"2.4rem",overflowY:t?"auto":"hidden",overflowX:t?"auto":"hidden",lineHeight:t?"1.4375em":"0.875em",fontWeight:500,color:n?e.palette.action.disabled:e.palette.grey[900],border:`1px solid ${e.palette.grey[900]+25}`,borderRadius:"10px",backgroundColor:e.palette.textBackground.main,boxSizing:"border-box",whiteSpace:t?"pre-wrap":"nowrap","&:hover":{borderColor:n?`${e.palette.grey[900]+25}`:e.palette.text.primary,cursor:n?"default":"text"},"&:focus":{borderColor:n?`${e.palette.grey[900]+25}`:e.palette.primary.main,outline:"none"},"& p.is-editor-empty:first-of-type::before":{content:"attr(data-placeholder)",float:"left",color:n?e.palette.action.disabled:e.palette.text.primary,opacity:n?.6:.4,pointerEvents:"none",height:0},"--code-bg":r?"#2d2d2d":"#f5f5f5","--code-color":r?"#d4d4d4":"#333333","--hljs-comment":"#6a9955","--hljs-variable":r?"#9cdcfe":"#d73a49","--hljs-number":r?"#b5cea8":"#e36209","--hljs-string":r?"#ce9178":"#22863a","--hljs-title":r?"#dcdcaa":"#6f42c1","--hljs-keyword":r?"#569cd6":"#005cc5","--hljs-operator":r?"#d4d4d4":"#333333","--hljs-punctuation":r?"#d4d4d4":"#333333"}})),b0=(e,t,n,r,s,a)=>[bl.configure({codeBlock:!1}),Ql.configure({HTMLAttributes:{class:"variable"},renderHTML({options:o,node:c}){return["span",Re(this.HTMLAttributes,o.HTMLAttributes),`${o.suggestion.char} ${c.attrs.label??c.attrs.id} }}`]},suggestion:ma(e,t,n,r,s,a),deleteTriggerWithBackspace:!0}),Rl.configure({lowlight:g0,enableTabIndentation:!0,tabSize:2})],dd=({show:e,dialogProps:t,onCancel:n,onInputHintDialogClicked:r,onConfirm:s})=>{const a=document.getElementById("portal"),o=qt(),l=Wt(y=>y.customization).isDarkMode,[u,p]=I.useState(""),[g,b]=I.useState(null),[_,T]=I.useState([]),[S,M]=I.useState([]),[k,O]=I.useState({}),[P,i]=I.useState(!1);I.useEffect(()=>(t.value&&p(t.value),t.inputParam&&b(t.inputParam),()=>{p(""),b(null)}),[t]),I.useEffect(()=>(o(e?{type:Gn}:{type:ht}),()=>o({type:ht})),[e,o]),I.useEffect(()=>{var y,w,v;if(!t.disabled&&t.nodes&&t.edges&&t.nodeId&&g){const x=g!=null&&g.acceptVariable?kr(t.nodes,t.edges,t.nodeId,g.id):[];T(x);const A=t.nodes.find(E=>E.data.name==="startAgentflow"),$=(w=(y=A==null?void 0:A.data)==null?void 0:y.inputs)==null?void 0:w.startState;M($);const D=t.nodes.find(E=>E.data.id===t.nodeId);O(D==null?void 0:D.data),i(((v=t.nodes.find(E=>E.data.id===t.nodeId))==null?void 0:v.extent)==="parent")}},[t.disabled,g,t.nodes,t.edges,t.nodeId]);const f=ga({extensions:[...b0(_,S,g==null?void 0:g.acceptNodeOutputAsVariable,t.nodes,k,P),ul.configure({placeholder:g==null?void 0:g.placeholder})],content:u,onUpdate:({editor:y})=>{p(y.getHTML())},editable:!t.disabled},[_]);I.useEffect(()=>{e&&f&&setTimeout(()=>{f.commands.focus()},100)},[e,f]);const d=e?m.jsxs(gt,{open:e,fullWidth:!0,maxWidth:"md","aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[m.jsx(mt,{children:m.jsx("div",{style:{display:"flex",flexDirection:"row"},children:g&&m.jsxs("div",{style:{flex:70,width:"100%"},children:[m.jsxs("div",{style:{marginBottom:"10px",display:"flex",flexDirection:"row"},children:[m.jsx(ze,{variant:"h4",children:g.label}),m.jsx("div",{style:{flex:1}}),g.hint&&m.jsx(de,{sx:{p:0,px:2},color:"secondary",variant:"text",onClick:()=>{r(g.hint)},children:g.hint.label})]}),m.jsx(li,{style:{borderRadius:"12px",height:"100%",maxHeight:"calc(100vh - 220px)",overflowX:"hidden"},children:m.jsx(Ie,{sx:{mt:1,border:""},children:m.jsx(m0,{editor:f,rows:15,disabled:t.disabled,isDarkMode:l})})})]})})}),m.jsxs(Dt,{children:[m.jsx(de,{onClick:n,children:t.cancelButtonName}),m.jsx(Kn,{disabled:t.disabled,variant:"contained",onClick:()=>s(u,g.name),children:t.confirmButtonName})]})]}):null;return xt.createPortal(d,a)};dd.propTypes={show:X.bool,dialogProps:X.object,onCancel:X.func,onConfirm:X.func,onInputHintDialogClicked:X.func};const ud=({show:e,dialogProps:t,onCancel:n,onConfirm:r})=>{const s=document.getElementById("portal"),a=qt(),[o,c]=I.useState(null),[l,u]=I.useState(0),[p,g]=I.useState({});I.useEffect(()=>(t.inputParam&&c(t.inputParam),t.data&&g(t.data),()=>{c(null),g({})}),[t]),I.useEffect(()=>(a(e?{type:Gn}:{type:ht}),()=>a({type:ht})),[e,a]);const b=e?m.jsxs(gt,{open:e,fullWidth:!0,maxWidth:"md","aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[m.jsx(mt,{children:m.jsx(m.Fragment,{children:o&&o.type.includes("conditionFunction")&&m.jsxs(m.Fragment,{children:[m.jsx(dl,{value:l,onChange:(_,T)=>u(T),"aria-label":"tabs",variant:"fullWidth",children:m.jsx(id,{children:o.tabs.map((_,T)=>m.jsx(ad,{children:_.label},T))})}),o.tabs.filter(_=>_.display!==!1).map((_,T)=>m.jsx(Sa,{value:l,index:T,children:m.jsx(Yn,{disabled:_.disabled,inputParam:_,data:p,isAdditionalParams:!0,disablePadding:!0})},T))]})})}),m.jsxs(Dt,{children:[m.jsx(de,{onClick:n,children:t.cancelButtonName}),m.jsx(Kn,{disabled:t.disabled,variant:"contained",onClick:()=>r(p,o,l),children:t.confirmButtonName})]})]}):null;return xt.createPortal(b,s)};ud.propTypes={show:X.bool,dialogProps:X.object,onCancel:X.func,onConfirm:X.func};var ji={},_0=ni;Object.defineProperty(ji,"__esModule",{value:!0});var fd=ji.default=void 0,y0=_0(ri()),w0=m,E0=(0,y0.default)((0,w0.jsx)("path",{d:"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z"}),"ArrowForwardIosSharp");fd=ji.default=E0;var Ui={},v0=ni;Object.defineProperty(Ui,"__esModule",{value:!0});var xr=Ui.default=void 0,S0=v0(ri()),x0=m,k0=(0,S0.default)((0,x0.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");xr=Ui.default=k0;const la="/assets/logs_empty-BSF3_JNE.svg",N0=e=>ui.post("/prompts-list",e),C0=e=>ui.post("/load-prompt",e),da={getAvailablePrompts:N0,getPrompt:C0},T0=({children:e=""})=>e.split(`
`).reduce(function(t,n){return t.concat(n,m.jsx("br",{}))},[]),Is=Lt(e=>m.jsx(ya,{disableGutters:!0,elevation:0,square:!0,...e}))(({theme:e})=>({border:`1px solid ${e.palette.divider}`,"&:not(:last-child)":{borderBottom:0},"&:before":{display:"none"}})),Rs=Lt(e=>m.jsx(wa,{expandIcon:m.jsx(fd,{sx:{fontSize:"0.9rem"}}),...e}))(({theme:e})=>({backgroundColor:e.palette.mode==="dark"?"rgba(255, 255, 255, .05)":"rgba(0, 0, 0, .03)",flexDirection:"row-reverse","& .MuiAccordionSummary-expandIconWrapper.Mui-expanded":{transform:"rotate(180deg)"},"& .MuiAccordionSummary-content":{marginLeft:e.spacing(1)}})),Os=Lt(Ea)(({theme:e})=>({padding:e.spacing(2),borderTop:"1px solid rgba(0, 0, 0, .125)"})),pd=({promptType:e,show:t,onCancel:n,onSubmit:r})=>{var z;const s=document.getElementById("portal"),a=qt(),o=Wt(B=>B.customization),c=Hd(da.getAvailablePrompts);I.useEffect(()=>(a(t?{type:Gn}:{type:ht}),()=>a({type:ht})),[t,a]),I.useEffect(()=>{e&&t&&(A(!0),c.request({tags:e==="template"?"StringPromptTemplate&":"ChatPromptTemplate&"}))},[e,t]),I.useEffect(()=>{var B;c.data&&c.data.repos&&(f(c.data.repos),(B=c.data.repos)!=null&&B.length&&D(0,c.data.repos),A(!1))},[c.data]);const p={PaperProps:{style:{maxHeight:48*4.5+8,width:250}}},g=[{id:101,name:"anthropic:claude-instant-1"},{id:102,name:"anthropic:claude-instant-1.2"},{id:103,name:"anthropic:claude-2"},{id:104,name:"google:palm-2-chat-bison"},{id:105,name:"google:palm-2-codechat-bison"},{id:106,name:"google:palm-2-text-bison"},{id:107,name:"meta:llama-2-13b-chat"},{id:108,name:"meta:llama-2-70b-chat"},{id:109,name:"openai:gpt-3.5-turbo"},{id:110,name:"openai:gpt-4"},{id:111,name:"openai:text-davinci-003"}],[b,_]=I.useState([]),T=[{id:201,name:"Agents"},{id:202,name:"Agent Stimulation"},{id:203,name:"Autonomous agents"},{id:204,name:"Classification"},{id:205,name:"Chatbots"},{id:206,name:"Code understanding"},{id:207,name:"Code writing"},{id:208,name:"Evaluation"},{id:209,name:"Extraction"},{id:210,name:"Interacting with APIs"},{id:211,name:"Multi-modal"},{id:212,name:"QA over documents"},{id:213,name:"Self-checking"},{id:214,name:"SQL"},{id:215,name:"Summarization"},{id:216,name:"Tagging"}],[S,M]=I.useState([]),k=[{id:301,name:"Chinese"},{id:302,name:"English"},{id:303,name:"French"},{id:304,name:"German"},{id:305,name:"Russian"},{id:306,name:"Spanish"}],[O,P]=I.useState([]),[i,f]=I.useState([]),[d,y]=I.useState({}),[w,v]=I.useState(["prompt"]),[x,A]=I.useState(!1),$=B=>(H,j)=>{const V=[...w];j?(V.push(B),v(V)):v(V.filter(W=>W!==B))},D=async(B,H=[])=>{const j=H.length?H[B]:i[B];if(!j.detailed){const V=await da.getPrompt({promptName:j.full_name});V.data&&(j.detailed=V.data.templates)}y(j)},E=async()=>{let B=e==="template"?"StringPromptTemplate&":"ChatPromptTemplate&";b.forEach(H=>{B+=`tags=${H.name}&`}),S.forEach(H=>{B+=`tags=${H.name}&`}),O.forEach(H=>{B+=`tags=${H.name}&`}),A(!0),c.request({tags:B})},C=B=>{let H=[];return B.forEach(j=>{B.filter(V=>V.id===j.id).length===1&&H.push(j)}),H},h=B=>{const{target:{value:H}}=B;_(C(H))},N=B=>{const{target:{value:H}}=B;M(C(H))},L=B=>{const{target:{value:H}}=B;P(C(H))},R=t?m.jsxs(gt,{onClose:n,open:t,fullWidth:!0,maxWidth:"lg","aria-labelledby":"prompt-dialog-title","aria-describedby":"prompt-dialog-description",children:[m.jsxs(Ot,{sx:{fontSize:"1rem"},id:"prompt-dialog-title",children:["Langchain Hub (",e==="template"?"PromptTemplate":"ChatPromptTemplate",")"]}),m.jsxs(mt,{dividers:!0,sx:{p:1},children:[m.jsxs(Ie,{sx:{display:"flex",flexDirection:"row",p:2,pt:1,alignItems:"center"},children:[m.jsxs($t,{sx:{mr:1,width:"30%"},children:[m.jsx(In,{size:"small",id:"model-checkbox-label",children:"Model"}),m.jsx(Rn,{id:"model-checkbox",labelId:"model-checkbox-label",multiple:!0,size:"small",value:b,onChange:h,input:m.jsx(Ht,{label:"Model"}),renderValue:B=>B.map(H=>H.name).join(", "),endAdornment:b.length?m.jsx(Ve,{sx:{mr:2},onClick:()=>_([]),children:m.jsx(xr,{style:{width:20,height:20}})}):!1,sx:{".MuiSvgIcon-root ":{fill:o.isDarkMode?"white !important":""}},MenuProps:p,children:g.map(B=>m.jsxs(an,{value:B,children:[m.jsx(fs,{id:B.id,checked:b.findIndex(H=>H.id===B.id)>=0}),m.jsx(ps,{primary:B.name})]},B.id))})]}),m.jsxs($t,{sx:{mr:1,width:"30%"},children:[m.jsx(In,{size:"small",id:"usecase-checkbox-label",children:"Usecase"}),m.jsx(Rn,{autoWidth:!1,labelId:"usecase-checkbox-label",id:"usecase-checkbox",multiple:!0,size:"small",value:S,onChange:N,input:m.jsx(Ht,{label:"Usecase"}),renderValue:B=>B.map(H=>H.name).join(", "),endAdornment:S.length?m.jsx(Ve,{sx:{mr:2},onClick:()=>M([]),children:m.jsx(xr,{style:{width:20,height:20}})}):!1,sx:{".MuiSvgIcon-root ":{fill:o.isDarkMode?"white !important":""}},MenuProps:p,children:T.map(B=>m.jsxs(an,{value:B,children:[m.jsx(fs,{id:B.id,checked:S.findIndex(H=>H.id===B.id)>=0}),m.jsx(ps,{primary:B.name})]},B.id))})]}),m.jsxs($t,{sx:{mr:1,width:"30%"},children:[m.jsx(In,{size:"small",id:"language-checkbox-label",children:"Language"}),m.jsx(Rn,{labelId:"language-checkbox-label",id:"language-checkbox",multiple:!0,size:"small",value:O,onChange:L,input:m.jsx(Ht,{label:"language"}),renderValue:B=>B.map(H=>H.name).join(", "),endAdornment:O.length?m.jsx(Ve,{sx:{mr:2},onClick:()=>P([]),children:m.jsx(xr,{style:{width:20,height:20}})}):!1,sx:{".MuiSvgIcon-root ":{fill:o.isDarkMode?"white !important":""}},MenuProps:p,children:k.map(B=>m.jsxs(an,{value:B,children:[m.jsx(fs,{id:B.id,checked:O.findIndex(H=>H.id===B.id)>=0}),m.jsx(ps,{primary:B.name})]},B.id))})]}),m.jsx($t,{sx:{width:"10%"},children:m.jsx(de,{disableElevation:!0,variant:"outlined",onClick:E,children:"Search"})})]}),x&&m.jsxs(mr,{sx:{alignItems:"center",justifyContent:"center",width:"100%",pb:3},flexDirection:"column",children:[m.jsx(Ie,{sx:{p:5,height:"auto"},children:m.jsx("img",{style:{objectFit:"cover",height:"20vh",width:"auto"},src:la,alt:"promptEmptySVG"})}),m.jsx("div",{children:"Please wait....loading Prompts"})]}),!x&&i&&i.length===0&&m.jsxs(mr,{sx:{alignItems:"center",justifyContent:"center",width:"100%",pb:3},flexDirection:"column",children:[m.jsx(Ie,{sx:{p:5,height:"auto"},children:m.jsx("img",{style:{objectFit:"cover",height:"20vh",width:"auto"},src:la,alt:"promptEmptySVG"})}),m.jsx("div",{children:"No Available Prompts"})]}),!x&&i&&i.length>0&&m.jsx(mr,{sx:{alignItems:"center",justifyContent:"center",width:"100%"},flexDirection:"column",children:m.jsx(Ie,{sx:{width:"100%",p:2},children:m.jsxs(hs,{xs:12,container:!0,spacing:1,justifyContent:"center",alignItems:"center",children:[m.jsx(hs,{xs:4,item:!0,sx:{textAlign:"left"},children:m.jsx(Ie,{sx:{width:"100%",maxWidth:360},children:m.jsx(Zi,{variant:"outlined",sx:{height:470,overflow:"auto",borderRadius:0},children:m.jsxs(Xi,{sx:{p:1},children:[m.jsx(ze,{sx:{fontSize:10},color:"text.secondary",gutterBottom:!0,children:"Available Prompts"}),m.jsx(Fd,{component:"nav","aria-label":"secondary mailbox folder",children:i.map((B,H)=>m.jsx(jd,{selected:B.id===(d==null?void 0:d.id),onClick:()=>D(H),children:m.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[m.jsx(ze,{sx:{fontSize:16,p:1,fontWeight:500},children:B.full_name}),m.jsx("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",marginTop:5},children:B.tags.map((j,V)=>m.jsx(xa,{label:j,style:{marginRight:5,marginBottom:5}},V))})]})},B.id))})]})})})}),m.jsx(hs,{xs:8,item:!0,sx:{textAlign:"left"},children:m.jsx(Ie,{sx:{display:"flex",flexDirection:"column"},children:m.jsx(Zi,{sx:{height:470,overflow:"auto"},children:m.jsxs(Xi,{sx:{p:.5},children:[m.jsxs(Is,{expanded:w.includes("prompt"),onChange:$("prompt"),children:[m.jsx(Rs,{"aria-controls":"panel2d-content",expandIcon:m.jsx(br,{}),id:"panel2d-header",children:m.jsx(ze,{children:"Prompt"})}),m.jsx(Os,{children:m.jsx(ze,{sx:{wordWrap:"true"},color:"text.primary",children:(z=d==null?void 0:d.detailed)==null?void 0:z.map(B=>m.jsxs(m.Fragment,{children:[m.jsx(ze,{sx:{fontSize:12},color:"text.secondary",gutterBottom:!0,children:B.typeDisplay.toUpperCase()}),m.jsx(ze,{children:m.jsx("p",{style:{whiteSpace:"pre-wrap -moz-pre-wrap -pre-wrap -o-pre-wrap",wordWrap:"break-word",fontFamily:"inherit",wordSpacing:"0.1rem",lineHeight:"1.5rem"},children:m.jsx(T0,{children:B.template})})})]}))})})]}),m.jsxs(Is,{expanded:w.includes("description"),onChange:$("description"),children:[m.jsx(Rs,{"aria-controls":"panel1d-content",expandIcon:m.jsx(br,{}),id:"panel1d-header",children:m.jsx(ze,{children:"Description"})}),m.jsx(Os,{children:m.jsx(ze,{sx:{wordWrap:"true",wordSpacing:"0.1rem",lineHeight:"1.5rem"},color:"text.primary",children:d==null?void 0:d.description})})]}),m.jsxs(Is,{expanded:w.includes("readme"),onChange:$("readme"),children:[m.jsx(Rs,{expandIcon:m.jsx(br,{}),"aria-controls":"panel3d-content",id:"panel3d-header",children:m.jsx(ze,{children:"Readme"})}),m.jsx(Os,{children:m.jsx("div",{style:{lineHeight:1.75,"& a":{display:"block",marginRight:"2.5rem",wordWrap:"break-word",color:"#16bed7",fontWeight:500},"& a:hover":{opacity:.8},"& code":{color:"#0ab126",fontWeight:500,whiteSpace:"pre-wrap !important"}},children:m.jsx(ka,{children:d==null?void 0:d.readme})})})]})]})})})})]})})})]}),i&&i.length>0&&m.jsxs(Dt,{children:[m.jsx(de,{onClick:n,children:"Cancel"}),m.jsx(Kn,{disabled:!(d!=null&&d.detailed),onClick:()=>r(d.detailed),variant:"contained",children:"Load"})]})]}):null;return xt.createPortal(R,s)};pd.propTypes={promptType:X.string,show:X.bool,onCancel:X.func,onSubmit:X.func};const M0=(e,t,n)=>ui.get(`/fetch-links?url=${encodeURIComponent(e)}&relativeLinksMethod=${t}&limit=${n}`),A0={fetchLinks:M0},Vi=({show:e,dialogProps:t,onCancel:n,onSave:r})=>{const s=document.getElementById("portal"),a=qt();fi();const o=(...f)=>a(pi(...f)),c=(...f)=>a(hi(...f)),[l,u]=I.useState(!1),[p,g]=I.useState([]),[b,_]=I.useState("");I.useEffect(()=>(t.url&&_(t.url),t.selectedLinks&&g(t.selectedLinks),()=>{u(!1),g([]),_("")}),[t]),I.useEffect(()=>(a(e?{type:Gn}:{type:ht}),()=>a({type:ht})),[e,a]);const T=async()=>{u(!0);try{const f=await A0.fetchLinks(b,t.relativeLinksMethod,t.limit);f.data&&(g(f.data.links),o({message:"Successfully fetched links",options:{key:new Date().getTime()+Math.random(),variant:"success",action:d=>m.jsx(de,{style:{color:"white"},onClick:()=>c(d),children:m.jsx(ft,{})})}}))}catch(f){o({message:typeof f.response.data=="object"?f.response.data.message:f.response.data,options:{key:new Date().getTime()+Math.random(),variant:"error",persist:!0,action:d=>m.jsx(de,{style:{color:"white"},onClick:()=>c(d),children:m.jsx(ft,{})})}})}u(!1)},S=(f,d)=>{const{value:y}=d.target,w=[...p];w[f]=y,g(w)},M=f=>{const d=[...p];d.splice(f,1),g(d)},k=()=>{g([...p,""])},O=()=>{g([])},P=()=>{r(b,p)},i=e?m.jsxs(gt,{onClose:n,open:e,fullWidth:!0,maxWidth:"sm","aria-labelledby":"manage-scraped-links-dialog-title","aria-describedby":"manage-scraped-links-dialog-description",children:[m.jsx(Ot,{sx:{fontSize:"1rem"},id:"manage-scraped-links-dialog-title",children:t.title||`Manage Scraped Links - ${b}`}),m.jsxs(mt,{children:[m.jsx(Ie,{sx:{mb:4},children:m.jsxs(mr,{flexDirection:"row",gap:1,sx:{width:"100%"},children:[m.jsx($t,{sx:{mt:1,width:"100%",display:"flex",flexShrink:1},size:"small",children:m.jsx(Ht,{id:"url",size:"small",type:"text",value:b,name:"url",onChange:f=>{_(f.target.value)}})}),m.jsx(de,{disabled:!b,sx:{borderRadius:"12px",mt:1,display:"flex",flexShrink:0},size:"small",variant:"contained",onClick:T,children:"Fetch Links"})]})}),m.jsxs(Ie,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1.5},children:[m.jsx(ze,{sx:{fontWeight:500},children:"Scraped Links"}),m.jsx(Ie,{sx:{width:"auto",flexGrow:1},children:m.jsx(Ve,{sx:{height:30,width:30,marginLeft:"8px"},size:"small",color:"primary",onClick:()=>k(),children:m.jsx(ti,{})})}),p.length>0?m.jsx(de,{sx:{height:"max-content",width:"max-content"},variant:"outlined",color:"error",title:"Clear All Links",onClick:O,startIcon:m.jsx(yu,{}),children:"Clear All"}):null]}),m.jsxs(m.Fragment,{children:[l&&m.jsx(Na,{open:l}),p.length>0?m.jsx(li,{style:{height:"100%",maxHeight:"320px",overflowX:"hidden",display:"flex",flexDirection:"column",gap:4},children:p.map((f,d)=>m.jsxs("div",{style:{display:"flex",width:"100%"},children:[m.jsx(Ie,{sx:{display:"flex",width:"100%"},children:m.jsx(Ht,{sx:{width:"100%"},type:"text",onChange:y=>S(d,y),size:"small",value:f,name:`link_${d}`},d)}),m.jsx(Ie,{sx:{width:"auto",flexGrow:1},children:m.jsx(Ve,{sx:{height:30,width:30},size:"small",color:"error",onClick:()=>M(d),edge:"end",children:m.jsx(Ca,{})})})]},d))}):m.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:m.jsx(ze,{sx:{my:2},children:"Links scraped from the URL will appear here"})})]})]}),m.jsxs(Dt,{children:[m.jsx(de,{onClick:n,children:"Cancel"}),m.jsx(Kn,{variant:"contained",onClick:P,children:"Save"})]})]}):null;return xt.createPortal(i,s)};Vi.propTypes={show:X.bool,dialogProps:X.object,onCancel:X.func,onSave:X.func};const hd=({show:e,dialogProps:t,onCancel:n})=>{const r=document.getElementById("portal"),s=e?m.jsxs(gt,{onClose:n,open:e,fullWidth:!0,maxWidth:"sm","aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[m.jsx(Ot,{sx:{fontSize:"1rem"},id:"alert-dialog-title",children:t.label}),m.jsx(mt,{children:m.jsx(ka,{children:t==null?void 0:t.value})})]}):null;return xt.createPortal(s,r)};hd.propTypes={show:X.bool,dialogProps:X.object,onCancel:X.func};const gd=({open:e,onClose:t,onComplete:n})=>{const r=document.getElementById("portal"),s={"nvcr.io/nim/meta/llama-3.1-8b-instruct:1.8.0-RTX":{label:"Llama 3.1 8B Instruct",licenseUrl:"https://catalog.ngc.nvidia.com/orgs/nim/teams/meta/containers/llama-3.1-8b-instruct"},"nvcr.io/nim/deepseek-ai/deepseek-r1-distill-llama-8b:1.8.0-RTX":{label:"DeepSeek R1 Distill Llama 8B",licenseUrl:"https://catalog.ngc.nvidia.com/orgs/nim/teams/deepseek-ai/containers/deepseek-r1-distill-llama-8b"},"nvcr.io/nim/nv-mistralai/mistral-nemo-12b-instruct:1.8.0-rtx":{label:"Mistral Nemo 12B Instruct",licenseUrl:"https://catalog.ngc.nvidia.com/orgs/nim/teams/nv-mistralai/containers/mistral-nemo-12b-instruct"}},[a,o]=I.useState(0),[c,l]=I.useState(!1),[u,p]=I.useState(""),[g,b]=I.useState(null),[_,T]=I.useState("0"),[S,M]=I.useState("8080"),[k,O]=I.useState(!1),[P,i]=I.useState(null),f=["Download Installer","Pull Image","Start Container"],d=async()=>{var E;try{l(!0),await rt.get("/api/v1/nvidia-nim/download-installer"),l(!1)}catch(C){let h=C.message;typeof C=="string"?h=C:(E=C.response)!=null&&E.data&&(h=C.response.data.message),alert("Failed to download installer: "+h),l(!1)}},y=async()=>{var E;try{l(!0),await rt.get("/api/v1/nvidia-nim/preload"),l(!1),o(1)}catch(C){let h=C.message;typeof C=="string"?h=C:(E=C.response)!=null&&E.data&&(h=C.response.data.message),alert("Failed to preload: "+h),l(!1)}},w=async()=>{var E,C;try{l(!0);try{const R=await rt.post("/api/v1/nvidia-nim/get-image",{imageTag:u});if(R.data&&R.data.tag===u){l(!1),o(2);return}}catch(R){if(((E=R.response)==null?void 0:E.status)!==404)throw R}const N=(await rt.get("/api/v1/nvidia-nim/get-token")).data.access_token;await rt.post("/api/v1/nvidia-nim/pull-image",{imageTag:u,apiKey:N});const L=setInterval(async()=>{var R;try{(await rt.post("/api/v1/nvidia-nim/get-image",{imageTag:u})).data&&(clearInterval(L),l(!1),o(2))}catch(z){((R=z.response)==null?void 0:R.status)!==404&&(clearInterval(L),alert("Failed to check image status: "+z.message),l(!1))}},5e3);b(L)}catch(h){let N=h.message;typeof h=="string"?N=h:(C=h.response)!=null&&C.data&&(N=h.response.data.message),alert("Failed to pull image: "+N),l(!1)}},v=async()=>{var E,C,h;try{l(!0);try{const N=await rt.post("/api/v1/nvidia-nim/get-container",{imageTag:u,port:parseInt(S)});if(N.data){i(N.data),O(!0),l(!1);return}}catch(N){if(((E=N.response)==null?void 0:E.status)===409){alert(`Port ${S} is already in use by another container. Please choose a different port.`),l(!1);return}if(((C=N.response)==null?void 0:C.status)!==404)throw N}await x()}catch(N){let L=N.message;typeof N=="string"?L=N:(h=N.response)!=null&&h.data&&(L=N.response.data.message),alert("Failed to check container status: "+L),l(!1)}},x=async()=>{var E;try{l(!0);const h=(await rt.get("/api/v1/nvidia-nim/get-token")).data.access_token;await rt.post("/api/v1/nvidia-nim/start-container",{imageTag:u,apiKey:h,nimRelaxMemConstraints:parseInt(_),hostPort:parseInt(S)});const N=setInterval(async()=>{var L;try{const R=await rt.post("/api/v1/nvidia-nim/get-container",{imageTag:u,port:parseInt(S)});R.data&&(clearInterval(N),l(!1),n(R.data),t())}catch(R){((L=R.response)==null?void 0:L.status)!==404&&(clearInterval(N),alert("Failed to check container status: "+R.message),l(!1))}},5e3);b(N)}catch(C){let h=C.message;typeof C=="string"?h=C:(E=C.response)!=null&&E.data&&(h=C.response.data.message),alert("Failed to start container: "+h),l(!1)}},A=async()=>{var E;try{l(!0);const C=setInterval(async()=>{var h;try{const N=await rt.post("/api/v1/nvidia-nim/get-container",{imageTag:u,port:parseInt(S)});N.data&&(clearInterval(C),l(!1),n(N.data),t())}catch(N){((h=N.response)==null?void 0:h.status)!==404&&(clearInterval(C),alert("Failed to check container status: "+N.message),l(!1))}},5e3);b(C)}catch(C){let h=C.message;typeof C=="string"?h=C:(E=C.response)!=null&&E.data&&(h=C.response.data.message),alert("Failed to check container status: "+h),l(!1)}},$=()=>{if(a===1&&!u){alert("Please enter an image tag");return}if(a===2){const E=parseInt(S);if(isNaN(E)||E<1||E>65535){alert("Please enter a valid port number between 1 and 65535");return}}switch(a){case 0:y();break;case 1:w();break;case 2:v();break;default:o(E=>E+1)}};I.useEffect(()=>()=>{g&&clearInterval(g)},[g]),I.useEffect(()=>{e||(o(0),l(!1),p(""))},[e]);const D=e?m.jsxs(m.Fragment,{children:[m.jsxs(gt,{open:e,children:[m.jsx(Ot,{children:"NIM Setup"}),m.jsxs(mt,{children:[m.jsx(Ud,{activeStep:a,children:f.map(E=>m.jsx(Vd,{children:m.jsx(Gd,{children:E})},E))}),a===0&&m.jsxs("div",{style:{marginTop:20},children:[m.jsx("p",{style:{marginBottom:20},children:"Would you like to download the NIM installer? Click Next if it has been installed"}),c&&m.jsx(gs,{})]}),a===1&&m.jsxs("div",{children:[m.jsxs($t,{fullWidth:!0,sx:{mt:2},children:[m.jsx(In,{children:"Model"}),m.jsx(Rn,{label:"Model",value:u,onChange:E=>p(E.target.value),children:Object.entries(s).map(([E,{label:C}])=>m.jsx(an,{value:E,children:C},E))})]}),u&&m.jsx(de,{variant:"text",size:"small",sx:{mt:1},onClick:()=>window.open(s[u].licenseUrl,"_blank"),children:"View License"}),c&&m.jsxs("div",{children:[m.jsx("div",{style:{marginBottom:20}}),m.jsx(gs,{}),m.jsx("p",{children:"Pulling image..."})]})]}),a===2&&m.jsx("div",{children:c?m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{marginBottom:20}}),m.jsx(gs,{}),m.jsx("p",{children:"Starting container..."})]}):m.jsxs(m.Fragment,{children:[m.jsxs($t,{fullWidth:!0,sx:{mt:2},children:[m.jsx(In,{children:"Relax Memory Constraints"}),m.jsxs(Rn,{label:"Relax Memory Constraints",value:_,onChange:E=>T(E.target.value),children:[m.jsx(an,{value:"1",children:"Yes"}),m.jsx(an,{value:"0",children:"No"})]})]}),m.jsx(Ta,{fullWidth:!0,type:"number",label:"Host Port",value:S,onChange:E=>M(E.target.value),inputProps:{min:1,max:65535},sx:{mt:2}}),m.jsx("p",{style:{marginTop:20},children:"Click Next to start the container."})]})})]}),m.jsxs(Dt,{children:[m.jsx(de,{onClick:t,variant:"outline",children:"Cancel"}),a===0&&m.jsx(de,{onClick:$,variant:"outline",color:"secondary",children:"Next"}),m.jsx(de,{onClick:a===0?d:$,disabled:c||a===2&&(!_||!S),children:a===0?"Download":"Next"})]})]}),m.jsxs(gt,{open:k,onClose:()=>O(!1),children:[m.jsx(Ot,{children:"Container Already Exists"}),m.jsxs(mt,{children:[m.jsx("p",{children:"A container for this image already exists:"}),m.jsxs("div",{children:[m.jsxs("p",{children:[m.jsx("strong",{children:"Name:"})," ",(P==null?void 0:P.name)||"N/A"]}),m.jsxs("p",{children:[m.jsx("strong",{children:"Status:"})," ",(P==null?void 0:P.status)||"N/A"]})]}),m.jsx("p",{children:"You can:"}),m.jsxs("ul",{children:[m.jsx("li",{children:"Use the existing container (recommended)"}),m.jsx("li",{children:"Change the port and try again"})]})]}),m.jsxs(Dt,{children:[m.jsx(de,{onClick:()=>{O(!1),i(null)},children:"Cancel"}),m.jsx(de,{onClick:()=>{O(!1),A()},children:"Use Existing"})]})]})]}):null;return xt.createPortal(D,r)};gd.propTypes={open:X.bool,onClose:X.func,onComplete:X.func};const I0=[{text:"Summarize a document",img:m.jsx(Eu,{})},{text:"Translate the language",img:m.jsx(qd,{})},{text:"Write me an email",img:m.jsx(wu,{})},{text:"Convert the code to another language",img:m.jsx(Yd,{})},{text:"Research and generate a report",img:m.jsx(vu,{})},{text:"Plan a trip",img:m.jsx(Zd,{})}],md=({show:e,dialogProps:t,onCancel:n,onConfirm:r})=>{const s=document.getElementById("portal"),[a,o]=I.useState(""),[c,l]=I.useState(""),[u,p]=I.useState(!1),g=qt();fi();const b=(...M)=>g(pi(...M)),_=(...M)=>g(hi(...M)),T=async()=>{try{p(!0);const M={name:t.data.selectedChatModel.name,inputs:t.data.selectedChatModel.inputs},k=await Ma.generateAssistantInstruction({selectedChatModel:M,task:a});k.data&&(p(!1),k.data.content&&l(k.data.content))}catch(M){p(!1),b({message:typeof M.response.data=="object"?M.response.data.message:M.response.data,options:{key:new Date().getTime()+Math.random(),variant:"error",persist:!0,action:k=>m.jsx(de,{style:{color:"white"},onClick:()=>_(k),children:m.jsx(ft,{})})}})}};I.useEffect(()=>{e||(o(""),l(""))},[e]);const S=e?m.jsx(m.Fragment,{children:m.jsxs(gt,{fullWidth:!0,maxWidth:"md",open:e,onClose:n,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[m.jsx(Ot,{sx:{fontSize:"1rem"},id:"alert-dialog-title",children:t.title}),m.jsxs(mt,{children:[m.jsx("span",{children:t.description}),m.jsx("div",{style:{display:"block",flexDirection:"row",width:"100%",marginTop:"15px"},children:I0.map((M,k)=>m.jsx(de,{size:"small",sx:{textTransform:"none",mr:1,mb:1,borderRadius:"16px"},variant:"outlined",color:"inherit",onClick:()=>{o(M.text),l("")},startIcon:M.img,children:M.text},k))}),!c&&m.jsx(Ht,{sx:{mt:2,width:"100%"},type:"text",multiline:!0,rows:12,disabled:u,value:a,placeholder:"Describe your task here",onChange:M=>o(M.target.value)}),c&&m.jsx(Ht,{sx:{mt:2,width:"100%"},type:"text",multiline:!0,rows:12,value:c,onChange:M=>l(M.target.value)})]}),m.jsxs(Dt,{sx:{pb:3,pr:3},children:[!c&&m.jsx(Kd,{loading:u,variant:"contained",onClick:()=>{T()},startIcon:m.jsx(zs,{size:20}),children:"Generate"}),c&&m.jsx(de,{variant:"outlined",startIcon:m.jsx(Wd,{size:20}),onClick:()=>{l("")},children:"Back"}),c&&m.jsx(Kn,{variant:"contained",onClick:()=>r(c),children:"Apply"})]})]})}):null;return xt.createPortal(S,s)};md.propTypes={show:X.bool,dialogProps:X.object,onConfirm:X.func,onCancel:X.func};const ua=["selectedTool","selectedAssistant"],fa=Lt(({className:e,...t})=>m.jsx(ai,{...t,classes:{popper:e}}))({[`& .${tu.tooltip}`]:{maxWidth:500}}),R0=Lt(au)({boxShadow:"0px 8px 10px -5px rgb(0 0 0 / 20%), 0px 16px 24px 2px rgb(0 0 0 / 14%), 0px 6px 30px 5px rgb(0 0 0 / 12%)",borderRadius:"10px",[`& .${cu.listbox}`]:{boxSizing:"border-box","& ul":{padding:10,margin:10}}}),O0=new Bm.Converter({simplifiedAutoLink:!0,strikethrough:!0,tables:!0,tasklists:!0}),Yn=({inputAnchor:e,inputParam:t,data:n,disabled:r=!1,isAdditionalParams:s=!1,disablePadding:a=!1,parentParamForArray:o=null,arrayIndex:c=null,onHideNodeInfoDialog:l,onCustomDataChange:u})=>{const p=oi(),g=Wt(F=>F.customization),b=I.useRef(null),{reactFlowInstance:_,deleteEdge:T,onNodeDataChange:S}=I.useContext(Fr),M=Dm();fi();const k=qt(),O=(...F)=>k(pi(...F)),P=(...F)=>k(hi(...F)),[i,f]=I.useState(0),[d,y]=I.useState(!1),[w,v]=I.useState({}),[x,A]=I.useState(!1),[$,D]=I.useState({}),[E,C]=I.useState(""),[h,N]=I.useState({}),[L,R]=I.useState(Date.now().toString()),[z,B]=I.useState(!1),[H,j]=I.useState({}),[V,W]=I.useState(!1),[ne,Z]=I.useState(!1),[q,ie]=I.useState({}),[oe,pe]=I.useState(!1),[Me,ve]=I.useState({}),[be,ge]=I.useState(!1),[se,we]=I.useState({}),[U,He]=I.useState(!1),[me,fe]=I.useState(0),[qe,Ae]=I.useState(!1),[Ge,Ze]=I.useState([]),[K,Q]=I.useState([]),[te,ce]=I.useState({}),[ue,_e]=I.useState(null),[Xe,$e]=I.useState(!1),[_t,Ke]=I.useState(!1),[Qe,kt]=I.useState({}),ct=({inputParam:F,newValue:Y})=>{n.inputs[F.name]=Y,["boolean","asyncOptions","asyncMultiOptions","options","multiOptions"].includes(F.type)&&(u?u({nodeId:n.id,inputParam:F,newValue:Y}):S({nodeId:n.id,inputParam:F,newValue:Y}))},lt=F=>{const Y={...F};ve(Y),pe(!0)},yn=(F,Y,ee)=>{const J={value:F,inputParam:Y,disabled:r,languageType:ee,nodes:(_==null?void 0:_.getNodes())||[],edges:(_==null?void 0:_.getEdges())||[],nodeId:n.id,confirmButtonName:"Save",cancelButtonName:"Cancel"};Y.acceptVariable?(D(J),A(!0)):(v(J),y(!0))},Zn=F=>{we({data:n,inputParam:F,disabled:r,confirmButtonName:"Save",cancelButtonName:"Cancel"}),ge(!0),l(!0)},yt=()=>{W(!0)},Qr=F=>{W(!1);for(const Y of F)Object.prototype.hasOwnProperty.call(n.inputs,Y.type)&&(n.inputs[Y.type]=Y.template)},Jr=(F,Y,ee,J)=>{ie({url:F,relativeLinksMethod:ee,limit:J,selectedLinks:Y,confirmButtonName:"Save",cancelButtonName:"Cancel"}),Z(!0)},es=(F,Y)=>{Z(!1),n.inputs.url=F,n.inputs.selectedLinks=Y},Xn=F=>{if(!F)return"";const Y={},ee=su(F);for(const J of ee)Y[J]="";return Object.keys(Y).length?JSON.stringify(Y):""},ts=(F,Y)=>{const ee=[];for(const J of F){const ye=_?_.getNodes().find(Se=>Se.data.name==="seqState"):null;if(J.type==="asyncSingleSelect"&&J.loadMethod&&J.loadMethod.includes("loadStateKeys"))if(ye){const Se=ye.data.inputParams.find(xe=>xe.tabIdentifier);if(Se&&Se.tabs.length>0){const xe=Se.tabIdentifier,Fe=ye.data.inputs[`${xe}_${ye.data.id}`]||Se.default||Se.tabs[0].name,ke=ye.data.inputs[Fe];if(ke)try{const Ne=JSON.parse(ke),Ee=Array.isArray(Ne)?Ne.map(De=>De.key):Object.keys(Ne);ee.push({...J,field:J.field,headerName:J.headerName,type:"singleSelect",editable:!0,valueOptions:Ee})}catch(Ne){console.error("Error parsing stateMemory",Ne)}}}else ee.push({...J,field:J.field,headerName:J.headerName,type:"singleSelect",editable:!0,valueOptions:[]});else if(J.type==="freeSolo"){const Se=[];if(J.loadMethod&&J.loadMethod.includes("getPreviousMessages")){const xe=kr((_==null?void 0:_.getNodes())||[],(_==null?void 0:_.getEdges())||[],n.id,Y.id);for(const Fe of xe)Se.push({value:`$${Fe.id}`,label:`Output from ${Fe.data.id}`})}if(J.loadMethod&&J.loadMethod.includes("loadStateKeys")&&ye){const xe=ye.data.inputParams.find(Fe=>Fe.tabIdentifier);if(xe&&xe.tabs.length>0){const Fe=xe.tabIdentifier,ke=ye.data.inputs[`${Fe}_${ye.data.id}`]||xe.default||xe.tabs[0].name,Ne=ye.data.inputs[ke];if(Ne)try{const Ee=JSON.parse(Ne),De=Array.isArray(Ee)?Ee.map(Je=>Je.key):Object.keys(Ee);for(const Je of De)Se.push({value:`$flow.state.${Je}`,label:`Value from ${Je}`})}catch(Ee){console.error("Error parsing stateMemory",Ee)}}}ee.push({...J,field:J.field,headerName:J.headerName,renderEditCell:({id:xe,field:Fe,value:ke})=>{const Ne=nu();return m.jsx(ru,{id:J.field,freeSolo:!0,fullWidth:!0,options:[...Se,...J.valueOptions],value:ke,PopperComponent:R0,renderInput:Ee=>m.jsx(Ta,{...Ee}),renderOption:(Ee,De)=>m.jsx("li",{...Ee,children:m.jsxs("div",{children:[m.jsx("strong",{children:De.value}),m.jsx("br",{}),m.jsx("small",{children:De.label})]})}),getOptionLabel:Ee=>typeof Ee=="string"?Ee:Ee.value,onInputChange:(Ee,De)=>{Ne.current.setEditCellValue({id:xe,field:Fe,value:De})},sx:{"& .MuiInputBase-root":{height:"50px"},"& .MuiOutlinedInput-root":{border:"none"},"& .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline":{border:"none"}}})}})}else ee.push(J)}return ee},Qn=F=>{const Y=[];if(F.loadPreviousNodes){const ee=kr((_==null?void 0:_.getNodes())||[],(_==null?void 0:_.getEdges())||[],n.id,F.id);for(const J of ee)Y.push({name:`{{ ${J.data.id} }}`,label:`{{ ${J.data.id} }}`,description:`Output from ${J.data.id}`})}return[...Y,...F.options]},wn=F=>F.tabs.findIndex(Y=>Y.name===n.inputs[`${F.tabIdentifier}_${n.id}`])>=0?F.tabs.findIndex(Y=>Y.name===n.inputs[`${F.tabIdentifier}_${n.id}`]):me,ns=(F,Y)=>{let ee=F;if(Y.name==="promptValues"&&!F){const ye=(n.inputs.template??"")+(n.inputs.systemMessagePrompt??"")+(n.inputs.humanMessagePrompt??"")+(n.inputs.workerPrompt??"");ee=Xn(ye)}const J={value:ee,inputParam:Y,nodes:(_==null?void 0:_.getNodes())||[],edges:(_==null?void 0:_.getEdges())||[],nodeId:n.id,data:n};j(J),B(!0)},rs=(F,Y)=>{n.inputs[Y]=F,y(!1)},ss=(F,Y)=>{n.inputs[Y]=F,A(!1)},is=(F,Y,ee)=>{n.inputs[`${Y.tabIdentifier}_${n.id}`]=Y.tabs[ee].name;const J=(_==null?void 0:_.getEdges().filter(xe=>xe.source===n.id))||[],{outputAnchors:ye,toBeRemovedEdgeIds:Se}=iu(F.inputs[Y.tabs[ee].name],n.id,J,Y.tabs[ee].type==="datagrid");if(ye){n.outputAnchors=ye;for(const xe of Se)T(xe);ge(!1),l(!1)}},os=(F,Y)=>{F==="selectedTool"?N({title:"Edit Tool",type:"EDIT",cancelButtonName:"Cancel",confirmButtonName:"Save",toolId:Y}):F==="selectedAssistant"&&N({title:"Edit Assistant",type:"EDIT",cancelButtonName:"Cancel",confirmButtonName:"Save",assistantId:Y}),C(F)},as=F=>{F==="selectedTool"?N({title:"Add New Tool",type:"ADD",cancelButtonName:"Cancel",confirmButtonName:"Add"}):F==="selectedAssistant"&&N({title:"Add New Assistant",type:"ADD",cancelButtonName:"Cancel",confirmButtonName:"Add"}),C(F)},En=(F="")=>{F?(n.inputs[E]=F,ct({inputParam:{name:E},newValue:F}),R(Date.now().toString())):(n.inputs[E]="",ct({inputParam:{name:E},newValue:""})),N({}),C("")},cs=F=>{F&&(n.inputs.basePath=F.baseUrl,n.inputs.modelName=F.image)},Jn=async()=>{try{const F=await Ma.getChatModels();if(F.data){const Y=F.data??[],ee=Y.map(J=>({name:J.name,label:J.label,description:J.description,imageSrc:`${ou}/api/v1/node-icon/${J.name}`}));Ze(Y),Q(ee)}}catch(F){console.error("Error loading chat models:",F)}},er=()=>{let F=!0;if(te&&Object.keys(te).length>0){const Y=(te.inputParams??[]).filter(ee=>!ee.hidden);for(const ee of Y)if(!ee.optional&&(!te.inputs[ee.name]||!te.credential)){if(ee.type==="credential"&&!te.credential){F=!1;break}else if(ee.type!=="credential"&&!te.inputs[ee.name]){F=!1;break}}}return F},tr=()=>{O({message:"Please fill in all mandatory fields.",options:{key:new Date().getTime()+Math.random(),variant:"warning",action:F=>m.jsx(de,{style:{color:"white"},onClick:()=>P(F),children:m.jsx(ft,{})})}})},ls=async F=>{var Se,xe,Fe;if(!F){O({message:"Please select a knowledge base",options:{key:new Date().getTime()+Math.random(),variant:"error",action:ke=>m.jsx(de,{style:{color:"white"},onClick:()=>P(ke),children:m.jsx(ft,{})})}});return}if(F=F.split(":")[0],!er()){tr();return}const ee=_==null?void 0:_.getNodes().find(ke=>ke.id===n.id),J=(Se=ee==null?void 0:ee.data)==null?void 0:Se.inputs,ye=(J==null?void 0:J.llmModel)||(J==null?void 0:J.agentModel)||(J==null?void 0:J.humanInputModel);if(ye){try{$e(!0);const ke={name:ye,inputs:(J==null?void 0:J.llmModelConfig)||(J==null?void 0:J.agentModelConfig)||(J==null?void 0:J.humanInputModelConfig)},Ne=await eo.generateDocStoreToolDesc(F,{selectedChatModel:ke});if(Ne.data){$e(!1);const Ee=((xe=Ne.data)==null?void 0:xe.content)||((Fe=Ne.data.kwargs)==null?void 0:Fe.content);n.inputs[t.name]=Ee,O({message:"Document Store Tool Description generated successfully",options:{key:new Date().getTime()+Math.random(),variant:"success",action:De=>m.jsx(de,{style:{color:"white"},onClick:()=>P(De),children:m.jsx(ft,{})})}})}}catch(ke){console.error("Error generating doc store tool desc",ke),$e(!1),O({message:typeof ke.response.data=="object"?ke.response.data.message:ke.response.data,options:{key:new Date().getTime()+Math.random(),variant:"error",persist:!0,action:Ne=>m.jsx(de,{style:{color:"white"},onClick:()=>P(Ne),children:m.jsx(ft,{})})}})}return}await Jn(),_e(()=>async ke=>{var Ne,Ee;try{$e(!0);const De={name:ke.name,inputs:ke.inputs},Je=await eo.generateDocStoreToolDesc(F,{selectedChatModel:De});if(Je.data){$e(!1);const vn=((Ne=Je.data)==null?void 0:Ne.content)||((Ee=Je.data.kwargs)==null?void 0:Ee.content);n.inputs[t.name]=vn,O({message:"Document Store Tool Description generated successfully",options:{key:new Date().getTime()+Math.random(),variant:"success",action:bd=>m.jsx(de,{style:{color:"white"},onClick:()=>P(bd),children:m.jsx(ft,{})})}})}}catch(De){console.error("Error generating doc store tool desc",De),$e(!1),O({message:typeof De.response.data=="object"?De.response.data.message:De.response.data,options:{key:new Date().getTime()+Math.random(),variant:"error",persist:!0,action:Je=>m.jsx(de,{style:{color:"white"},onClick:()=>P(Je),children:m.jsx(ft,{})})}})}}),Ae(!0)},ds=async()=>{var ye;if(!er()){tr();return}const Y=_==null?void 0:_.getNodes().find(Se=>Se.id===n.id),ee=(ye=Y==null?void 0:Y.data)==null?void 0:ye.inputs,J=(ee==null?void 0:ee.llmModel)||(ee==null?void 0:ee.agentModel)||(ee==null?void 0:ee.humanInputModel);if(J){kt({title:"Generate Instructions",description:"You can generate a prompt template by sharing basic details about your task.",data:{selectedChatModel:{name:J,inputs:(ee==null?void 0:ee.llmModelConfig)||(ee==null?void 0:ee.agentModelConfig)||(ee==null?void 0:ee.humanInputModelConfig)}}}),Ke(!0);return}await Jn(),_e(()=>async Se=>{kt({title:"Generate Instructions",description:"You can generate a prompt template by sharing basic details about your task.",data:{selectedChatModel:Se}}),Ke(!0)}),Ae(!0)};return I.useEffect(()=>{b.current&&b.current.offsetTop&&b.current.clientHeight&&(f(b.current.offsetTop+b.current.clientHeight/2),M(n.id))},[n.id,b,M]),I.useEffect(()=>{M(n.id)},[n.id,i,M]),m.jsxs("div",{ref:b,children:[e&&m.jsxs(m.Fragment,{children:[m.jsx(fa,{placement:"left",title:e.type,children:m.jsx(mn,{type:"target",position:re.Left,id:e.id,isValidConnection:F=>Qi(F,_),style:{height:10,width:10,backgroundColor:n.selected?p.palette.primary.main:p.palette.text.secondary,top:i}},e.id)}),m.jsx(Ie,{sx:{p:2},children:m.jsxs(ze,{children:[e.label,!e.optional&&m.jsx("span",{style:{color:"red"},children:" *"}),e.description&&m.jsx(Bs,{style:{marginLeft:10},title:e.description})]})})]}),(t&&!t.additionalParams||s)&&m.jsxs(m.Fragment,{children:[t.acceptVariable&&!s&&m.jsx(fa,{placement:"left",title:t.type,children:m.jsx(mn,{type:"target",position:re.Left,id:t.id,isValidConnection:F=>Qi(F,_),style:{height:10,width:10,backgroundColor:n.selected?p.palette.primary.main:p.palette.text.secondary,top:i}},t.id)}),m.jsxs(Ie,{sx:{p:a?0:2},children:[(n.name==="promptTemplate"||n.name==="chatPromptTemplate")&&(t.name==="template"||t.name==="systemMessagePrompt")&&m.jsxs(m.Fragment,{children:[m.jsx(de,{style:{display:"flex",flexDirection:"row",width:"100%"},disabled:r,sx:{borderRadius:25,width:"100%",mb:2,mt:0},variant:"outlined",onClick:()=>yt(),endIcon:m.jsx(sl,{}),children:"Langchain Hub"}),m.jsx(pd,{promptType:t.name,show:V,onCancel:()=>W(!1),onSubmit:Qr})]}),n.name==="chatNvidiaNIM"&&t.name==="modelName"&&m.jsx(m.Fragment,{children:m.jsx(de,{style:{display:"flex",flexDirection:"row",width:"100%"},sx:{borderRadius:"12px",width:"100%",mb:2,mt:-1},variant:"outlined",onClick:()=>He(!0),children:"Setup NIM Locally"})}),m.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[m.jsxs(ze,{children:[t.label,!t.optional&&m.jsx("span",{style:{color:"red"},children:" *"}),t.description&&m.jsx(Bs,{style:{marginLeft:10},title:t.description})]}),m.jsx("div",{style:{flexGrow:1}}),t.hint&&!s&&m.jsx(Ve,{size:"small",sx:{height:25,width:25},title:t.hint.label,color:"secondary",onClick:()=>lt(t.hint),children:m.jsx(Ji,{})}),t.hint&&s&&m.jsx(de,{sx:{p:0,px:2},color:"secondary",variant:"text",onClick:()=>{lt(t.hint)},startIcon:m.jsx(Ji,{size:17}),children:t.hint.label}),t.acceptVariable&&t.type==="string"&&m.jsx(ai,{title:"Type {{ to select variables",children:m.jsx(Xd,{size:20,style:{color:"teal"}})}),t.generateDocStoreDescription&&m.jsx(Ve,{title:"Generate knowledge base description",sx:{height:25,width:25},size:"small",color:"secondary",onClick:()=>ls(n.inputs.documentStore),children:m.jsx(zs,{})}),t.generateInstruction&&m.jsx(Ve,{title:"Generate instructions",sx:{height:25,width:25,ml:.5},size:"small",color:"secondary",onClick:()=>ds(),children:m.jsx(zs,{})}),(t.type==="string"&&t.rows||t.type==="code")&&m.jsx(Ve,{size:"small",sx:{height:25,width:25,ml:.5},title:"Expand",color:"primary",onClick:()=>yn(n.inputs[t.name]??t.default??"",t),children:m.jsx(Aa,{})})]}),t.warning&&m.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",borderRadius:10,background:"rgb(254,252,191)",padding:10,marginTop:10,marginBottom:10},children:[m.jsx(ci,{size:30,color:"orange"}),m.jsx("span",{style:{color:"rgb(116,66,16)",marginLeft:10},children:Qd(t.warning)})]}),t.type==="credential"&&m.jsx(Ia,{disabled:r,data:n,inputParam:t,onSelect:F=>{n.credential=F,n.inputs[on]=F}}),t.type==="tabs"&&m.jsxs(m.Fragment,{children:[m.jsx(dl,{value:wn(t),onChange:(F,Y)=>{fe(Y),n.inputs[`${t.tabIdentifier}_${n.id}`]=t.tabs[Y].name},"aria-label":"tabs",variant:"fullWidth",defaultValue:wn(t),children:m.jsx(id,{children:t.tabs.map((F,Y)=>m.jsx(ad,{children:F.label},Y))})}),t.tabs.filter(F=>F.display!==!1).map((F,Y)=>m.jsx(Sa,{value:wn(t),index:Y,children:m.jsx(Yn,{disabled:F.disabled,inputParam:F,data:n,isAdditionalParams:!0,disablePadding:!0})},Y))]}),t.type==="file"&&m.jsx(Ra,{disabled:r,fileType:t.fileType||"*",onChange:F=>n.inputs[t.name]=F,value:n.inputs[t.name]??t.default??"Choose a file to upload"}),t.type==="boolean"&&m.jsx(Oa,{disabled:r,onChange:F=>ct({inputParam:t,newValue:F}),value:n.inputs[t.name]??t.default??!1}),t.type==="datagrid"&&m.jsx(mi,{disabled:r,columns:ts(t.datagrid,t),hideFooter:!0,rows:n.inputs[t.name]??JSON.stringify(t.default)??[],onChange:F=>n.inputs[t.name]=F}),t.type==="code"&&m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"flex-start"},children:t.codeExample&&m.jsx(de,{variant:"outlined",onClick:()=>{n.inputs[t.name]=t.codeExample,R(Date.now().toString())},children:"See Example"})}),m.jsx("div",{style:{marginTop:"10px",border:"1px solid",borderColor:p.palette.grey[900]+25,borderRadius:"6px",height:t.rows?"100px":"200px"},children:m.jsx(Da,{disabled:r,value:n.inputs[t.name]??t.default??"",height:t.rows?"100px":"200px",theme:g.isDarkMode?"dark":"light",lang:"js",placeholder:t.placeholder,onValueChange:F=>n.inputs[t.name]=F,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1}})},`${L}_${n.id}}`)]}),(t.type==="string"||t.type==="password"||t.type==="number")&&(t!=null&&t.acceptVariable&&(window.location.href.includes("v2/agentcanvas")||window.location.href.includes("v2/marketplace"))?m.jsx(Jl,{placeholder:t.placeholder,disabled:r,inputParam:t,onChange:F=>n.inputs[t.name]=F,value:n.inputs[t.name]??t.default??"",nodes:_?_.getNodes():[],edges:_?_.getEdges():[],nodeId:n.id},n.inputs[t.name]):m.jsx(La,{placeholder:t.placeholder,disabled:r,inputParam:t,onChange:F=>n.inputs[t.name]=F,value:n.inputs[t.name]??t.default??"",nodes:[],edges:[],nodeId:n.id},n.inputs[t.name])),t.type==="json"&&m.jsxs(m.Fragment,{children:[!(t!=null&&t.acceptVariable)&&m.jsx(di,{disabled:r,onChange:F=>n.inputs[t.name]=F,value:n.inputs[t.name]||t.default||Xn(n.inputs.workerPrompt)||"",isSequentialAgent:n.category==="Sequential Agents",isDarkMode:g.isDarkMode}),(t==null?void 0:t.acceptVariable)&&m.jsxs(m.Fragment,{children:[m.jsx(de,{sx:{borderRadius:25,width:"100%",mb:0,mt:2},variant:"outlined",disabled:r,onClick:()=>ns(n.inputs[t.name]??"",t),children:t.label}),m.jsx(ld,{show:z,dialogProps:H,onCancel:()=>B(!1),onChange:F=>n.inputs[t.name]=F})]})]}),t.type==="options"&&m.jsx("div",{children:m.jsx(Ps,{disabled:r,name:t.name,options:Qn(t),freeSolo:t.freeSolo,onSelect:F=>ct({inputParam:t,newValue:F}),value:n.inputs[t.name]??t.default??"choose an option"})},`${n.id}_${JSON.stringify(n.inputs[t.name])}`),t.type==="multiOptions"&&m.jsx("div",{children:m.jsx(Ba,{disabled:r,name:t.name,options:Qn(t),onSelect:F=>ct({inputParam:t,newValue:F}),value:n.inputs[t.name]??t.default??"choose an option"})},`${n.id}_${JSON.stringify(n.inputs[t.name])}`),(t.type==="asyncOptions"||t.type==="asyncMultiOptions")&&m.jsxs(m.Fragment,{children:[n.inputParams.length===1&&m.jsx("div",{style:{marginTop:10}}),m.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:1},children:[m.jsx(Pa,{disabled:r,name:t.name,nodeData:n,value:n.inputs[t.name]??t.default??"choose an option",freeSolo:t.freeSolo,multiple:t.type==="asyncMultiOptions",isCreateNewOption:ua.includes(t.name),onSelect:F=>{t.loadConfig&&R(Date.now().toString()),ct({inputParam:t,newValue:F})},onCreateNew:()=>as(t.name)}),ua.includes(t.name)&&n.inputs[t.name]&&m.jsx(Ve,{title:"Edit",color:"primary",size:"small",onClick:()=>os(t.name,n.inputs[t.name]),children:m.jsx(Jd,{})}),t.refresh&&m.jsx(Ve,{title:"Refresh",color:"primary",size:"small",onClick:()=>R(Date.now().toString()),children:m.jsx($a,{})})]},`${L}_${n.id}_${JSON.stringify(n.inputs[t.name])}`)]}),t.type==="array"&&m.jsx(Gi,{inputParam:t,data:n,disabled:r}),t.type.includes("conditionFunction")&&m.jsx(m.Fragment,{children:m.jsx(de,{style:{display:"flex",flexDirection:"row",width:"100%"},sx:{borderRadius:"12px",width:"100%",mt:1},variant:"outlined",onClick:()=>Zn(t),children:t.label})}),(n.name==="cheerioWebScraper"||n.name==="puppeteerWebScraper"||n.name==="playwrightWebScraper")&&t.name==="url"&&m.jsxs(m.Fragment,{children:[m.jsx(de,{style:{display:"flex",flexDirection:"row",width:"100%"},disabled:r,sx:{borderRadius:"12px",width:"100%",mt:1},variant:"outlined",onClick:()=>Jr(n.inputs[t.name]??t.default??"",n.inputs.selectedLinks,n.inputs.relativeLinksMethod??"webCrawl",parseInt(n.inputs.limit)??0),children:"Manage Links"}),m.jsx(Vi,{show:ne,dialogProps:q,onCancel:()=>Z(!1),onSave:es})]}),t.loadConfig&&n&&n.inputs&&n.inputs[t.name]&&m.jsx(m.Fragment,{children:m.jsx(cd,{data:n,inputParam:t,disabled:r,arrayIndex:c,parentParamForArray:o},`${n.id}_${JSON.stringify(n.inputs[t.name])}_${c}_${o==null?void 0:o.name}`)})]})]}),m.jsx(eu,{show:E==="selectedTool",dialogProps:h,onCancel:()=>C(""),onConfirm:En}),m.jsx(lu,{show:E==="selectedAssistant",dialogProps:h,onCancel:()=>C(""),onConfirm:En}),m.jsx(za,{show:d,dialogProps:w,onCancel:()=>y(!1),onConfirm:(F,Y)=>rs(F,Y),onInputHintDialogClicked:lt}),m.jsx(dd,{show:x,dialogProps:$,onCancel:()=>A(!1),onConfirm:(F,Y)=>ss(F,Y),onInputHintDialogClicked:lt}),m.jsx(ud,{show:be,dialogProps:se,onCancel:()=>{ge(!1),l(!1)},onConfirm:(F,Y,ee)=>is(F,Y,ee)}),m.jsx(hd,{show:oe,dialogProps:Me,onCancel:()=>pe(!1)}),m.jsx(gd,{open:U,onClose:()=>He(!1),onComplete:cs}),m.jsxs(gt,{open:qe,onClose:()=>{Ae(!1),ce({})},"aria-labelledby":"model-selection-dialog-title",maxWidth:"sm",fullWidth:!0,children:[m.jsx(Ot,{id:"model-selection-dialog-title",children:"Select Model"}),m.jsx(mt,{children:m.jsxs(Ie,{sx:{mt:2},children:[m.jsx(Ie,{sx:{px:2},children:m.jsx(Ps,{name:"chatModel",options:K??[],onSelect:F=>{if(!F)ce({});else{const Y=Ge.find(ee=>ee.name===F);if(Y){const ee=`${Y.name}_0`,J=ot.cloneDeep(Y),ye=va(J,ee);ce(ye)}}},value:(te==null?void 0:te.name)??"choose an option"})}),te&&Object.keys(te).length>0&&m.jsx(Ie,{sx:{mt:2},children:(te.inputParams??[]).filter(F=>!F.hidden).map((F,Y)=>m.jsx(Ki,{inputParam:F,data:te},Y))})]})}),m.jsxs(Dt,{children:[m.jsx(de,{onClick:()=>{Ae(!1),ce({})},children:"Cancel"}),m.jsx(de,{disabled:!te||Object.keys(te).length===0,onClick:async()=>{Ae(!1),ue&&await ue(te),ce({})},variant:"contained",children:"Confirm"})]})]}),m.jsx(md,{show:_t,dialogProps:Qe,onCancel:()=>Ke(!1),onConfirm:F=>{try{if(t!=null&&t.acceptVariable&&window.location.href.includes("v2/agentcanvas")){const Y=O0.makeHtml(F);n.inputs[t.name]=Y}else n.inputs[t.name]=F;Ke(!1)}catch{O({message:"Error setting generated instruction",options:{key:new Date().getTime()+Math.random(),variant:"error",persist:!0,action:ee=>m.jsx(de,{style:{color:"white"},onClick:()=>P(ee),children:m.jsx(ft,{})})}})}}}),Xe&&m.jsx(Na,{open:Xe})]})};Yn.propTypes={inputAnchor:X.object,inputParam:X.object,data:X.object,disabled:X.bool,isAdditionalParams:X.bool,disablePadding:X.bool,parentParamForArray:X.object,arrayIndex:X.number,onCustomDataChange:X.func,onHideNodeInfoDialog:X.func};const Gi=({inputParam:e,data:t,disabled:n,isDocStore:r=!1})=>{const[s,a]=I.useState([]),[o,c]=I.useState([]),l=oi(),u=Wt(k=>k.customization),p=I.useContext(Fr),{reactFlowInstance:g}=p||{},b=({inputParam:k,newValue:O},P)=>{let i=ot.cloneDeep(t);const f=[...s],d={...f[P]};for(let w=0;w<e.array.length;w+=1){const v=e.array[w];(v.show||v.hide)&&(d[v.name]=v.default||"")}d[k.name]=O,f[P]=d,a(f),t.inputs[e.name]=f,i.inputs[e.name]=f;const y=ms(i,"inputParams",ot.cloneDeep(e.array),P);if(y.length){const w=[...o];w[P]=y,c(w)}};I.useEffect(()=>{const k=t.inputs[e.name]||[];a(k);const O=[];for(let P=0;P<k.length;P+=1){const i=ms(t,"inputParams",ot.cloneDeep(e.array),P);i.length&&O.push(i)}c(O)},[t,e]);const _=(k,O,P)=>{if(r||!g||t.name!=="conditionAgentflow"&&t.name!=="conditionAgentAgentflow")return;const i=k.map((y,w)=>({id:`${t.id}-output-${w}`,label:w,name:w,description:`Condition ${w}`}));t.name==="conditionAgentflow"&&i.push({id:`${t.id}-output-${k.length}`,label:k.length,name:k.length,description:"Else"}),t.outputAnchors=i;const d=g.getNodes().map(y=>y.id===t.id?{...y,data:{...y.data,outputAnchors:i}}:y);if(g.setNodes(d),O==="DELETE"){const w=g.getEdges().filter(v=>!(v.sourceHandle&&v.sourceHandle.includes(t.id)&&v.sourceHandle.split("-").pop()===P.toString()));g.setEdges(w)}},T=()=>{let k={};for(const i of e.array)k[i.name]=i.default||"";const O=[...s,k];a(O),t.inputs[e.name]=O;const P=[];for(let i=0;i<O.length;i+=1){const f=ms(t,"inputParams",ot.cloneDeep(e.array),i);f.length&&P.push(f)}c(P),_(O,"ADD")},S=k=>{const O=s.filter((i,f)=>f!==k);a(O),t.inputs[e.name]=O;const P=o.filter((i,f)=>f!==k);c(P),_(O,"DELETE",k)},M=t.name!=="conditionAgentflow"&&t.name!=="conditionAgentAgentflow"||s.length>1;return m.jsxs(m.Fragment,{children:[s.map((k,O)=>{const P={...t,inputs:k,inputParams:o[O]||[]};return m.jsxs(Ie,{sx:{p:2,mt:2,mb:1,border:1,borderColor:l.palette.grey[900]+25,borderRadius:2,position:"relative"},children:[M&&m.jsx(Ve,{title:"Delete",onClick:()=>S(O),sx:{position:"absolute",height:"35px",width:"35px",right:10,top:10,color:u!=null&&u.isDarkMode?l.palette.grey[300]:"inherit","&:hover":{color:"red"}},children:m.jsx(Ca,{})}),m.jsx(xa,{label:`${O}`,size:"small",sx:{position:"absolute",right:M?45:10,top:16}}),o[O].filter(i=>i.display!==!1).map((i,f)=>r?m.jsx(Ki,{disabled:n,inputParam:i,data:P,onNodeDataChange:({inputParam:d,newValue:y})=>{b({inputParam:d,newValue:y},O)}},f):m.jsx(Yn,{disabled:n,inputParam:i,data:P,isAdditionalParams:!0,parentParamForArray:e,arrayIndex:O,onCustomDataChange:({inputParam:d,newValue:y})=>{b({inputParam:d,newValue:y},O)}},f))]},O)}),m.jsxs(de,{fullWidth:!0,size:"small",variant:"outlined",sx:{borderRadius:"16px",mt:2},startIcon:m.jsx(ti,{}),onClick:T,children:["Add ",e.label]})]})};Gi.propTypes={inputParam:X.object.isRequired,data:X.object.isRequired,disabled:X.bool,isDocStore:X.bool};const Ki=({inputParam:e,data:t,disabled:n=!1,onNodeDataChange:r})=>{var y;const s=Wt(w=>w.customization),a=I.useContext(Fr),o=r||(a==null?void 0:a.onNodeDataChange),[c,l]=I.useState(!1),[u,p]=I.useState({}),[g,b]=I.useState(!1),[_,T]=I.useState({}),[S,M]=I.useState(Date.now().toString()),k=({inputParam:w,newValue:v})=>{t.inputs[w.name]=v,["boolean","asyncOptions","asyncMultiOptions","options","multiOptions"].includes(w.type)&&o&&o({nodeId:t.id,inputParam:w,newValue:v})},O=(w,v)=>{p({value:w,inputParam:v,disabled:n,confirmButtonName:"Save",cancelButtonName:"Cancel"}),l(!0)},P=(w,v,x,A)=>{T({url:w,relativeLinksMethod:x,limit:A,selectedLinks:v,confirmButtonName:"Save",cancelButtonName:"Cancel"}),b(!0)},i=(w,v)=>{b(!1),t.inputs.url=w,t.inputs.selectedLinks=v},f=(w,v)=>{l(!1),t.inputs[v]=w},d=()=>{const w=t.inputs.credential||t.inputs[on];return w?{credential:w}:{}};return m.jsxs("div",{children:[e&&m.jsx(m.Fragment,{children:m.jsxs(Ie,{sx:{p:2},children:[m.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[m.jsxs(ze,{children:[e.label,!e.optional&&m.jsx("span",{style:{color:"red"},children:" *"}),e.description&&m.jsx(Bs,{style:{marginLeft:10},title:e.description})]}),m.jsx("div",{style:{flexGrow:1}}),(e.type==="string"&&e.rows||e.type==="code")&&m.jsx(Ve,{size:"small",sx:{height:25,width:25},title:"Expand",color:"primary",onClick:()=>O(t.inputs[e.name]??e.default??"",e),children:m.jsx(Aa,{})})]}),e.warning&&m.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",borderRadius:10,background:"rgb(254,252,191)",padding:10,marginTop:10,marginBottom:10},children:[m.jsx(ci,{size:30,color:"orange"}),m.jsx("span",{style:{color:"rgb(116,66,16)",marginLeft:10},children:e.warning})]}),e.type==="credential"&&m.jsx(Ia,{disabled:n,data:d(),inputParam:e,onSelect:w=>{t.credential=w,t.inputs[on]=w,o&&o({nodeId:t.id,inputParam:e,newValue:w})}},JSON.stringify(e)),e.type==="file"&&m.jsx(Ra,{disabled:n,fileType:e.fileType||"*",onChange:w=>t.inputs[e.name]=w,value:t.inputs[e.name]??e.default??"Choose a file to upload"}),e.type==="boolean"&&m.jsx(Oa,{disabled:n,onChange:w=>k({inputParam:e,newValue:w}),value:t.inputs[e.name]??e.default??!1}),e.type==="datagrid"&&m.jsx(mi,{disabled:n,columns:e.datagrid,hideFooter:!0,rows:t.inputs[e.name]??JSON.stringify(e.default)??[],onChange:w=>t.inputs[e.name]=w}),e.type==="code"&&m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{height:"5px"}}),m.jsx("div",{style:{height:e.rows?"100px":"200px"},children:m.jsx(Da,{disabled:n,value:t.inputs[e.name]??e.default??"",height:e.rows?"100px":"200px",theme:s.isDarkMode?"dark":"light",lang:"js",placeholder:e.placeholder,onValueChange:w=>t.inputs[e.name]=w,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1}})})]}),(e.type==="string"||e.type==="password"||e.type==="number")&&m.jsx(La,{disabled:n,inputParam:e,onChange:w=>t.inputs[e.name]=w,value:t.inputs[e.name]??e.default??"",nodeId:t.id},t.inputs[e.name]),e.type==="json"&&m.jsx(di,{disabled:n,onChange:w=>t.inputs[e.name]=w,value:t.inputs[e.name]??e.default??"",isDarkMode:s.isDarkMode}),e.type==="options"&&m.jsx(Ps,{disabled:n,name:e.name,options:e.options,onSelect:w=>k({inputParam:e,newValue:w}),value:t.inputs[e.name]??e.default??"choose an option"},JSON.stringify(e)),e.type==="multiOptions"&&m.jsx(Ba,{disabled:n,name:e.name,options:e.options,onSelect:w=>k({inputParam:e,newValue:w}),value:t.inputs[e.name]??e.default??"choose an option"},JSON.stringify(e)),(e.type==="asyncOptions"||e.type==="asyncMultiOptions")&&m.jsxs(m.Fragment,{children:[((y=t.inputParams)==null?void 0:y.length)===1&&m.jsx("div",{style:{marginTop:10}}),m.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[m.jsx("div",{style:{flex:1},children:m.jsx(Pa,{disabled:n,name:e.name,nodeData:t,freeSolo:e.freeSolo,multiple:e.type==="asyncMultiOptions",value:t.inputs[e.name]??e.default??"choose an option",onSelect:w=>k({inputParam:e,newValue:w}),onCreateNew:()=>addAsyncOption(e.name),fullWidth:!0},JSON.stringify(e))},S),e.refresh&&m.jsx(Ve,{title:"Refresh",color:"primary",size:"small",onClick:()=>M(Date.now().toString()),children:m.jsx($a,{})})]})]}),e.type==="array"&&m.jsx(Gi,{inputParam:e,data:t,disabled:n,isDocStore:!0}),(t.name==="cheerioWebScraper"||t.name==="puppeteerWebScraper"||t.name==="playwrightWebScraper")&&e.name==="url"&&m.jsxs(m.Fragment,{children:[m.jsx(de,{style:{display:"flex",flexDirection:"row",width:"100%"},disabled:n,sx:{borderRadius:"12px",width:"100%",mt:1},variant:"outlined",onClick:()=>P(t.inputs[e.name]??e.default??"",t.inputs.selectedLinks,t.inputs.relativeLinksMethod??"webCrawl",parseInt(t.inputs.limit)??0),children:"Manage Links"}),m.jsx(Vi,{show:g,dialogProps:_,onCancel:()=>b(!1),onSave:i})]})]})}),m.jsx(za,{show:c,dialogProps:u,onCancel:()=>l(!1),onConfirm:(w,v)=>f(w,v)})]})};Ki.propTypes={inputParam:X.object,data:X.object,disabled:X.bool,onNodeDataChange:X.func};export{md as A,Ki as D,Zh as E,mn as H,zs as I,Yn as N,Wh as P,Rm as R,yu as a,F0 as b,lg as c,Pe as d,Te as e,Hc as f,wc as g,nt as h,Dm as i,re as j,st as k,It as l,ln as m,$0 as n,Ti as o,pt as p,z0 as q,ig as r,We as s,Oe as t,H0 as u,Vg as v,_p as w,gn as x,Vh as z};
