nebula-notebook 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{errorwidget-DQl0VDhF.js → errorwidget-B2XZ3hoa.js} +1 -1
- package/dist/assets/{index-2nV_DRXf.js → index-CV0ZPmTH.js} +1 -1
- package/dist/assets/{index-BElcu9UX.js → index-DqHzn4vg.js} +1 -1
- package/dist/assets/{index-BRnOuVqD.js → index-NfxQwPBq.js} +3 -3
- package/dist/assets/{index-FGb2qbG1.js → index-a9gKLTlv.js} +1 -1
- package/dist/assets/{services-shim-BksFNANN.js → services-shim-D_SeYcB9.js} +1 -1
- package/dist/index.html +1 -1
- package/node-server/dist/fs/fs-service.d.ts +11 -1
- package/node-server/dist/fs/fs-service.js +16 -3
- package/node-server/dist/routes/fs.js +10 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CV0ZPmTH.js","assets/services-shim-D_SeYcB9.js","assets/errorwidget-B2XZ3hoa.js","assets/index-BtWv4MIT.css","assets/index-a9gKLTlv.js","assets/viewlist-uomDf7I7.js","assets/index-DqHzn4vg.js","assets/widgets-X7J3NxEn.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
var v6=Object.defineProperty;var y6=(s,e,t)=>e in s?v6(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var Vu=(s,e,t)=>y6(s,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(i){if(i.ep)return;i.ep=!0;const r=t(i);fetch(i.href,r)}})();var DBe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jx(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function zBe(s){if(Object.prototype.hasOwnProperty.call(s,"__esModule"))return s;var e=s.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(n){var i=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return s[n]}})}),t}var Hv={exports:{}},Kf={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -533,7 +533,7 @@ Error generating stack: `+g.message+`
|
|
|
533
533
|
</html>`;var ey={},$o={};const o8="Á",a8="á",l8="Ă",c8="ă",h8="∾",u8="∿",d8="∾̳",f8="Â",m8="â",p8="´",g8="А",O8="а",x8="Æ",b8="æ",v8="",y8="𝔄",_8="𝔞",w8="À",S8="à",k8="ℵ",C8="ℵ",T8="Α",$8="α",Q8="Ā",E8="ā",R8="⨿",N8="&",A8="&",M8="⩕",j8="⩓",P8="∧",L8="⩜",D8="⩘",z8="⩚",B8="∠",I8="⦤",q8="∠",X8="⦨",U8="⦩",Z8="⦪",W8="⦫",V8="⦬",H8="⦭",F8="⦮",Y8="⦯",G8="∡",K8="∟",J8="⊾",e7="⦝",t7="∢",s7="Å",n7="⍼",i7="Ą",r7="ą",o7="𝔸",a7="𝕒",l7="⩯",c7="≈",h7="⩰",u7="≊",d7="≋",f7="'",m7="",p7="≈",g7="≊",O7="Å",x7="å",b7="𝒜",v7="𝒶",y7="≔",_7="*",w7="≈",S7="≍",k7="Ã",C7="ã",T7="Ä",$7="ä",Q7="∳",E7="⨑",R7="≌",N7="϶",A7="‵",M7="∽",j7="⋍",P7="∖",L7="⫧",D7="⊽",z7="⌅",B7="⌆",I7="⌅",q7="⎵",X7="⎶",U7="≌",Z7="Б",W7="б",V7="„",H7="∵",F7="∵",Y7="∵",G7="⦰",K7="϶",J7="ℬ",eI="ℬ",tI="Β",sI="β",nI="ℶ",iI="≬",rI="𝔅",oI="𝔟",aI="⋂",lI="◯",cI="⋃",hI="⨀",uI="⨁",dI="⨂",fI="⨆",mI="★",pI="▽",gI="△",OI="⨄",xI="⋁",bI="⋀",vI="⤍",yI="⧫",_I="▪",wI="▴",SI="▾",kI="◂",CI="▸",TI="␣",$I="▒",QI="░",EI="▓",RI="█",NI="=⃥",AI="≡⃥",MI="⫭",jI="⌐",PI="𝔹",LI="𝕓",DI="⊥",zI="⊥",BI="⋈",II="⧉",qI="┐",XI="╕",UI="╖",ZI="╗",WI="┌",VI="╒",HI="╓",FI="╔",YI="─",GI="═",KI="┬",JI="╤",eq="╥",tq="╦",sq="┴",nq="╧",iq="╨",rq="╩",oq="⊟",aq="⊞",lq="⊠",cq="┘",hq="╛",uq="╜",dq="╝",fq="└",mq="╘",pq="╙",gq="╚",Oq="│",xq="║",bq="┼",vq="╪",yq="╫",_q="╬",wq="┤",Sq="╡",kq="╢",Cq="╣",Tq="├",$q="╞",Qq="╟",Eq="╠",Rq="‵",Nq="˘",Aq="˘",Mq="¦",jq="𝒷",Pq="ℬ",Lq="⁏",Dq="∽",zq="⋍",Bq="⧅",Iq="\\",qq="⟈",Xq="•",Uq="•",Zq="≎",Wq="⪮",Vq="≏",Hq="≎",Fq="≏",Yq="Ć",Gq="ć",Kq="⩄",Jq="⩉",eX="⩋",tX="∩",sX="⋒",nX="⩇",iX="⩀",rX="ⅅ",oX="∩︀",aX="⁁",lX="ˇ",cX="ℭ",hX="⩍",uX="Č",dX="č",fX="Ç",mX="ç",pX="Ĉ",gX="ĉ",OX="∰",xX="⩌",bX="⩐",vX="Ċ",yX="ċ",_X="¸",wX="¸",SX="⦲",kX="¢",CX="·",TX="·",$X="𝔠",QX="ℭ",EX="Ч",RX="ч",NX="✓",AX="✓",MX="Χ",jX="χ",PX="ˆ",LX="≗",DX="↺",zX="↻",BX="⊛",IX="⊚",qX="⊝",XX="⊙",UX="®",ZX="Ⓢ",WX="⊖",VX="⊕",HX="⊗",FX="○",YX="⧃",GX="≗",KX="⨐",JX="⫯",eU="⧂",tU="∲",sU="”",nU="’",iU="♣",rU="♣",oU=":",aU="∷",lU="⩴",cU="≔",hU="≔",uU=",",dU="@",fU="∁",mU="∘",pU="∁",gU="ℂ",OU="≅",xU="⩭",bU="≡",vU="∮",yU="∯",_U="∮",wU="𝕔",SU="ℂ",kU="∐",CU="∐",TU="©",$U="©",QU="℗",EU="∳",RU="↵",NU="✗",AU="⨯",MU="𝒞",jU="𝒸",PU="⫏",LU="⫑",DU="⫐",zU="⫒",BU="⋯",IU="⤸",qU="⤵",XU="⋞",UU="⋟",ZU="↶",WU="⤽",VU="⩈",HU="⩆",FU="≍",YU="∪",GU="⋓",KU="⩊",JU="⊍",e9="⩅",t9="∪︀",s9="↷",n9="⤼",i9="⋞",r9="⋟",o9="⋎",a9="⋏",l9="¤",c9="↶",h9="↷",u9="⋎",d9="⋏",f9="∲",m9="∱",p9="⌭",g9="†",O9="‡",x9="ℸ",b9="↓",v9="↡",y9="⇓",_9="‐",w9="⫤",S9="⊣",k9="⤏",C9="˝",T9="Ď",$9="ď",Q9="Д",E9="д",R9="‡",N9="⇊",A9="ⅅ",M9="ⅆ",j9="⤑",P9="⩷",L9="°",D9="∇",z9="Δ",B9="δ",I9="⦱",q9="⥿",X9="𝔇",U9="𝔡",Z9="⥥",W9="⇃",V9="⇂",H9="´",F9="˙",Y9="˝",G9="`",K9="˜",J9="⋄",eZ="⋄",tZ="⋄",sZ="♦",nZ="♦",iZ="¨",rZ="ⅆ",oZ="ϝ",aZ="⋲",lZ="÷",cZ="÷",hZ="⋇",uZ="⋇",dZ="Ђ",fZ="ђ",mZ="⌞",pZ="⌍",gZ="$",OZ="𝔻",xZ="𝕕",bZ="¨",vZ="˙",yZ="⃜",_Z="≐",wZ="≑",SZ="≐",kZ="∸",CZ="∔",TZ="⊡",$Z="⌆",QZ="∯",EZ="¨",RZ="⇓",NZ="⇐",AZ="⇔",MZ="⫤",jZ="⟸",PZ="⟺",LZ="⟹",DZ="⇒",zZ="⊨",BZ="⇑",IZ="⇕",qZ="∥",XZ="⤓",UZ="↓",ZZ="↓",WZ="⇓",VZ="⇵",HZ="̑",FZ="⇊",YZ="⇃",GZ="⇂",KZ="⥐",JZ="⥞",eW="⥖",tW="↽",sW="⥟",nW="⥗",iW="⇁",rW="↧",oW="⊤",aW="⤐",lW="⌟",cW="⌌",hW="𝒟",uW="𝒹",dW="Ѕ",fW="ѕ",mW="⧶",pW="Đ",gW="đ",OW="⋱",xW="▿",bW="▾",vW="⇵",yW="⥯",_W="⦦",wW="Џ",SW="џ",kW="⟿",CW="É",TW="é",$W="⩮",QW="Ě",EW="ě",RW="Ê",NW="ê",AW="≖",MW="≕",jW="Э",PW="э",LW="⩷",DW="Ė",zW="ė",BW="≑",IW="ⅇ",qW="≒",XW="𝔈",UW="𝔢",ZW="⪚",WW="È",VW="è",HW="⪖",FW="⪘",YW="⪙",GW="∈",KW="⏧",JW="ℓ",eV="⪕",tV="⪗",sV="Ē",nV="ē",iV="∅",rV="∅",oV="◻",aV="∅",lV="▫",cV=" ",hV=" ",uV=" ",dV="Ŋ",fV="ŋ",mV=" ",pV="Ę",gV="ę",OV="𝔼",xV="𝕖",bV="⋕",vV="⧣",yV="⩱",_V="ε",wV="Ε",SV="ε",kV="ϵ",CV="≖",TV="≕",$V="≂",QV="⪖",EV="⪕",RV="⩵",NV="=",AV="≂",MV="≟",jV="⇌",PV="≡",LV="⩸",DV="⧥",zV="⥱",BV="≓",IV="ℯ",qV="ℰ",XV="≐",UV="⩳",ZV="≂",WV="Η",VV="η",HV="Ð",FV="ð",YV="Ë",GV="ë",KV="€",JV="!",eH="∃",tH="∃",sH="ℰ",nH="ⅇ",iH="ⅇ",rH="≒",oH="Ф",aH="ф",lH="♀",cH="ffi",hH="ff",uH="ffl",dH="𝔉",fH="𝔣",mH="fi",pH="◼",gH="▪",OH="fj",xH="♭",bH="fl",vH="▱",yH="ƒ",_H="𝔽",wH="𝕗",SH="∀",kH="∀",CH="⋔",TH="⫙",$H="ℱ",QH="⨍",EH="½",RH="⅓",NH="¼",AH="⅕",MH="⅙",jH="⅛",PH="⅔",LH="⅖",DH="¾",zH="⅗",BH="⅜",IH="⅘",qH="⅚",XH="⅝",UH="⅞",ZH="⁄",WH="⌢",VH="𝒻",HH="ℱ",FH="ǵ",YH="Γ",GH="γ",KH="Ϝ",JH="ϝ",eF="⪆",tF="Ğ",sF="ğ",nF="Ģ",iF="Ĝ",rF="ĝ",oF="Г",aF="г",lF="Ġ",cF="ġ",hF="≥",uF="≧",dF="⪌",fF="⋛",mF="≥",pF="≧",gF="⩾",OF="⪩",xF="⩾",bF="⪀",vF="⪂",yF="⪄",_F="⋛︀",wF="⪔",SF="𝔊",kF="𝔤",CF="≫",TF="⋙",$F="⋙",QF="ℷ",EF="Ѓ",RF="ѓ",NF="⪥",AF="≷",MF="⪒",jF="⪤",PF="⪊",LF="⪊",DF="⪈",zF="≩",BF="⪈",IF="≩",qF="⋧",XF="𝔾",UF="𝕘",ZF="`",WF="≥",VF="⋛",HF="≧",FF="⪢",YF="≷",GF="⩾",KF="≳",JF="𝒢",eY="ℊ",tY="≳",sY="⪎",nY="⪐",iY="⪧",rY="⩺",oY=">",aY=">",lY="≫",cY="⋗",hY="⦕",uY="⩼",dY="⪆",fY="⥸",mY="⋗",pY="⋛",gY="⪌",OY="≷",xY="≳",bY="≩︀",vY="≩︀",yY="ˇ",_Y=" ",wY="½",SY="ℋ",kY="Ъ",CY="ъ",TY="⥈",$Y="↔",QY="⇔",EY="↭",RY="^",NY="ℏ",AY="Ĥ",MY="ĥ",jY="♥",PY="♥",LY="…",DY="⊹",zY="𝔥",BY="ℌ",IY="ℋ",qY="⤥",XY="⤦",UY="⇿",ZY="∻",WY="↩",VY="↪",HY="𝕙",FY="ℍ",YY="―",GY="─",KY="𝒽",JY="ℋ",eG="ℏ",tG="Ħ",sG="ħ",nG="≎",iG="≏",rG="⁃",oG="‐",aG="Í",lG="í",cG="",hG="Î",uG="î",dG="И",fG="и",mG="İ",pG="Е",gG="е",OG="¡",xG="⇔",bG="𝔦",vG="ℑ",yG="Ì",_G="ì",wG="ⅈ",SG="⨌",kG="∭",CG="⧜",TG="℩",$G="IJ",QG="ij",EG="Ī",RG="ī",NG="ℑ",AG="ⅈ",MG="ℐ",jG="ℑ",PG="ı",LG="ℑ",DG="⊷",zG="Ƶ",BG="⇒",IG="℅",qG="∞",XG="⧝",UG="ı",ZG="⊺",WG="∫",VG="∬",HG="ℤ",FG="∫",YG="⊺",GG="⋂",KG="⨗",JG="⨼",eK="",tK="",sK="Ё",nK="ё",iK="Į",rK="į",oK="𝕀",aK="𝕚",lK="Ι",cK="ι",hK="⨼",uK="¿",dK="𝒾",fK="ℐ",mK="∈",pK="⋵",gK="⋹",OK="⋴",xK="⋳",bK="∈",vK="",yK="Ĩ",_K="ĩ",wK="І",SK="і",kK="Ï",CK="ï",TK="Ĵ",$K="ĵ",QK="Й",EK="й",RK="𝔍",NK="𝔧",AK="ȷ",MK="𝕁",jK="𝕛",PK="𝒥",LK="𝒿",DK="Ј",zK="ј",BK="Є",IK="є",qK="Κ",XK="κ",UK="ϰ",ZK="Ķ",WK="ķ",VK="К",HK="к",FK="𝔎",YK="𝔨",GK="ĸ",KK="Х",JK="х",eJ="Ќ",tJ="ќ",sJ="𝕂",nJ="𝕜",iJ="𝒦",rJ="𝓀",oJ="⇚",aJ="Ĺ",lJ="ĺ",cJ="⦴",hJ="ℒ",uJ="Λ",dJ="λ",fJ="⟨",mJ="⟪",pJ="⦑",gJ="⟨",OJ="⪅",xJ="ℒ",bJ="«",vJ="⇤",yJ="⤟",_J="←",wJ="↞",SJ="⇐",kJ="⤝",CJ="↩",TJ="↫",$J="⤹",QJ="⥳",EJ="↢",RJ="⤙",NJ="⤛",AJ="⪫",MJ="⪭",jJ="⪭︀",PJ="⤌",LJ="⤎",DJ="❲",zJ="{",BJ="[",IJ="⦋",qJ="⦏",XJ="⦍",UJ="Ľ",ZJ="ľ",WJ="Ļ",VJ="ļ",HJ="⌈",FJ="{",YJ="Л",GJ="л",KJ="⤶",JJ="“",eee="„",tee="⥧",see="⥋",nee="↲",iee="≤",ree="≦",oee="⟨",aee="⇤",lee="←",cee="←",hee="⇐",uee="⇆",dee="↢",fee="⌈",mee="⟦",pee="⥡",gee="⥙",Oee="⇃",xee="⌊",bee="↽",vee="↼",yee="⇇",_ee="↔",wee="↔",See="⇔",kee="⇆",Cee="⇋",Tee="↭",$ee="⥎",Qee="↤",Eee="⊣",Ree="⥚",Nee="⋋",Aee="⧏",Mee="⊲",jee="⊴",Pee="⥑",Lee="⥠",Dee="⥘",zee="↿",Bee="⥒",Iee="↼",qee="⪋",Xee="⋚",Uee="≤",Zee="≦",Wee="⩽",Vee="⪨",Hee="⩽",Fee="⩿",Yee="⪁",Gee="⪃",Kee="⋚︀",Jee="⪓",ete="⪅",tte="⋖",ste="⋚",nte="⪋",ite="⋚",rte="≦",ote="≶",ate="≶",lte="⪡",cte="≲",hte="⩽",ute="≲",dte="⥼",fte="⌊",mte="𝔏",pte="𝔩",gte="≶",Ote="⪑",xte="⥢",bte="↽",vte="↼",yte="⥪",_te="▄",wte="Љ",Ste="љ",kte="⇇",Cte="≪",Tte="⋘",$te="⌞",Qte="⇚",Ete="⥫",Rte="◺",Nte="Ŀ",Ate="ŀ",Mte="⎰",jte="⎰",Pte="⪉",Lte="⪉",Dte="⪇",zte="≨",Bte="⪇",Ite="≨",qte="⋦",Xte="⟬",Ute="⇽",Zte="⟦",Wte="⟵",Vte="⟵",Hte="⟸",Fte="⟷",Yte="⟷",Gte="⟺",Kte="⟼",Jte="⟶",ese="⟶",tse="⟹",sse="↫",nse="↬",ise="⦅",rse="𝕃",ose="𝕝",ase="⨭",lse="⨴",cse="∗",hse="_",use="↙",dse="↘",fse="◊",mse="◊",pse="⧫",gse="(",Ose="⦓",xse="⇆",bse="⌟",vse="⇋",yse="⥭",_se="",wse="⊿",Sse="‹",kse="𝓁",Cse="ℒ",Tse="↰",$se="↰",Qse="≲",Ese="⪍",Rse="⪏",Nse="[",Ase="‘",Mse="‚",jse="Ł",Pse="ł",Lse="⪦",Dse="⩹",zse="<",Bse="<",Ise="≪",qse="⋖",Xse="⋋",Use="⋉",Zse="⥶",Wse="⩻",Vse="◃",Hse="⊴",Fse="◂",Yse="⦖",Gse="⥊",Kse="⥦",Jse="≨︀",ene="≨︀",tne="¯",sne="♂",nne="✠",ine="✠",rne="↦",one="↦",ane="↧",lne="↤",cne="↥",hne="▮",une="⨩",dne="М",fne="м",mne="—",pne="∺",gne="∡",One=" ",xne="ℳ",bne="𝔐",vne="𝔪",yne="℧",_ne="µ",wne="*",Sne="⫰",kne="∣",Cne="·",Tne="⊟",$ne="−",Qne="∸",Ene="⨪",Rne="∓",Nne="⫛",Ane="…",Mne="∓",jne="⊧",Pne="𝕄",Lne="𝕞",Dne="∓",zne="𝓂",Bne="ℳ",Ine="∾",qne="Μ",Xne="μ",Une="⊸",Zne="⊸",Wne="∇",Vne="Ń",Hne="ń",Fne="∠⃒",Yne="≉",Gne="⩰̸",Kne="≋̸",Jne="ʼn",eie="≉",tie="♮",sie="ℕ",nie="♮",iie=" ",rie="≎̸",oie="≏̸",aie="⩃",lie="Ň",cie="ň",hie="Ņ",uie="ņ",die="≇",fie="⩭̸",mie="⩂",pie="Н",gie="н",Oie="–",xie="⤤",bie="↗",vie="⇗",yie="↗",_ie="≠",wie="≐̸",Sie="",kie="",Cie="",Tie="",$ie="≢",Qie="⤨",Eie="≂̸",Rie="≫",Nie="≪",Aie=`
|
|
534
534
|
`,Mie="∄",jie="∄",Pie="𝔑",Lie="𝔫",Die="≧̸",zie="≱",Bie="≱",Iie="≧̸",qie="⩾̸",Xie="⩾̸",Uie="⋙̸",Zie="≵",Wie="≫⃒",Vie="≯",Hie="≯",Fie="≫̸",Yie="↮",Gie="⇎",Kie="⫲",Jie="∋",ere="⋼",tre="⋺",sre="∋",nre="Њ",ire="њ",rre="↚",ore="⇍",are="‥",lre="≦̸",cre="≰",hre="↚",ure="⇍",dre="↮",fre="⇎",mre="≰",pre="≦̸",gre="⩽̸",Ore="⩽̸",xre="≮",bre="⋘̸",vre="≴",yre="≪⃒",_re="≮",wre="⋪",Sre="⋬",kre="≪̸",Cre="∤",Tre="",$re=" ",Qre="𝕟",Ere="ℕ",Rre="⫬",Nre="¬",Are="≢",Mre="≭",jre="∦",Pre="∉",Lre="≠",Dre="≂̸",zre="∄",Bre="≯",Ire="≱",qre="≧̸",Xre="≫̸",Ure="≹",Zre="⩾̸",Wre="≵",Vre="≎̸",Hre="≏̸",Fre="∉",Yre="⋵̸",Gre="⋹̸",Kre="∉",Jre="⋷",eoe="⋶",toe="⧏̸",soe="⋪",noe="⋬",ioe="≮",roe="≰",ooe="≸",aoe="≪̸",loe="⩽̸",coe="≴",hoe="⪢̸",uoe="⪡̸",doe="∌",foe="∌",moe="⋾",poe="⋽",goe="⊀",Ooe="⪯̸",xoe="⋠",boe="∌",voe="⧐̸",yoe="⋫",_oe="⋭",woe="⊏̸",Soe="⋢",koe="⊐̸",Coe="⋣",Toe="⊂⃒",$oe="⊈",Qoe="⊁",Eoe="⪰̸",Roe="⋡",Noe="≿̸",Aoe="⊃⃒",Moe="⊉",joe="≁",Poe="≄",Loe="≇",Doe="≉",zoe="∤",Boe="∦",Ioe="∦",qoe="⫽⃥",Xoe="∂̸",Uoe="⨔",Zoe="⊀",Woe="⋠",Voe="⊀",Hoe="⪯̸",Foe="⪯̸",Yoe="⤳̸",Goe="↛",Koe="⇏",Joe="↝̸",eae="↛",tae="⇏",sae="⋫",nae="⋭",iae="⊁",rae="⋡",oae="⪰̸",aae="𝒩",lae="𝓃",cae="∤",hae="∦",uae="≁",dae="≄",fae="≄",mae="∤",pae="∦",gae="⋢",Oae="⋣",xae="⊄",bae="⫅̸",vae="⊈",yae="⊂⃒",_ae="⊈",wae="⫅̸",Sae="⊁",kae="⪰̸",Cae="⊅",Tae="⫆̸",$ae="⊉",Qae="⊃⃒",Eae="⊉",Rae="⫆̸",Nae="≹",Aae="Ñ",Mae="ñ",jae="≸",Pae="⋪",Lae="⋬",Dae="⋫",zae="⋭",Bae="Ν",Iae="ν",qae="#",Xae="№",Uae=" ",Zae="≍⃒",Wae="⊬",Vae="⊭",Hae="⊮",Fae="⊯",Yae="≥⃒",Gae=">⃒",Kae="⤄",Jae="⧞",ele="⤂",tle="≤⃒",sle="<⃒",nle="⊴⃒",ile="⤃",rle="⊵⃒",ole="∼⃒",ale="⤣",lle="↖",cle="⇖",hle="↖",ule="⤧",dle="Ó",fle="ó",mle="⊛",ple="Ô",gle="ô",Ole="⊚",xle="О",ble="о",vle="⊝",yle="Ő",_le="ő",wle="⨸",Sle="⊙",kle="⦼",Cle="Œ",Tle="œ",$le="⦿",Qle="𝔒",Ele="𝔬",Rle="˛",Nle="Ò",Ale="ò",Mle="⧁",jle="⦵",Ple="Ω",Lle="∮",Dle="↺",zle="⦾",Ble="⦻",Ile="‾",qle="⧀",Xle="Ō",Ule="ō",Zle="Ω",Wle="ω",Vle="Ο",Hle="ο",Fle="⦶",Yle="⊖",Gle="𝕆",Kle="𝕠",Jle="⦷",ece="“",tce="‘",sce="⦹",nce="⊕",ice="↻",rce="⩔",oce="∨",ace="⩝",lce="ℴ",cce="ℴ",hce="ª",uce="º",dce="⊶",fce="⩖",mce="⩗",pce="⩛",gce="Ⓢ",Oce="𝒪",xce="ℴ",bce="Ø",vce="ø",yce="⊘",_ce="Õ",wce="õ",Sce="⨶",kce="⨷",Cce="⊗",Tce="Ö",$ce="ö",Qce="⌽",Ece="‾",Rce="⏞",Nce="⎴",Ace="⏜",Mce="¶",jce="∥",Pce="∥",Lce="⫳",Dce="⫽",zce="∂",Bce="∂",Ice="П",qce="п",Xce="%",Uce=".",Zce="‰",Wce="⊥",Vce="‱",Hce="𝔓",Fce="𝔭",Yce="Φ",Gce="φ",Kce="ϕ",Jce="ℳ",ehe="☎",the="Π",she="π",nhe="⋔",ihe="ϖ",rhe="ℏ",ohe="ℎ",ahe="ℏ",lhe="⨣",che="⊞",hhe="⨢",uhe="+",dhe="∔",fhe="⨥",mhe="⩲",phe="±",ghe="±",Ohe="⨦",xhe="⨧",bhe="±",vhe="ℌ",yhe="⨕",_he="𝕡",whe="ℙ",She="£",khe="⪷",Che="⪻",The="≺",$he="≼",Qhe="⪷",Ehe="≺",Rhe="≼",Nhe="≺",Ahe="⪯",Mhe="≼",jhe="≾",Phe="⪯",Lhe="⪹",Dhe="⪵",zhe="⋨",Bhe="⪯",Ihe="⪳",qhe="≾",Xhe="′",Uhe="″",Zhe="ℙ",Whe="⪹",Vhe="⪵",Hhe="⋨",Fhe="∏",Yhe="∏",Ghe="⌮",Khe="⌒",Jhe="⌓",eue="∝",tue="∝",sue="∷",nue="∝",iue="≾",rue="⊰",oue="𝒫",aue="𝓅",lue="Ψ",cue="ψ",hue=" ",uue="𝔔",due="𝔮",fue="⨌",mue="𝕢",pue="ℚ",gue="⁗",Oue="𝒬",xue="𝓆",bue="ℍ",vue="⨖",yue="?",_ue="≟",wue='"',Sue='"',kue="⇛",Cue="∽̱",Tue="Ŕ",$ue="ŕ",Que="√",Eue="⦳",Rue="⟩",Nue="⟫",Aue="⦒",Mue="⦥",jue="⟩",Pue="»",Lue="⥵",Due="⇥",zue="⤠",Bue="⤳",Iue="→",que="↠",Xue="⇒",Uue="⤞",Zue="↪",Wue="↬",Vue="⥅",Hue="⥴",Fue="⤖",Yue="↣",Gue="↝",Kue="⤚",Jue="⤜",ede="∶",tde="ℚ",sde="⤍",nde="⤏",ide="⤐",rde="❳",ode="}",ade="]",lde="⦌",cde="⦎",hde="⦐",ude="Ř",dde="ř",fde="Ŗ",mde="ŗ",pde="⌉",gde="}",Ode="Р",xde="р",bde="⤷",vde="⥩",yde="”",_de="”",wde="↳",Sde="ℜ",kde="ℛ",Cde="ℜ",Tde="ℝ",$de="ℜ",Qde="▭",Ede="®",Rde="®",Nde="∋",Ade="⇋",Mde="⥯",jde="⥽",Pde="⌋",Lde="𝔯",Dde="ℜ",zde="⥤",Bde="⇁",Ide="⇀",qde="⥬",Xde="Ρ",Ude="ρ",Zde="ϱ",Wde="⟩",Vde="⇥",Hde="→",Fde="→",Yde="⇒",Gde="⇄",Kde="↣",Jde="⌉",efe="⟧",tfe="⥝",sfe="⥕",nfe="⇂",ife="⌋",rfe="⇁",ofe="⇀",afe="⇄",lfe="⇌",cfe="⇉",hfe="↝",ufe="↦",dfe="⊢",ffe="⥛",mfe="⋌",pfe="⧐",gfe="⊳",Ofe="⊵",xfe="⥏",bfe="⥜",vfe="⥔",yfe="↾",_fe="⥓",wfe="⇀",Sfe="˚",kfe="≓",Cfe="⇄",Tfe="⇌",$fe="",Qfe="⎱",Efe="⎱",Rfe="⫮",Nfe="⟭",Afe="⇾",Mfe="⟧",jfe="⦆",Pfe="𝕣",Lfe="ℝ",Dfe="⨮",zfe="⨵",Bfe="⥰",Ife=")",qfe="⦔",Xfe="⨒",Ufe="⇉",Zfe="⇛",Wfe="›",Vfe="𝓇",Hfe="ℛ",Ffe="↱",Yfe="↱",Gfe="]",Kfe="’",Jfe="’",eme="⋌",tme="⋊",sme="▹",nme="⊵",ime="▸",rme="⧎",ome="⧴",ame="⥨",lme="℞",cme="Ś",hme="ś",ume="‚",dme="⪸",fme="Š",mme="š",pme="⪼",gme="≻",Ome="≽",xme="⪰",bme="⪴",vme="Ş",yme="ş",_me="Ŝ",wme="ŝ",Sme="⪺",kme="⪶",Cme="⋩",Tme="⨓",$me="≿",Qme="С",Eme="с",Rme="⊡",Nme="⋅",Ame="⩦",Mme="⤥",jme="↘",Pme="⇘",Lme="↘",Dme="§",zme=";",Bme="⤩",Ime="∖",qme="∖",Xme="✶",Ume="𝔖",Zme="𝔰",Wme="⌢",Vme="♯",Hme="Щ",Fme="щ",Yme="Ш",Gme="ш",Kme="↓",Jme="←",epe="∣",tpe="∥",spe="→",npe="↑",ipe="",rpe="Σ",ope="σ",ape="ς",lpe="ς",cpe="∼",hpe="⩪",upe="≃",dpe="≃",fpe="⪞",mpe="⪠",ppe="⪝",gpe="⪟",Ope="≆",xpe="⨤",bpe="⥲",vpe="←",ype="∘",_pe="∖",wpe="⨳",Spe="⧤",kpe="∣",Cpe="⌣",Tpe="⪪",$pe="⪬",Qpe="⪬︀",Epe="Ь",Rpe="ь",Npe="⌿",Ape="⧄",Mpe="/",jpe="𝕊",Ppe="𝕤",Lpe="♠",Dpe="♠",zpe="∥",Bpe="⊓",Ipe="⊓︀",qpe="⊔",Xpe="⊔︀",Upe="√",Zpe="⊏",Wpe="⊑",Vpe="⊏",Hpe="⊑",Fpe="⊐",Ype="⊒",Gpe="⊐",Kpe="⊒",Jpe="□",ege="□",tge="⊓",sge="⊏",nge="⊑",ige="⊐",rge="⊒",oge="⊔",age="▪",lge="□",cge="▪",hge="→",uge="𝒮",dge="𝓈",fge="∖",mge="⌣",pge="⋆",gge="⋆",Oge="☆",xge="★",bge="ϵ",vge="ϕ",yge="¯",_ge="⊂",wge="⋐",Sge="⪽",kge="⫅",Cge="⊆",Tge="⫃",$ge="⫁",Qge="⫋",Ege="⊊",Rge="⪿",Nge="⥹",Age="⊂",Mge="⋐",jge="⊆",Pge="⫅",Lge="⊆",Dge="⊊",zge="⫋",Bge="⫇",Ige="⫕",qge="⫓",Xge="⪸",Uge="≻",Zge="≽",Wge="≻",Vge="⪰",Hge="≽",Fge="≿",Yge="⪰",Gge="⪺",Kge="⪶",Jge="⋩",e0e="≿",t0e="∋",s0e="∑",n0e="∑",i0e="♪",r0e="¹",o0e="²",a0e="³",l0e="⊃",c0e="⋑",h0e="⪾",u0e="⫘",d0e="⫆",f0e="⊇",m0e="⫄",p0e="⊃",g0e="⊇",O0e="⟉",x0e="⫗",b0e="⥻",v0e="⫂",y0e="⫌",_0e="⊋",w0e="⫀",S0e="⊃",k0e="⋑",C0e="⊇",T0e="⫆",$0e="⊋",Q0e="⫌",E0e="⫈",R0e="⫔",N0e="⫖",A0e="⤦",M0e="↙",j0e="⇙",P0e="↙",L0e="⤪",D0e="ß",z0e=" ",B0e="⌖",I0e="Τ",q0e="τ",X0e="⎴",U0e="Ť",Z0e="ť",W0e="Ţ",V0e="ţ",H0e="Т",F0e="т",Y0e="⃛",G0e="⌕",K0e="𝔗",J0e="𝔱",eOe="∴",tOe="∴",sOe="∴",nOe="Θ",iOe="θ",rOe="ϑ",oOe="ϑ",aOe="≈",lOe="∼",cOe=" ",hOe=" ",uOe=" ",dOe="≈",fOe="∼",mOe="Þ",pOe="þ",gOe="˜",OOe="∼",xOe="≃",bOe="≅",vOe="≈",yOe="⨱",_Oe="⊠",wOe="×",SOe="⨰",kOe="∭",COe="⤨",TOe="⌶",$Oe="⫱",QOe="⊤",EOe="𝕋",ROe="𝕥",NOe="⫚",AOe="⤩",MOe="‴",jOe="™",POe="™",LOe="▵",DOe="▿",zOe="◃",BOe="⊴",IOe="≜",qOe="▹",XOe="⊵",UOe="◬",ZOe="≜",WOe="⨺",VOe="⃛",HOe="⨹",FOe="⧍",YOe="⨻",GOe="⏢",KOe="𝒯",JOe="𝓉",exe="Ц",txe="ц",sxe="Ћ",nxe="ћ",ixe="Ŧ",rxe="ŧ",oxe="≬",axe="↞",lxe="↠",cxe="Ú",hxe="ú",uxe="↑",dxe="↟",fxe="⇑",mxe="⥉",pxe="Ў",gxe="ў",Oxe="Ŭ",xxe="ŭ",bxe="Û",vxe="û",yxe="У",_xe="у",wxe="⇅",Sxe="Ű",kxe="ű",Cxe="⥮",Txe="⥾",$xe="𝔘",Qxe="𝔲",Exe="Ù",Rxe="ù",Nxe="⥣",Axe="↿",Mxe="↾",jxe="▀",Pxe="⌜",Lxe="⌜",Dxe="⌏",zxe="◸",Bxe="Ū",Ixe="ū",qxe="¨",Xxe="_",Uxe="⏟",Zxe="⎵",Wxe="⏝",Vxe="⋃",Hxe="⊎",Fxe="Ų",Yxe="ų",Gxe="𝕌",Kxe="𝕦",Jxe="⤒",ebe="↑",tbe="↑",sbe="⇑",nbe="⇅",ibe="↕",rbe="↕",obe="⇕",abe="⥮",lbe="↿",cbe="↾",hbe="⊎",ube="↖",dbe="↗",fbe="υ",mbe="ϒ",pbe="ϒ",gbe="Υ",Obe="υ",xbe="↥",bbe="⊥",vbe="⇈",ybe="⌝",_be="⌝",wbe="⌎",Sbe="Ů",kbe="ů",Cbe="◹",Tbe="𝒰",$be="𝓊",Qbe="⋰",Ebe="Ũ",Rbe="ũ",Nbe="▵",Abe="▴",Mbe="⇈",jbe="Ü",Pbe="ü",Lbe="⦧",Dbe="⦜",zbe="ϵ",Bbe="ϰ",Ibe="∅",qbe="ϕ",Xbe="ϖ",Ube="∝",Zbe="↕",Wbe="⇕",Vbe="ϱ",Hbe="ς",Fbe="⊊︀",Ybe="⫋︀",Gbe="⊋︀",Kbe="⫌︀",Jbe="ϑ",eve="⊲",tve="⊳",sve="⫨",nve="⫫",ive="⫩",rve="В",ove="в",ave="⊢",lve="⊨",cve="⊩",hve="⊫",uve="⫦",dve="⊻",fve="∨",mve="⋁",pve="≚",gve="⋮",Ove="|",xve="‖",bve="|",vve="‖",yve="∣",_ve="|",wve="❘",Sve="≀",kve=" ",Cve="𝔙",Tve="𝔳",$ve="⊲",Qve="⊂⃒",Eve="⊃⃒",Rve="𝕍",Nve="𝕧",Ave="∝",Mve="⊳",jve="𝒱",Pve="𝓋",Lve="⫋︀",Dve="⊊︀",zve="⫌︀",Bve="⊋︀",Ive="⊪",qve="⦚",Xve="Ŵ",Uve="ŵ",Zve="⩟",Wve="∧",Vve="⋀",Hve="≙",Fve="℘",Yve="𝔚",Gve="𝔴",Kve="𝕎",Jve="𝕨",eye="℘",tye="≀",sye="≀",nye="𝒲",iye="𝓌",rye="⋂",oye="◯",aye="⋃",lye="▽",cye="𝔛",hye="𝔵",uye="⟷",dye="⟺",fye="Ξ",mye="ξ",pye="⟵",gye="⟸",Oye="⟼",xye="⋻",bye="⨀",vye="𝕏",yye="𝕩",_ye="⨁",wye="⨂",Sye="⟶",kye="⟹",Cye="𝒳",Tye="𝓍",$ye="⨆",Qye="⨄",Eye="△",Rye="⋁",Nye="⋀",Aye="Ý",Mye="ý",jye="Я",Pye="я",Lye="Ŷ",Dye="ŷ",zye="Ы",Bye="ы",Iye="¥",qye="𝔜",Xye="𝔶",Uye="Ї",Zye="ї",Wye="𝕐",Vye="𝕪",Hye="𝒴",Fye="𝓎",Yye="Ю",Gye="ю",Kye="ÿ",Jye="Ÿ",e1e="Ź",t1e="ź",s1e="Ž",n1e="ž",i1e="З",r1e="з",o1e="Ż",a1e="ż",l1e="ℨ",c1e="",h1e="Ζ",u1e="ζ",d1e="𝔷",f1e="ℨ",m1e="Ж",p1e="ж",g1e="⇝",O1e="𝕫",x1e="ℤ",b1e="𝒵",v1e="𝓏",y1e="",_1e="",YN={Aacute:o8,aacute:a8,Abreve:l8,abreve:c8,ac:h8,acd:u8,acE:d8,Acirc:f8,acirc:m8,acute:p8,Acy:g8,acy:O8,AElig:x8,aelig:b8,af:v8,Afr:y8,afr:_8,Agrave:w8,agrave:S8,alefsym:k8,aleph:C8,Alpha:T8,alpha:$8,Amacr:Q8,amacr:E8,amalg:R8,amp:N8,AMP:A8,andand:M8,And:j8,and:P8,andd:L8,andslope:D8,andv:z8,ang:B8,ange:I8,angle:q8,angmsdaa:X8,angmsdab:U8,angmsdac:Z8,angmsdad:W8,angmsdae:V8,angmsdaf:H8,angmsdag:F8,angmsdah:Y8,angmsd:G8,angrt:K8,angrtvb:J8,angrtvbd:e7,angsph:t7,angst:s7,angzarr:n7,Aogon:i7,aogon:r7,Aopf:o7,aopf:a7,apacir:l7,ap:c7,apE:h7,ape:u7,apid:d7,apos:f7,ApplyFunction:m7,approx:p7,approxeq:g7,Aring:O7,aring:x7,Ascr:b7,ascr:v7,Assign:y7,ast:_7,asymp:w7,asympeq:S7,Atilde:k7,atilde:C7,Auml:T7,auml:$7,awconint:Q7,awint:E7,backcong:R7,backepsilon:N7,backprime:A7,backsim:M7,backsimeq:j7,Backslash:P7,Barv:L7,barvee:D7,barwed:z7,Barwed:B7,barwedge:I7,bbrk:q7,bbrktbrk:X7,bcong:U7,Bcy:Z7,bcy:W7,bdquo:V7,becaus:H7,because:F7,Because:Y7,bemptyv:G7,bepsi:K7,bernou:J7,Bernoullis:eI,Beta:tI,beta:sI,beth:nI,between:iI,Bfr:rI,bfr:oI,bigcap:aI,bigcirc:lI,bigcup:cI,bigodot:hI,bigoplus:uI,bigotimes:dI,bigsqcup:fI,bigstar:mI,bigtriangledown:pI,bigtriangleup:gI,biguplus:OI,bigvee:xI,bigwedge:bI,bkarow:vI,blacklozenge:yI,blacksquare:_I,blacktriangle:wI,blacktriangledown:SI,blacktriangleleft:kI,blacktriangleright:CI,blank:TI,blk12:$I,blk14:QI,blk34:EI,block:RI,bne:NI,bnequiv:AI,bNot:MI,bnot:jI,Bopf:PI,bopf:LI,bot:DI,bottom:zI,bowtie:BI,boxbox:II,boxdl:qI,boxdL:XI,boxDl:UI,boxDL:ZI,boxdr:WI,boxdR:VI,boxDr:HI,boxDR:FI,boxh:YI,boxH:GI,boxhd:KI,boxHd:JI,boxhD:eq,boxHD:tq,boxhu:sq,boxHu:nq,boxhU:iq,boxHU:rq,boxminus:oq,boxplus:aq,boxtimes:lq,boxul:cq,boxuL:hq,boxUl:uq,boxUL:dq,boxur:fq,boxuR:mq,boxUr:pq,boxUR:gq,boxv:Oq,boxV:xq,boxvh:bq,boxvH:vq,boxVh:yq,boxVH:_q,boxvl:wq,boxvL:Sq,boxVl:kq,boxVL:Cq,boxvr:Tq,boxvR:$q,boxVr:Qq,boxVR:Eq,bprime:Rq,breve:Nq,Breve:Aq,brvbar:Mq,bscr:jq,Bscr:Pq,bsemi:Lq,bsim:Dq,bsime:zq,bsolb:Bq,bsol:Iq,bsolhsub:qq,bull:Xq,bullet:Uq,bump:Zq,bumpE:Wq,bumpe:Vq,Bumpeq:Hq,bumpeq:Fq,Cacute:Yq,cacute:Gq,capand:Kq,capbrcup:Jq,capcap:eX,cap:tX,Cap:sX,capcup:nX,capdot:iX,CapitalDifferentialD:rX,caps:oX,caret:aX,caron:lX,Cayleys:cX,ccaps:hX,Ccaron:uX,ccaron:dX,Ccedil:fX,ccedil:mX,Ccirc:pX,ccirc:gX,Cconint:OX,ccups:xX,ccupssm:bX,Cdot:vX,cdot:yX,cedil:_X,Cedilla:wX,cemptyv:SX,cent:kX,centerdot:CX,CenterDot:TX,cfr:$X,Cfr:QX,CHcy:EX,chcy:RX,check:NX,checkmark:AX,Chi:MX,chi:jX,circ:PX,circeq:LX,circlearrowleft:DX,circlearrowright:zX,circledast:BX,circledcirc:IX,circleddash:qX,CircleDot:XX,circledR:UX,circledS:ZX,CircleMinus:WX,CirclePlus:VX,CircleTimes:HX,cir:FX,cirE:YX,cire:GX,cirfnint:KX,cirmid:JX,cirscir:eU,ClockwiseContourIntegral:tU,CloseCurlyDoubleQuote:sU,CloseCurlyQuote:nU,clubs:iU,clubsuit:rU,colon:oU,Colon:aU,Colone:lU,colone:cU,coloneq:hU,comma:uU,commat:dU,comp:fU,compfn:mU,complement:pU,complexes:gU,cong:OU,congdot:xU,Congruent:bU,conint:vU,Conint:yU,ContourIntegral:_U,copf:wU,Copf:SU,coprod:kU,Coproduct:CU,copy:TU,COPY:$U,copysr:QU,CounterClockwiseContourIntegral:EU,crarr:RU,cross:NU,Cross:AU,Cscr:MU,cscr:jU,csub:PU,csube:LU,csup:DU,csupe:zU,ctdot:BU,cudarrl:IU,cudarrr:qU,cuepr:XU,cuesc:UU,cularr:ZU,cularrp:WU,cupbrcap:VU,cupcap:HU,CupCap:FU,cup:YU,Cup:GU,cupcup:KU,cupdot:JU,cupor:e9,cups:t9,curarr:s9,curarrm:n9,curlyeqprec:i9,curlyeqsucc:r9,curlyvee:o9,curlywedge:a9,curren:l9,curvearrowleft:c9,curvearrowright:h9,cuvee:u9,cuwed:d9,cwconint:f9,cwint:m9,cylcty:p9,dagger:g9,Dagger:O9,daleth:x9,darr:b9,Darr:v9,dArr:y9,dash:_9,Dashv:w9,dashv:S9,dbkarow:k9,dblac:C9,Dcaron:T9,dcaron:$9,Dcy:Q9,dcy:E9,ddagger:R9,ddarr:N9,DD:A9,dd:M9,DDotrahd:j9,ddotseq:P9,deg:L9,Del:D9,Delta:z9,delta:B9,demptyv:I9,dfisht:q9,Dfr:X9,dfr:U9,dHar:Z9,dharl:W9,dharr:V9,DiacriticalAcute:H9,DiacriticalDot:F9,DiacriticalDoubleAcute:Y9,DiacriticalGrave:G9,DiacriticalTilde:K9,diam:J9,diamond:eZ,Diamond:tZ,diamondsuit:sZ,diams:nZ,die:iZ,DifferentialD:rZ,digamma:oZ,disin:aZ,div:lZ,divide:cZ,divideontimes:hZ,divonx:uZ,DJcy:dZ,djcy:fZ,dlcorn:mZ,dlcrop:pZ,dollar:gZ,Dopf:OZ,dopf:xZ,Dot:bZ,dot:vZ,DotDot:yZ,doteq:_Z,doteqdot:wZ,DotEqual:SZ,dotminus:kZ,dotplus:CZ,dotsquare:TZ,doublebarwedge:$Z,DoubleContourIntegral:QZ,DoubleDot:EZ,DoubleDownArrow:RZ,DoubleLeftArrow:NZ,DoubleLeftRightArrow:AZ,DoubleLeftTee:MZ,DoubleLongLeftArrow:jZ,DoubleLongLeftRightArrow:PZ,DoubleLongRightArrow:LZ,DoubleRightArrow:DZ,DoubleRightTee:zZ,DoubleUpArrow:BZ,DoubleUpDownArrow:IZ,DoubleVerticalBar:qZ,DownArrowBar:XZ,downarrow:UZ,DownArrow:ZZ,Downarrow:WZ,DownArrowUpArrow:VZ,DownBreve:HZ,downdownarrows:FZ,downharpoonleft:YZ,downharpoonright:GZ,DownLeftRightVector:KZ,DownLeftTeeVector:JZ,DownLeftVectorBar:eW,DownLeftVector:tW,DownRightTeeVector:sW,DownRightVectorBar:nW,DownRightVector:iW,DownTeeArrow:rW,DownTee:oW,drbkarow:aW,drcorn:lW,drcrop:cW,Dscr:hW,dscr:uW,DScy:dW,dscy:fW,dsol:mW,Dstrok:pW,dstrok:gW,dtdot:OW,dtri:xW,dtrif:bW,duarr:vW,duhar:yW,dwangle:_W,DZcy:wW,dzcy:SW,dzigrarr:kW,Eacute:CW,eacute:TW,easter:$W,Ecaron:QW,ecaron:EW,Ecirc:RW,ecirc:NW,ecir:AW,ecolon:MW,Ecy:jW,ecy:PW,eDDot:LW,Edot:DW,edot:zW,eDot:BW,ee:IW,efDot:qW,Efr:XW,efr:UW,eg:ZW,Egrave:WW,egrave:VW,egs:HW,egsdot:FW,el:YW,Element:GW,elinters:KW,ell:JW,els:eV,elsdot:tV,Emacr:sV,emacr:nV,empty:iV,emptyset:rV,EmptySmallSquare:oV,emptyv:aV,EmptyVerySmallSquare:lV,emsp13:cV,emsp14:hV,emsp:uV,ENG:dV,eng:fV,ensp:mV,Eogon:pV,eogon:gV,Eopf:OV,eopf:xV,epar:bV,eparsl:vV,eplus:yV,epsi:_V,Epsilon:wV,epsilon:SV,epsiv:kV,eqcirc:CV,eqcolon:TV,eqsim:$V,eqslantgtr:QV,eqslantless:EV,Equal:RV,equals:NV,EqualTilde:AV,equest:MV,Equilibrium:jV,equiv:PV,equivDD:LV,eqvparsl:DV,erarr:zV,erDot:BV,escr:IV,Escr:qV,esdot:XV,Esim:UV,esim:ZV,Eta:WV,eta:VV,ETH:HV,eth:FV,Euml:YV,euml:GV,euro:KV,excl:JV,exist:eH,Exists:tH,expectation:sH,exponentiale:nH,ExponentialE:iH,fallingdotseq:rH,Fcy:oH,fcy:aH,female:lH,ffilig:cH,fflig:hH,ffllig:uH,Ffr:dH,ffr:fH,filig:mH,FilledSmallSquare:pH,FilledVerySmallSquare:gH,fjlig:OH,flat:xH,fllig:bH,fltns:vH,fnof:yH,Fopf:_H,fopf:wH,forall:SH,ForAll:kH,fork:CH,forkv:TH,Fouriertrf:$H,fpartint:QH,frac12:EH,frac13:RH,frac14:NH,frac15:AH,frac16:MH,frac18:jH,frac23:PH,frac25:LH,frac34:DH,frac35:zH,frac38:BH,frac45:IH,frac56:qH,frac58:XH,frac78:UH,frasl:ZH,frown:WH,fscr:VH,Fscr:HH,gacute:FH,Gamma:YH,gamma:GH,Gammad:KH,gammad:JH,gap:eF,Gbreve:tF,gbreve:sF,Gcedil:nF,Gcirc:iF,gcirc:rF,Gcy:oF,gcy:aF,Gdot:lF,gdot:cF,ge:hF,gE:uF,gEl:dF,gel:fF,geq:mF,geqq:pF,geqslant:gF,gescc:OF,ges:xF,gesdot:bF,gesdoto:vF,gesdotol:yF,gesl:_F,gesles:wF,Gfr:SF,gfr:kF,gg:CF,Gg:TF,ggg:$F,gimel:QF,GJcy:EF,gjcy:RF,gla:NF,gl:AF,glE:MF,glj:jF,gnap:PF,gnapprox:LF,gne:DF,gnE:zF,gneq:BF,gneqq:IF,gnsim:qF,Gopf:XF,gopf:UF,grave:ZF,GreaterEqual:WF,GreaterEqualLess:VF,GreaterFullEqual:HF,GreaterGreater:FF,GreaterLess:YF,GreaterSlantEqual:GF,GreaterTilde:KF,Gscr:JF,gscr:eY,gsim:tY,gsime:sY,gsiml:nY,gtcc:iY,gtcir:rY,gt:oY,GT:aY,Gt:lY,gtdot:cY,gtlPar:hY,gtquest:uY,gtrapprox:dY,gtrarr:fY,gtrdot:mY,gtreqless:pY,gtreqqless:gY,gtrless:OY,gtrsim:xY,gvertneqq:bY,gvnE:vY,Hacek:yY,hairsp:_Y,half:wY,hamilt:SY,HARDcy:kY,hardcy:CY,harrcir:TY,harr:$Y,hArr:QY,harrw:EY,Hat:RY,hbar:NY,Hcirc:AY,hcirc:MY,hearts:jY,heartsuit:PY,hellip:LY,hercon:DY,hfr:zY,Hfr:BY,HilbertSpace:IY,hksearow:qY,hkswarow:XY,hoarr:UY,homtht:ZY,hookleftarrow:WY,hookrightarrow:VY,hopf:HY,Hopf:FY,horbar:YY,HorizontalLine:GY,hscr:KY,Hscr:JY,hslash:eG,Hstrok:tG,hstrok:sG,HumpDownHump:nG,HumpEqual:iG,hybull:rG,hyphen:oG,Iacute:aG,iacute:lG,ic:cG,Icirc:hG,icirc:uG,Icy:dG,icy:fG,Idot:mG,IEcy:pG,iecy:gG,iexcl:OG,iff:xG,ifr:bG,Ifr:vG,Igrave:yG,igrave:_G,ii:wG,iiiint:SG,iiint:kG,iinfin:CG,iiota:TG,IJlig:$G,ijlig:QG,Imacr:EG,imacr:RG,image:NG,ImaginaryI:AG,imagline:MG,imagpart:jG,imath:PG,Im:LG,imof:DG,imped:zG,Implies:BG,incare:IG,in:"∈",infin:qG,infintie:XG,inodot:UG,intcal:ZG,int:WG,Int:VG,integers:HG,Integral:FG,intercal:YG,Intersection:GG,intlarhk:KG,intprod:JG,InvisibleComma:eK,InvisibleTimes:tK,IOcy:sK,iocy:nK,Iogon:iK,iogon:rK,Iopf:oK,iopf:aK,Iota:lK,iota:cK,iprod:hK,iquest:uK,iscr:dK,Iscr:fK,isin:mK,isindot:pK,isinE:gK,isins:OK,isinsv:xK,isinv:bK,it:vK,Itilde:yK,itilde:_K,Iukcy:wK,iukcy:SK,Iuml:kK,iuml:CK,Jcirc:TK,jcirc:$K,Jcy:QK,jcy:EK,Jfr:RK,jfr:NK,jmath:AK,Jopf:MK,jopf:jK,Jscr:PK,jscr:LK,Jsercy:DK,jsercy:zK,Jukcy:BK,jukcy:IK,Kappa:qK,kappa:XK,kappav:UK,Kcedil:ZK,kcedil:WK,Kcy:VK,kcy:HK,Kfr:FK,kfr:YK,kgreen:GK,KHcy:KK,khcy:JK,KJcy:eJ,kjcy:tJ,Kopf:sJ,kopf:nJ,Kscr:iJ,kscr:rJ,lAarr:oJ,Lacute:aJ,lacute:lJ,laemptyv:cJ,lagran:hJ,Lambda:uJ,lambda:dJ,lang:fJ,Lang:mJ,langd:pJ,langle:gJ,lap:OJ,Laplacetrf:xJ,laquo:bJ,larrb:vJ,larrbfs:yJ,larr:_J,Larr:wJ,lArr:SJ,larrfs:kJ,larrhk:CJ,larrlp:TJ,larrpl:$J,larrsim:QJ,larrtl:EJ,latail:RJ,lAtail:NJ,lat:AJ,late:MJ,lates:jJ,lbarr:PJ,lBarr:LJ,lbbrk:DJ,lbrace:zJ,lbrack:BJ,lbrke:IJ,lbrksld:qJ,lbrkslu:XJ,Lcaron:UJ,lcaron:ZJ,Lcedil:WJ,lcedil:VJ,lceil:HJ,lcub:FJ,Lcy:YJ,lcy:GJ,ldca:KJ,ldquo:JJ,ldquor:eee,ldrdhar:tee,ldrushar:see,ldsh:nee,le:iee,lE:ree,LeftAngleBracket:oee,LeftArrowBar:aee,leftarrow:lee,LeftArrow:cee,Leftarrow:hee,LeftArrowRightArrow:uee,leftarrowtail:dee,LeftCeiling:fee,LeftDoubleBracket:mee,LeftDownTeeVector:pee,LeftDownVectorBar:gee,LeftDownVector:Oee,LeftFloor:xee,leftharpoondown:bee,leftharpoonup:vee,leftleftarrows:yee,leftrightarrow:_ee,LeftRightArrow:wee,Leftrightarrow:See,leftrightarrows:kee,leftrightharpoons:Cee,leftrightsquigarrow:Tee,LeftRightVector:$ee,LeftTeeArrow:Qee,LeftTee:Eee,LeftTeeVector:Ree,leftthreetimes:Nee,LeftTriangleBar:Aee,LeftTriangle:Mee,LeftTriangleEqual:jee,LeftUpDownVector:Pee,LeftUpTeeVector:Lee,LeftUpVectorBar:Dee,LeftUpVector:zee,LeftVectorBar:Bee,LeftVector:Iee,lEg:qee,leg:Xee,leq:Uee,leqq:Zee,leqslant:Wee,lescc:Vee,les:Hee,lesdot:Fee,lesdoto:Yee,lesdotor:Gee,lesg:Kee,lesges:Jee,lessapprox:ete,lessdot:tte,lesseqgtr:ste,lesseqqgtr:nte,LessEqualGreater:ite,LessFullEqual:rte,LessGreater:ote,lessgtr:ate,LessLess:lte,lesssim:cte,LessSlantEqual:hte,LessTilde:ute,lfisht:dte,lfloor:fte,Lfr:mte,lfr:pte,lg:gte,lgE:Ote,lHar:xte,lhard:bte,lharu:vte,lharul:yte,lhblk:_te,LJcy:wte,ljcy:Ste,llarr:kte,ll:Cte,Ll:Tte,llcorner:$te,Lleftarrow:Qte,llhard:Ete,lltri:Rte,Lmidot:Nte,lmidot:Ate,lmoustache:Mte,lmoust:jte,lnap:Pte,lnapprox:Lte,lne:Dte,lnE:zte,lneq:Bte,lneqq:Ite,lnsim:qte,loang:Xte,loarr:Ute,lobrk:Zte,longleftarrow:Wte,LongLeftArrow:Vte,Longleftarrow:Hte,longleftrightarrow:Fte,LongLeftRightArrow:Yte,Longleftrightarrow:Gte,longmapsto:Kte,longrightarrow:Jte,LongRightArrow:ese,Longrightarrow:tse,looparrowleft:sse,looparrowright:nse,lopar:ise,Lopf:rse,lopf:ose,loplus:ase,lotimes:lse,lowast:cse,lowbar:hse,LowerLeftArrow:use,LowerRightArrow:dse,loz:fse,lozenge:mse,lozf:pse,lpar:gse,lparlt:Ose,lrarr:xse,lrcorner:bse,lrhar:vse,lrhard:yse,lrm:_se,lrtri:wse,lsaquo:Sse,lscr:kse,Lscr:Cse,lsh:Tse,Lsh:$se,lsim:Qse,lsime:Ese,lsimg:Rse,lsqb:Nse,lsquo:Ase,lsquor:Mse,Lstrok:jse,lstrok:Pse,ltcc:Lse,ltcir:Dse,lt:zse,LT:Bse,Lt:Ise,ltdot:qse,lthree:Xse,ltimes:Use,ltlarr:Zse,ltquest:Wse,ltri:Vse,ltrie:Hse,ltrif:Fse,ltrPar:Yse,lurdshar:Gse,luruhar:Kse,lvertneqq:Jse,lvnE:ene,macr:tne,male:sne,malt:nne,maltese:ine,Map:"⤅",map:rne,mapsto:one,mapstodown:ane,mapstoleft:lne,mapstoup:cne,marker:hne,mcomma:une,Mcy:dne,mcy:fne,mdash:mne,mDDot:pne,measuredangle:gne,MediumSpace:One,Mellintrf:xne,Mfr:bne,mfr:vne,mho:yne,micro:_ne,midast:wne,midcir:Sne,mid:kne,middot:Cne,minusb:Tne,minus:$ne,minusd:Qne,minusdu:Ene,MinusPlus:Rne,mlcp:Nne,mldr:Ane,mnplus:Mne,models:jne,Mopf:Pne,mopf:Lne,mp:Dne,mscr:zne,Mscr:Bne,mstpos:Ine,Mu:qne,mu:Xne,multimap:Une,mumap:Zne,nabla:Wne,Nacute:Vne,nacute:Hne,nang:Fne,nap:Yne,napE:Gne,napid:Kne,napos:Jne,napprox:eie,natural:tie,naturals:sie,natur:nie,nbsp:iie,nbump:rie,nbumpe:oie,ncap:aie,Ncaron:lie,ncaron:cie,Ncedil:hie,ncedil:uie,ncong:die,ncongdot:fie,ncup:mie,Ncy:pie,ncy:gie,ndash:Oie,nearhk:xie,nearr:bie,neArr:vie,nearrow:yie,ne:_ie,nedot:wie,NegativeMediumSpace:Sie,NegativeThickSpace:kie,NegativeThinSpace:Cie,NegativeVeryThinSpace:Tie,nequiv:$ie,nesear:Qie,nesim:Eie,NestedGreaterGreater:Rie,NestedLessLess:Nie,NewLine:Aie,nexist:Mie,nexists:jie,Nfr:Pie,nfr:Lie,ngE:Die,nge:zie,ngeq:Bie,ngeqq:Iie,ngeqslant:qie,nges:Xie,nGg:Uie,ngsim:Zie,nGt:Wie,ngt:Vie,ngtr:Hie,nGtv:Fie,nharr:Yie,nhArr:Gie,nhpar:Kie,ni:Jie,nis:ere,nisd:tre,niv:sre,NJcy:nre,njcy:ire,nlarr:rre,nlArr:ore,nldr:are,nlE:lre,nle:cre,nleftarrow:hre,nLeftarrow:ure,nleftrightarrow:dre,nLeftrightarrow:fre,nleq:mre,nleqq:pre,nleqslant:gre,nles:Ore,nless:xre,nLl:bre,nlsim:vre,nLt:yre,nlt:_re,nltri:wre,nltrie:Sre,nLtv:kre,nmid:Cre,NoBreak:Tre,NonBreakingSpace:$re,nopf:Qre,Nopf:Ere,Not:Rre,not:Nre,NotCongruent:Are,NotCupCap:Mre,NotDoubleVerticalBar:jre,NotElement:Pre,NotEqual:Lre,NotEqualTilde:Dre,NotExists:zre,NotGreater:Bre,NotGreaterEqual:Ire,NotGreaterFullEqual:qre,NotGreaterGreater:Xre,NotGreaterLess:Ure,NotGreaterSlantEqual:Zre,NotGreaterTilde:Wre,NotHumpDownHump:Vre,NotHumpEqual:Hre,notin:Fre,notindot:Yre,notinE:Gre,notinva:Kre,notinvb:Jre,notinvc:eoe,NotLeftTriangleBar:toe,NotLeftTriangle:soe,NotLeftTriangleEqual:noe,NotLess:ioe,NotLessEqual:roe,NotLessGreater:ooe,NotLessLess:aoe,NotLessSlantEqual:loe,NotLessTilde:coe,NotNestedGreaterGreater:hoe,NotNestedLessLess:uoe,notni:doe,notniva:foe,notnivb:moe,notnivc:poe,NotPrecedes:goe,NotPrecedesEqual:Ooe,NotPrecedesSlantEqual:xoe,NotReverseElement:boe,NotRightTriangleBar:voe,NotRightTriangle:yoe,NotRightTriangleEqual:_oe,NotSquareSubset:woe,NotSquareSubsetEqual:Soe,NotSquareSuperset:koe,NotSquareSupersetEqual:Coe,NotSubset:Toe,NotSubsetEqual:$oe,NotSucceeds:Qoe,NotSucceedsEqual:Eoe,NotSucceedsSlantEqual:Roe,NotSucceedsTilde:Noe,NotSuperset:Aoe,NotSupersetEqual:Moe,NotTilde:joe,NotTildeEqual:Poe,NotTildeFullEqual:Loe,NotTildeTilde:Doe,NotVerticalBar:zoe,nparallel:Boe,npar:Ioe,nparsl:qoe,npart:Xoe,npolint:Uoe,npr:Zoe,nprcue:Woe,nprec:Voe,npreceq:Hoe,npre:Foe,nrarrc:Yoe,nrarr:Goe,nrArr:Koe,nrarrw:Joe,nrightarrow:eae,nRightarrow:tae,nrtri:sae,nrtrie:nae,nsc:iae,nsccue:rae,nsce:oae,Nscr:aae,nscr:lae,nshortmid:cae,nshortparallel:hae,nsim:uae,nsime:dae,nsimeq:fae,nsmid:mae,nspar:pae,nsqsube:gae,nsqsupe:Oae,nsub:xae,nsubE:bae,nsube:vae,nsubset:yae,nsubseteq:_ae,nsubseteqq:wae,nsucc:Sae,nsucceq:kae,nsup:Cae,nsupE:Tae,nsupe:$ae,nsupset:Qae,nsupseteq:Eae,nsupseteqq:Rae,ntgl:Nae,Ntilde:Aae,ntilde:Mae,ntlg:jae,ntriangleleft:Pae,ntrianglelefteq:Lae,ntriangleright:Dae,ntrianglerighteq:zae,Nu:Bae,nu:Iae,num:qae,numero:Xae,numsp:Uae,nvap:Zae,nvdash:Wae,nvDash:Vae,nVdash:Hae,nVDash:Fae,nvge:Yae,nvgt:Gae,nvHarr:Kae,nvinfin:Jae,nvlArr:ele,nvle:tle,nvlt:sle,nvltrie:nle,nvrArr:ile,nvrtrie:rle,nvsim:ole,nwarhk:ale,nwarr:lle,nwArr:cle,nwarrow:hle,nwnear:ule,Oacute:dle,oacute:fle,oast:mle,Ocirc:ple,ocirc:gle,ocir:Ole,Ocy:xle,ocy:ble,odash:vle,Odblac:yle,odblac:_le,odiv:wle,odot:Sle,odsold:kle,OElig:Cle,oelig:Tle,ofcir:$le,Ofr:Qle,ofr:Ele,ogon:Rle,Ograve:Nle,ograve:Ale,ogt:Mle,ohbar:jle,ohm:Ple,oint:Lle,olarr:Dle,olcir:zle,olcross:Ble,oline:Ile,olt:qle,Omacr:Xle,omacr:Ule,Omega:Zle,omega:Wle,Omicron:Vle,omicron:Hle,omid:Fle,ominus:Yle,Oopf:Gle,oopf:Kle,opar:Jle,OpenCurlyDoubleQuote:ece,OpenCurlyQuote:tce,operp:sce,oplus:nce,orarr:ice,Or:rce,or:oce,ord:ace,order:lce,orderof:cce,ordf:hce,ordm:uce,origof:dce,oror:fce,orslope:mce,orv:pce,oS:gce,Oscr:Oce,oscr:xce,Oslash:bce,oslash:vce,osol:yce,Otilde:_ce,otilde:wce,otimesas:Sce,Otimes:kce,otimes:Cce,Ouml:Tce,ouml:$ce,ovbar:Qce,OverBar:Ece,OverBrace:Rce,OverBracket:Nce,OverParenthesis:Ace,para:Mce,parallel:jce,par:Pce,parsim:Lce,parsl:Dce,part:zce,PartialD:Bce,Pcy:Ice,pcy:qce,percnt:Xce,period:Uce,permil:Zce,perp:Wce,pertenk:Vce,Pfr:Hce,pfr:Fce,Phi:Yce,phi:Gce,phiv:Kce,phmmat:Jce,phone:ehe,Pi:the,pi:she,pitchfork:nhe,piv:ihe,planck:rhe,planckh:ohe,plankv:ahe,plusacir:lhe,plusb:che,pluscir:hhe,plus:uhe,plusdo:dhe,plusdu:fhe,pluse:mhe,PlusMinus:phe,plusmn:ghe,plussim:Ohe,plustwo:xhe,pm:bhe,Poincareplane:vhe,pointint:yhe,popf:_he,Popf:whe,pound:She,prap:khe,Pr:Che,pr:The,prcue:$he,precapprox:Qhe,prec:Ehe,preccurlyeq:Rhe,Precedes:Nhe,PrecedesEqual:Ahe,PrecedesSlantEqual:Mhe,PrecedesTilde:jhe,preceq:Phe,precnapprox:Lhe,precneqq:Dhe,precnsim:zhe,pre:Bhe,prE:Ihe,precsim:qhe,prime:Xhe,Prime:Uhe,primes:Zhe,prnap:Whe,prnE:Vhe,prnsim:Hhe,prod:Fhe,Product:Yhe,profalar:Ghe,profline:Khe,profsurf:Jhe,prop:eue,Proportional:tue,Proportion:sue,propto:nue,prsim:iue,prurel:rue,Pscr:oue,pscr:aue,Psi:lue,psi:cue,puncsp:hue,Qfr:uue,qfr:due,qint:fue,qopf:mue,Qopf:pue,qprime:gue,Qscr:Oue,qscr:xue,quaternions:bue,quatint:vue,quest:yue,questeq:_ue,quot:wue,QUOT:Sue,rAarr:kue,race:Cue,Racute:Tue,racute:$ue,radic:Que,raemptyv:Eue,rang:Rue,Rang:Nue,rangd:Aue,range:Mue,rangle:jue,raquo:Pue,rarrap:Lue,rarrb:Due,rarrbfs:zue,rarrc:Bue,rarr:Iue,Rarr:que,rArr:Xue,rarrfs:Uue,rarrhk:Zue,rarrlp:Wue,rarrpl:Vue,rarrsim:Hue,Rarrtl:Fue,rarrtl:Yue,rarrw:Gue,ratail:Kue,rAtail:Jue,ratio:ede,rationals:tde,rbarr:sde,rBarr:nde,RBarr:ide,rbbrk:rde,rbrace:ode,rbrack:ade,rbrke:lde,rbrksld:cde,rbrkslu:hde,Rcaron:ude,rcaron:dde,Rcedil:fde,rcedil:mde,rceil:pde,rcub:gde,Rcy:Ode,rcy:xde,rdca:bde,rdldhar:vde,rdquo:yde,rdquor:_de,rdsh:wde,real:Sde,realine:kde,realpart:Cde,reals:Tde,Re:$de,rect:Qde,reg:Ede,REG:Rde,ReverseElement:Nde,ReverseEquilibrium:Ade,ReverseUpEquilibrium:Mde,rfisht:jde,rfloor:Pde,rfr:Lde,Rfr:Dde,rHar:zde,rhard:Bde,rharu:Ide,rharul:qde,Rho:Xde,rho:Ude,rhov:Zde,RightAngleBracket:Wde,RightArrowBar:Vde,rightarrow:Hde,RightArrow:Fde,Rightarrow:Yde,RightArrowLeftArrow:Gde,rightarrowtail:Kde,RightCeiling:Jde,RightDoubleBracket:efe,RightDownTeeVector:tfe,RightDownVectorBar:sfe,RightDownVector:nfe,RightFloor:ife,rightharpoondown:rfe,rightharpoonup:ofe,rightleftarrows:afe,rightleftharpoons:lfe,rightrightarrows:cfe,rightsquigarrow:hfe,RightTeeArrow:ufe,RightTee:dfe,RightTeeVector:ffe,rightthreetimes:mfe,RightTriangleBar:pfe,RightTriangle:gfe,RightTriangleEqual:Ofe,RightUpDownVector:xfe,RightUpTeeVector:bfe,RightUpVectorBar:vfe,RightUpVector:yfe,RightVectorBar:_fe,RightVector:wfe,ring:Sfe,risingdotseq:kfe,rlarr:Cfe,rlhar:Tfe,rlm:$fe,rmoustache:Qfe,rmoust:Efe,rnmid:Rfe,roang:Nfe,roarr:Afe,robrk:Mfe,ropar:jfe,ropf:Pfe,Ropf:Lfe,roplus:Dfe,rotimes:zfe,RoundImplies:Bfe,rpar:Ife,rpargt:qfe,rppolint:Xfe,rrarr:Ufe,Rrightarrow:Zfe,rsaquo:Wfe,rscr:Vfe,Rscr:Hfe,rsh:Ffe,Rsh:Yfe,rsqb:Gfe,rsquo:Kfe,rsquor:Jfe,rthree:eme,rtimes:tme,rtri:sme,rtrie:nme,rtrif:ime,rtriltri:rme,RuleDelayed:ome,ruluhar:ame,rx:lme,Sacute:cme,sacute:hme,sbquo:ume,scap:dme,Scaron:fme,scaron:mme,Sc:pme,sc:gme,sccue:Ome,sce:xme,scE:bme,Scedil:vme,scedil:yme,Scirc:_me,scirc:wme,scnap:Sme,scnE:kme,scnsim:Cme,scpolint:Tme,scsim:$me,Scy:Qme,scy:Eme,sdotb:Rme,sdot:Nme,sdote:Ame,searhk:Mme,searr:jme,seArr:Pme,searrow:Lme,sect:Dme,semi:zme,seswar:Bme,setminus:Ime,setmn:qme,sext:Xme,Sfr:Ume,sfr:Zme,sfrown:Wme,sharp:Vme,SHCHcy:Hme,shchcy:Fme,SHcy:Yme,shcy:Gme,ShortDownArrow:Kme,ShortLeftArrow:Jme,shortmid:epe,shortparallel:tpe,ShortRightArrow:spe,ShortUpArrow:npe,shy:ipe,Sigma:rpe,sigma:ope,sigmaf:ape,sigmav:lpe,sim:cpe,simdot:hpe,sime:upe,simeq:dpe,simg:fpe,simgE:mpe,siml:ppe,simlE:gpe,simne:Ope,simplus:xpe,simrarr:bpe,slarr:vpe,SmallCircle:ype,smallsetminus:_pe,smashp:wpe,smeparsl:Spe,smid:kpe,smile:Cpe,smt:Tpe,smte:$pe,smtes:Qpe,SOFTcy:Epe,softcy:Rpe,solbar:Npe,solb:Ape,sol:Mpe,Sopf:jpe,sopf:Ppe,spades:Lpe,spadesuit:Dpe,spar:zpe,sqcap:Bpe,sqcaps:Ipe,sqcup:qpe,sqcups:Xpe,Sqrt:Upe,sqsub:Zpe,sqsube:Wpe,sqsubset:Vpe,sqsubseteq:Hpe,sqsup:Fpe,sqsupe:Ype,sqsupset:Gpe,sqsupseteq:Kpe,square:Jpe,Square:ege,SquareIntersection:tge,SquareSubset:sge,SquareSubsetEqual:nge,SquareSuperset:ige,SquareSupersetEqual:rge,SquareUnion:oge,squarf:age,squ:lge,squf:cge,srarr:hge,Sscr:uge,sscr:dge,ssetmn:fge,ssmile:mge,sstarf:pge,Star:gge,star:Oge,starf:xge,straightepsilon:bge,straightphi:vge,strns:yge,sub:_ge,Sub:wge,subdot:Sge,subE:kge,sube:Cge,subedot:Tge,submult:$ge,subnE:Qge,subne:Ege,subplus:Rge,subrarr:Nge,subset:Age,Subset:Mge,subseteq:jge,subseteqq:Pge,SubsetEqual:Lge,subsetneq:Dge,subsetneqq:zge,subsim:Bge,subsub:Ige,subsup:qge,succapprox:Xge,succ:Uge,succcurlyeq:Zge,Succeeds:Wge,SucceedsEqual:Vge,SucceedsSlantEqual:Hge,SucceedsTilde:Fge,succeq:Yge,succnapprox:Gge,succneqq:Kge,succnsim:Jge,succsim:e0e,SuchThat:t0e,sum:s0e,Sum:n0e,sung:i0e,sup1:r0e,sup2:o0e,sup3:a0e,sup:l0e,Sup:c0e,supdot:h0e,supdsub:u0e,supE:d0e,supe:f0e,supedot:m0e,Superset:p0e,SupersetEqual:g0e,suphsol:O0e,suphsub:x0e,suplarr:b0e,supmult:v0e,supnE:y0e,supne:_0e,supplus:w0e,supset:S0e,Supset:k0e,supseteq:C0e,supseteqq:T0e,supsetneq:$0e,supsetneqq:Q0e,supsim:E0e,supsub:R0e,supsup:N0e,swarhk:A0e,swarr:M0e,swArr:j0e,swarrow:P0e,swnwar:L0e,szlig:D0e,Tab:z0e,target:B0e,Tau:I0e,tau:q0e,tbrk:X0e,Tcaron:U0e,tcaron:Z0e,Tcedil:W0e,tcedil:V0e,Tcy:H0e,tcy:F0e,tdot:Y0e,telrec:G0e,Tfr:K0e,tfr:J0e,there4:eOe,therefore:tOe,Therefore:sOe,Theta:nOe,theta:iOe,thetasym:rOe,thetav:oOe,thickapprox:aOe,thicksim:lOe,ThickSpace:cOe,ThinSpace:hOe,thinsp:uOe,thkap:dOe,thksim:fOe,THORN:mOe,thorn:pOe,tilde:gOe,Tilde:OOe,TildeEqual:xOe,TildeFullEqual:bOe,TildeTilde:vOe,timesbar:yOe,timesb:_Oe,times:wOe,timesd:SOe,tint:kOe,toea:COe,topbot:TOe,topcir:$Oe,top:QOe,Topf:EOe,topf:ROe,topfork:NOe,tosa:AOe,tprime:MOe,trade:jOe,TRADE:POe,triangle:LOe,triangledown:DOe,triangleleft:zOe,trianglelefteq:BOe,triangleq:IOe,triangleright:qOe,trianglerighteq:XOe,tridot:UOe,trie:ZOe,triminus:WOe,TripleDot:VOe,triplus:HOe,trisb:FOe,tritime:YOe,trpezium:GOe,Tscr:KOe,tscr:JOe,TScy:exe,tscy:txe,TSHcy:sxe,tshcy:nxe,Tstrok:ixe,tstrok:rxe,twixt:oxe,twoheadleftarrow:axe,twoheadrightarrow:lxe,Uacute:cxe,uacute:hxe,uarr:uxe,Uarr:dxe,uArr:fxe,Uarrocir:mxe,Ubrcy:pxe,ubrcy:gxe,Ubreve:Oxe,ubreve:xxe,Ucirc:bxe,ucirc:vxe,Ucy:yxe,ucy:_xe,udarr:wxe,Udblac:Sxe,udblac:kxe,udhar:Cxe,ufisht:Txe,Ufr:$xe,ufr:Qxe,Ugrave:Exe,ugrave:Rxe,uHar:Nxe,uharl:Axe,uharr:Mxe,uhblk:jxe,ulcorn:Pxe,ulcorner:Lxe,ulcrop:Dxe,ultri:zxe,Umacr:Bxe,umacr:Ixe,uml:qxe,UnderBar:Xxe,UnderBrace:Uxe,UnderBracket:Zxe,UnderParenthesis:Wxe,Union:Vxe,UnionPlus:Hxe,Uogon:Fxe,uogon:Yxe,Uopf:Gxe,uopf:Kxe,UpArrowBar:Jxe,uparrow:ebe,UpArrow:tbe,Uparrow:sbe,UpArrowDownArrow:nbe,updownarrow:ibe,UpDownArrow:rbe,Updownarrow:obe,UpEquilibrium:abe,upharpoonleft:lbe,upharpoonright:cbe,uplus:hbe,UpperLeftArrow:ube,UpperRightArrow:dbe,upsi:fbe,Upsi:mbe,upsih:pbe,Upsilon:gbe,upsilon:Obe,UpTeeArrow:xbe,UpTee:bbe,upuparrows:vbe,urcorn:ybe,urcorner:_be,urcrop:wbe,Uring:Sbe,uring:kbe,urtri:Cbe,Uscr:Tbe,uscr:$be,utdot:Qbe,Utilde:Ebe,utilde:Rbe,utri:Nbe,utrif:Abe,uuarr:Mbe,Uuml:jbe,uuml:Pbe,uwangle:Lbe,vangrt:Dbe,varepsilon:zbe,varkappa:Bbe,varnothing:Ibe,varphi:qbe,varpi:Xbe,varpropto:Ube,varr:Zbe,vArr:Wbe,varrho:Vbe,varsigma:Hbe,varsubsetneq:Fbe,varsubsetneqq:Ybe,varsupsetneq:Gbe,varsupsetneqq:Kbe,vartheta:Jbe,vartriangleleft:eve,vartriangleright:tve,vBar:sve,Vbar:nve,vBarv:ive,Vcy:rve,vcy:ove,vdash:ave,vDash:lve,Vdash:cve,VDash:hve,Vdashl:uve,veebar:dve,vee:fve,Vee:mve,veeeq:pve,vellip:gve,verbar:Ove,Verbar:xve,vert:bve,Vert:vve,VerticalBar:yve,VerticalLine:_ve,VerticalSeparator:wve,VerticalTilde:Sve,VeryThinSpace:kve,Vfr:Cve,vfr:Tve,vltri:$ve,vnsub:Qve,vnsup:Eve,Vopf:Rve,vopf:Nve,vprop:Ave,vrtri:Mve,Vscr:jve,vscr:Pve,vsubnE:Lve,vsubne:Dve,vsupnE:zve,vsupne:Bve,Vvdash:Ive,vzigzag:qve,Wcirc:Xve,wcirc:Uve,wedbar:Zve,wedge:Wve,Wedge:Vve,wedgeq:Hve,weierp:Fve,Wfr:Yve,wfr:Gve,Wopf:Kve,wopf:Jve,wp:eye,wr:tye,wreath:sye,Wscr:nye,wscr:iye,xcap:rye,xcirc:oye,xcup:aye,xdtri:lye,Xfr:cye,xfr:hye,xharr:uye,xhArr:dye,Xi:fye,xi:mye,xlarr:pye,xlArr:gye,xmap:Oye,xnis:xye,xodot:bye,Xopf:vye,xopf:yye,xoplus:_ye,xotime:wye,xrarr:Sye,xrArr:kye,Xscr:Cye,xscr:Tye,xsqcup:$ye,xuplus:Qye,xutri:Eye,xvee:Rye,xwedge:Nye,Yacute:Aye,yacute:Mye,YAcy:jye,yacy:Pye,Ycirc:Lye,ycirc:Dye,Ycy:zye,ycy:Bye,yen:Iye,Yfr:qye,yfr:Xye,YIcy:Uye,yicy:Zye,Yopf:Wye,yopf:Vye,Yscr:Hye,yscr:Fye,YUcy:Yye,yucy:Gye,yuml:Kye,Yuml:Jye,Zacute:e1e,zacute:t1e,Zcaron:s1e,zcaron:n1e,Zcy:i1e,zcy:r1e,Zdot:o1e,zdot:a1e,zeetrf:l1e,ZeroWidthSpace:c1e,Zeta:h1e,zeta:u1e,zfr:d1e,Zfr:f1e,ZHcy:m1e,zhcy:p1e,zigrarr:g1e,zopf:O1e,Zopf:x1e,Zscr:b1e,zscr:v1e,zwj:y1e,zwnj:_1e},w1e="Á",S1e="á",k1e="Â",C1e="â",T1e="´",$1e="Æ",Q1e="æ",E1e="À",R1e="à",N1e="&",A1e="&",M1e="Å",j1e="å",P1e="Ã",L1e="ã",D1e="Ä",z1e="ä",B1e="¦",I1e="Ç",q1e="ç",X1e="¸",U1e="¢",Z1e="©",W1e="©",V1e="¤",H1e="°",F1e="÷",Y1e="É",G1e="é",K1e="Ê",J1e="ê",e_e="È",t_e="è",s_e="Ð",n_e="ð",i_e="Ë",r_e="ë",o_e="½",a_e="¼",l_e="¾",c_e=">",h_e=">",u_e="Í",d_e="í",f_e="Î",m_e="î",p_e="¡",g_e="Ì",O_e="ì",x_e="¿",b_e="Ï",v_e="ï",y_e="«",__e="<",w_e="<",S_e="¯",k_e="µ",C_e="·",T_e=" ",$_e="¬",Q_e="Ñ",E_e="ñ",R_e="Ó",N_e="ó",A_e="Ô",M_e="ô",j_e="Ò",P_e="ò",L_e="ª",D_e="º",z_e="Ø",B_e="ø",I_e="Õ",q_e="õ",X_e="Ö",U_e="ö",Z_e="¶",W_e="±",V_e="£",H_e='"',F_e='"',Y_e="»",G_e="®",K_e="®",J_e="§",ewe="",twe="¹",swe="²",nwe="³",iwe="ß",rwe="Þ",owe="þ",awe="×",lwe="Ú",cwe="ú",hwe="Û",uwe="û",dwe="Ù",fwe="ù",mwe="¨",pwe="Ü",gwe="ü",Owe="Ý",xwe="ý",bwe="¥",vwe="ÿ",ywe={Aacute:w1e,aacute:S1e,Acirc:k1e,acirc:C1e,acute:T1e,AElig:$1e,aelig:Q1e,Agrave:E1e,agrave:R1e,amp:N1e,AMP:A1e,Aring:M1e,aring:j1e,Atilde:P1e,atilde:L1e,Auml:D1e,auml:z1e,brvbar:B1e,Ccedil:I1e,ccedil:q1e,cedil:X1e,cent:U1e,copy:Z1e,COPY:W1e,curren:V1e,deg:H1e,divide:F1e,Eacute:Y1e,eacute:G1e,Ecirc:K1e,ecirc:J1e,Egrave:e_e,egrave:t_e,ETH:s_e,eth:n_e,Euml:i_e,euml:r_e,frac12:o_e,frac14:a_e,frac34:l_e,gt:c_e,GT:h_e,Iacute:u_e,iacute:d_e,Icirc:f_e,icirc:m_e,iexcl:p_e,Igrave:g_e,igrave:O_e,iquest:x_e,Iuml:b_e,iuml:v_e,laquo:y_e,lt:__e,LT:w_e,macr:S_e,micro:k_e,middot:C_e,nbsp:T_e,not:$_e,Ntilde:Q_e,ntilde:E_e,Oacute:R_e,oacute:N_e,Ocirc:A_e,ocirc:M_e,Ograve:j_e,ograve:P_e,ordf:L_e,ordm:D_e,Oslash:z_e,oslash:B_e,Otilde:I_e,otilde:q_e,Ouml:X_e,ouml:U_e,para:Z_e,plusmn:W_e,pound:V_e,quot:H_e,QUOT:F_e,raquo:Y_e,reg:G_e,REG:K_e,sect:J_e,shy:ewe,sup1:twe,sup2:swe,sup3:nwe,szlig:iwe,THORN:rwe,thorn:owe,times:awe,Uacute:lwe,uacute:cwe,Ucirc:hwe,ucirc:uwe,Ugrave:dwe,ugrave:fwe,uml:mwe,Uuml:pwe,uuml:gwe,Yacute:Owe,yacute:xwe,yen:bwe,yuml:vwe},_we="&",wwe="'",Swe=">",kwe="<",Cwe='"',GN={amp:_we,apos:wwe,gt:Swe,lt:kwe,quot:Cwe};var Hu={};const Twe={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376};var oT;function $we(){if(oT)return Hu;oT=1;var s=Hu&&Hu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Hu,"__esModule",{value:!0});var e=s(Twe),t=String.fromCodePoint||function(i){var r="";return i>65535&&(i-=65536,r+=String.fromCharCode(i>>>10&1023|55296),i=56320|i&1023),r+=String.fromCharCode(i),r};function n(i){return i>=55296&&i<=57343||i>1114111?"�":(i in e.default&&(i=e.default[i]),t(i))}return Hu.default=n,Hu}var aT;function lT(){if(aT)return $o;aT=1;var s=$o&&$o.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty($o,"__esModule",{value:!0}),$o.decodeHTML=$o.decodeHTMLStrict=$o.decodeXML=void 0;var e=s(YN),t=s(ywe),n=s(GN),i=s($we()),r=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;$o.decodeXML=o(n.default),$o.decodeHTMLStrict=o(e.default);function o(u){var m=h(u);return function(p){return String(p).replace(r,m)}}var l=function(u,m){return u<m?1:-1};$o.decodeHTML=(function(){for(var u=Object.keys(t.default).sort(l),m=Object.keys(e.default).sort(l),p=0,O=0;p<m.length;p++)u[O]===m[p]?(m[p]+=";?",O++):m[p]+=";";var x=new RegExp("&(?:"+m.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),y=h(e.default);function w(S){return S.substr(-1)!==";"&&(S+=";"),y(S)}return function(S){return String(S).replace(x,w)}})();function h(u){return function(p){if(p.charAt(1)==="#"){var O=p.charAt(2);return O==="X"||O==="x"?i.default(parseInt(p.substr(3),16)):i.default(parseInt(p.substr(2),10))}return u[p.slice(1,-1)]||p}}return $o}var Wi={},cT;function hT(){if(cT)return Wi;cT=1;var s=Wi&&Wi.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.escapeUTF8=Wi.escape=Wi.encodeNonAsciiHTML=Wi.encodeHTML=Wi.encodeXML=void 0;var e=s(GN),t=l(e.default),n=h(t);Wi.encodeXML=S(t);var i=s(YN),r=l(i.default),o=h(r);Wi.encodeHTML=O(r,o),Wi.encodeNonAsciiHTML=S(r);function l(k){return Object.keys(k).sort().reduce(function(A,N){return A[k[N]]="&"+N+";",A},{})}function h(k){for(var A=[],N=[],R=0,D=Object.keys(k);R<D.length;R++){var U=D[R];U.length===1?A.push("\\"+U):N.push(U)}A.sort();for(var Z=0;Z<A.length-1;Z++){for(var te=Z;te<A.length-1&&A[te].charCodeAt(1)+1===A[te+1].charCodeAt(1);)te+=1;var ee=1+te-Z;ee<3||A.splice(Z,ee,A[Z]+"-"+A[te])}return N.unshift("["+A.join("")+"]"),new RegExp(N.join("|"),"g")}var u=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,m=String.prototype.codePointAt!=null?function(k){return k.codePointAt(0)}:function(k){return(k.charCodeAt(0)-55296)*1024+k.charCodeAt(1)-56320+65536};function p(k){return"&#x"+(k.length>1?m(k):k.charCodeAt(0)).toString(16).toUpperCase()+";"}function O(k,A){return function(N){return N.replace(A,function(R){return k[R]}).replace(u,p)}}var x=new RegExp(n.source+"|"+u.source,"g");function y(k){return k.replace(x,p)}Wi.escape=y;function w(k){return k.replace(n,p)}Wi.escapeUTF8=w;function S(k){return function(A){return A.replace(x,function(N){return k[N]||p(N)})}}return Wi}var uT;function Qwe(){return uT||(uT=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.decodeXMLStrict=s.decodeHTML5Strict=s.decodeHTML4Strict=s.decodeHTML5=s.decodeHTML4=s.decodeHTMLStrict=s.decodeHTML=s.decodeXML=s.encodeHTML5=s.encodeHTML4=s.escapeUTF8=s.escape=s.encodeNonAsciiHTML=s.encodeHTML=s.encodeXML=s.encode=s.decodeStrict=s.decode=void 0;var e=lT(),t=hT();function n(h,u){return(!u||u<=0?e.decodeXML:e.decodeHTML)(h)}s.decode=n;function i(h,u){return(!u||u<=0?e.decodeXML:e.decodeHTMLStrict)(h)}s.decodeStrict=i;function r(h,u){return(!u||u<=0?t.encodeXML:t.encodeHTML)(h)}s.encode=r;var o=hT();Object.defineProperty(s,"encodeXML",{enumerable:!0,get:function(){return o.encodeXML}}),Object.defineProperty(s,"encodeHTML",{enumerable:!0,get:function(){return o.encodeHTML}}),Object.defineProperty(s,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return o.encodeNonAsciiHTML}}),Object.defineProperty(s,"escape",{enumerable:!0,get:function(){return o.escape}}),Object.defineProperty(s,"escapeUTF8",{enumerable:!0,get:function(){return o.escapeUTF8}}),Object.defineProperty(s,"encodeHTML4",{enumerable:!0,get:function(){return o.encodeHTML}}),Object.defineProperty(s,"encodeHTML5",{enumerable:!0,get:function(){return o.encodeHTML}});var l=lT();Object.defineProperty(s,"decodeXML",{enumerable:!0,get:function(){return l.decodeXML}}),Object.defineProperty(s,"decodeHTML",{enumerable:!0,get:function(){return l.decodeHTML}}),Object.defineProperty(s,"decodeHTMLStrict",{enumerable:!0,get:function(){return l.decodeHTMLStrict}}),Object.defineProperty(s,"decodeHTML4",{enumerable:!0,get:function(){return l.decodeHTML}}),Object.defineProperty(s,"decodeHTML5",{enumerable:!0,get:function(){return l.decodeHTML}}),Object.defineProperty(s,"decodeHTML4Strict",{enumerable:!0,get:function(){return l.decodeHTMLStrict}}),Object.defineProperty(s,"decodeHTML5Strict",{enumerable:!0,get:function(){return l.decodeHTMLStrict}}),Object.defineProperty(s,"decodeXMLStrict",{enumerable:!0,get:function(){return l.decodeXML}})})(ey)),ey}var ty,dT;function Ewe(){if(dT)return ty;dT=1;function s(E,Q){if(!(E instanceof Q))throw new TypeError("Cannot call a class as a function")}function e(E,Q){for(var T=0;T<Q.length;T++){var L=Q[T];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(E,L.key,L)}}function t(E,Q,T){return Q&&e(E.prototype,Q),E}function n(E,Q){var T=typeof Symbol<"u"&&E[Symbol.iterator]||E["@@iterator"];if(!T){if(Array.isArray(E)||(T=i(E))||Q){T&&(E=T);var L=0,M=function(){};return{s:M,n:function(){return L>=E.length?{done:!0}:{done:!1,value:E[L++]}},e:function(z){throw z},f:M}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
535
535
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var P=!0,I=!1,X;return{s:function(){T=T.call(E)},n:function(){var z=T.next();return P=z.done,z},e:function(z){I=!0,X=z},f:function(){try{!P&&T.return!=null&&T.return()}finally{if(I)throw X}}}}function i(E,Q){if(E){if(typeof E=="string")return r(E,Q);var T=Object.prototype.toString.call(E).slice(8,-1);if(T==="Object"&&E.constructor&&(T=E.constructor.name),T==="Map"||T==="Set")return Array.from(E);if(T==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return r(E,Q)}}function r(E,Q){(Q==null||Q>E.length)&&(Q=E.length);for(var T=0,L=new Array(Q);T<Q;T++)L[T]=E[T];return L}var o=Qwe(),l={fg:"#FFF",bg:"#000",newline:!1,escapeXML:!1,stream:!1,colors:h()};function h(){var E={0:"#000",1:"#A00",2:"#0A0",3:"#A50",4:"#00A",5:"#A0A",6:"#0AA",7:"#AAA",8:"#555",9:"#F55",10:"#5F5",11:"#FF5",12:"#55F",13:"#F5F",14:"#5FF",15:"#FFF"};return S(0,5).forEach(function(Q){S(0,5).forEach(function(T){S(0,5).forEach(function(L){return u(Q,T,L,E)})})}),S(0,23).forEach(function(Q){var T=Q+232,L=m(Q*10+8);E[T]="#"+L+L+L}),E}function u(E,Q,T,L){var M=16+E*36+Q*6+T,P=E>0?E*40+55:0,I=Q>0?Q*40+55:0,X=T>0?T*40+55:0;L[M]=p([P,I,X])}function m(E){for(var Q=E.toString(16);Q.length<2;)Q="0"+Q;return Q}function p(E){var Q=[],T=n(E),L;try{for(T.s();!(L=T.n()).done;){var M=L.value;Q.push(m(M))}}catch(P){T.e(P)}finally{T.f()}return"#"+Q.join("")}function O(E,Q,T,L){var M;return Q==="text"?M=N(T,L):Q==="display"?M=y(E,T,L):Q==="xterm256Foreground"?M=U(E,L.colors[T]):Q==="xterm256Background"?M=Z(E,L.colors[T]):Q==="rgb"&&(M=x(E,T)),M}function x(E,Q){Q=Q.substring(2).slice(0,-1);var T=+Q.substr(0,2),L=Q.substring(5).split(";"),M=L.map(function(P){return("0"+Number(P).toString(16)).substr(-2)}).join("");return D(E,(T===38?"color:#":"background-color:#")+M)}function y(E,Q,T){Q=parseInt(Q,10);var L={"-1":function(){return"<br/>"},0:function(){return E.length&&w(E)},1:function(){return R(E,"b")},3:function(){return R(E,"i")},4:function(){return R(E,"u")},8:function(){return D(E,"display:none")},9:function(){return R(E,"strike")},22:function(){return D(E,"font-weight:normal;text-decoration:none;font-style:normal")},23:function(){return te(E,"i")},24:function(){return te(E,"u")},39:function(){return U(E,T.fg)},49:function(){return Z(E,T.bg)},53:function(){return D(E,"text-decoration:overline")}},M;return L[Q]?M=L[Q]():4<Q&&Q<7?M=R(E,"blink"):29<Q&&Q<38?M=U(E,T.colors[Q-30]):39<Q&&Q<48?M=Z(E,T.colors[Q-40]):89<Q&&Q<98?M=U(E,T.colors[8+(Q-90)]):99<Q&&Q<108&&(M=Z(E,T.colors[8+(Q-100)])),M}function w(E){var Q=E.slice(0);return E.length=0,Q.reverse().map(function(T){return"</"+T+">"}).join("")}function S(E,Q){for(var T=[],L=E;L<=Q;L++)T.push(L);return T}function k(E){return function(Q){return(E===null||Q.category!==E)&&E!=="all"}}function A(E){E=parseInt(E,10);var Q=null;return E===0?Q="all":E===1?Q="bold":2<E&&E<5?Q="underline":4<E&&E<7?Q="blink":E===8?Q="hide":E===9?Q="strike":29<E&&E<38||E===39||89<E&&E<98?Q="foreground-color":(39<E&&E<48||E===49||99<E&&E<108)&&(Q="background-color"),Q}function N(E,Q){return Q.escapeXML?o.encodeXML(E):E}function R(E,Q,T){return T||(T=""),E.push(Q),"<".concat(Q).concat(T?' style="'.concat(T,'"'):"",">")}function D(E,Q){return R(E,"span",Q)}function U(E,Q){return R(E,"span","color:"+Q)}function Z(E,Q){return R(E,"span","background-color:"+Q)}function te(E,Q){var T;if(E.slice(-1)[0]===Q&&(T=E.pop()),T)return"</"+Q+">"}function ee(E,Q,T){var L=!1,M=3;function P(){return""}function I(We,fe){return T("xterm256Foreground",fe),""}function X(We,fe){return T("xterm256Background",fe),""}function V(We){return Q.newline?T("display",-1):T("text",We),""}function z(We,fe){L=!0,fe.trim().length===0&&(fe="0"),fe=fe.trimRight(";").split(";");var rt=n(fe),we;try{for(rt.s();!(we=rt.n()).done;){var Ve=we.value;T("display",Ve)}}catch(Ee){rt.e(Ee)}finally{rt.f()}return""}function G(We){return T("text",We),""}function H(We){return T("rgb",We),""}var Y=[{pattern:/^\x08+/,sub:P},{pattern:/^\x1b\[[012]?K/,sub:P},{pattern:/^\x1b\[\(B/,sub:P},{pattern:/^\x1b\[[34]8;2;\d+;\d+;\d+m/,sub:H},{pattern:/^\x1b\[38;5;(\d+)m/,sub:I},{pattern:/^\x1b\[48;5;(\d+)m/,sub:X},{pattern:/^\n/,sub:V},{pattern:/^\r+\n/,sub:V},{pattern:/^\r/,sub:V},{pattern:/^\x1b\[((?:\d{1,3};?)+|)m/,sub:z},{pattern:/^\x1b\[\d?J/,sub:P},{pattern:/^\x1b\[\d{0,3};\d{0,3}f/,sub:P},{pattern:/^\x1b\[?[\d;]{0,3}/,sub:P},{pattern:/^(([^\x1b\x08\r\n])+)/,sub:G}];function he(We,fe){fe>M&&L||(L=!1,E=E.replace(We.pattern,We.sub))}var le=[],Se=E,ue=Se.length;e:for(;ue>0;){for(var F=0,ne=0,Oe=Y.length;ne<Oe;F=++ne){var je=Y[F];if(he(je,F),E.length!==ue){ue=E.length;continue e}}if(E.length===ue)break;le.push(0),ue=E.length}return le}function pe(E,Q,T){return Q!=="text"&&(E=E.filter(k(A(T))),E.push({token:Q,data:T,category:A(T)})),E}var oe=(function(){function E(Q){s(this,E),Q=Q||{},Q.colors&&(Q.colors=Object.assign({},l.colors,Q.colors)),this.options=Object.assign({},l,Q),this.stack=[],this.stickyStack=[]}return t(E,[{key:"toHtml",value:function(T){var L=this;T=typeof T=="string"?[T]:T;var M=this.stack,P=this.options,I=[];return this.stickyStack.forEach(function(X){var V=O(M,X.token,X.data,P);V&&I.push(V)}),ee(T.join(""),P,function(X,V){var z=O(M,X,V,P);z&&I.push(z),P.stream&&(L.stickyStack=pe(L.stickyStack,X,V))}),M.length&&I.push(w(M)),I.join("")}}]),E})();return ty=oe,ty}var Rwe=Ewe();const Nwe=jx(Rwe);var SS=MN();const em=[],fT=["a[href]","button:not([disabled])","textarea:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function Uc(s,e){const t=v.useRef(null),n=v.useRef(s);n.current=s;const i=(e==null?void 0:e.trapFocus)!==!1,r=(e==null?void 0:e.skipInitialFocus)===!0;return v.useEffect(()=>{const o=t.current;if(!o)return;const l=document.activeElement;em.push(o);const h=()=>em[em.length-1]===o;!r&&!o.contains(document.activeElement)&&(o.querySelector(fT)??o).focus({preventScroll:!0});const u=p=>{var O;if(p.key==="Escape"){if(p.defaultPrevented||!h())return;p.preventDefault(),p.stopPropagation(),(O=n.current)==null||O.call(n);return}if(i&&p.key==="Tab"){const x=Array.from(o.querySelectorAll(fT)).filter(k=>k.offsetParent!==null||k===document.activeElement);if(x.length===0){p.preventDefault(),o.focus({preventScroll:!0});return}const y=x[0],w=x[x.length-1],S=document.activeElement;p.shiftKey&&(S===y||S===o)?(p.preventDefault(),w.focus({preventScroll:!0})):!p.shiftKey&&S===w&&(p.preventDefault(),y.focus({preventScroll:!0}))}};o.addEventListener("keydown",u);const m=p=>{var O;p.key!=="Escape"||p.defaultPrevented||!h()||p.target instanceof Node&&o.contains(p.target)||(p.preventDefault(),p.stopPropagation(),(O=n.current)==null||O.call(n))};return window.addEventListener("keydown",m,{capture:!0}),()=>{const p=em.indexOf(o);p!==-1&&em.splice(p,1),o.removeEventListener("keydown",u),window.removeEventListener("keydown",m,{capture:!0}),l&&document.contains(l)&&l.focus({preventScroll:!0})}},[i,r]),t}const ti=1,v0=6,mT=2.5,Awe=.002,Mwe=4,Fu=(s,e,t)=>Math.min(t,Math.max(e,s)),sy=(s,e)=>Math.hypot(e.x-s.x,e.y-s.y),KN=({alt:s,onClose:e,src:t})=>{const n=Uc(e),i=v.useRef(null),r=v.useRef(null),o=v.useRef(null),l=v.useRef(!1),h=v.useRef(new Map),u=v.useRef(null),m=v.useRef({scale:ti,x:0,y:0}),p=v.useRef(null),[O,x]=v.useState({scale:ti,x:0,y:0}),[y,w]=v.useState(!1),S=v.useCallback((T,L)=>{const M=i.current;if(!M)return null;const P=M.getBoundingClientRect();return{x:T-P.left-P.width/2,y:L-P.top-P.height/2}},[]),k=v.useCallback(T=>{const L=i.current,M=r.current;if(!L||!M)return{x:0,y:0};const P=M.clientWidth*T,I=M.clientHeight*T;return{x:Math.max(0,(P-L.clientWidth)/2),y:Math.max(0,(I-L.clientHeight)/2)}},[]),A=v.useCallback(T=>{x(L=>{const M=typeof T=="function"?T(L):T,P=Fu(M.scale,ti,v0);let I=M.x,X=M.y;if(P<=ti)I=0,X=0;else{const z=k(P);I=Fu(I,-z.x,z.x),X=Fu(X,-z.y,z.y)}const V={scale:P,x:I,y:X};return m.current=V,V})},[k]),N=v.useCallback((T,L)=>{A(M=>{const P=Fu(T,ti,v0);if(P<=ti)return{scale:ti,x:0,y:0};const I=P/M.scale;return{scale:P,x:L.x-(L.x-M.x)*I,y:L.y-(L.y-M.y)*I}})},[A]),R=v.useCallback(()=>{const[T,L]=Array.from(h.current.values());if(!T||!L)return;const M=S((T.x+L.x)/2,(T.y+L.y)/2);M&&(u.current={type:"pinch",startScale:m.current.scale,startOffset:{x:m.current.x,y:m.current.y},startAnchor:M,startDistance:Math.max(sy(T,L),1)})},[S]),D=v.useCallback(()=>{h.current.clear(),u.current=null,p.current=null,w(!1),A({scale:ti,x:0,y:0})},[A]);v.useEffect(()=>{D()},[D,t]),v.useEffect(()=>{const T=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{o.current!==null&&(window.clearTimeout(o.current),o.current=null),document.body.style.overflow=T}},[]),v.useEffect(()=>{const T=i.current;if(!T)return;const L=I=>{const X=I,V=S(X.clientX,X.clientY);V&&(I.preventDefault(),p.current={type:"pinch",startScale:m.current.scale,startOffset:{x:m.current.x,y:m.current.y},startAnchor:V,startDistance:1})},M=I=>{const X=I,V=p.current;if(!V)return;const z=S(X.clientX,X.clientY);if(!z)return;I.preventDefault();const G=Fu(V.startScale*X.scale,ti,v0),H=G/V.startScale;A({scale:G,x:z.x-(V.startAnchor.x-V.startOffset.x)*H,y:z.y-(V.startAnchor.y-V.startOffset.y)*H})},P=I=>{I.preventDefault(),p.current=null};return T.addEventListener("gesturestart",L,{passive:!1}),T.addEventListener("gesturechange",M,{passive:!1}),T.addEventListener("gestureend",P,{passive:!1}),()=>{T.removeEventListener("gesturestart",L),T.removeEventListener("gesturechange",M),T.removeEventListener("gestureend",P)}},[A,S]),v.useEffect(()=>{const T=()=>{A(L=>L)};return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[A]);const U=v.useCallback((T,L)=>{if(L&&"hasPointerCapture"in L&&L.hasPointerCapture(T)&&L.releasePointerCapture(T),h.current.delete(T),h.current.size>=2){R(),w(!1);return}if(h.current.size===1&&m.current.scale>ti){const[M]=Array.from(h.current.values());M&&(u.current={type:"pan",startPoint:M,startOffset:{x:m.current.x,y:m.current.y}})}else u.current=null;w(!1)},[R]),Z=v.useCallback(T=>{if(!(T.pointerType==="mouse"&&T.button!==0)){if(T.preventDefault(),"setPointerCapture"in T.currentTarget&&T.currentTarget.setPointerCapture(T.pointerId),h.current.set(T.pointerId,{x:T.clientX,y:T.clientY}),h.current.size>=2){l.current=!0,R(),w(!1);return}m.current.scale>ti&&(u.current={type:"pan",startPoint:{x:T.clientX,y:T.clientY},startOffset:{x:m.current.x,y:m.current.y}},w(!0))}},[R]),te=v.useCallback(T=>{if(!h.current.has(T.pointerId))return;h.current.set(T.pointerId,{x:T.clientX,y:T.clientY});const L=u.current;if(L){if(T.preventDefault(),L.type==="pan"&&sy(L.startPoint,{x:T.clientX,y:T.clientY})>Mwe&&(l.current=!0),L.type==="pan"&&h.current.size===1){A({scale:m.current.scale,x:L.startOffset.x+(T.clientX-L.startPoint.x),y:L.startOffset.y+(T.clientY-L.startPoint.y)}),w(!0);return}if(L.type==="pinch"&&h.current.size>=2){const[M,P]=Array.from(h.current.values());if(!M||!P)return;const I=S((M.x+P.x)/2,(M.y+P.y)/2);if(!I)return;const X=Fu(L.startScale*(sy(M,P)/L.startDistance),ti,v0),V=X/L.startScale;A({scale:X,x:I.x-(L.startAnchor.x-L.startOffset.x)*V,y:I.y-(L.startAnchor.y-L.startOffset.y)*V}),w(!1)}}},[A,S]),ee=v.useCallback(T=>{U(T.pointerId,T.currentTarget)},[U]),pe=v.useCallback(T=>{U(T.pointerId,T.currentTarget)},[U]),oe=v.useCallback(T=>{if(T.ctrlKey||T.metaKey){const L=S(T.clientX,T.clientY);if(!L)return;T.preventDefault();const M=m.current.scale*Math.exp(-T.deltaY*Awe);N(M,L);return}m.current.scale>ti&&(T.preventDefault(),A(L=>({scale:L.scale,x:L.x-T.deltaX,y:L.y-T.deltaY})))},[A,S,N]),E=v.useCallback(T=>{if(l.current){l.current=!1;return}const L=S(T.clientX,T.clientY);L&&(o.current!==null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null;const M=m.current.scale>ti?ti:mT;N(M,L)},180))},[S,N]),Q=v.useCallback(T=>{o.current!==null&&(window.clearTimeout(o.current),o.current=null);const L=S(T.clientX,T.clientY);if(!L)return;const M=m.current.scale>ti?ti:mT;N(M,L)},[S,N]);return SS.createPortal(d.jsxs("div",{ref:n,role:"dialog","aria-modal":"true","aria-label":"Image preview",tabIndex:-1,className:"fixed inset-0 z-50 bg-slate-950/80 backdrop-blur-sm",onClick:e,children:[d.jsx("button",{type:"button",onClick:e,className:"absolute top-4 right-4 rounded-full bg-slate-900/70 px-3 py-1.5 text-sm text-white/85 hover:text-white hover:bg-slate-900 z-20",title:"Close",children:"Close"}),d.jsx("div",{ref:i,"aria-label":"Image viewer",className:`relative h-full w-full overflow-hidden ${O.scale>ti?y?"cursor-grabbing":"cursor-grab":"cursor-zoom-in"}`,onClick:T=>{T.stopPropagation(),E(T)},onDoubleClick:Q,onPointerCancel:pe,onPointerDown:Z,onPointerMove:te,onPointerUp:ee,onWheel:oe,style:{touchAction:"none",overscrollBehavior:"contain"},children:d.jsx("div",{className:"flex h-full w-full items-center justify-center p-4",children:d.jsx("img",{ref:r,src:t,alt:s,draggable:!1,onLoad:()=>A(T=>T),className:"pointer-events-none max-h-full max-w-full select-none will-change-transform",style:{transform:`translate3d(${O.x}px, ${O.y}px, 0) scale(${O.scale})`,transformOrigin:"center center"}})})})]}),document.body)},ny="2.35.2",tm=new Map;function jwe(s){if(typeof s=="string"){if(s==="plotly")return{key:`plotly@${ny}`,url:`https://cdn.plot.ly/plotly-${ny}.min.js`,globalName:"Plotly"};throw new Error(`Unknown library "${s}"`)}if(s.name==="plotly"){const e=s.version||ny;return{key:s.key||`plotly@${e}`,url:s.url||`https://cdn.plot.ly/plotly-${e}.min.js`,globalName:s.global||"Plotly"}}if(!s.url||!s.global)throw new Error('Custom libraries must include both "url" and "global"');return{key:s.key||s.url,url:s.url,globalName:s.global}}async function JN(s){const e=jwe(s);if(tm.has(e.key))return tm.get(e.key);const t=window[e.globalName];if(t){const i=Promise.resolve(t);return tm.set(e.key,i),i}const n=new Promise((i,r)=>{const o=document.querySelector(`script[data-nebula-lib-key="${e.key}"]`);if(o){o.addEventListener("load",()=>{i(window[e.globalName])},{once:!0}),o.addEventListener("error",()=>{r(new Error(`Failed to load ${e.key}`))},{once:!0});return}const l=document.createElement("script");l.src=e.url,l.async=!0,l.dataset.nebulaLibKey=e.key,l.onload=()=>{i(window[e.globalName])},l.onerror=()=>{tm.delete(e.key),r(new Error(`Failed to load ${e.key}`))},document.head.appendChild(l)});return tm.set(e.key,n),n}const Pwe="modulepreload",Lwe=function(s){return"/"+s},pT={},Qm=function(e,t,n){let i=Promise.resolve();if(t&&t.length>0){let o=function(u){return Promise.all(u.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),h=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=o(t.map(u=>{if(u=Lwe(u),u in pT)return;pT[u]=!0;const m=u.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${p}`))return;const O=document.createElement("link");if(O.rel=m?"stylesheet":Pwe,m||(O.as="script"),O.crossOrigin="",O.href=u,h&&O.setAttribute("nonce",h),document.head.appendChild(O),m)return new Promise((x,y)=>{O.addEventListener("load",x),O.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${u}`)))})}))}function r(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&r(l.reason);return e().catch(r)})},gT="/api",iy="nebula_auth_token";class Dwe{constructor(){this.cachedStatus=null}getToken(){return localStorage.getItem(iy)}setToken(e){localStorage.setItem(iy,e)}clearToken(){localStorage.removeItem(iy),this.cachedStatus=null}async getStatus(e=!1){if(this.cachedStatus&&!e)return this.cachedStatus;const t=this.getToken(),n={};t&&(n.Authorization=`Bearer ${t}`);try{const r=await(await fetch(`${gT}/auth/status`,{headers:n})).json();return this.cachedStatus=r,r}catch(i){return console.error("[Auth] Failed to get status:",i),{configured:!1,authenticated:!1}}}async verify(e,t){try{const i=await(await fetch(`${gT}/auth/verify`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,trustBrowser:t})})).json();return i.success&&i.token?(this.setToken(i.token),this.cachedStatus=null,{success:!0,token:i.token}):{success:!1,error:i.error||"Verification failed"}}catch(n){return console.error("[Auth] Verification error:",n),{success:!1,error:"Network error"}}}async isAuthenticated(){return(await this.getStatus()).authenticated}logout(){this.clearToken()}getAuthHeaders(){const e=this.getToken();return e?{Authorization:`Bearer ${e}`}:{}}getAuthenticatedWebSocketUrl(e){const t=this.getToken();if(t){const n=e.includes("?")?"&":"?";return`${e}${n}token=${encodeURIComponent(t)}`}return e}}const Ei=new Dwe;if(typeof window<"u"){const s=window.fetch;window.fetch=function(e,t){const n=typeof e=="string"?e:e instanceof URL?e.toString():e.url;if(n.startsWith("/api/")||n.includes("/api/")){const i=Ei.getToken();if(i){const r=new Headers(t==null?void 0:t.headers);return r.has("Authorization")||r.set("Authorization",`Bearer ${i}`),s.call(window,e,{...t,headers:r})}}return s.call(window,e,t)}}const xs="/api";class OT extends Error{constructor(e){super(e),this.name="KernelServerGoneError"}}class Th extends Error{constructor(e,t,n){super(e),this.name="KernelProvisionError",this.code=t,this.installHint=n}}const eA="env:";function ry(s){return eA+s}function oy(s){return!!s&&s.startsWith(eA)}function xT(s,e){return s.code?new Th(s.detail||e,s.code,s.install_hint):new Error(s.detail||e)}class zwe{constructor(){this.sessions=new Map,this.reconnectInterval=null,this.disconnectedSessions=new Set,this.serverGoneCounts=new Map,this.onReconnectCallbacks=[],this.onDisconnectCallbacks=[],this.onStatusCallbacks=[],this.onBufferedOutputCallbacks=[],this.onCommCallbacks=[],this.onSyncReplaceCallbacks=[]}async getAvailableKernels(e){const t=new URLSearchParams;e&&t.set("server_id",e);const n=t.toString()?`${xs}/kernels?${t.toString()}`:`${xs}/kernels`,i=await fetch(n);if(!i.ok)throw new Error("Failed to fetch kernels");return(await i.json()).kernels}async startKernel(e="python3",t,n,i){const r={kernel_name:e,client_origin:"ui"};t&&(r.cwd=t),n&&(r.file_path=n),i&&(r.server_id=i);const o=await fetch(`${xs}/kernels/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok){const m=await o.json().catch(()=>({detail:"Failed to start kernel"}));throw xT(m,"Failed to start kernel")}const l=await o.json(),h=l.session_id,u=l.server_id??i??null;return this.sessions.set(h,{sessionId:h,ws:null,messageQueue:[],filePath:n,kernelName:e,serverId:u}),await this.connectWebSocket(h),h}async getOrCreateKernelForFile(e,t="python3",n){const i={file_path:e,kernel_name:t,client_origin:"ui"};n&&(i.server_id=n);const r=await fetch(`${xs}/kernels/for-file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok){const O=await r.json().catch(()=>({detail:"Failed to get/create kernel"}));throw xT(O,"Failed to get/create kernel")}const o=await r.json(),l=o.session_id,h=o.created,u=o.created_at,m=o.server_id??n??null,p=o.mtime;if(!this.sessions.has(l))this.sessions.set(l,{sessionId:l,ws:null,messageQueue:[],filePath:e,kernelName:t,serverId:m}),await this.connectWebSocket(l);else{const O=this.sessions.get(l);O.filePath=e,O.kernelName=t,O.serverId=m,this.isConnected(l)||await this.connectWebSocket(l)}return{sessionId:l,created:h,createdAt:u,serverId:m,mtime:p}}async attachToSession(e,t){const n=await fetch(`${xs}/kernels/${encodeURIComponent(e)}/status`);if(n.status===404)throw new Error(`Session ${e} not found`);if(!n.ok){const h=await n.json().catch(()=>({detail:"Failed to attach to kernel session"}));throw new Error(h.detail||"Failed to attach to kernel session")}const i=await n.json(),r=i.file_path??t,o=i.kernel_name,l=i.server_id??null;if(!this.sessions.has(e))this.sessions.set(e,{sessionId:e,ws:null,messageQueue:[],filePath:r,kernelName:o,serverId:l}),await this.connectWebSocket(e);else{const h=this.sessions.get(e);h.filePath=r,h.kernelName=o,h.serverId=l,this.isConnected(e)||await this.connectWebSocket(e)}return{sessionId:e,filePath:r,kernelName:o,serverId:l}}async connectWebSocket(e){const t=this.sessions.get(e);if(!t)throw new Error(`Session ${e} not found`);return t.initialSyncDone=!1,t.initialSyncTimedOut=!1,t.initialSyncPromise=void 0,t.initialSyncResolve=null,t.initialSyncTimeout&&clearTimeout(t.initialSyncTimeout),t.initialSyncTimeout=null,new Promise((n,i)=>{const r=window.location.protocol==="https:"?"wss:":"ws:",o=encodeURIComponent(e),l=`${r}//${window.location.host}${xs}/kernels/${o}/ws`,h=Ei.getAuthenticatedWebSocketUrl(l),u=new WebSocket(h);u.onopen=()=>{console.log("Kernel WebSocket connected"),t.ws=u,this.requestInitialSync(e),n()},u.onerror=m=>{console.error("WebSocket error:",m),i(m)},u.onclose=()=>{if(console.log("Kernel WebSocket closed"),t.ws===u){t.ws=null,this.disconnectedSessions.add(e),this.startReconnectLoop();for(const m of this.onDisconnectCallbacks)try{m(e)}catch(p){console.error("Disconnect callback error:",p)}}},u.onmessage=async m=>{try{let p=m.data,O;typeof p=="string"?O=p:p instanceof ArrayBuffer?O=new TextDecoder().decode(p):p instanceof Blob?O=await p.text():O=String(p);const x=JSON.parse(O);this.handleMessage(e,x)}catch(p){console.error("[Kernel WS] Failed to parse message:",p)}}})}handleMessage(e,t){const n=this.sessions.get(e);if(!n)return;if(t.type==="status"){const r=t.status,o=t.cell_id??null;for(const l of this.onStatusCallbacks)try{l(e,r,o)}catch(h){console.error("Status callback error:",h)}return}if(t.type==="sync_outputs"){const r=t.cells;if(r&&typeof r=="object"){const o=new Map,l=Date.now();for(const[u,m]of Object.entries(r)){if(!Array.isArray(m))continue;const p=m.map((O,x)=>({id:`sync-${u}-${x}`,type:O.type,content:O.content,timestamp:l,mimeBundle:O.mimeBundle,metadata:O.metadata,preferredMimeType:O.preferredMimeType}));o.set(u,p)}const h=t.executing_cell??null;for(const u of this.onSyncReplaceCallbacks)try{u(e,o,h)}catch(m){console.error("Sync replace callback error:",m)}}if(!n.initialSyncDone&&(n.initialSyncDone=!0,n.initialSyncTimeout&&(clearTimeout(n.initialSyncTimeout),n.initialSyncTimeout=null),n.initialSyncResolve))try{n.initialSyncResolve()}catch{}return}if(t.type==="comm"){const r=t.comm;if(r&&typeof r.comm_id=="string"&&r.msg_type)for(const o of this.onCommCallbacks)try{o(e,r)}catch(l){console.error("Comm callback error:",l)}return}if(t.type==="comm_info_reply"){const r=t.comms??{},o=n.pendingCommInfo;if(n.pendingCommInfo=void 0,o)for(const l of o){clearTimeout(l.timeout);try{l.resolve(r)}catch(h){console.error("Comm info callback error:",h)}}return}if(t.type==="complete_reply"){n.pendingCompletion&&(n.pendingCompletion.resolve(t.result),n.pendingCompletion=void 0);return}const i=n.messageQueue[0];if(t.type==="output"){const r=t.output,o=t.cell_id??t.cellId??null,l={id:crypto.randomUUID(),type:r.type,content:r.content,timestamp:Date.now(),mimeBundle:r.mimeBundle,metadata:r.metadata,preferredMimeType:r.preferredMimeType};if(i&&i.cellId&&o&&i.cellId!==o)for(const h of this.onBufferedOutputCallbacks)try{h(e,l,o)}catch(u){console.error("Buffered output callback error:",u)}else if(i)i.onOutput(l);else for(const h of this.onBufferedOutputCallbacks)try{h(e,l,o)}catch(u){console.error("Buffered output callback error:",u)}return}if(i)switch(t.type){case"result":n.messageQueue.shift(),i.resolve(t.result);break;case"error":n.messageQueue.shift(),i.reject(new Error(t.error));break}}async executeCode(e,t,n,i){const r=this.sessions.get(e);if(!r)throw new Error(`Session ${e} not found`);if(!r.ws||r.ws.readyState!==WebSocket.OPEN)throw new Error("Kernel not connected");return await this.waitForInitialSync(e),new Promise((o,l)=>{r.messageQueue.push({resolve:o,reject:l,onOutput:n,cellId:i}),r.ws.send(JSON.stringify({type:"execute",code:t,cell_id:i??void 0}))})}async complete(e,t,n){const i=this.sessions.get(e);return i?!i.ws||i.ws.readyState!==WebSocket.OPEN?{status:"error",matches:[],cursor_start:n,cursor_end:n}:(await this.waitForInitialSync(e),i.pendingCompletion&&i.pendingCompletion.reject(new Error("Cancelled")),new Promise((r,o)=>{const l=setTimeout(()=>{i.pendingCompletion&&(i.pendingCompletion=void 0,r({status:"timeout",matches:[],cursor_start:n,cursor_end:n}))},3e3);i.pendingCompletion={resolve:h=>{clearTimeout(l),r(h)},reject:h=>{clearTimeout(l),o(h)}},i.ws.send(JSON.stringify({type:"complete",code:t,cursor_pos:n}))})):{status:"error",matches:[],cursor_start:n,cursor_end:n}}async stopKernel(e){const t=this.sessions.get(e);t&&(t.ws&&t.ws.close(),this.sessions.delete(e)),await fetch(`${xs}/kernels/${encodeURIComponent(e)}`,{method:"DELETE"})}async interruptKernel(e){const t=await fetch(`${xs}/kernels/${encodeURIComponent(e)}/interrupt`,{method:"POST"});if(!t.ok){const n=await t.json().catch(()=>({detail:"Failed to interrupt kernel"}));throw new Error(n.detail||"Failed to interrupt kernel")}}async restartKernel(e){const t=await fetch(`${xs}/kernels/${encodeURIComponent(e)}/restart`,{method:"POST"});if(!t.ok){const n=await t.json().catch(()=>({detail:"Failed to restart kernel"}));throw new Error(n.detail||"Failed to restart kernel")}}async getStatus(e){if(!this.sessions.has(e))return null;const t=await fetch(`${xs}/kernels/${encodeURIComponent(e)}/status`);if(t.status===404)return null;if(t.status===410){const n=await t.json().catch(()=>({detail:"Allocation ended"}));throw new OT(n.detail||"Allocation ended — kernel stopped")}if(!t.ok){const n=await t.json().catch(()=>({detail:"Failed to get kernel status"}));throw new Error(n.detail||"Failed to get kernel status")}return t.json()}isConnected(e){const t=this.sessions.get(e);return t?t.ws!==null&&t.ws.readyState===WebSocket.OPEN:!1}hasPendingRequest(e){const t=this.sessions.get(e);return!!t&&t.messageQueue.length>0}hasOpenConnection(){for(const e of this.sessions.values())if(e.ws!==null&&e.ws.readyState===WebSocket.OPEN)return!0;return!1}onSyncReplace(e){return this.onSyncReplaceCallbacks.push(e),()=>{this.onSyncReplaceCallbacks=this.onSyncReplaceCallbacks.filter(t=>t!==e)}}onReconnect(e){return this.onReconnectCallbacks.push(e),()=>{this.onReconnectCallbacks=this.onReconnectCallbacks.filter(t=>t!==e)}}onDisconnect(e){return this.onDisconnectCallbacks.push(e),()=>{this.onDisconnectCallbacks=this.onDisconnectCallbacks.filter(t=>t!==e)}}onStatus(e){return this.onStatusCallbacks.push(e),()=>{this.onStatusCallbacks=this.onStatusCallbacks.filter(t=>t!==e)}}onBufferedOutput(e){return this.onBufferedOutputCallbacks.push(e),()=>{this.onBufferedOutputCallbacks=this.onBufferedOutputCallbacks.filter(t=>t!==e)}}sendComm(e,t){const n=this.sessions.get(e);if(!n||!n.ws||n.ws.readyState!==WebSocket.OPEN){console.warn(`[Kernel WS] Dropping ${t.msg_type} for comm ${t.comm_id}: session ${e} not connected`);return}try{n.ws.send(JSON.stringify({type:"comm",comm:t}))}catch(i){console.warn("[Kernel WS] Failed to send comm message:",i)}}onComm(e){return this.onCommCallbacks.push(e),()=>{this.onCommCallbacks=this.onCommCallbacks.filter(t=>t!==e)}}requestCommInfo(e,t=5e3){const n=this.sessions.get(e);return!n||!n.ws||n.ws.readyState!==WebSocket.OPEN?Promise.resolve({}):new Promise(i=>{var o;const r={resolve:i,timeout:setTimeout(()=>{n.pendingCommInfo&&(n.pendingCommInfo=n.pendingCommInfo.filter(l=>l!==r)),i({})},t)};n.pendingCommInfo=[...n.pendingCommInfo??[],r];try{n.ws.send(JSON.stringify({type:"comm_info"}))}catch(l){console.warn("[Kernel WS] Failed to request comm info:",l),clearTimeout(r.timeout),n.pendingCommInfo=(o=n.pendingCommInfo)==null?void 0:o.filter(h=>h!==r),i({})}})}startReconnectLoop(){this.reconnectInterval||(this.reconnectInterval=setInterval(async()=>{if(this.disconnectedSessions.size===0){this.stopReconnectLoop();return}for(const e of Array.from(this.disconnectedSessions)){const t=this.sessions.get(e);if(!t){this.disconnectedSessions.delete(e);continue}try{let n=null;try{n=await this.getStatus(e)}catch(i){if(i instanceof OT){const r=(this.serverGoneCounts.get(e)??0)+1;if(this.serverGoneCounts.set(e,r),r<3){console.log(`Session ${e} server/allocation reported gone (${r}/3): ${i.message}`);continue}console.log(`Session ${e} server/allocation gone: ${i.message}`),this.serverGoneCounts.delete(e),this.disconnectedSessions.delete(e);for(const o of this.onStatusCallbacks)try{o(e,"dead",null)}catch(l){console.error("Status callback error:",l)}continue}this.serverGoneCounts.delete(e),console.error(`Failed to check session status for ${e}:`,i);continue}if(this.serverGoneCounts.delete(e),!n&&t.filePath&&t.kernelName){console.log(`Session ${e} not found on server, recreating for ${t.filePath}`),this.sessions.delete(e),this.disconnectedSessions.delete(e);try{const{sessionId:i}=await this.getOrCreateKernelForFile(t.filePath,t.kernelName,t.serverId);console.log(`Recreated session as ${i}`);for(const r of this.onReconnectCallbacks)try{r(i,t.filePath)}catch(o){console.error("Reconnect callback error:",o)}}catch(i){console.error("Failed to recreate session:",i)}continue}await this.connectWebSocket(e),this.disconnectedSessions.delete(e),console.log(`Reconnected session ${e}`);for(const i of this.onReconnectCallbacks)try{i(e,t.filePath)}catch(r){console.error("Reconnect callback error:",r)}}catch(n){console.log(`Reconnection attempt failed for ${e}:`,n)}}},2e3))}stopReconnectLoop(){this.reconnectInterval&&(clearInterval(this.reconnectInterval),this.reconnectInterval=null)}_clearAllSessions(){this.stopReconnectLoop(),this.disconnectedSessions.clear(),this.sessions.clear()}getActiveSessions(){return Array.from(this.sessions.keys())}async getPythonEnvironments(e=!1,t){const n=new URLSearchParams({refresh:e?"true":"false"});t&&n.set("server_id",t);const i=await fetch(`${xs}/python/environments?${n.toString()}`);if(!i.ok)throw new Error("Failed to fetch Python environments");return i.json()}async getKernelPreference(e){const t=new URLSearchParams({file_path:e}),n=await fetch(`${xs}/kernels/preference?${t.toString()}`);if(!n.ok)throw new Error("Failed to fetch kernel preference");const i=await n.json();return!i.kernel_name&&!i.server_id?null:i}async installKernel(e,t,n){const i=await fetch(`${xs}/python/install-kernel`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({python_path:e,kernel_name:t,server_id:n||void 0})});if(!i.ok){const r=await i.json().catch(()=>({}));throw new Th(r.detail||"Failed to install kernel",r.code,r.install_hint)}return i.json()}async installIpykernel(e,t,n){const i=await fetch(`${xs}/python/install-ipykernel`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({python_path:e,server_id:t||void 0})});if(!i.ok||!i.body){const m=await i.json().catch(()=>({}));throw new Th(m.detail||"Failed to install ipykernel",m.code,m.install_hint)}const r=i.body.getReader(),o=new TextDecoder;let l="";const h=m=>{if(!m.trim())return null;let p;try{p=JSON.parse(m)}catch{return null}if(p.type==="output"&&p.data)return n==null||n(p.data),null;if(p.type==="done")return{installer:p.installer||"unknown",message:p.message||"Installed ipykernel"};if(p.type==="error")throw new Th(p.detail||"Failed to install ipykernel",p.code,p.install_hint);return null};for(;;){const{done:m,value:p}=await r.read();if(m)break;l+=o.decode(p,{stream:!0});let O;for(;(O=l.indexOf(`
|
|
536
|
-
`))>=0;){const x=l.slice(0,O);l=l.slice(O+1);const y=h(x);if(y)return y}}const u=h(l);if(u)return u;throw new Error("Install stream ended unexpectedly — the server may have restarted mid-install")}async probePythonPath(e,t){const n=await fetch(`${xs}/python/probe`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({python_path:e,server_id:t||void 0})});if(!n.ok){const i=await n.json().catch(()=>({}));throw new Th(i.detail||"Failed to probe interpreter",i.code,i.install_hint)}return n.json()}async refreshPythonEnvironments(e){const t=new URLSearchParams;e&&t.set("server_id",e);const n=t.toString()?`${xs}/python/refresh?${t.toString()}`:`${xs}/python/refresh`,i=await fetch(n,{method:"POST"});if(!i.ok)throw new Error("Failed to refresh Python environments");return i.json()}async getAllSessions(e){const t=new URLSearchParams;e&&t.set("server_id",e);const n=t.toString()?`${xs}/kernels/sessions?${t.toString()}`:`${xs}/kernels/sessions`,i=await fetch(n);if(!i.ok)throw new Error("Failed to fetch kernel sessions");return(await i.json()).sessions}requestInitialSync(e){var n;const t=this.sessions.get(e);if(t&&!t.initialSyncDone&&!t.initialSyncPromise&&!(!t.ws||t.ws.readyState!==WebSocket.OPEN)){t.initialSyncPromise=new Promise(i=>{t.initialSyncResolve=i});try{t.ws.send(JSON.stringify({type:"sync_outputs"}))}catch(i){console.error("Failed to request output sync:",i),t.initialSyncDone=!0,(n=t.initialSyncResolve)==null||n.call(t);return}t.initialSyncTimeout=setTimeout(()=>{var i;t.initialSyncDone||(t.initialSyncTimedOut=!0,console.warn("[Kernel WS] Initial output sync timed out; continuing without sync"),(i=t.initialSyncResolve)==null||i.call(t))},5e3)}}async waitForInitialSync(e){const t=this.sessions.get(e);t&&(t.initialSyncDone||t.initialSyncTimedOut||(this.requestInitialSync(e),t.initialSyncPromise&&await t.initialSyncPromise))}}const Jt=new zwe,bT=async s=>{const e=Ei.getToken(),t={"Content-Type":"application/json"};e&&(t.Authorization=`Bearer ${e}`);const n=new URLSearchParams;s&&n.set("server_id",s);const i=n.toString()?`${xs}/kernels/dead?${n.toString()}`:`${xs}/kernels/dead`,r=await fetch(i,{headers:t});if(!r.ok)throw new Error(`Failed to get dead sessions: ${r.statusText}`);return(await r.json()).sessions||[]},Bwe=async(s,e)=>{const t=Ei.getToken(),n={"Content-Type":"application/json"};t&&(n.Authorization=`Bearer ${t}`);const i=await fetch(`${xs}/kernels/dead/cleanup`,{method:"POST",headers:n,body:JSON.stringify({session_ids:s,server_id:e||void 0})});if(!i.ok)throw new Error(`Failed to cleanup dead sessions: ${i.statusText}`);return(await i.json()).deleted||0},Ec=new Map,Iwe=8e3;function ay(s){if(!(!s||s.length===0))return s.map(e=>{const t=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let n="";const i=32768;for(let r=0;r<t.length;r+=i)n+=String.fromCharCode(...t.subarray(r,r+i));return btoa(n)})}function qwe(s){return!s||s.length===0?[]:s.map(e=>{const t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return new DataView(n.buffer)})}function ly(s,e){const t={comm_id:s.comm_id,data:s.data??{}};return s.msg_type==="comm_open"&&(t.target_name=s.target_name),{header:{msg_id:crypto.randomUUID(),msg_type:s.msg_type,username:"",session:"",date:new Date().toISOString(),version:"5.2"},parent_header:e?{msg_id:e}:{},metadata:s.msg_type==="comm_open"?{version:"2.1.0"}:{},content:t,buffers:qwe(s.buffers),channel:"iopub"}}let vT=!1;function Xwe(){vT||(vT=!0,Jt.onStatus((s,e)=>{(e==="dead"||e==="starting")&&Ec.has(s)&&(console.log(`[widgets] Kernel ${e} — disposing widget manager for session ${s}`),Uwe(s))}))}function Uwe(s){const e=Ec.get(s);e&&(Ec.delete(s),e.disposed=!0,e.deliver=null,e.queue.length=0,e.unsubscribeComm(),e.promise.then(t=>t.disposeManager()).catch(()=>{}))}async function Zwe(s){const e=Ec.get(s);if(!e||e.disposed)return null;try{return await(await e.promise).getStateSnapshot()}catch{return null}}function Wwe(s){Xwe();const e=Ec.get(s);if(e)return e.promise;const t={promise:void 0,queue:[],deliver:null,unsubscribeComm:()=>{},disposed:!1};return t.unsubscribeComm=Jt.onComm((n,i)=>{n!==s||t.disposed||(t.deliver?t.deliver(i):t.queue.push(i))}),t.promise=Vwe(s,t).catch(n=>{throw Ec.get(s)===t&&(t.unsubscribeComm(),Ec.delete(s)),n}),Ec.set(s,t),t.promise}async function Vwe(s,e){const[{HTMLManager:t},n,i]=await Promise.all([Qm(()=>import("./index-2nV_DRXf.js"),__vite__mapDeps([0,1,2,3])),Qm(()=>import("./index-FGb2qbG1.js"),__vite__mapDeps([4,1,5,2])),Qm(()=>import("./index-BElcu9UX.js"),__vite__mapDeps([6,1,5])),Qm(()=>Promise.resolve({}),__vite__mapDeps([7]))]);class r{constructor(u,m,p){this.comm_id=u,this.target_name=m,this.onLocalClose=p,this.onMsgCallback=null,this.onCloseCallback=null,this.pendingMessages=[],this.lastSentMsgId="",this.closed=!1}nextMsgId(){return this.lastSentMsgId=crypto.randomUUID(),this.lastSentMsgId}open(u,m,p,O){return Jt.sendComm(s,{msg_type:"comm_open",comm_id:this.comm_id,target_name:this.target_name,data:u??{},buffers:ay(O)}),this.nextMsgId()}send(u,m,p,O){return this.closed?"":(Jt.sendComm(s,{msg_type:"comm_msg",comm_id:this.comm_id,data:u??{},buffers:ay(O)}),this.nextMsgId())}close(u,m,p,O){return this.closed?"":(this.closed=!0,Jt.sendComm(s,{msg_type:"comm_close",comm_id:this.comm_id,data:u??{},buffers:ay(O)}),this.onLocalClose(this.comm_id),this.nextMsgId())}on_msg(u){this.onMsgCallback=u;const m=this.pendingMessages.splice(0);for(const p of m)try{u(p)}catch(O){console.error("[widgets] Comm message handler error:",O)}}on_close(u){this.onCloseCallback=u}handleIncoming(u){var O,x;if(u.msg_type==="comm_close"){this.closed=!0,(O=this.onCloseCallback)==null||O.call(this,ly(u,this.lastSentMsgId));return}if(((x=u.data)==null?void 0:x.method)==="echo_update")return;const p=ly(u,this.lastSentMsgId);this.onMsgCallback?this.onMsgCallback(p):this.pendingMessages.push(p)}}class o extends t{constructor(){super(...arguments),this.sessionId=s,this.comms=new Map}makeComm(u,m){const p=new r(u,m,O=>this.comms.delete(O));return this.comms.set(u,p),p}_create_comm(u,m,p,O,x){const y=this.makeComm(m??crypto.randomUUID(),u);return(p!==void 0||O!==void 0)&&y.open(p??{},void 0,O,x),Promise.resolve(y)}async _get_comm_info(){const u=await Jt.requestCommInfo(this.sessionId),m={};for(const[p,O]of Object.entries(u))(O==null?void 0:O.target_name)===this.comm_target_name&&(m[p]=O);return m}loadClass(u,m,p){const O=m==="@jupyter-widgets/base"?n:m==="@jupyter-widgets/controls"?i:null;if(O){const x=O[u];return x?Promise.resolve(x):Promise.reject(new Error(`Widget class ${u} not found in ${m}`))}return super.loadClass(u,m,p)}handleComm(u){if(u.msg_type==="comm_open"){if(u.target_name!==this.comm_target_name||this.comms.has(u.comm_id)||this.has_model(u.comm_id))return;const p=this.makeComm(u.comm_id,u.target_name);this.handle_comm_open(p,ly(u,"")).catch(O=>{console.error("[widgets] Failed to handle comm_open:",O)});return}const m=this.comms.get(u.comm_id);m&&(u.msg_type==="comm_close"&&this.comms.delete(u.comm_id),m.handleIncoming(u))}restoreState(){return this._loadFromKernel()}hasModel(u){return this.has_model(u)}async renderModel(u,m){if(!this.has_model(u))return null;const p=await this.get_model(u),O=await this.create_view(p);await this.display_view(O,m);let x=!1;return{dispose:()=>{if(!x){x=!0;try{O.remove()}catch(y){console.warn("[widgets] Failed to remove widget view:",y)}}}}}disposeManager(){try{this.disconnect()}catch{}this.clear_state().catch(()=>{}),this.comms.clear()}async getStateSnapshot(){return await this.get_state()}}const l=new o;e.deliver=h=>l.handleComm(h);for(const h of e.queue.splice(0))l.handleComm(h);if(!e.disposed&&Jt.isConnected(s))try{await Promise.race([l.restoreState(),new Promise((h,u)=>setTimeout(()=>u(new Error("widget state restore timed out")),Iwe))])}catch(h){console.warn("[widgets] Could not restore pre-existing widget state:",h)}return l}const tA="application/vnd.jupyter.widget-view+json",Hwe=[tA,"application/vnd.nebula.web+json","application/vnd.plotly.v1+json","text/html","image/png","text/plain"],Fwe=Object.getPrototypeOf(async function(){}).constructor;function Ywe(s,e){if(!s)return e??null;if(e&&e in s)return e;for(const n of Hwe)if(n in s)return n;const[t]=Object.keys(s);return t??e??null}function yT(s,e){return!s||!e?null:s[e]??null}function y0(s){return s===null?"":typeof s=="string"?s:JSON.stringify(s,null,2)}function Gwe(s){const e=s.bdata,t=atob(e),n=new Uint8Array(t.length);for(let l=0;l<t.length;l++)n[l]=t.charCodeAt(l);const r={i1:{ctor:Int8Array,size:1},u1:{ctor:Uint8Array,size:1},i2:{ctor:Int16Array,size:2},u2:{ctor:Uint16Array,size:2},i4:{ctor:Int32Array,size:4},u4:{ctor:Uint32Array,size:4},f4:{ctor:Float32Array,size:4},f8:{ctor:Float64Array,size:8}}[s.dtype];if(!r)return Array.from(n);const o=new r.ctor(n.buffer);return Array.from(o)}function Kwe(s){return typeof s=="object"&&s!==null&&"dtype"in s&&"bdata"in s}function V1(s){for(const e of Object.keys(s)){const t=s[e];Kwe(t)?s[e]=Gwe(t):typeof t=="object"&&t!==null&&!Array.isArray(t)&&V1(t)}}function Jwe(s){if(s===null)return null;let e=null;if(typeof s=="string")try{e=JSON.parse(s)}catch{return null}else typeof s=="object"&&!Array.isArray(s)&&(e=s);if(!e)return null;if(e.data)for(const t of e.data)V1(t);return e.layout&&typeof e.layout=="object"&&V1(e.layout),e}function eSe(s){if(s===null)return null;if(typeof s=="string")try{return JSON.parse(s)}catch{return null}return typeof s=="object"&&!Array.isArray(s)?s:null}function tSe(s){const e=s==null?void 0:s["text/html"];return!!(e&&typeof e=="object"&&!Array.isArray(e)&&e.isolated===!0)}function sA(s,e,t,n){v.useEffect(()=>{let i=!1,r=null;return(async()=>{try{const l=await JN("plotly");if(i||!s.current||!(l!=null&&l.react))return;r=l;const h=t?{...e.layout,...t}:e.layout||{};await l.react(s.current,e.data||[],h,e.config||{})}catch(l){!i&&n&&n(l instanceof Error?l.message:"Failed to render Plotly output")}})(),()=>{i=!0,r!=null&&r.purge&&s.current&&r.purge(s.current)}},[s,e,t,n])}const sSe=({figure:s,onClose:e})=>{const t=v.useRef(null),n=v.useMemo(()=>({autosize:!0,paper_bgcolor:"white",plot_bgcolor:void 0}),[]),i=v.useCallback(r=>{console.error("[PlotlyModal]",r)},[]);return sA(t,s,n,i),v.useEffect(()=>{const r=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=r}},[]),v.useEffect(()=>{const r=o=>{o.key==="Escape"&&e()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e]),SS.createPortal(d.jsxs("div",{className:"fixed inset-0 z-50 bg-slate-950/80 backdrop-blur-sm flex flex-col",onClick:e,children:[d.jsx("div",{className:"flex justify-end p-3 shrink-0",children:d.jsx("button",{type:"button",onClick:e,className:"rounded-full bg-slate-900/70 px-3 py-1.5 text-sm text-white/85 hover:text-white hover:bg-slate-900 z-20",children:"Close"})}),d.jsx("div",{className:"flex-1 min-h-0 p-4 overflow-auto",onClick:r=>r.stopPropagation(),children:d.jsx("div",{ref:t,className:"w-full min-h-full bg-white rounded-lg"})})]}),document.body)},nSe=({figure:s,fallbackText:e})=>{const t=v.useRef(null),[n,i]=v.useState(null),[r,o]=v.useState(!1),l=v.useCallback(h=>i(h),[]);return sA(t,s,void 0,l),n?d.jsxs("div",{className:"my-2 rounded border border-amber-200 bg-amber-50 p-3 text-sm text-amber-800",children:[d.jsx("div",{className:"font-medium",children:"Plotly renderer failed"}),d.jsx("div",{className:"mt-1 whitespace-pre-wrap",children:n}),e?d.jsx("pre",{className:"mt-2 overflow-x-auto whitespace-pre-wrap text-xs text-amber-900",children:e}):null]}):d.jsxs(d.Fragment,{children:[r&&d.jsx(sSe,{figure:s,onClose:()=>o(!1)}),d.jsxs("div",{className:"my-2 relative group overflow-hidden rounded border border-slate-200",children:[d.jsx("button",{type:"button",onClick:()=>o(!0),className:"absolute top-2 right-2 z-10 opacity-0 group-hover:opacity-100 transition-opacity rounded bg-slate-800/70 px-2 py-1 text-xs text-white hover:bg-slate-800",title:"View fullscreen",children:"Expand"}),d.jsx("div",{ref:t,className:"min-h-[18rem] w-full overflow-x-auto bg-white"})]})]})},iSe=({payload:s,fallbackText:e})=>{const t=v.useRef(null),[n,i]=v.useState(null);return v.useEffect(()=>{let r=!1,o;const l=async()=>{if(!t.current)return;const h=t.current.shadowRoot||t.current.attachShadow({mode:"open"}),u=document.createElement("div");u.style.minHeight=`${s.height??240}px`,u.innerHTML=s.html||"<div data-nebula-root></div>";const m=document.createElement("style");m.textContent=`
|
|
536
|
+
`))>=0;){const x=l.slice(0,O);l=l.slice(O+1);const y=h(x);if(y)return y}}const u=h(l);if(u)return u;throw new Error("Install stream ended unexpectedly — the server may have restarted mid-install")}async probePythonPath(e,t){const n=await fetch(`${xs}/python/probe`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({python_path:e,server_id:t||void 0})});if(!n.ok){const i=await n.json().catch(()=>({}));throw new Th(i.detail||"Failed to probe interpreter",i.code,i.install_hint)}return n.json()}async refreshPythonEnvironments(e){const t=new URLSearchParams;e&&t.set("server_id",e);const n=t.toString()?`${xs}/python/refresh?${t.toString()}`:`${xs}/python/refresh`,i=await fetch(n,{method:"POST"});if(!i.ok)throw new Error("Failed to refresh Python environments");return i.json()}async getAllSessions(e){const t=new URLSearchParams;e&&t.set("server_id",e);const n=t.toString()?`${xs}/kernels/sessions?${t.toString()}`:`${xs}/kernels/sessions`,i=await fetch(n);if(!i.ok)throw new Error("Failed to fetch kernel sessions");return(await i.json()).sessions}requestInitialSync(e){var n;const t=this.sessions.get(e);if(t&&!t.initialSyncDone&&!t.initialSyncPromise&&!(!t.ws||t.ws.readyState!==WebSocket.OPEN)){t.initialSyncPromise=new Promise(i=>{t.initialSyncResolve=i});try{t.ws.send(JSON.stringify({type:"sync_outputs"}))}catch(i){console.error("Failed to request output sync:",i),t.initialSyncDone=!0,(n=t.initialSyncResolve)==null||n.call(t);return}t.initialSyncTimeout=setTimeout(()=>{var i;t.initialSyncDone||(t.initialSyncTimedOut=!0,console.warn("[Kernel WS] Initial output sync timed out; continuing without sync"),(i=t.initialSyncResolve)==null||i.call(t))},5e3)}}async waitForInitialSync(e){const t=this.sessions.get(e);t&&(t.initialSyncDone||t.initialSyncTimedOut||(this.requestInitialSync(e),t.initialSyncPromise&&await t.initialSyncPromise))}}const Jt=new zwe,bT=async s=>{const e=Ei.getToken(),t={"Content-Type":"application/json"};e&&(t.Authorization=`Bearer ${e}`);const n=new URLSearchParams;s&&n.set("server_id",s);const i=n.toString()?`${xs}/kernels/dead?${n.toString()}`:`${xs}/kernels/dead`,r=await fetch(i,{headers:t});if(!r.ok)throw new Error(`Failed to get dead sessions: ${r.statusText}`);return(await r.json()).sessions||[]},Bwe=async(s,e)=>{const t=Ei.getToken(),n={"Content-Type":"application/json"};t&&(n.Authorization=`Bearer ${t}`);const i=await fetch(`${xs}/kernels/dead/cleanup`,{method:"POST",headers:n,body:JSON.stringify({session_ids:s,server_id:e||void 0})});if(!i.ok)throw new Error(`Failed to cleanup dead sessions: ${i.statusText}`);return(await i.json()).deleted||0},Ec=new Map,Iwe=8e3;function ay(s){if(!(!s||s.length===0))return s.map(e=>{const t=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let n="";const i=32768;for(let r=0;r<t.length;r+=i)n+=String.fromCharCode(...t.subarray(r,r+i));return btoa(n)})}function qwe(s){return!s||s.length===0?[]:s.map(e=>{const t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return new DataView(n.buffer)})}function ly(s,e){const t={comm_id:s.comm_id,data:s.data??{}};return s.msg_type==="comm_open"&&(t.target_name=s.target_name),{header:{msg_id:crypto.randomUUID(),msg_type:s.msg_type,username:"",session:"",date:new Date().toISOString(),version:"5.2"},parent_header:e?{msg_id:e}:{},metadata:s.msg_type==="comm_open"?{version:"2.1.0"}:{},content:t,buffers:qwe(s.buffers),channel:"iopub"}}let vT=!1;function Xwe(){vT||(vT=!0,Jt.onStatus((s,e)=>{(e==="dead"||e==="starting")&&Ec.has(s)&&(console.log(`[widgets] Kernel ${e} — disposing widget manager for session ${s}`),Uwe(s))}))}function Uwe(s){const e=Ec.get(s);e&&(Ec.delete(s),e.disposed=!0,e.deliver=null,e.queue.length=0,e.unsubscribeComm(),e.promise.then(t=>t.disposeManager()).catch(()=>{}))}async function Zwe(s){const e=Ec.get(s);if(!e||e.disposed)return null;try{return await(await e.promise).getStateSnapshot()}catch{return null}}function Wwe(s){Xwe();const e=Ec.get(s);if(e)return e.promise;const t={promise:void 0,queue:[],deliver:null,unsubscribeComm:()=>{},disposed:!1};return t.unsubscribeComm=Jt.onComm((n,i)=>{n!==s||t.disposed||(t.deliver?t.deliver(i):t.queue.push(i))}),t.promise=Vwe(s,t).catch(n=>{throw Ec.get(s)===t&&(t.unsubscribeComm(),Ec.delete(s)),n}),Ec.set(s,t),t.promise}async function Vwe(s,e){const[{HTMLManager:t},n,i]=await Promise.all([Qm(()=>import("./index-CV0ZPmTH.js"),__vite__mapDeps([0,1,2,3])),Qm(()=>import("./index-a9gKLTlv.js"),__vite__mapDeps([4,1,5,2])),Qm(()=>import("./index-DqHzn4vg.js"),__vite__mapDeps([6,1,5])),Qm(()=>Promise.resolve({}),__vite__mapDeps([7]))]);class r{constructor(u,m,p){this.comm_id=u,this.target_name=m,this.onLocalClose=p,this.onMsgCallback=null,this.onCloseCallback=null,this.pendingMessages=[],this.lastSentMsgId="",this.closed=!1}nextMsgId(){return this.lastSentMsgId=crypto.randomUUID(),this.lastSentMsgId}open(u,m,p,O){return Jt.sendComm(s,{msg_type:"comm_open",comm_id:this.comm_id,target_name:this.target_name,data:u??{},buffers:ay(O)}),this.nextMsgId()}send(u,m,p,O){return this.closed?"":(Jt.sendComm(s,{msg_type:"comm_msg",comm_id:this.comm_id,data:u??{},buffers:ay(O)}),this.nextMsgId())}close(u,m,p,O){return this.closed?"":(this.closed=!0,Jt.sendComm(s,{msg_type:"comm_close",comm_id:this.comm_id,data:u??{},buffers:ay(O)}),this.onLocalClose(this.comm_id),this.nextMsgId())}on_msg(u){this.onMsgCallback=u;const m=this.pendingMessages.splice(0);for(const p of m)try{u(p)}catch(O){console.error("[widgets] Comm message handler error:",O)}}on_close(u){this.onCloseCallback=u}handleIncoming(u){var O,x;if(u.msg_type==="comm_close"){this.closed=!0,(O=this.onCloseCallback)==null||O.call(this,ly(u,this.lastSentMsgId));return}if(((x=u.data)==null?void 0:x.method)==="echo_update")return;const p=ly(u,this.lastSentMsgId);this.onMsgCallback?this.onMsgCallback(p):this.pendingMessages.push(p)}}class o extends t{constructor(){super(...arguments),this.sessionId=s,this.comms=new Map}makeComm(u,m){const p=new r(u,m,O=>this.comms.delete(O));return this.comms.set(u,p),p}_create_comm(u,m,p,O,x){const y=this.makeComm(m??crypto.randomUUID(),u);return(p!==void 0||O!==void 0)&&y.open(p??{},void 0,O,x),Promise.resolve(y)}async _get_comm_info(){const u=await Jt.requestCommInfo(this.sessionId),m={};for(const[p,O]of Object.entries(u))(O==null?void 0:O.target_name)===this.comm_target_name&&(m[p]=O);return m}loadClass(u,m,p){const O=m==="@jupyter-widgets/base"?n:m==="@jupyter-widgets/controls"?i:null;if(O){const x=O[u];return x?Promise.resolve(x):Promise.reject(new Error(`Widget class ${u} not found in ${m}`))}return super.loadClass(u,m,p)}handleComm(u){if(u.msg_type==="comm_open"){if(u.target_name!==this.comm_target_name||this.comms.has(u.comm_id)||this.has_model(u.comm_id))return;const p=this.makeComm(u.comm_id,u.target_name);this.handle_comm_open(p,ly(u,"")).catch(O=>{console.error("[widgets] Failed to handle comm_open:",O)});return}const m=this.comms.get(u.comm_id);m&&(u.msg_type==="comm_close"&&this.comms.delete(u.comm_id),m.handleIncoming(u))}restoreState(){return this._loadFromKernel()}hasModel(u){return this.has_model(u)}async renderModel(u,m){if(!this.has_model(u))return null;const p=await this.get_model(u),O=await this.create_view(p);await this.display_view(O,m);let x=!1;return{dispose:()=>{if(!x){x=!0;try{O.remove()}catch(y){console.warn("[widgets] Failed to remove widget view:",y)}}}}}disposeManager(){try{this.disconnect()}catch{}this.clear_state().catch(()=>{}),this.comms.clear()}async getStateSnapshot(){return await this.get_state()}}const l=new o;e.deliver=h=>l.handleComm(h);for(const h of e.queue.splice(0))l.handleComm(h);if(!e.disposed&&Jt.isConnected(s))try{await Promise.race([l.restoreState(),new Promise((h,u)=>setTimeout(()=>u(new Error("widget state restore timed out")),Iwe))])}catch(h){console.warn("[widgets] Could not restore pre-existing widget state:",h)}return l}const tA="application/vnd.jupyter.widget-view+json",Hwe=[tA,"application/vnd.nebula.web+json","application/vnd.plotly.v1+json","text/html","image/png","text/plain"],Fwe=Object.getPrototypeOf(async function(){}).constructor;function Ywe(s,e){if(!s)return e??null;if(e&&e in s)return e;for(const n of Hwe)if(n in s)return n;const[t]=Object.keys(s);return t??e??null}function yT(s,e){return!s||!e?null:s[e]??null}function y0(s){return s===null?"":typeof s=="string"?s:JSON.stringify(s,null,2)}function Gwe(s){const e=s.bdata,t=atob(e),n=new Uint8Array(t.length);for(let l=0;l<t.length;l++)n[l]=t.charCodeAt(l);const r={i1:{ctor:Int8Array,size:1},u1:{ctor:Uint8Array,size:1},i2:{ctor:Int16Array,size:2},u2:{ctor:Uint16Array,size:2},i4:{ctor:Int32Array,size:4},u4:{ctor:Uint32Array,size:4},f4:{ctor:Float32Array,size:4},f8:{ctor:Float64Array,size:8}}[s.dtype];if(!r)return Array.from(n);const o=new r.ctor(n.buffer);return Array.from(o)}function Kwe(s){return typeof s=="object"&&s!==null&&"dtype"in s&&"bdata"in s}function V1(s){for(const e of Object.keys(s)){const t=s[e];Kwe(t)?s[e]=Gwe(t):typeof t=="object"&&t!==null&&!Array.isArray(t)&&V1(t)}}function Jwe(s){if(s===null)return null;let e=null;if(typeof s=="string")try{e=JSON.parse(s)}catch{return null}else typeof s=="object"&&!Array.isArray(s)&&(e=s);if(!e)return null;if(e.data)for(const t of e.data)V1(t);return e.layout&&typeof e.layout=="object"&&V1(e.layout),e}function eSe(s){if(s===null)return null;if(typeof s=="string")try{return JSON.parse(s)}catch{return null}return typeof s=="object"&&!Array.isArray(s)?s:null}function tSe(s){const e=s==null?void 0:s["text/html"];return!!(e&&typeof e=="object"&&!Array.isArray(e)&&e.isolated===!0)}function sA(s,e,t,n){v.useEffect(()=>{let i=!1,r=null;return(async()=>{try{const l=await JN("plotly");if(i||!s.current||!(l!=null&&l.react))return;r=l;const h=t?{...e.layout,...t}:e.layout||{};await l.react(s.current,e.data||[],h,e.config||{})}catch(l){!i&&n&&n(l instanceof Error?l.message:"Failed to render Plotly output")}})(),()=>{i=!0,r!=null&&r.purge&&s.current&&r.purge(s.current)}},[s,e,t,n])}const sSe=({figure:s,onClose:e})=>{const t=v.useRef(null),n=v.useMemo(()=>({autosize:!0,paper_bgcolor:"white",plot_bgcolor:void 0}),[]),i=v.useCallback(r=>{console.error("[PlotlyModal]",r)},[]);return sA(t,s,n,i),v.useEffect(()=>{const r=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=r}},[]),v.useEffect(()=>{const r=o=>{o.key==="Escape"&&e()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e]),SS.createPortal(d.jsxs("div",{className:"fixed inset-0 z-50 bg-slate-950/80 backdrop-blur-sm flex flex-col",onClick:e,children:[d.jsx("div",{className:"flex justify-end p-3 shrink-0",children:d.jsx("button",{type:"button",onClick:e,className:"rounded-full bg-slate-900/70 px-3 py-1.5 text-sm text-white/85 hover:text-white hover:bg-slate-900 z-20",children:"Close"})}),d.jsx("div",{className:"flex-1 min-h-0 p-4 overflow-auto",onClick:r=>r.stopPropagation(),children:d.jsx("div",{ref:t,className:"w-full min-h-full bg-white rounded-lg"})})]}),document.body)},nSe=({figure:s,fallbackText:e})=>{const t=v.useRef(null),[n,i]=v.useState(null),[r,o]=v.useState(!1),l=v.useCallback(h=>i(h),[]);return sA(t,s,void 0,l),n?d.jsxs("div",{className:"my-2 rounded border border-amber-200 bg-amber-50 p-3 text-sm text-amber-800",children:[d.jsx("div",{className:"font-medium",children:"Plotly renderer failed"}),d.jsx("div",{className:"mt-1 whitespace-pre-wrap",children:n}),e?d.jsx("pre",{className:"mt-2 overflow-x-auto whitespace-pre-wrap text-xs text-amber-900",children:e}):null]}):d.jsxs(d.Fragment,{children:[r&&d.jsx(sSe,{figure:s,onClose:()=>o(!1)}),d.jsxs("div",{className:"my-2 relative group overflow-hidden rounded border border-slate-200",children:[d.jsx("button",{type:"button",onClick:()=>o(!0),className:"absolute top-2 right-2 z-10 opacity-0 group-hover:opacity-100 transition-opacity rounded bg-slate-800/70 px-2 py-1 text-xs text-white hover:bg-slate-800",title:"View fullscreen",children:"Expand"}),d.jsx("div",{ref:t,className:"min-h-[18rem] w-full overflow-x-auto bg-white"})]})]})},iSe=({payload:s,fallbackText:e})=>{const t=v.useRef(null),[n,i]=v.useState(null);return v.useEffect(()=>{let r=!1,o;const l=async()=>{if(!t.current)return;const h=t.current.shadowRoot||t.current.attachShadow({mode:"open"}),u=document.createElement("div");u.style.minHeight=`${s.height??240}px`,u.innerHTML=s.html||"<div data-nebula-root></div>";const m=document.createElement("style");m.textContent=`
|
|
537
537
|
:host { all: initial; display: block; }
|
|
538
538
|
.nebula-web-root { box-sizing: border-box; }
|
|
539
539
|
${s.css||""}
|
|
@@ -597,7 +597,7 @@ def add(a, b):
|
|
|
597
597
|
`,r=lo.diff_linesToChars_(n,i),o=lo.diff_main(r.chars1,r.chars2,!1);lo.diff_charsToLines_(o,r.lineArray);const l=[];let h=1,u=1;for(const[O,x]of o)if(x!=="")for(const y of kje(x))O===0?l.push({kind:"context",text:y,oldLine:h++,newLine:u++}):O===-1?l.push({kind:"removed",text:y,oldLine:h++}):l.push({kind:"added",text:y,newLine:u++});const m=[];let p=0;for(;p<l.length;){if(l[p].kind!=="context"){m.push(l[p]),p++;continue}let O=p;for(;O<l.length&&l[O].kind==="context";)O++;const x=l.slice(p,O),y=p>0?t:0,w=O<l.length?t:0;if(x.length>y+w){m.push(...x.slice(0,y));const S=x.length-y-w;m.push({kind:"gap",text:"",hiddenCount:S}),w>0&&m.push(...x.slice(x.length-w))}else m.push(...x);p=O}return m}function ud(s){let e=0;for(let t=0;t<s.length;t++){const n=s.charCodeAt(t);e=(e<<5)-e+n,e=e&e}return e.toString(16)}const fw="nebula-active-agent";function mc(){try{return window.localStorage.getItem(fw)||null}catch{return null}}function a4(s){try{s?window.localStorage.setItem(fw,s):window.localStorage.removeItem(fw)}catch{}}function Tje(s){if(!s)return null;const e=s.lastIndexOf("/");return e>0?s.slice(0,e):null}function $je(s){let e=0;for(let i=0;i<s.length;i++)e=(e<<5)-e+s.charCodeAt(i)|0;const t=(e>>>0).toString(16).padStart(8,"0").slice(0,6),n=s.split("/").pop()||"dir";return`agent-${t}-${n}`}async function r1(){try{const s=await fetch("/api/agents");if(!s.ok)return[];const e=await s.json();return Array.isArray(e.agents)?e.agents:[]}catch{return[]}}async function mw(s){try{const e=await fetch(`/api/terminals/${encodeURIComponent(s)}/busy`);if(!e.ok)return null;const t=await e.json();return typeof t.busy=="boolean"?t.busy:null}catch{return null}}async function Qje(s){try{await fetch("/api/agents/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}catch{}}async function Eje(s){try{return(await fetch(`/api/agents/${encodeURIComponent(s)}/hibernate`,{method:"POST"})).ok}catch{return!1}}async function Rje(s){try{return(await fetch(`/api/agents/${encodeURIComponent(s)}`,{method:"DELETE"})).ok}catch{return!1}}const l4="nebula-getstarted",o1={openedNotebook:!1,ranCell:!1,launchedAgent:!1,allocatedCompute:!1,dismissed:!1};let id=null;const pw=new Set;function qk(){if(id)return id;try{const s=localStorage.getItem(l4);id=s?{...o1,...JSON.parse(s)}:{...o1}}catch{id={...o1}}return id}function c4(s){id=s;try{localStorage.setItem(l4,JSON.stringify(s))}catch{}for(const e of pw)e()}function Nje(){return qk()}function jp(s){const e=qk();e[s]||c4({...e,[s]:!0})}function jE(){const s=qk();s.dismissed||c4({...s,dismissed:!0})}function Aje(s){return pw.add(s),()=>{pw.delete(s)}}const Mje=150,gw=280,jje=1e4,Pje=5e3,a1=/\x1b\[\?(1049|1004|1000|1002|1003)h/,Lje=/\x1b\[\?(1049|1004|1000|1002|1003)l/,Dje=/command not found|not found|no such file or directory|is not recognized|permission denied|cannot execute|No such file|connection refused|connection timed out|could not resolve hostname|no route to host|ssh: connect to host|no conversation found/i,Ow="nebula-agent-running:";function PE(s){try{const e=window.sessionStorage.getItem(Ow+s);return e==="claude"||e==="codex"||e==="manual"?e:null}catch{return null}}function fm(s,e){try{e?window.sessionStorage.setItem(Ow+s,e):window.sessionStorage.removeItem(Ow+s)}catch{}}const xw="nebula-agent-session:";function LE(s){try{return window.localStorage.getItem(xw+s)||null}catch{return null}}function DE(s,e){try{e?window.localStorage.setItem(xw+s,e):window.localStorage.removeItem(xw+s)}catch{}}function l1(s){let e=0;for(let i=0;i<s.length;i++)e=(e<<5)-e+s.charCodeAt(i)|0;const t=(e>>>0).toString(16).padStart(8,"0").slice(0,6),n=(s.split("/").pop()||"project").replace(/[^a-zA-Z0-9_-]/g,"-").slice(0,24);return`p-${t}-${n}`}function zje(){try{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID()}catch{}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{const e=Math.random()*16|0;return(s==="x"?e:e&3|8).toString(16)})}const Xk=/\x1b\[[0-9;?]*[ -\/]*[@-~]/g;class Bje{constructor(){this.senders=new Map,this.state={terminalId:null,status:"none",agentKind:null},this.listeners=new Set,this.panelOpener=null,this.notebookPath=null,this.lastTaggedNotebook=null,this.teardownGraceTimer=null,this.lastLaunchKind=null,this.lastLaunchSent=null,this.serverBaseUrl=null,this.repoRoot=null,this.launchWatch=null}registerSender(e,t){if(this.senders.set(e,t),e===this.state.terminalId&&this.state.status==="none"){const n=PE(e);n&&(this.state={...this.state,status:"running",agentKind:n},this.armExitWatch(e,n))}this.notify()}unregisterSender(e){this.senders.delete(e),this.notify()}setAgentTerminal(e){if(this.state.terminalId===e)return;this.lastLaunchSent=null,this.clearWatch();const t=e?PE(e):null;this.state=t?{terminalId:e,status:"running",agentKind:t}:{terminalId:e,status:"none",agentKind:null},e&&t&&this.armExitWatch(e,t),this.notify()}setPanelOpener(e){this.panelOpener=e}setNotebookContext(e){const t=this.notebookPath;if(this.notebookPath=e,e&&t&&e!==t&&this.state.status==="running"&&this.lastTaggedNotebook!==e){const n=this.state.terminalId?this.senders.get(this.state.terminalId):void 0;n&&n(`[now driving: ${e}] `)&&(this.lastTaggedNotebook=e)}}setServerContext(e){this.serverBaseUrl=e}setRepoRoot(e){this.repoRoot=e}buildSetupMcpCommand(){return"npx nebula-notebook-mcp setup-mcp"}buildSetupSkillCommand(){return"npx -p nebula-notebook-mcp nebula setup-skill"}getRemoteAgentConfig(){var t;const e=$t();return!e.remoteAgentEnabled||!e.remoteAgentPort||!((t=e.remoteAgentUser)!=null&&t.trim())?null:{port:e.remoteAgentPort,user:e.remoteAgentUser.trim(),localUrl:(e.remoteAgentLocalUrl||"http://localhost:3000").replace(/\/$/,"")}}buildTunnelCommand(e,t){var l;const n=$t();let i="3000";try{i=new URL(n.remoteAgentLocalUrl||"http://localhost:3000").port||"80"}catch{}const r=(l=n.remoteAgentJumpHost)!=null&&l.trim()?` -J ${n.remoteAgentJumpHost.trim()}`:"",o=n.remoteAgentLocalSshPort??22;return`ssh${r} -L ${i}:localhost:${t??3e3} -R ${n.remoteAgentPort??"<port>"}:localhost:${o} ${e||"<server-host>"}`}buildBurrowCommand(e,t){var l;const n=$t();let i="3000";try{i=new URL(n.remoteAgentLocalUrl||"http://localhost:3000").port||"80"}catch{}const r=(l=n.remoteAgentJumpHost)!=null&&l.trim()?` --jump ${n.remoteAgentJumpHost.trim()}`:"",o=n.remoteAgentLocalSshPort??22;return`burrow add --name nebula-agent --host ${e||"<server-host>"}${r} --local ${i}:localhost:${t??3e3} --remote ${n.remoteAgentPort??"<port>"}:localhost:${o}`}buildRemoteSetupAgentPrompt(e,t){var u;const n=$t(),i=e||"<server-host>",r=n.remoteAgentPort??"<port>",o=n.remoteAgentLocalSshPort??22;let l="3000";try{l=new URL(n.remoteAgentLocalUrl||"http://localhost:3000").port||"80"}catch{}const h=(u=n.remoteAgentJumpHost)!=null&&u.trim()?`
|
|
598
598
|
The server is reachable only through the jump host \`${n.remoteAgentJumpHost.trim()}\` (already in the commands below).`:`
|
|
599
599
|
If \`${i}\` is not reachable directly from my machine, add a jump host (\`-J <bastion>\` / \`--jump <bastion>\`) and tell me what you used.`;return['Please set up "Nebula agent on my machine" for me. I am on macOS; you are running ON my machine.',`Nebula runs on the server \`${i}\`. The goal: an SSH tunnel that (a) forwards the Nebula UI to my machine and (b) lets the server reach my machine's sshd on port ${o}, so Nebula can start agents here.`,"","Step 1 — create the tunnel. Prefer Burrow (macOS menu-bar SSH manager: supervised, auto-reconnect) if `burrow` is on PATH:",` ${this.buildBurrowCommand(e,t)}`," then connect it from the Burrow menu bar. If Burrow is not installed, use plain ssh in a terminal that stays open:",` ${this.buildTunnelCommand(e,t)}`,h,"",`Step 2 — let the server ssh back in. Turn on Remote Login (System Settings → General → Sharing → Remote Login), or \`sudo systemsetup -setremotelogin on\`. Confirm my sshd really listens on port ${o} (\`sudo lsof -iTCP:${o} -sTCP:LISTEN\`); if it does not, tell me — Nebula must be pointed at the real port.`,"","Step 3 — authorize the server. The server needs key access to my machine, so it can start agents without a password. This one runs ON THE SERVER, so give me the exact line to paste there once the tunnel is up:",` ssh-copy-id -o ProxyCommand=none -p ${r} $(whoami)@localhost`,"","Step 4 — install the Nebula tooling here, so agents on my machine can drive notebooks:",` ${this.buildSetupSkillCommand()}`,` ${this.buildSetupMcpCommand()}`,"",`Finally, verify and report: the tunnel is connected, \`curl -sf http://localhost:${l}/api/health\` answers from my machine, and \`ssh -p ${o} localhost whoami\` works locally. Tell me my username on this machine — Nebula needs it, and it is what \`whoami\` prints. If any step fails, say which one and what the error was rather than working around it.`].join(`
|
|
600
|
-
`)}buildAgentCommand(e,t,n="",i,r=!1,o="",l){if(r)return e==="claude"?`${n}claude${o} --resume`:`${n}codex resume${o}`;if(t&&e==="claude"){const u=SO("We were disconnected — this is the same Nebula notebook session as before. "+(this.notebookPath?`Still driving ${this.notebookPath}. `:"")+"Re-read the notebook if you need to re-orient, then continue where you left off."),m=i?`--resume ${i}`:"--continue";return`${n}claude${o} ${m} ${Oh(u)}`}const h=Oh(this.buildBootstrapPrompt(n!=="",l));return e==="claude"&&i?`${n}claude${o} --session-id ${i} ${h}`:`${n}${e}${o} ${h}`}buildRemoteLaunchCommand(e,t=!1,n,i=!1,r,o){const l=this.getRemoteAgentConfig();if(!l)return null;const h=o||(r?l1(r):null),u=h?`"$HOME/.nebula/agent/${h}"`:'"$HOME/.nebula/agent"',p=(e==="claude"?'[ -z "$CLAUDE_CODE_OAUTH_TOKEN_NEBULA" ] || export CLAUDE_CODE_OAUTH_TOKEN="$CLAUDE_CODE_OAUTH_TOKEN_NEBULA"; ':"")+`mkdir -p ${u} && cd ${u} && `+this.buildAgentCommand(e,t,`NEBULA_URL=${l.localUrl} `,n,i),O=`exec "$SHELL" -l -i -c ${Oh(p)}`;return`ssh -t -p ${l.port} -o ProxyCommand=none -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=15 -o ServerAliveCountMax=4 ${l.user}@localhost ${Oh(O)}`}buildLocalLaunchCommand(e,t=!1,n,i=!1,r,o,l){const h=l?null:o||(r?l1(r):null),u=l?`"${l.replace(/"/g,'\\"')}"`:h?`"$HOME/.nebula/agent/${h}"`:'"$HOME/.nebula/agent"',m=r!=null&&r.startsWith("/")?e==="claude"?` --add-dir ${Oh(r)}`:` -c ${Oh(`sandbox_workspace_write.writable_roots=[${JSON.stringify(r)}]`)}`:"",p=`mkdir -p ${u} && cd ${u} && `+this.buildAgentCommand(e,t,"",n,i,m,r);return`"$SHELL" -l -i -c ${Oh(p)}`}buildBootstrapPrompt(e=!1,t){const n=e?this.getRemoteAgentConfig():null,i=e?(n==null?void 0:n.localUrl)||"http://localhost:3000":this.serverBaseUrl,r=["You are driving a Nebula notebook."];return r.push((e?`PREFERRED: use the \`nebula\` CLI (NEBULA_URL is already set to ${i}, your SSH-forwarded Nebula server; notebook paths are paths on the SERVER, not this machine). Your shell here runs in a scratch dir on your own machine — the notebook and its data files live on the server, reachable only through nebula. If \`nebula\` is not on PATH, use \`npx -p nebula-notebook-mcp nebula …\`. `:"PREFERRED: use the `nebula` CLI available in this terminal (NEBULA_URL is already set). "+(t?`The project lives at ${t}; your shell is in a scratch workspace, not the project dir — use absolute paths (or the nebula CLI) to work with its files. `:""))+"Start with `nebula --help`; key commands: `nebula nb read <path>` (list cells), `nebula run <path> <cell-id>` (execute AND get output in one call), `nebula nb edit <path> <cell-id> -` (content from stdin; or --content '…'), `nebula nb search <path> <query>`, `nebula kernel status|restart|interrupt <path>`. For NON-notebook files on the server (data, logs, scripts): `nebula fs ls|cat|download|upload <path>` — a path that starts at the server root is on the SERVER; do not assume your local filesystem has it. Exit code 9 = edit conflict (the current content is printed — retry against it). IMPORTANT — cell source is plain data in the notebook file: `nebula nb read` returns it and `nebula nb edit` writes it directly. NEVER move cell content through the kernel (no printing/base64/chunked transfer of source, no helper cells that emit code): to change a cell, just call `nebula nb edit`. Executing a cell repeatedly without an intervening edit makes no progress — if a command did not do what you expected, re-read its --help instead of re-running it. For long-running cells: `nebula run` blocks until the cell finishes — launch it as a background shell task (`--max-wait 0` = no time limit) and the process exit is your completion signal; never poll."),r.push(`FALLBACK (only if the nebula CLI is missing): use the nebula-notebook MCP tools — register with ${this.buildSetupMcpCommand()} and restart this CLI`+(!e&&this.repoRoot?` (the server's Nebula repo is at ${this.repoRoot} if you need the source)`:"")+(i?`, then call connect_server with base_url ${i}; if that URL is not reachable from this machine, ask the user for the correct Nebula server URL.`:", then call connect_server with this Nebula server’s base_url (ask the user for it).")),this.notebookPath?(r.push(`This session is for the notebook ${this.notebookPath} — operate on that notebook unless told otherwise.`),r.push("Read it now (nebula nb read) to get oriented, then confirm you are ready.")):r.push("No notebook is open yet; confirm you are ready and wait for instructions."),r.push('If a message begins with "[now driving: <path>]", the user has switched notebooks — operate on that notebook from then on (nebula commands always take explicit paths).'),SO(r.join(" "))}getState(){return this.state}where(){return this.getRemoteAgentConfig()?"mine":"server"}sessionKey(e){return`${e}:${this.where()}`}adoptSessionId(e,t){DE(`${e}:${this.where()}`,t)}getResumableKind(){return this.state.terminalId&&LE(this.sessionKey(this.state.terminalId))?"claude":null}isConnected(){return!!(this.state.terminalId&&this.senders.has(this.state.terminalId))}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notify(){for(const e of this.listeners)e()}openPanel(){var e;(e=this.panelOpener)==null||e.call(this)}launchAgent(e,t={}){const n=this.getAgentSender();if(!n.ok)return n;this.lastLaunchKind=e;const i=!!t.resume,r=!!t.continueProject;let o;if(e==="claude"&&this.state.terminalId&&!r){const p=this.sessionKey(this.state.terminalId);i?o=LE(p)??void 0:(o=zje(),DE(p,o))}const h=this.buildRemoteLaunchCommand(e,i,o,r,t.workdir,t.mirrorSlug)??this.buildLocalLaunchCommand(e,i,o,r,t.workdir,t.mirrorSlug,t.legacyRealCwd),u=Date.now(),m=this.lastLaunchSent;return m&&m.terminalId===this.state.terminalId&&m.line===h&&u-m.at<Pje?{ok:!0}:(this.lastLaunchSent={terminalId:this.state.terminalId,line:h,at:u},n.sender(`${h}\r`),jp("launchedAgent"),this.state.terminalId&&(a4(this.state.terminalId),Qje({terminalId:this.state.terminalId,kind:e,workdir:t.workdir||"~",location:this.getRemoteAgentConfig()?"remote":"server",sessionId:o,launchedFrom:this.notebookPath??void 0,mirrorSlug:t.legacyRealCwd?void 0:t.workdir?l1(t.workdir):void 0})),this.state={...this.state,status:"running",agentKind:e,launchError:void 0},this.state.terminalId&&fm(this.state.terminalId,e),this.lastTaggedNotebook=this.notebookPath,this.startLaunchWatch(e),this.notify(),{ok:!0})}clearWatch(){var e;(e=this.launchWatch)!=null&&e.timer&&clearTimeout(this.launchWatch.timer),this.launchWatch=null,this.teardownGraceTimer&&(clearTimeout(this.teardownGraceTimer),this.teardownGraceTimer=null)}startLaunchWatch(e){this.clearWatch();const t=this.state.terminalId;if(!t)return;const n=setTimeout(()=>{var i;((i=this.launchWatch)==null?void 0:i.phase)==="launch"&&mw(t).then(r=>{const o=this.launchWatch;(o==null?void 0:o.phase)==="launch"&&(r===!0?(o.timer&&(clearTimeout(o.timer),o.timer=null),o.phase="run",o.raw=""):this.markLaunchFailed("the agent did not start (no interface appeared)"))})},jje);this.launchWatch={terminalId:t,kind:e,phase:"launch",raw:"",timer:n}}armExitWatch(e,t){this.clearWatch(),this.launchWatch={terminalId:e,kind:t,phase:"run",raw:"",timer:null}}observeOutput(e,t){if(e===this.state.terminalId&&this.state.status!=="running"&&a1.test(t)){this.adoptRunningState(this.lastLaunchKind==="codex"?"codex":"claude");return}const n=this.launchWatch;if(!(!n||this.state.status!=="running"||n.terminalId!==e)){if(n.raw=(n.raw+t).slice(-4e3),n.phase==="launch"){const i=n.raw.replace(Xk,""),r=i.match(Dje);if(r){const l=(i.slice(i.indexOf(r[0])).split(`
|
|
600
|
+
`)}buildAgentCommand(e,t,n="",i,r=!1,o="",l){if(r)return e==="claude"?`${n}claude${o} --resume`:`${n}codex resume${o}`;if(t&&e==="claude"){const u=SO("We were disconnected — this is the same Nebula notebook session as before. "+(this.notebookPath?`Still driving ${this.notebookPath}. `:"")+"Re-read the notebook if you need to re-orient, then continue where you left off."),m=i?`--resume ${i}`:"--continue";return`${n}claude${o} ${m} ${Oh(u)}`}const h=Oh(this.buildBootstrapPrompt(n!=="",l));return e==="claude"&&i?`${n}claude${o} --session-id ${i} ${h}`:`${n}${e}${o} ${h}`}buildRemoteLaunchCommand(e,t=!1,n,i=!1,r,o){const l=this.getRemoteAgentConfig();if(!l)return null;const h=o||(r?l1(r):null),u=h?`"$HOME/.nebula/agent/${h}"`:'"$HOME/.nebula/agent"',p=(e==="claude"?'[ -z "$CLAUDE_CODE_OAUTH_TOKEN_NEBULA" ] || export CLAUDE_CODE_OAUTH_TOKEN="$CLAUDE_CODE_OAUTH_TOKEN_NEBULA"; ':"")+`mkdir -p ${u} && cd ${u} && `+this.buildAgentCommand(e,t,`NEBULA_URL=${l.localUrl} `,n,i),O=`exec "$SHELL" -l -i -c ${Oh(p)}`;return`ssh -t -p ${l.port} -o ProxyCommand=none -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=15 -o ServerAliveCountMax=4 ${l.user}@localhost ${Oh(O)}`}buildLocalLaunchCommand(e,t=!1,n,i=!1,r,o,l){const h=l?null:o||(r?l1(r):null),u=l?`"${l.replace(/"/g,'\\"')}"`:h?`"$HOME/.nebula/agent/${h}"`:'"$HOME/.nebula/agent"',m=r!=null&&r.startsWith("/")?e==="claude"?` --add-dir ${Oh(r)}`:` -c ${Oh(`sandbox_workspace_write.writable_roots=[${JSON.stringify(r)}]`)}`:"",p=`mkdir -p ${u} && cd ${u} && `+this.buildAgentCommand(e,t,"",n,i,m,r);return`"$SHELL" -l -i -c ${Oh(p)}`}buildBootstrapPrompt(e=!1,t){const n=e?this.getRemoteAgentConfig():null,i=e?(n==null?void 0:n.localUrl)||"http://localhost:3000":this.serverBaseUrl,r=["You are driving a Nebula notebook."];return r.push((e?`PREFERRED: use the \`nebula\` CLI (NEBULA_URL is already set to ${i}, your SSH-forwarded Nebula server; notebook paths are paths on the SERVER, not this machine). Your shell here runs in a scratch dir on your own machine — the notebook and its data files live on the server, reachable only through nebula. If \`nebula\` is not on PATH, use \`npx -p nebula-notebook-mcp nebula …\`. `:"PREFERRED: use the `nebula` CLI available in this terminal (NEBULA_URL is already set). "+(t?`The project lives at ${t}; your shell is in a scratch workspace, not the project dir — use absolute paths (or the nebula CLI) to work with its files. `:""))+"Start with `nebula --help`; key commands: `nebula nb read <path>` (list cells), `nebula run <path> <cell-id>` (execute AND get output in one call), `nebula nb edit <path> <cell-id> -` (content from stdin; or --content '…'), `nebula nb search <path> <query>`, `nebula kernel status|restart|interrupt <path>`. For NON-notebook files on the server (data, logs, scripts): `nebula fs ls|cat|download|upload <path>` — a path that starts at the server root is on the SERVER; do not assume your local filesystem has it. Before your first notebook WRITE, run `nebula session start <path>` (takes the agent lock; the browser shows an \"agent session\" badge) and `nebula session end <path>` when done. To REPLACE an existing server file, `nebula fs write` overwrites; `nebula fs upload` refuses a name collision unless you pass --overwrite (or --rename to keep both). Exit code 9 = edit conflict (the current content is printed — retry against it). IMPORTANT — cell source is plain data in the notebook file: `nebula nb read` returns it and `nebula nb edit` writes it directly. NEVER move cell content through the kernel (no printing/base64/chunked transfer of source, no helper cells that emit code): to change a cell, just call `nebula nb edit`. Executing a cell repeatedly without an intervening edit makes no progress — if a command did not do what you expected, re-read its --help instead of re-running it. For long-running cells: `nebula run` blocks until the cell finishes — launch it as a background shell task (`--max-wait 0` = no time limit) and the process exit is your completion signal; never poll."),r.push(`FALLBACK (only if the nebula CLI is missing): use the nebula-notebook MCP tools — register with ${this.buildSetupMcpCommand()} and restart this CLI`+(!e&&this.repoRoot?` (the server's Nebula repo is at ${this.repoRoot} if you need the source)`:"")+(i?`, then call connect_server with base_url ${i}; if that URL is not reachable from this machine, ask the user for the correct Nebula server URL.`:", then call connect_server with this Nebula server’s base_url (ask the user for it).")),this.notebookPath?(r.push(`This session is for the notebook ${this.notebookPath} — operate on that notebook unless told otherwise.`),r.push("Read it now (nebula nb read) to get oriented, then confirm you are ready.")):r.push("No notebook is open yet; confirm you are ready and wait for instructions."),r.push('If a message begins with "[now driving: <path>]", the user has switched notebooks — operate on that notebook from then on (nebula commands always take explicit paths).'),SO(r.join(" "))}getState(){return this.state}where(){return this.getRemoteAgentConfig()?"mine":"server"}sessionKey(e){return`${e}:${this.where()}`}adoptSessionId(e,t){DE(`${e}:${this.where()}`,t)}getResumableKind(){return this.state.terminalId&&LE(this.sessionKey(this.state.terminalId))?"claude":null}isConnected(){return!!(this.state.terminalId&&this.senders.has(this.state.terminalId))}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notify(){for(const e of this.listeners)e()}openPanel(){var e;(e=this.panelOpener)==null||e.call(this)}launchAgent(e,t={}){const n=this.getAgentSender();if(!n.ok)return n;this.lastLaunchKind=e;const i=!!t.resume,r=!!t.continueProject;let o;if(e==="claude"&&this.state.terminalId&&!r){const p=this.sessionKey(this.state.terminalId);i?o=LE(p)??void 0:(o=zje(),DE(p,o))}const h=this.buildRemoteLaunchCommand(e,i,o,r,t.workdir,t.mirrorSlug)??this.buildLocalLaunchCommand(e,i,o,r,t.workdir,t.mirrorSlug,t.legacyRealCwd),u=Date.now(),m=this.lastLaunchSent;return m&&m.terminalId===this.state.terminalId&&m.line===h&&u-m.at<Pje?{ok:!0}:(this.lastLaunchSent={terminalId:this.state.terminalId,line:h,at:u},n.sender(`${h}\r`),jp("launchedAgent"),this.state.terminalId&&(a4(this.state.terminalId),Qje({terminalId:this.state.terminalId,kind:e,workdir:t.workdir||"~",location:this.getRemoteAgentConfig()?"remote":"server",sessionId:o,launchedFrom:this.notebookPath??void 0,mirrorSlug:t.legacyRealCwd?void 0:t.workdir?l1(t.workdir):void 0})),this.state={...this.state,status:"running",agentKind:e,launchError:void 0},this.state.terminalId&&fm(this.state.terminalId,e),this.lastTaggedNotebook=this.notebookPath,this.startLaunchWatch(e),this.notify(),{ok:!0})}clearWatch(){var e;(e=this.launchWatch)!=null&&e.timer&&clearTimeout(this.launchWatch.timer),this.launchWatch=null,this.teardownGraceTimer&&(clearTimeout(this.teardownGraceTimer),this.teardownGraceTimer=null)}startLaunchWatch(e){this.clearWatch();const t=this.state.terminalId;if(!t)return;const n=setTimeout(()=>{var i;((i=this.launchWatch)==null?void 0:i.phase)==="launch"&&mw(t).then(r=>{const o=this.launchWatch;(o==null?void 0:o.phase)==="launch"&&(r===!0?(o.timer&&(clearTimeout(o.timer),o.timer=null),o.phase="run",o.raw=""):this.markLaunchFailed("the agent did not start (no interface appeared)"))})},jje);this.launchWatch={terminalId:t,kind:e,phase:"launch",raw:"",timer:n}}armExitWatch(e,t){this.clearWatch(),this.launchWatch={terminalId:e,kind:t,phase:"run",raw:"",timer:null}}observeOutput(e,t){if(e===this.state.terminalId&&this.state.status!=="running"&&a1.test(t)){this.adoptRunningState(this.lastLaunchKind==="codex"?"codex":"claude");return}const n=this.launchWatch;if(!(!n||this.state.status!=="running"||n.terminalId!==e)){if(n.raw=(n.raw+t).slice(-4e3),n.phase==="launch"){const i=n.raw.replace(Xk,""),r=i.match(Dje);if(r){const l=(i.slice(i.indexOf(r[0])).split(`
|
|
601
601
|
`)[0]||"").trim();if(/no conversation found/i.test(l)){this.markLaunchFailed("no previous conversation in this directory — start a fresh agent instead (Claude Code / Codex)");return}this.markLaunchFailed(l.slice(0,gw)||"launch failed");return}a1.test(n.raw)&&(n.timer&&(clearTimeout(n.timer),n.timer=null),n.phase="run",n.raw="");return}if(a1.test(n.raw)){this.teardownGraceTimer&&(clearTimeout(this.teardownGraceTimer),this.teardownGraceTimer=null),n.raw="";return}if(Lje.test(n.raw)){if(n.raw="",this.teardownGraceTimer)return;this.teardownGraceTimer=setTimeout(()=>{this.teardownGraceTimer=null,this.markStopped()},2e3)}}}markLaunchFailed(e){this.clearWatch(),this.state.terminalId&&fm(this.state.terminalId,null),this.state={...this.state,status:"failed",agentKind:null,launchError:e},this.notify()}adoptRunningState(e){this.state.status!=="running"&&(this.state.terminalId&&this.armExitWatch(this.state.terminalId,e),this.state={...this.state,status:"running",agentKind:e,launchError:void 0},this.state.terminalId&&fm(this.state.terminalId,e),this.lastTaggedNotebook=this.notebookPath,this.notify())}async markRunning(){const e=this.state.terminalId;if(e&&await mw(e)===!1){this.state={...this.state,status:"failed",agentKind:null,launchError:"nothing is running in this terminal — start the agent below first, then mark it active"},this.notify();return}jp("launchedAgent"),this.state.terminalId&&this.armExitWatch(this.state.terminalId,"manual"),this.state={...this.state,status:"running",agentKind:"manual",launchError:void 0},this.state.terminalId&&fm(this.state.terminalId,"manual"),this.notify(),this.sendPrompt(this.buildBootstrapPrompt())}breakRemoteConnection(){const e=this.state.terminalId?this.senders.get(this.state.terminalId):void 0;e&&e("\r~."),this.markStopped()}markStopped(){this.clearWatch(),this.state.terminalId&&fm(this.state.terminalId,null),this.state.status!=="none"&&(this.state={...this.state,status:"none",agentKind:null,launchError:void 0},this.notify())}sendPrompt(e){if(this.state.status!=="running")return this.openPanel(),{ok:!1,reason:"agent-not-running"};const t=this.getAgentSender();if(!t.ok)return t;const n=SO(e);if(!n)return{ok:!0};t.sender(n);const i=this.state.terminalId;return setTimeout(()=>{const r=i?this.senders.get(i):void 0;r==null||r("\r")},Mje),{ok:!0}}sendFixPrompt(e){const t=Ije(e.errorContent),n=this.notebookPath?`notebook ${this.notebookPath}`:"the open notebook";return this.sendPrompt(`In ${n}, cell ${e.cellNumber} (id ${e.cellId}) failed with: ${t} — use the nebula CLI (nebula nb read / nebula run <path> <cell-id>; fall back to the nebula-notebook MCP tools only if the CLI is unavailable) to read the cell and its full error output, fix the cell, and re-run it to verify the fix.`)}sendCellPrompt(e){const t=this.notebookPath?`notebook ${this.notebookPath}`:"the open notebook";return this.sendPrompt(`In ${t}, regarding cell ${e.cellNumber} (id ${e.cellId}): ${e.prompt} — use the nebula CLI (nebula nb read / nebula nb edit / nebula run; fall back to the nebula-notebook MCP tools only if the CLI is unavailable) to read and edit the notebook; re-run the cell if you change it.`)}getAgentSender(){const e=this.state.terminalId;if(!e)return this.openPanel(),{ok:!1,reason:"no-terminal"};const t=this.senders.get(e);return t?{ok:!0,sender:n=>t(n)}:(this.openPanel(),{ok:!1,reason:"not-connected"})}}function Oh(s){return`'${s.replace(/'/g,"'\\''")}'`}function SO(s){return s.replace(Xk,"").replace(/[\r\n\t]+/g," ").replace(/ {2,}/g," ").trim()}function Ije(s){const e=(s||"").replace(Xk,""),t=e.split(`
|
|
602
602
|
`).map(r=>r.trim()).filter(Boolean),n=t.length>0?t[t.length-1]:"",i=SO(n||e);return i.length>gw?`${i.slice(0,gw)}…`:i}const jt=new Bje,h4=v.createContext(null),qje={success:d.jsx(xS,{className:"w-5 h-5 text-green-500"}),error:d.jsx(Ao,{className:"w-5 h-5 text-red-500"}),warning:d.jsx(_S,{className:"w-5 h-5 text-amber-500"}),info:d.jsx(qz,{className:"w-5 h-5 text-blue-500"})},Xje={success:"bg-green-50 border-green-200 text-green-800",error:"bg-red-50 border-red-200 text-red-800",warning:"bg-amber-50 border-amber-200 text-amber-800",info:"bg-blue-50 border-blue-200 text-blue-800"},Uje=({toast:s,onDismiss:e})=>d.jsxs("div",{className:`flex items-start gap-3 px-4 py-3 rounded-lg border shadow-lg animate-in slide-in-from-right-5 max-w-sm ${Xje[s.type]}`,role:"alert",children:[d.jsx("div",{className:"flex-shrink-0",children:qje[s.type]}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-medium break-words",children:s.message}),s.action&&d.jsx("button",{onClick:()=>{s.action.onClick(),e(s.id)},className:"mt-1.5 px-2.5 py-1 text-xs font-semibold rounded-md border border-current/30 hover:bg-black/5 transition-colors",children:s.action.label})]}),d.jsx("button",{onClick:()=>e(s.id),"aria-label":"Dismiss notification",className:"p-0.5 hover:bg-black/5 rounded transition-colors flex-shrink-0",children:d.jsx(di,{className:"w-4 h-4"})})]}),Zje=({state:s,onConfirm:e,onCancel:t})=>{const n=Uc(t),i={danger:"bg-red-600 hover:bg-red-700 focus:ring-red-500",warning:"bg-amber-600 hover:bg-amber-700 focus:ring-amber-500",default:"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500"};return d.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50 animate-in fade-in",onClick:t}),d.jsxs("div",{ref:n,role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",tabIndex:-1,className:"relative bg-white rounded-xl shadow-2xl max-w-md w-full mx-4 animate-in zoom-in-95 fade-in",children:[d.jsxs("div",{className:"p-6",children:[d.jsx("h3",{id:"confirm-dialog-title",className:"text-lg font-semibold text-slate-900 mb-2",children:s.title}),d.jsx("p",{className:"text-sm text-slate-600 break-words",children:s.message})]}),d.jsxs("div",{className:"flex justify-end gap-3 px-6 py-4 bg-slate-50 rounded-b-xl border-t border-slate-100",children:[d.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-slate-700 bg-white border border-slate-300 rounded-lg hover:bg-slate-50 focus:outline-none focus:ring-2 focus:ring-slate-500 focus:ring-offset-2 transition-colors",children:s.cancelLabel||"Cancel"}),d.jsx("button",{onClick:e,className:`px-4 py-2 text-sm font-medium text-white rounded-lg focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors ${i[s.variant||"default"]}`,children:s.confirmLabel||"Confirm"})]})]})]})},Wje=({state:s,onSubmit:e,onCancel:t})=>{const n=Uc(t),[i,r]=v.useState(s.defaultValue??"");return d.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50 animate-in fade-in",onClick:t}),d.jsx("div",{ref:n,role:"dialog","aria-modal":"true","aria-labelledby":"prompt-dialog-title",tabIndex:-1,className:"relative bg-white rounded-xl shadow-2xl max-w-md w-full mx-4 animate-in zoom-in-95 fade-in",children:d.jsxs("form",{onSubmit:o=>{o.preventDefault(),i.trim()&&e(i.trim())},children:[d.jsxs("div",{className:"p-6",children:[d.jsx("h3",{id:"prompt-dialog-title",className:"text-lg font-semibold text-slate-900 mb-2",children:s.title}),s.message&&d.jsx("p",{className:"text-sm text-slate-600 mb-3 break-words",children:s.message}),d.jsx("input",{autoFocus:!0,type:"text",value:i,placeholder:s.placeholder,onChange:o=>r(o.target.value),className:"w-full px-3 py-2 text-sm border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),d.jsxs("div",{className:"flex justify-end gap-3 px-6 py-4 bg-slate-50 rounded-b-xl border-t border-slate-100",children:[d.jsx("button",{type:"button",onClick:t,className:"px-4 py-2 text-sm font-medium text-slate-700 bg-white border border-slate-300 rounded-lg hover:bg-slate-50 focus:outline-none focus:ring-2 focus:ring-slate-500 focus:ring-offset-2 transition-colors",children:"Cancel"}),d.jsx("button",{type:"submit",disabled:!i.trim(),className:"px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 disabled:opacity-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors",children:s.confirmLabel||"Create"})]})]})})]})},Vje=({children:s})=>{const[e,t]=v.useState([]),[n,i]=v.useState({isOpen:!1,title:"",message:""}),[r,o]=v.useState({isOpen:!1,title:""}),l=v.useRef(new Map),h=v.useCallback(S=>{t(A=>A.filter(N=>N.id!==S));const k=l.current.get(S);k&&(clearTimeout(k),l.current.delete(S))},[]),u=v.useCallback((S,k="info",A=4e3,N)=>{const R=crypto.randomUUID(),D={id:R,type:k,message:S,duration:A,action:N};if(t(U=>[...U,D]),A>0){const U=setTimeout(()=>{h(R)},A);l.current.set(R,U)}},[h]),m=v.useCallback(S=>new Promise(k=>{i({isOpen:!0,...S,resolve:k})}),[]),p=v.useCallback(S=>new Promise(k=>{o({isOpen:!0,...S,resolve:k})}),[]),O=v.useCallback(S=>{var k;(k=r.resolve)==null||k.call(r,S),o(A=>({...A,isOpen:!1}))},[r.resolve]),x=v.useCallback(()=>{var S;(S=r.resolve)==null||S.call(r,null),o(k=>({...k,isOpen:!1}))},[r.resolve]),y=v.useCallback(()=>{var S;(S=n.resolve)==null||S.call(n,!0),i(k=>({...k,isOpen:!1}))},[n.resolve]),w=v.useCallback(()=>{var S;(S=n.resolve)==null||S.call(n,!1),i(k=>({...k,isOpen:!1}))},[n.resolve]);return d.jsxs(h4.Provider,{value:{toast:u,confirm:m,promptText:p},children:[s,d.jsx("div",{className:"fixed top-4 right-4 z-[101] flex flex-col gap-2 max-w-sm",children:e.map(S=>d.jsx(Uje,{toast:S,onDismiss:h},S.id))}),n.isOpen&&d.jsx(Zje,{state:n,onConfirm:y,onCancel:w}),r.isOpen&&d.jsx(Wje,{state:r,onSubmit:O,onCancel:x},r.title+(r.defaultValue??""))]})},Hd=()=>{const s=v.useContext(h4);if(!s)throw new Error("useNotification must be used within a NotificationProvider");return s},Hje=({oldContent:s,newContent:e})=>{const t=v.useMemo(()=>Cje(s,e),[s,e]);let n=0,i=0;return d.jsx("div",{className:"font-mono text-xs leading-5 overflow-x-auto py-1","data-testid":"preview-line-diff",children:t.map((r,o)=>{if(r.kind==="gap")return d.jsxs("div",{className:"px-3 py-0.5 text-slate-400 bg-slate-50 select-none",children:["⋯ ",r.hiddenCount," unchanged line",r.hiddenCount===1?"":"s"]},o);const l=r.kind==="removed"?`diff-line-removed-${n++}`:r.kind==="added"?`diff-line-added-${i++}`:void 0,h=r.kind==="removed"?"bg-red-50 text-red-800":r.kind==="added"?"bg-green-50 text-green-800":"text-slate-600",u=r.kind==="removed"?"−":r.kind==="added"?"+":" ";return d.jsxs("div",{"data-testid":l,className:`flex px-3 whitespace-pre ${h}`,children:[d.jsx("span",{className:"w-4 flex-shrink-0 select-none opacity-60",children:u}),d.jsx("span",{children:r.text||" "})]},o)})})},Fje=({cell:s,index:e,isActive:t,isSelected:n=!1,isHighlighted:i=!1,agentActive:r=!1,isLocked:o=!1,allCellsRef:l,cellIndexMapRef:h,onUpdate:u,onAIUpdate:m,onFlush:p,onRun:O,onRunAndAdvance:x,onDelete:y,onMove:w,onChangeType:S,onClick:k,onActivate:A,onNavigateCell:N,onEditorBoundaryNavigate:R,onReorder:D,onAddCell:U,onSave:Z,onSetCellScrolled:te,onSetCellScrolledHeight:ee,onCursorActivity:pe,searchHighlight:oe,searchCurrentMatch:E,queuePosition:Q,indentConfig:T=Id,requestedFocusMode:L,onFocusModeApplied:M,onSearchEscape:P,showLineNumbers:I=!1,showCellIds:X=!1,previewDiffStatus:V,previewDiffAgainst:z,kernelSessionId:G})=>{var gn;const{toast:H}=Hd(),[Y,he]=v.useState(!1),[le,Se]=v.useState(""),[ue,F]=v.useState("none"),ne=v.useRef(O),Oe=v.useRef(x),je=v.useRef(Z),We=v.useRef(p),fe=v.useRef(A),rt=v.useRef(u),we=v.useRef(pe),Ve=v.useRef(P),Ee=v.useRef(R),qe=v.useRef(D),Ie=v.useRef(s.id),Re=v.useRef(s.content);v.useEffect(()=>{ne.current=O,Oe.current=x,je.current=Z,We.current=p,fe.current=A,rt.current=u,we.current=pe,Ve.current=P,Ee.current=R,qe.current=D,Ie.current=s.id,Re.current=s.content});const ut=v.useRef(null),wt=v.useRef(!1);v.useEffect(()=>{var de;L==="editor"?(F("editor"),setTimeout(()=>M==null?void 0:M(),0)):L==="cell"&&((de=ut.current)==null||de.focus({preventScroll:!0}),M==null||M())},[L,M]);const Xe=v.useCallback(()=>{F("editor"),fe.current(Ie.current)},[]),$s=v.useCallback(()=>{Oe.current(Ie.current,"editor")},[]),Pt=v.useCallback(()=>{ne.current(Ie.current)},[]),Ft=v.useCallback(()=>{var ie;return((ie=Ve.current)==null?void 0:ie.call(Ve))??!1?!0:(wt.current=!0,!1)},[]),ns=v.useCallback(()=>{var de;(de=je.current)==null||de.call(je)},[]),Qe=v.useCallback(()=>{var de;(de=Ee.current)==null||de.call(Ee,Ie.current,"up")},[]),mt=v.useCallback(()=>{var de;(de=Ee.current)==null||de.call(Ee,Ie.current,"down")},[]),ps=v.useCallback(de=>{rt.current(Ie.current,de)},[]),Yt=v.useCallback(de=>{var ie;(ie=we.current)==null||ie.call(we,Ie.current,de)},[]),zt=v.useCallback(()=>{F("none"),We.current&&We.current(Ie.current,Re.current),wt.current&&(wt.current=!1,setTimeout(()=>{var de;return(de=ut.current)==null?void 0:de.focus({preventScroll:!0})},0))},[]),Bt=v.useCallback(de=>{de.target===de.currentTarget&&(F("cell"),fe.current(Ie.current))},[]),hs=v.useCallback(de=>{de.target===de.currentTarget&&F("none")},[]),ks=()=>{var de;return(((de=h.current)==null?void 0:de.get(s.id))??e)+1},Be=de=>{de.ok?(jt.openPanel(),H("Sent to agent — watch the Agent tab below","success",2500)):de.reason==="agent-not-running"?H('No agent is running yet — opened the Agent tab: click "Claude Code" or "Codex" to launch one, then retry',"info",6e3):H("Agent terminal is not connected — opened the Agent tab; wait for it to connect and try again","info",5e3)},He=()=>{const de=le.trim();if(!de)return;const ie=jt.sendCellPrompt({cellNumber:ks(),cellId:s.id,prompt:de});ie.ok&&(Se(""),he(!1)),Be(ie)},zs=()=>{const de=s.outputs.find(ke=>ke.type==="error"||ke.type==="stderr");if(!de)return;const ie=jt.sendFixPrompt({cellNumber:ks(),cellId:s.id,errorContent:de.content});Be(ie)},Cs=s.outputs.some(de=>de.type==="error"),It=jMe()||ue==="editor",[Wt,ye]=v.useState(!1),Pe=v.useRef(null);v.useEffect(()=>{if(Wt)return;const de=ut.current;if(!de)return;const ie=new IntersectionObserver(([ke])=>{if(ke.isIntersecting){const gt=Pe.current;if(gt){const qt=gt.offsetHeight;gt.style.height=`${qt}px`,gt.style.overflow="hidden"}ye(!0),ie.disconnect()}},{rootMargin:"300px 0px"});return ie.observe(de),()=>ie.disconnect()},[Wt]),v.useEffect(()=>{if(!Wt)return;const de=Pe.current;if(!de)return;if(typeof ResizeObserver>"u"){de.style.height="",de.style.overflow="";return}let ie=null;const ke=new ResizeObserver(()=>{ie&&clearTimeout(ie),ie=setTimeout(()=>{de.style.height="",de.style.overflow="",ke.disconnect()},150)});ke.observe(de);const gt=setTimeout(()=>{de.style.height="",de.style.overflow="",ke.disconnect()},1e3);return()=>{ke.disconnect(),ie&&clearTimeout(ie),clearTimeout(gt)}},[Wt]),v.useEffect(()=>{ue==="editor"&&!Wt&&ye(!0)},[Wt,ue]);const Ue=()=>Cs?"border-red-200":ue==="editor"?"border-blue-400 ring-1 ring-blue-100":ue==="cell"?"border-green-500 ring-1 ring-green-100":V==="modified"?"border-orange-400 ring-2 ring-orange-100 bg-orange-50/30":V==="deleted"?"border-red-400 ring-2 ring-red-100 bg-red-50/30":"border-slate-200 hover:border-slate-300",Fe=v.useCallback(de=>{var ie;de.stopPropagation(),(ie=ut.current)==null||ie.focus({preventScroll:!0})},[]),Je=v.useCallback(de=>{var ie;de.stopPropagation(),k(s.id,de),(ie=ut.current)==null||ie.focus({preventScroll:!0})},[s.id,k]),ze=v.useCallback(de=>{var ie;if(de.stopPropagation(),k(s.id,de),o){(ie=ut.current)==null||ie.focus({preventScroll:!0});return}F("editor")},[s.id,o,k]),st=v.useCallback(de=>{var ie,ke;if(ue==="cell"){if((de.metaKey||de.ctrlKey)&&de.shiftKey){if(de.key==="ArrowUp"){de.preventDefault(),o||w(s.id,"up");return}if(de.key==="ArrowDown"){de.preventDefault(),o||w(s.id,"down");return}}if(de.key==="ArrowUp"&&!de.metaKey&&!de.ctrlKey&&!de.shiftKey){de.preventDefault(),(((ie=h.current)==null?void 0:ie.get(Ie.current))??-1)>0&&N("up");return}if(de.key==="ArrowDown"&&!de.metaKey&&!de.ctrlKey&&!de.shiftKey){de.preventDefault();const gt=l.current,qt=((ke=h.current)==null?void 0:ke.get(Ie.current))??-1;qt>=0&&qt<gt.length-1&&N("down");return}if(de.key==="Enter"&&!de.shiftKey&&!de.ctrlKey&&!de.metaKey){if(de.preventDefault(),o)return;F("editor");return}if(de.key==="Delete"||de.key==="Backspace"){de.preventDefault(),o||y(s.id);return}if(de.key==="Enter"&&de.shiftKey){de.preventDefault(),Oe.current(s.id,"cell");return}if(de.key==="Enter"&&(de.ctrlKey||de.metaKey)){de.preventDefault(),ne.current(s.id);return}}},[s.id,w,y,ue,o]),tt=s.type==="markdown"&&ue!=="editor",[vt,Ot]=v.useState(null),[Gt,et]=v.useState(!1),bs="application/x-nebula-cell",Qn=v.useCallback(de=>{de.stopPropagation(),de.dataTransfer.setData(bs,Ie.current),de.dataTransfer.effectAllowed="move",ut.current&&de.dataTransfer.setDragImage(ut.current,24,24),et(!0)},[]),Lt=v.useCallback(()=>et(!1),[]),Dt=v.useCallback(de=>{if(!de.dataTransfer.types.includes(bs))return;de.preventDefault(),de.dataTransfer.dropEffect="move";const ie=de.currentTarget.getBoundingClientRect(),ke=de.clientY<ie.top+ie.height/2?"above":"below";Ot(gt=>gt===ke?gt:ke)},[]),vs=v.useCallback(de=>{de.currentTarget.contains(de.relatedTarget)||Ot(null)},[]),Ns=v.useCallback(de=>{const ie=de.dataTransfer.getData(bs);Ot(ke=>{var gt;return ie&&ie!==Ie.current&&ke&&((gt=qe.current)==null||gt.call(qe,ie,Ie.current,ke)),null}),ie&&de.preventDefault()},[]);return d.jsxs("div",{ref:ut,"data-cell-id":s.id,onClick:de=>k(s.id,de),onKeyDown:st,onFocus:Bt,onBlur:hs,onDragOver:D?Dt:void 0,onDragLeave:D?vs:void 0,onDrop:D?Ns:void 0,tabIndex:t?0:-1,className:`group relative mb-2 rounded-lg border bg-white shadow-sm transition-all hover:shadow-md ${Ue()} ${i?"cell-highlight-animation":""} ${r?"ring-2 ring-purple-300 ring-offset-1":""} ${n?"ring-2 ring-blue-300 border-blue-300 bg-blue-50/40":""} ${Gt?"opacity-50":""} ${ue==="cell"?"outline-none":""}`,style:vt?{boxShadow:vt==="above"?"inset 0 3px 0 0 #3b82f6":"inset 0 -3px 0 0 #3b82f6"}:void 0,children:[d.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-slate-50 border-b border-slate-100 rounded-t-lg cursor-pointer",onClick:Fe,children:[d.jsxs("div",{className:"flex items-center gap-0.5",children:[D&&!o&&d.jsx("span",{draggable:!0,onDragStart:Qn,onDragEnd:Lt,onClick:de=>de.stopPropagation(),className:"cursor-grab active:cursor-grabbing text-slate-300 hover:text-slate-500 -ml-1 opacity-0 group-hover:opacity-100 transition-opacity",title:"Drag to reorder cell","aria-label":"Drag to reorder cell",children:d.jsx(jz,{className:"w-3.5 h-3.5"})}),d.jsxs("span",{className:"text-[0.625rem] font-mono font-bold text-slate-400 min-w-[1.5rem]",children:["#",(((gn=h.current)==null?void 0:gn.get(s.id))??e)+1]}),X&&d.jsx("span",{className:"text-[0.625rem] font-mono text-slate-400 truncate max-w-[11.25rem]",title:s.id,children:s.id}),s.isExecuting?d.jsx("span",{className:"text-[0.625rem] font-mono text-amber-600 animate-pulse",title:"Executing...",children:"[*]"}):Q!==void 0&&Q>=0?d.jsx("span",{className:"text-[0.625rem] font-mono text-amber-600 animate-pulse",title:`Queued at position ${Q+1}`,children:"[*]"}):s.executionCount!==void 0?d.jsxs("span",{className:"text-[0.625rem] font-mono text-green-600",children:["[",s.executionCount,"]"]}):s.type==="code"?d.jsx("span",{className:"text-[0.625rem] font-mono text-slate-400",title:"Not yet executed",children:"[ ]"}):null,d.jsx("button",{onClick:de=>{de.stopPropagation(),O(s.id)},className:"p-1 text-slate-500 hover:text-green-600 hover:bg-green-50 rounded",title:"Run Cell (Shift+Enter or Ctrl+Enter)",children:s.isExecuting?d.jsx(hi,{className:"w-3.5 h-3.5 animate-spin"}):d.jsx(Ac,{className:"w-3.5 h-3.5"})}),d.jsx("button",{onClick:de=>{de.stopPropagation(),he(!Y)},className:`p-1 rounded transition-colors ${Y?"text-purple-600 bg-purple-50":"text-slate-400 hover:text-purple-600 hover:bg-purple-50"}`,title:"AI Assistant",children:d.jsx(gr,{className:"w-3.5 h-3.5"})}),d.jsx("button",{onClick:de=>{de.stopPropagation(),o||w(s.id,"up")},disabled:o,className:`p-1 text-slate-400 rounded opacity-0 group-hover:opacity-100 transition-opacity ${o?"cursor-not-allowed opacity-50":"hover:text-slate-700 hover:bg-slate-100"}`,title:o?"Locked during agent session":"Move Up",children:d.jsx(DN,{className:"w-3.5 h-3.5"})}),d.jsx("button",{onClick:de=>{de.stopPropagation(),o||w(s.id,"down")},disabled:o,className:`p-1 text-slate-400 rounded opacity-0 group-hover:opacity-100 transition-opacity ${o?"cursor-not-allowed opacity-50":"hover:text-slate-700 hover:bg-slate-100"}`,title:o?"Locked during agent session":"Move Down",children:d.jsx(q6,{className:"w-3.5 h-3.5"})}),d.jsx("button",{onClick:de=>{de.stopPropagation(),o||y(s.id)},disabled:o,className:`p-1 text-slate-400 rounded opacity-0 group-hover:opacity-100 transition-opacity ${o?"cursor-not-allowed opacity-50":"hover:text-red-600 hover:bg-red-50"}`,title:o?"Locked during agent session":"Delete Cell",children:d.jsx(Lc,{className:"w-3.5 h-3.5"})}),d.jsx("button",{onClick:de=>{var ie;if(de.stopPropagation(),!o){const ke=((ie=h.current)==null?void 0:ie.get(s.id))??-1;ke>=0&&U(ke)}},disabled:o,className:`p-1 text-slate-400 rounded opacity-0 group-hover:opacity-100 transition-opacity ${o?"cursor-not-allowed opacity-50":"hover:text-blue-600 hover:bg-blue-50"}`,title:o?"Locked during agent session":"Add Cell Below",children:d.jsx(so,{className:"w-3.5 h-3.5"})})]}),d.jsx("div",{className:"flex-1 flex justify-center",children:Cs&&d.jsxs("button",{onClick:de=>{de.stopPropagation(),zs()},className:"flex items-center gap-1 text-[0.625rem] px-2 py-0.5 bg-red-100 text-red-700 rounded hover:bg-red-200 transition-colors",title:"Send this cell's error to the agent (Claude Code / Codex) to fix",children:[d.jsx(gr,{className:"w-3 h-3"}),"Fix with agent"]})}),d.jsxs("div",{className:"flex gap-0.5",children:[d.jsxs("button",{onClick:de=>{de.stopPropagation(),S(s.id,"code")},className:`text-[0.625rem] px-1.5 py-0.5 rounded flex items-center gap-0.5 ${s.type==="code"?"bg-white shadow-sm text-slate-800 font-medium":"text-slate-400 hover:text-slate-600"}`,children:[d.jsx(gz,{className:"w-3 h-3"})," Code"]}),d.jsxs("button",{onClick:de=>{de.stopPropagation(),S(s.id,"markdown")},className:`text-[0.625rem] px-1.5 py-0.5 rounded flex items-center gap-0.5 ${s.type==="markdown"?"bg-white shadow-sm text-slate-800 font-medium":"text-slate-400 hover:text-slate-600"}`,children:[d.jsx(Dx,{className:"w-3 h-3"})," Text"]})]})]}),Y&&d.jsxs("div",{className:"px-3 py-2 bg-purple-50 border-b border-purple-100 flex gap-2 items-center",children:[d.jsx(gr,{className:"w-4 h-4 text-purple-600 flex-shrink-0"}),d.jsx("input",{type:"text",value:le,onChange:de=>Se(de.target.value),placeholder:"Ask the agent to edit, debug, or explain this cell…",className:"flex-grow bg-white border-purple-200 border rounded px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-purple-500",onKeyDown:de=>de.key==="Enter"&&He(),onClick:de=>de.stopPropagation()}),d.jsx("button",{onClick:de=>{de.stopPropagation(),He()},className:"px-2 py-1 bg-purple-600 text-white text-xs font-medium rounded hover:bg-purple-700",children:"Send to agent"})]}),d.jsx("div",{ref:Pe,onClick:de=>{de.stopPropagation(),!Wt&&!tt&&ye(!0),k(s.id,de)},children:z!==void 0&&(V==="modified"||V==="deleted")?d.jsx(Hje,{oldContent:s.content,newContent:z}):tt?d.jsx("div",{className:"cursor-default",onClick:Je,onDoubleClick:ze,title:o?void 0:"Double-click or press Enter to edit",children:d.jsx(bje,{content:s.content,placeholder:"## Markdown Title"})}):Wt?d.jsx(mje,{value:s.content,onChange:ps,language:s.type==="code"?"python":"markdown",enableInteractiveFeatures:It,onShiftEnter:$s,onModEnter:Pt,onEscape:Ft,onSave:ns,onNavigateUp:Qe,onNavigateDown:mt,onFocus:Xe,onBlur:zt,placeholder:s.type==="code"?'print("Hello World")':"## Markdown Title",searchHighlight:oe?{...oe,currentMatch:E}:null,cellId:s.id,shouldFocus:ue==="editor",onCursorActivity:pe?Yt:void 0,indentConfig:T,allCellsRef:l,showLineNumbers:s.type==="code"&&I,readOnly:o,kernelSessionId:G}):d.jsx("pre",{className:"font-mono text-sm px-3 py-2 text-slate-700 whitespace-pre-wrap break-all min-h-[1.5rem]",children:s.content||(s.type==="code"?'print("Hello World")':"## Markdown Title")})}),(s.outputs.length>0||s.isExecuting||s.lastExecutionMs!==void 0)&&d.jsx("div",{id:`cell-output-${s.id}`,className:"scroll-mt-20",children:d.jsx(rA,{outputs:s.outputs,isUpdating:s.isExecuting,executionMs:s.lastExecutionMs,scrolled:s.scrolled,onScrolledChange:te?de=>te(s.id,de):void 0,scrolledHeight:s.scrolledHeight,onScrolledHeightChange:ee?de=>ee(s.id,de):void 0,kernelSessionId:G})})]})},Yje=v.memo(Fje,(s,e)=>s.cell===e.cell&&s.isActive===e.isActive&&s.isHighlighted===e.isHighlighted&&s.agentActive===e.agentActive&&s.isLocked===e.isLocked&&s.searchHighlight===e.searchHighlight&&s.searchCurrentMatch===e.searchCurrentMatch&&s.queuePosition===e.queuePosition&&s.indentConfig===e.indentConfig&&s.requestedFocusMode===e.requestedFocusMode&&s.previewDiffStatus===e.previewDiffStatus&&s.previewDiffAgainst===e.previewDiffAgainst&&s.showLineNumbers===e.showLineNumbers&&s.showCellIds===e.showCellIds&&s.kernelSessionId===e.kernelSessionId);async function Jm(){const s=Ei.getToken(),e={"Content-Type":"application/json"};s&&(e.Authorization=`Bearer ${s}`);const t=await fetch(`${xs}/servers`,{headers:e});if(!t.ok)throw new Error(`Failed to get cluster info: ${t.statusText}`);return t.json()}function Fd(){const s=Ei.getToken(),e={"Content-Type":"application/json"};return s&&(e.Authorization=`Bearer ${s}`),e}async function nb(s,e){const t=await s.json().catch(()=>({error:e}));throw new Error(t.error||`${e}: ${s.statusText}`)}async function Uk(){const s=await fetch(`${xs}/compute/status`,{headers:Fd()});return s.ok?s.json():{enabled:!1,scheduler:null}}async function bw(){const s=await fetch(`${xs}/compute/partitions`,{headers:Fd()});return s.ok||await nb(s,"Failed to load partitions"),s.json()}async function Gje(s){const e=await fetch(`${xs}/compute/partition-qos?partition=${encodeURIComponent(s)}`,{headers:Fd()});return e.ok?(await e.json()).allowed??null:null}async function Cx(){const s=await fetch(`${xs}/compute/allocations`,{headers:Fd()});return s.ok||await nb(s,"Failed to list allocations"),(await s.json()).allocations||[]}async function Kje(s){const e=await fetch(`${xs}/compute/allocations`,{method:"POST",headers:Fd(),body:JSON.stringify(s)});return e.ok||await nb(e,"Failed to create allocation"),e.json()}async function u4(s){const e=await fetch(`${xs}/compute/allocations/${encodeURIComponent(s)}`,{method:"DELETE",headers:Fd()});e.ok||await nb(e,"Failed to cancel allocation")}const Zk=({onClose:s,label:e,className:t,trapFocus:n,skipInitialFocus:i,onClick:r,children:o})=>{const l=Uc(s,{trapFocus:n,skipInitialFocus:i});return d.jsx("div",{ref:l,role:"dialog","aria-modal":"true","aria-label":e,tabIndex:-1,className:t,onClick:r,children:o})},xh="w-full px-2 py-1.5 text-sm border border-slate-300 rounded focus:outline-none focus:ring-1 focus:ring-blue-500",pc="block text-xs font-medium text-slate-600 mb-1";function mm({value:s,min:e,step:t,onCommit:n,className:i,disabled:r,ariaLabel:o}){const[l,h]=v.useState(null);return d.jsx("input",{type:"number",min:e,step:t,className:i,disabled:r,"aria-label":o,value:l??String(s),onChange:u=>{h(u.target.value);const m=Number(u.target.value);u.target.value.trim()!==""&&Number.isFinite(m)&&n(Math.max(e,m))},onBlur:()=>h(null)})}const Jje={pending:"bg-amber-100 text-amber-700",running:"bg-blue-100 text-blue-700",active:"bg-green-100 text-green-700",ended:"bg-slate-100 text-slate-500",failed:"bg-red-100 text-red-700",cancelled:"bg-slate-100 text-slate-500"};function ep(s){return s.replace(/^nvidia[_-]?/i,"").toUpperCase()}function e3e(s){const e=(s||"").trim().toLowerCase();if(!e||e==="infinite"||e==="unlimited"||e==="n/a")return null;const t=e.match(/^(?:(\d+)-)?(\d+):(\d+):(\d+)$/);if(t)return parseInt(t[1]||"0",10)*1440+parseInt(t[2],10)*60+parseInt(t[3],10);const n=e.match(/^(\d+):(\d+)$/);if(n)return parseInt(n[1],10);const i=parseInt(e,10);return Number.isFinite(i)?i:null}function zE(s,e){var n;if(!s.up)return{ok:!1,reason:"offline",score:-1e9};const t=e3e(s.timeLimit);if(t!==null&&e.walltimeMinutes>t)return{ok:!1,reason:`walltime exceeds ${s.timeLimit} limit`,score:-1e8};if(e.gpus>0){if(!((n=s.gpus)!=null&&n.length))return{ok:!1,reason:"no GPUs",score:-1e9};if(e.gpuType){const r=s.gpus.find(o=>o.type===e.gpuType);return r?r.idle<e.gpus?{ok:!1,reason:`only ${r.idle} of ${e.gpus} ${ep(r.type)} free`,score:-1e6+r.idle}:{ok:!0,reason:`${r.idle} ${ep(r.type)} free now`,score:1e6+r.idle}:{ok:!1,reason:"different GPU type",score:-1e9}}const i=s.gpus.reduce((r,o)=>r+o.idle,0);return i<e.gpus?{ok:!1,reason:`only ${i} of ${e.gpus} GPUs free`,score:-1e6+i}:{ok:!0,reason:`${i} GPUs free now`,score:1e6+i}}return s.cpus.idle<e.cpus?{ok:!1,reason:`only ${s.cpus.idle} of ${e.cpus} CPUs free`,score:-1e6+s.cpus.idle}:{ok:!0,reason:`${s.cpus.idle} CPUs free now`,score:1e6+s.cpus.idle}}function d4({isOpen:s,onClose:e,onChanged:t,onUseForKernels:n,onUseWhenReady:i}){var Xe,$s,Pt,Ft,ns;const[r,o]=v.useState(!1),[l,h]=v.useState(null),[u,m]=v.useState(null),[p,O]=v.useState([]),[x,y]=v.useState(""),[w,S]=v.useState(""),[k,A]=v.useState(4),[N,R]=v.useState(8),[D,U]=v.useState(0),[Z,te]=v.useState(""),[ee,pe]=v.useState(2),[oe,E]=v.useState(""),[Q,T]=v.useState(!1),[L,M]=v.useState(60),[P,I]=v.useState(!1),[X,V]=v.useState(null),z=v.useCallback(()=>{var Qe;return{partition:x,qos:w||void 0,account:((Qe=u==null?void 0:u.associations)==null?void 0:Qe.account)||void 0,cpus:k,memGb:N,gpus:D>0?D:void 0,gpuType:D>0&&Z?Z:void 0,walltimeMinutes:Math.max(1,Math.round(ee*60)),jobName:oe||void 0,idleTimeoutMinutes:Q?Math.max(10,Math.round(L)||60):void 0}},[x,w,u,k,N,D,Z,ee,oe,Q,L]),G=v.useCallback(async()=>{try{O(await Cx())}catch{}},[]),H=v.useCallback(async()=>{try{m(await bw())}catch{}},[]);v.useEffect(()=>{if(!s)return;let Qe=!1;return o(!0),h(null),(async()=>{var mt,ps;try{const[Yt]=await Promise.all([bw(),G()]);if(Qe)return;m(Yt);const zt=((mt=Yt.associations)==null?void 0:mt.partitions)??[];zt.length&&!x&&y(zt[0]);const Bt=(ps=Yt.associations)==null?void 0:ps.defaultQos;Bt&&!w&&S(Bt)}catch(Yt){Qe||h((Yt==null?void 0:Yt.message)||"Failed to load compute options")}finally{Qe||o(!1)}})(),()=>{Qe=!0}},[s]),v.useEffect(()=>{if(!s)return;const Qe=setInterval(()=>{document.hidden||G()},4e3);return()=>clearInterval(Qe)},[s,G]),v.useEffect(()=>{if(!s)return;const Qe=setInterval(()=>{document.hidden||H()},15e3);return()=>clearInterval(Qe)},[s,H]),v.useEffect(()=>{if(!s)return;const Qe=()=>{document.hidden||(G(),H())};return document.addEventListener("visibilitychange",Qe),()=>document.removeEventListener("visibilitychange",Qe)},[s,G,H]),v.useEffect(()=>{if(!s||!x){V(null);return}let Qe=!1;return Gje(x).then(mt=>{Qe||(V(mt),mt&&mt.length&&!mt.includes(w)&&S(mt[0]))}).catch(()=>{Qe||V(null)}),()=>{Qe=!0}},[s,x]),v.useEffect(()=>{var ps,Yt;const Qe=(Yt=(ps=u==null?void 0:u.load)==null?void 0:ps.partitions.find(zt=>zt.name===x))==null?void 0:Yt.gpus,mt=(Qe==null?void 0:Qe.map(zt=>zt.type))??[];te(zt=>zt&&!mt.includes(zt)?"":zt)},[x]);const Y=async()=>{if(!x){h("Pick a partition first");return}I(!0),h(null);try{await Kje(z()),jp("allocatedCompute"),await G(),t==null||t()}catch(Qe){h((Qe==null?void 0:Qe.message)||"Failed to submit allocation")}finally{I(!1)}},he=async Qe=>{try{await u4(Qe),await G(),t==null||t()}catch(mt){h((mt==null?void 0:mt.message)||"Failed to cancel allocation")}};if(!s)return null;const le=u==null?void 0:u.associations,Se=(le==null?void 0:le.partitions)??[],ue=((Xe=u==null?void 0:u.load)==null?void 0:Xe.partitions)??[],F=new Map(ue.map(Qe=>[Qe.name,Qe])),ne=(($s=u==null?void 0:u.load)==null?void 0:$s.qoses)??[],Oe=new Map(ne.map(Qe=>[Qe.name,Qe])),je=!!(X&&X.length>0),We=(Pt=le==null?void 0:le.qoses)!=null&&Pt.length?le.qoses:ne.map(Qe=>Qe.name),fe=je?X:We,rt={cpus:k,gpus:D,gpuType:Z,walltimeMinutes:Math.max(1,Math.round(ee*60))},Ee=[...Se.map(Qe=>{const mt=F.get(Qe);return mt?{name:Qe,p:mt,fit:zE(mt,rt)}:null}).filter(Boolean)].sort((Qe,mt)=>mt.fit.score-Qe.fit.score)[0],qe=F.get(x),Ie=((Ft=qe==null?void 0:qe.gpus)==null?void 0:Ft.map(Qe=>Qe.type))??[],Re=qe?zE(qe,rt):null,ut=Ee&&Ee.name!==x&&(!Re||Ee.fit.score>Re.score+1),wt=()=>{var Qe;Ee&&(y(Ee.name),D>0&&!Z&&((Qe=Ee.p.gpus)==null?void 0:Qe.length)===1&&te(Ee.p.gpus[0].type))};return d.jsx("div",{className:"fixed inset-0 bg-black/50 flex z-50 overflow-y-auto p-4",onClick:e,children:d.jsxs(Zk,{onClose:e,label:"Compute Allocation",className:"bg-white rounded-lg shadow-xl max-w-2xl w-full m-auto max-h-[85vh] overflow-auto",onClick:Qe=>Qe.stopPropagation(),children:[d.jsxs("div",{className:"flex items-center justify-between p-4 border-b sticky top-0 bg-white z-10",children:[d.jsxs("h2",{className:"text-lg font-semibold text-slate-800 flex items-center gap-2",children:[d.jsx(Mo,{className:"w-5 h-5 text-blue-600"})," Compute Allocation"]}),d.jsx("button",{onClick:e,"aria-label":"Close",className:"p-1 hover:bg-slate-100 rounded",children:d.jsx(di,{className:"w-5 h-5 text-slate-500"})})]}),d.jsx("div",{className:"p-4 space-y-4",children:r?d.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 py-6 justify-center",children:[d.jsx(hi,{className:"w-4 h-4 animate-spin"})," Loading compute options…"]}):d.jsxs(d.Fragment,{children:[l&&d.jsx("div",{className:"text-xs text-red-700 bg-red-50 border border-red-100 rounded px-3 py-2",children:l}),ut&&d.jsxs("button",{onClick:wt,className:"w-full text-left text-xs rounded px-3 py-2 border border-blue-200 bg-blue-50 hover:bg-blue-100 text-blue-800 flex items-center gap-2",children:[d.jsx(Ph,{className:"w-4 h-4 flex-shrink-0 text-blue-500"}),d.jsxs("span",{children:[d.jsx("span",{className:"font-medium",children:Ee.name})," ",Ee.fit.ok?`can start this now — ${Ee.fit.reason}`:`is the closest fit — ${Ee.fit.reason}`]}),d.jsx("span",{className:"flex-1"}),d.jsx("span",{className:"font-medium underline",children:"Use it"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:pc,children:"Partition / Queue"}),d.jsxs("select",{className:xh,value:x,onChange:Qe=>y(Qe.target.value),children:[Se.length===0&&d.jsx("option",{value:"",children:"(none available)"}),Se.map(Qe=>{var Yt;const mt=F.get(Qe),ps=(Yt=mt==null?void 0:mt.gpus)!=null&&Yt.length?`${mt.gpus.reduce((zt,Bt)=>zt+Bt.idle,0)} gpu free`:mt?`${mt.cpus.idle} cpu free`:"";return d.jsxs("option",{value:Qe,children:[Qe,ps?` — ${ps}`:""]},Qe)})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:pc,children:"Walltime (hours)"}),d.jsx(mm,{min:.25,step:.25,className:xh,value:ee,onCommit:pe,ariaLabel:"Walltime in hours"})]}),d.jsxs("div",{children:[d.jsx("label",{className:pc,children:"CPUs"}),d.jsx(mm,{min:1,className:xh,value:k,onCommit:A,ariaLabel:"Number of CPUs"})]}),d.jsxs("div",{children:[d.jsx("label",{className:pc,children:"Memory (GB)"}),d.jsx(mm,{min:1,className:xh,value:N,onCommit:R,ariaLabel:"Memory in GB"})]}),d.jsxs("div",{children:[d.jsx("label",{className:pc,children:"GPUs (0 = none)"}),d.jsx(mm,{min:0,className:xh,value:D,onCommit:U,ariaLabel:"Number of GPUs"})]}),d.jsxs("div",{children:[d.jsx("label",{className:pc,children:"GPU type"}),d.jsxs("select",{className:xh,value:Z,disabled:D===0||Ie.length===0,onChange:Qe=>te(Qe.target.value),children:[d.jsx("option",{value:"",children:D===0?"—":Ie.length===0?"no GPUs in this queue":"(any type)"}),Ie.map(Qe=>d.jsx("option",{value:Qe,children:ep(Qe)},Qe))]})]}),d.jsxs("div",{className:"col-span-2",children:[d.jsx("label",{className:pc,children:"Job name (optional)"}),d.jsx("input",{type:"text",className:xh,value:oe,placeholder:`nebula-${x||"compute"}`,onChange:Qe=>E(Qe.target.value)})]}),d.jsxs("div",{className:"col-span-2 flex items-center gap-2 text-xs text-slate-600",children:[d.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[d.jsx("input",{type:"checkbox",checked:Q,onChange:Qe=>T(Qe.target.checked)}),"End automatically when idle"]}),d.jsx(mm,{min:10,step:5,className:"w-20 px-2 py-1 text-xs border border-slate-300 rounded focus:outline-none focus:ring-1 focus:ring-blue-500 disabled:opacity-50",value:L,disabled:!Q,onCommit:M,ariaLabel:"Idle minutes before auto-end"}),d.jsx("span",{className:Q?"":"text-slate-400",children:"idle minutes (no running cells or terminal use)"})]})]}),qe&&Re&&d.jsxs("div",{className:`text-xs rounded px-3 py-2 border flex items-start gap-2 ${Re.ok?"bg-green-50 border-green-200 text-green-800":"bg-amber-50 border-amber-200 text-amber-800"}`,children:[Re.ok?d.jsx(Ip,{className:"w-4 h-4 flex-shrink-0 text-green-600 mt-px"}):d.jsx(qh,{className:"w-4 h-4 flex-shrink-0 text-amber-600 mt-px"}),d.jsxs("span",{children:[Re.ok?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"font-medium",children:"Should start right away"})," — ",Re.reason," on ",qe.name,"."]}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"font-medium",children:"Likely to wait"})," — ",Re.reason,"; ",qe.jobs.pending," pending in ",qe.name,"."]})," ",d.jsxs("span",{className:"text-slate-500",children:["(",qe.cpus.idle,"/",qe.cpus.total," CPUs",(ns=qe.gpus)!=null&&ns.length?qe.gpus.map(Qe=>`, ${Qe.idle}/${Qe.total} ${ep(Qe.type)} GPUs`).join(""):""," idle",qe.timeLimit?`, limit ${qe.timeLimit}`:"",")"]})]})]}),d.jsxs("div",{children:[d.jsxs("label",{className:pc,children:["QoS — how the job is scheduled",je&&d.jsxs("span",{className:"ml-1 font-normal text-amber-600",children:["· ",x," requires an explicit QoS"]})]}),d.jsx("div",{className:"space-y-1",children:(je?fe:["",...fe]).map(Qe=>{const mt=Qe?Oe.get(Qe):void 0,ps=Qe===w,Yt=Qe?ne.filter(Bt=>Bt.preempts.includes(Qe)).map(Bt=>Bt.name):[];let zt="";return mt!=null&&mt.preempts.length?zt=`preempts ${mt.preempts.join(", ")}`:Yt.length&&(zt=`preemptible · yields to ${Yt.join(", ")}`),d.jsxs("button",{onClick:()=>S(Qe),className:`w-full text-left flex items-center gap-2 text-xs rounded px-2.5 py-1.5 border ${ps?"border-blue-300 bg-blue-50":"border-slate-200 hover:bg-slate-50"}`,children:[d.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${ps?"bg-blue-500":"bg-slate-300"}`}),d.jsx("span",{className:"font-medium text-slate-700",children:Qe||"(scheduler default)"}),zt&&d.jsx("span",{className:`px-1.5 py-0.5 rounded text-[0.625rem] ${mt!=null&&mt.preemptible?"bg-amber-100 text-amber-700":"bg-slate-100 text-slate-500"}`,children:zt}),d.jsx("span",{className:"flex-1"}),mt&&d.jsxs("span",{className:"text-slate-400 tabular-nums",children:[mt.jobs.running," run · ",mt.jobs.pending," pend",mt.maxWall?` · ≤${mt.maxWall}`:""]})]},Qe||"__default")})})]}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsxs("button",{onClick:Y,disabled:!x||P,className:"px-3 py-1.5 text-sm font-medium text-white bg-blue-600 rounded hover:bg-blue-700 disabled:opacity-50 flex items-center gap-1.5",children:[P?d.jsx(hi,{className:"w-3.5 h-3.5 animate-spin"}):d.jsx(t8,{className:"w-3.5 h-3.5"})," Request allocation"]})}),d.jsxs("div",{className:"pt-2 border-t",children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsxs("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide flex items-center gap-1",children:[d.jsx(Ol,{className:"w-3 h-3"})," Allocations"]}),d.jsx("button",{onClick:G,className:"p-1 hover:bg-slate-100 rounded text-slate-400",title:"Refresh","aria-label":"Refresh",children:d.jsx(jo,{className:"w-3.5 h-3.5"})})]}),p.length===0?d.jsx("div",{className:"text-xs text-slate-400 py-2",children:"No allocations yet."}):d.jsx("div",{className:"space-y-1.5",children:p.map(Qe=>{var mt;return d.jsxs("div",{className:"flex items-center gap-2 text-xs border border-slate-200 rounded px-2.5 py-1.5",children:[d.jsx("span",{className:`px-1.5 py-0.5 rounded font-medium ${Jje[Qe.state]}`,children:Qe.state}),d.jsx("span",{className:"font-medium text-slate-700",children:Qe.spec.jobName}),d.jsxs("span",{className:"text-slate-500",children:[Qe.spec.partition,Qe.spec.qos?`/${Qe.spec.qos}`:""," · ",Qe.spec.cpus,"cpu · ",Qe.spec.memGb,"GB",Qe.spec.gpus?` · ${Qe.spec.gpus}gpu${Qe.spec.gpuType?` ${ep(Qe.spec.gpuType)}`:""}`:""]}),Qe.spec.idleTimeoutMinutes?d.jsxs("span",{className:"text-slate-400",title:"The allocation's server exits itself after this long without kernel or terminal activity",children:["(auto-ends after ",Qe.spec.idleTimeoutMinutes,"m idle)"]}):null,(mt=Qe.nodes)!=null&&mt.length?d.jsx("span",{className:"text-slate-400 truncate",children:Qe.nodes.join(", ")}):null,Qe.jobId&&d.jsxs("span",{className:"text-slate-400",children:["job ",Qe.jobId]}),d.jsx("div",{className:"flex-1"}),n&&Qe.state==="active"&&Qe.serverId&&d.jsxs("button",{onClick:()=>{n(Qe.serverId),e()},className:"px-2 py-0.5 rounded border border-green-200 bg-green-50 text-green-700 hover:bg-green-100 font-medium flex items-center gap-1",title:"Run this notebook's kernels on this allocation",children:[d.jsx(Ac,{className:"w-3 h-3"}),"Use for kernels"]}),i&&["pending","running"].includes(Qe.state)&&d.jsxs("button",{onClick:()=>{i(Qe.id),e()},className:"px-2 py-0.5 rounded border border-blue-200 bg-blue-50 text-blue-700 hover:bg-blue-100 font-medium flex items-center gap-1",title:"Switch this notebook's kernels to this allocation as soon as it finishes starting",children:[d.jsx(qh,{className:"w-3 h-3"}),"Use when ready"]}),!["ended","failed","cancelled"].includes(Qe.state)&&d.jsx("button",{onClick:()=>he(Qe.id),className:"p-1 hover:bg-red-50 rounded text-slate-400 hover:text-red-600",title:"Cancel","aria-label":"Cancel",children:d.jsx(Lc,{className:"w-3.5 h-3.5"})})]},Qe.id)})})]})]})})]})})}const t3e=new Set([".ipynb",".qmd"]),s3e=new Set([".py",".r",".jl",".json",".txt",".md",".markdown",".yaml",".yml",".js",".jsx",".ts",".tsx",".css",".scss",".csv",".tsv",".log",".toml",".ini",".cfg",".sh",".bash",".zsh",".sql",".xml",".rmd",".c",".h",".cpp",".hpp",".java",".go",".rs",".rb",".pl",".lua"]),n3e=new Set([".html",".htm"]),i3e=new Set([".pdf",".png",".jpg",".jpeg",".gif",".svg",".webp",".bmp",".ico",".avif",".mp4",".webm",".mov",".m4v",".ogv",".mp3",".wav",".ogg",".oga",".flac",".m4a",".aac"]);function f4(s){const e=s.split("/").pop()||s,t=e.lastIndexOf(".");return t>0?e.slice(t).toLowerCase():""}function m4(s){const e=f4(s);return t3e.has(e)?"notebook":n3e.has(e)?"html":s3e.has(e)?"text":i3e.has(e)?"newtab":"download"}function vw(s,e){const t=new URLSearchParams({path:s,inline:"1"});return e&&t.set("token",e),`/api/fs/download?${t.toString()}`}const p4=[","," ",";","|"];function r3e(s){const e=s.split(/\r?\n/).filter(i=>i.length>0).slice(0,20);if(e.length===0)return",";let t=",",n=-1/0;for(const i of p4){const o=e.map(m=>o3e(m,i).length).filter(m=>m>1);if(o.length===0)continue;const l=o.reduce((m,p)=>m+p,0)/o.length,h=o.reduce((m,p)=>m+(p-l)**2,0)/o.length,u=l-h*2;u>n&&(n=u,t=i)}return t}function o3e(s,e){const t=[];let n="",i=!1;for(let r=0;r<s.length;r++){const o=s[r];i?o==='"'?s[r+1]==='"'?(n+='"',r++):i=!1:n+=o:o==='"'?i=!0:o===e?(t.push(n),n=""):n+=o}return t.push(n),t}function a3e(s,e){const t=[];let n="",i=[],r=!1;const o=()=>{i.push(n),n=""},l=()=>{o(),t.push(i),i=[]};for(let h=0;h<s.length;h++){const u=s[h];r?u==='"'?s[h+1]==='"'?(n+='"',h++):r=!1:n+=u:u==='"'?r=!0:u===e?o():u===`
|
|
603
603
|
`?l():u==="\r"?(s[h+1]===`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as n,q as a,s as o,T as r}from"./services-shim-
|
|
1
|
+
import{o as n,q as a,s as o,T as r}from"./services-shim-D_SeYcB9.js";import{L as c,D as y,a as f,E as w,h as b,w as x,y as W,x as E,j as V,z as O,B as j,G as v,H as L,K as P,I as S,v as M,p as T,r as I,l as N,k as R,C as k,t as C,u as J}from"./services-shim-D_SeYcB9.js";import{V as z}from"./viewlist-uomDf7I7.js";import{E as q,c as B,a as K}from"./errorwidget-B2XZ3hoa.js";import"./index-NfxQwPBq.js";const s={align_content:null,align_items:null,align_self:null,border_top:null,border_right:null,border_bottom:null,border_left:null,bottom:null,display:null,flex:null,flex_flow:null,height:null,justify_content:null,justify_items:null,left:null,margin:null,max_height:null,max_width:null,min_height:null,min_width:null,overflow:null,order:null,padding:null,right:null,top:null,visibility:null,width:null,object_fit:null,object_position:null,grid_auto_columns:null,grid_auto_flow:null,grid_auto_rows:null,grid_gap:null,grid_template_rows:null,grid_template_columns:null,grid_template_areas:null,grid_row:null,grid_column:null,grid_area:null};class _ extends n{defaults(){return a(super.defaults(),{_model_name:"LayoutModel",_view_name:"LayoutView"},s)}}class p extends o{initialize(e){this._traitNames=[],super.initialize(e);for(const l of Object.keys(s))this.registerTrait(l)}registerTrait(e){this._traitNames.push(e),this.listenTo(this.model,"change:"+e,(l,t)=>{this.handleChange(e,t)}),this.handleChange(e,this.model.get(e))}css_name(e){return e.replace(/_/g,"-")}handleChange(e,l){const t=this.options.parent;t?l===null?t.el.style.removeProperty(this.css_name(e)):t.el.style.setProperty(this.css_name(e),l):console.warn("Style not applied because a parent view does not exist")}unlayout(){const e=this.options.parent;this._traitNames.forEach(l=>{e?e.el.style.removeProperty(this.css_name(l)):console.warn("Style not removed because a parent view does not exist")},this)}}const g=new r("jupyter.extensions.jupyterWidgetRegistry");export{c as BROKEN_FILE_SVG_ICON,y as DOMWidgetModel,f as DOMWidgetView,q as ErrorWidgetView,g as IJupyterWidgetRegistry,w as JUPYTER_WIDGETS_VERSION,b as JupyterLuminoPanelWidget,x as JupyterLuminoWidget,W as JupyterPhosphorPanelWidget,E as JupyterPhosphorWidget,_ as LayoutModel,p as LayoutView,V as PROTOCOL_VERSION,O as StyleModel,j as StyleView,z as ViewList,n as WidgetModel,o as WidgetView,a as assign,B as createErrorWidgetModel,K as createErrorWidgetView,v as difference,L as isEqual,P as isObject,S as isSerializable,M as pack_models,T as put_buffers,I as reject,N as remove_buffers,R as resolvePromisesDict,k as shims,C as unpack_models,J as uuid};
|